Skip to contentSkip to conversation

xrun and snd_pcm_prepare.

DISCUSSION Shaju Abraham 2 participants 2 messages Sep 16, 2002

lore
Share & tools
lore
#0 lore raw

Hi,
In aplay utility to playback music, we see that if the return value
is -EPIPE, a function xrun() is called. This function does nothing more than snd_pcm_prepare(handle). What is the meaning of receiving a -EPIPE return value to a application? and, Why cannot this be done at the driver level itself? say in pcm_native.c .

Is it ok if this snd_pcm_prepare is called from pcm_native.c instead of returning -EPIPE to the application?

--Shaju Abraham

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 5 lines

In aplay utility to playback music, we see that if the return value
is -EPIPE, a function xrun() is called. This function does nothing more than snd_pcm_prepare(handle). What is the meaning of receiving a -EPIPE return value to a application? and, Why cannot this be done at the driver level itself? say in pcm_native.c .

EPIPE signals an xrun (over- or under-run). Its analogous to a POSIX pipe that has either filled up or has nothing to read. It means that application has failed to keep up with the hardware.

Quoted 2 lines

Is it ok if this snd_pcm_prepare is called from pcm_native.c instead of returning -EPIPE to the application?

no, its not.

behaviour when xruns happen is not automatic. sometimes the driver will do something, sometimes user space wants to know about it and take care of the situation with its own approach.

--p

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf