[Portaudio] Issue with Pa_OpenStream on WDM/KS hostAPI

Robert Bielik robert.bielik at dirac.se
Thu Dec 3 06:43:06 EST 2015


Hello Sarang,

Den 2015-12-03 kl. 11:51, skrev sarang sapre:
> If the Sampling rate supported by Device is 48KHz, and we try to open it with 44.1KHz using paOpenStream(), it fails as expected. Error Code is paInvalidDevice (-9996).. I was thinking it would be paInvalidSamplingRate (-9997).
That would be one area where some Tenderness, Love & Care would apply ;)

Regards
/Robert

>
> Regards,
> Sarang
>
>
> ----- Original Message -----
> From: sarang sapre <sarangsapre at yahoo.com>
> To: "portaudio at lists.columbia.edu" <portaudio at lists.columbia.edu>
> Sent: Thursday, November 26, 2015 2:34 PM
> Subject: Re: [Portaudio] Issue with Pa_OpenStream on WDM/KS hostAPI
>
> Robert,
>
>     Thanks for the response...
>
>
>      Our Device supports only 48000 KHz , however On Windows Playback device settings I can set it wrongly to 44100 (Only under special sequence of usage). This becomes unusable playback device...  When such situation comes, query to Pa_DeviceCount and Pa_DeviceInfo gives me list of devices.. Our device is listed under 3 APIs  and each of them has different defaultSamplingRate
> 1. Api = paMME, defaultFs = 44100
> 2. Api = paWASAPI, defaultFs = 44100
> 3. Api = paWDMKS, defaultFs = 48000
> We tried using Api =paWDM/Ks because defaultSamplingRate matches what our device supports...
>
>
> If I understand you now, Api=paWASAPI returns defaultFs = 44100, which should match whatever is there in Windows Playback device settings... If so, we will try to use paWASAPI going forwards...
>
>
>
> Please note that if we called paOpenStream only once, it will give us valid stream handle - but we could not play audio on it...
>
> We were calling paOpenStream twice w/o closeSteam inbetween... This just happened to be out of experiment as such sequence was giving us expected result.. Also causing closeStream in between was causing eventual crash for this particular scenario...
>
> Thanks and Best Regards,
> Sarang Sapre
>
>
>
> ________________________________
>
>
>
> From: Robert Bielik <robert.bielik at dirac.se>
> To: portaudio at lists.columbia.edu
> Sent: Thursday, November 26, 2015 1:13 PM
> Subject: Re: [Portaudio] Issue with Pa_OpenStream on WDM/KS hostAPI
>
>
>
> Hi Sarang,
>
>
> Den 2015-11-26 kl. 08:33, skrev sarang sapre:
>
>
> While doing Pa_OpenStream we are using WDM/KS HostAPI device and passing sampleRate = 48000.  To my surprise it returns PaNoError and some valid stream handle.
> You should not be surprised. WDM/KS opens your device directly and does not care about what setting there is in Windows. If your device supports the settings, open stream will succeed.
>
> Use WASAPI backend if you want to use the setting in Windows control
>     panel.
>
>
> If I call Pa_OpenStream again with same settings I get NULL handle with error code -9996 . Basically from second call onwards I am getting error, but first call to Pa_OpenStream() is strangely successful
> Do you call Pa_CloseStream in between ?
>
>
>> Simply calling Pa_OpenStream twice doesn’t help because it will start behaving strangely soon after..
> Once the device is opened through Pa_OpenStream, you have to call Pa_CloseStream before calling Pa_OpenStream again.
>
>
>
>
> Regards
> /Robert
>
>
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio



More information about the Portaudio mailing list