[alsa-devel] a xrun() query

Santosh Sivaraj santoshs at fossix.org
Wed May 11 14:10:39 CEST 2011


Hi,

I am getting glitches while playing audio with aplay. With little
debugging I figured out that the state changes from RUNNING to XRUN at
which time the trigger gets called. I also figured out that XRUN state
is set in the function:

static int snd_pcm_update_hw_ptr_post(struct snd_pcm_substream *substream,
				      struct snd_pcm_runtime *runtime)
{
        <snip>
	} else {
		if (avail >= runtime->stop_threshold) {
			xrun(substream);
			return -EPIPE;
		}
	}
        </snip>
}

I am not able to find out why the condition (avail >
runtime->stop_threshold) becomes true. Can the experts here tell
during what use cases/scenarios this happens?

Thanks,
Santosh

-- 
http://fossix.org, http://dot.slashb.in

Luck is a matter of preparation meeting the opportunity.
					-- Anon


More information about the Alsa-devel mailing list