Skip to contentSkip to conversation

underrun problem when short audio play

DISCUSSION ANISH KUMAR 2 participants 2 messages Mar 9, 2010 – Mar 16, 2010

lore
Share & tools
lore
#0 lore raw

Hi all,

I am facing a problem when i try to play short duration audio(problem is not observerd when i am playing tones which is also short duration audio).
Somehow i am getting buffer overrun everytime i am playing short duration audio. It is happening because of avail >= stop_threshold.

When i tried to increase the stop_threshold but then i got "same audio played again kind of echo" problem. I can't try the solution suggested by jaroslav i.e. checking for DRAINING state in lower level driver and stop queuing because of some design issue as in my code i don't call drain function as soon as all buffers are written. I wait for some time(in miliseconds) and then call drain function.

Please suggest any pointers.Should i increase the buffer size or stop_threshold both of which i tried but to no use. I am always getting underrun problem that too always in the function update_hw_ptr_post function.

How can i disable the stop_threshold check??

Thanks,
anish

#1 lore raw
Quoted 4 lines · ANISH KUMAR

When i tried to increase the stop_threshold but then i got "same audio played again kind of echo" problem. I can't try the solution suggested by jaroslav i.e. checking for DRAINING state in lower level driver and stop queuing because of some design issue as in my code i don't call drain function as soon as all buffers are written. I wait for some time(in miliseconds) and then call drain function.

What is the design issue in your driver? If you're limited by that the most obvious solution would seem to be to address that. If your driver is not responding promptly to requests to terminate playback then an underrun doesn't seem surprising.