susmith mr
|
snd_pcm_open_preferred and SND_PCM_OPEN_NONBLOCK
|
susmith mr
12/06/2009 3:46 PM
post43265
|
snd_pcm_open_preferred and SND_PCM_OPEN_NONBLOCK
Hai,
I am writing an application with libasound.so on beagleboard-qnx using the plugin type api's of snd_pcm. But when i
tried to use the api snd_pcm_open_preferred with SND_PCM_OPEN_NONBLOCK or'ed with SND_PCM_OPEN_PLAYBACK i am getting
some unusual behavier. Is it correctly implemented.
ie: Almost all the threads in the system and in the application is stopped and audio is executed. Priority is also
enabled in my process. But i thinks something is going wrong. Any idea?
When i tried without SND_PCM_OPEN_NONBLOCK, i got it working fine, but continuous write onto the device is causing
problem in my application.
Algorithm:
write the buffer;
check whether underrun/overrun happend
prepare the device again.
play the remaining buffer.
The above steps are happening in a thread. So these steps, when executed multiple times ( i don't know when the voice
output to the actual device will get over,because there is no callback like windows waveout functionality), my
application stops sending output. Is there any problem of writing a buffer into the device when it is still playing the
buffer. I have no clue from application side.
Please help?
Thanks
Susmith
|
|
|