[Portaudio] Fwd: Re: OSX 10.6. problem
bjorn at xowave.com
Tue Dec 1 08:57:39 EST 2009
On Dec 1, 2009, at 5:08 AM, Dmitry Kostjuchenko wrote:
> Hi guys!
> I have seen that you worked hard on Mac core part :)
> I got several comments and thoughts over implementation and issue of
> changing global Sample Rate at all.
> 1. Do we acquire device in exclusive mode?
> What will happen if any other application or say another PortAudio
> stream changes sample rate to something else again. I mean, if one
> PortAudio stream expects its sample rate be fixed at say 48000 and
> is working, while another 2-nd stream tries to change sample rate to
> 44100 for example (Or user changes through Control Panel). What will
> happen to 1-st stream, will it be getting 48000 or will start
> getting 44100 samples per second? Won't we need then
> AudioDeviceAddPropertyListener to trace global sample rate changes
> and take actions to avoid corrrupt sound or crash on bad buffer size?
IIRC, it will perform SR Conversion automatically.
> 2. New AudioDeviceSetPropertyNowAndWaitForChange: Pa_Sleep( 100 ) -
> 1 msec waiting is just fine for CPU and make this function be a
> little more responsive. Sleeping 10 times in loop with 100msec will
> take 1 second! It is too much.
The function returns immediately if the parameter can change
immediately, and sleeps otherwise. Without the waits the app will
crash, and the call to setting the parameters may take 10-20 seconds.
If you see a way to avoid waiting, please submit a patch.
Digital Audio Production and Post-Production Software
More information about the Portaudio