Skip to contentSkip to conversation

One drop-out per xrun?

DISCUSSION Ryan Cassidy 3 participants 4 messages Dec 10, 2003 – Dec 11, 2003 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hello all,

I wanted to check my knowledge of something: does an xrun necessarily correspond to a "drop-out" in the audio stream? In other words, could you have a drop-out WITHOUT an xrun, or an xrun WITHOUT a drop-out? Is there a strict one-to-one correspondence between the two?

Any assistance, as always, GREATLY appreciated.

Cheers, rjc.
--
Ryan Cassidy
Electrical Engineering Graduate Student, CCRMA Researcher Stanford University
E-mail: [email protected]

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#1 lore raw
Quoted 4 lines

I wanted to check my knowledge of something: does an xrun necessarily correspond to a "drop-out" in the audio stream? In other words, could you have a drop-out WITHOUT an xrun, or an xrun WITHOUT a drop-out? Is there a strict one-to-one correspondence between the two?

a dropout occurs when the h/w playback pointer gets ahead of the data already written by the s/w (i.e. repeating data already played). its therefore a 1:1 correspondence with an xrun, which is defined in the same way.

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#2 lore raw
Quoted 9 lines · Paul Davis
Quoted 4 lines

I wanted to check my knowledge of something: does an xrun necessarily correspond to a "drop-out" in the audio stream? In other words, could you have a drop-out WITHOUT an xrun, or an xrun WITHOUT a drop-out? Is there a strict one-to-one correspondence between the two?

a dropout occurs when the h/w playback pointer gets ahead of the data already written by the s/w (i.e. repeating data already played). its therefore a 1:1 correspondence with an xrun, which is defined in the same way.

To be 100% correct, in the driver, there is very small window where the hardware might be in xrun state, but we cannot detect this situation:

	disable_interrupts();
	pos = get_current_position();
	<--- DMA transfer occured here and position (pos) was
	     on last valid sample -->
	if (xrun(pos))
		do_xrun_handling();
	enable_interrupts();

						Jaroslav

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

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#4 lore raw
In reply to a message not in the archive
Quoted 13 lines · Alfons Adriaensen
Quoted 10 lines · Jaroslav Kysela

To be 100% correct, in the driver, there is very small window where the hardware might be in xrun state, but we cannot detect this situation:

	disable_interrupts();
	pos = get_current_position();
	<--- DMA transfer occured here and position (pos) was
	     on last valid sample -->
	if (xrun(pos))
		do_xrun_handling();
	enable_interrupts();
Quoted 5 lines

I'm involved in the development of an application (sonar) where the continuity of the signal is essential, but a few corrupted samples every now and then won't do any harm (the S/N ratio is -60 dB anyway). Is it possible in ALSA to make the driver just ignore short xruns, and continue without the need to restart ?

Yes, stop_threshold is what you want to set. If this value is equal to boundary (sw_params) no xruns are detected. If this value is above ring buffer size, then xruns will be detected later.

Jaroslav

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

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/