Skip to contentSkip to conversation

underun problems

DISCUSSION Maciek Kaminski 3 participants 3 messages Mar 29, 2006 – Mar 30, 2006

lore
Share & tools
lore
#0 lore raw

I get voice data over network, at the moment I can't implement jitter buffer so I have to play exactly what I get. The problem is how to manage underuns that happen when data arrives late. I tried to use silence threshold but that does not seem to help. Question is: what to do to make silence substitution work? I was suggested to set the silence size to boundary value that also does not seem to work... Are the any other strategies to silence underruns?

Maciej Kaminski

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#1 lore raw

At Wed, 29 Mar 2006 11:35:37 +0200,

Quoted 8 lines · Maciek Kaminski

I get voice data over network, at the moment I can't implement jitter buffer so I have to play exactly what I get. The problem is how to manage underuns that happen when data arrives late. I tried to use silence threshold but that does not seem to help. Question is: what to do to make silence substitution work? I was suggested to set the silence size to boundary value that also does not seem to work... Are the any other strategies to silence underruns?

The silence_* stuff has basically nothing to do with underrun conditions. They are for automatic silencing the data area that have been played.

The underrun condition is set up via stop_threshold parameter. Setting it to boundary means that the sound keeps running even if underrun occurs. It's what dmix is doing.

This free-run mode is, though, a bit tricky. Since it never reports XRUN, you have to check and compare hwptr and applptr, reset reset the applptr appropriately by yourself.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#2 lore raw
Quoted 15 lines · Takashi Iwai

At Wed, 29 Mar 2006 11:35:37 +0200,

Quoted 8 lines · Maciek Kaminski

I get voice data over network, at the moment I can't implement jitter buffer so I have to play exactly what I get. The problem is how to manage underuns that happen when data arrives late. I tried to use silence threshold but that does not seem to help. Question is: what to do to make silence substitution work? I was suggested to set the silence size to boundary value that also does not seem to work... Are the any other strategies to silence underruns?

The silence_* stuff has basically nothing to do with underrun conditions. They are for automatic silencing the data area that have been played.

Quoted 7 lines

The underrun condition is set up via stop_threshold parameter. Setting it to boundary means that the sound keeps running even if underrun occurs. It's what dmix is doing.

This free-run mode is, though, a bit tricky. Since it never reports XRUN, you have to check and compare hwptr and applptr, reset reset the applptr appropriately by yourself.

It's not required - you can continue work as no XRUN occured, but there is bigger chance to get clicks for playback because you will write old data to some areas. It's better to "snd_pcm_forward()" appl_ptr to the actual hw_ptr and then feed samples from this position.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642