[alsa-devel] EPIPE and underruns
Hi,
Can somebody explain precisely the circumstances leading to an EPIPE as the result of a pcm_snd_writei()?
What buffer has been underrun that leads to this error? Does providing more data to pcn_snd_writei() help alleviate the issue?
Thanks,
On Mon, 4 Oct 2010, Andrew Bell wrote:
Hi,
Can somebody explain precisely the circumstances leading to an EPIPE as the result of a pcm_snd_writei()?
Simply, the driver consumed all queued samples in the ring buffer.
What buffer has been underrun that leads to this error? Does providing more data to pcn_snd_writei() help alleviate the issue?
Yes, also the ring buffer size may be increased depending on the stream parameter setup to prevent underruns.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Mon, Oct 4, 2010 at 3:45 PM, Jaroslav Kysela perex@perex.cz wrote:
On Mon, 4 Oct 2010, Andrew Bell wrote:
Hi,
Can somebody explain precisely the circumstances leading to an EPIPE as the result of a pcm_snd_writei()?
Simply, the driver consumed all queued samples in the ring buffer.
What buffer has been underrun that leads to this error? Does providing more data to pcn_snd_writei() help alleviate the issue?
Yes, also the ring buffer size may be increased depending on the stream parameter setup to prevent underruns.
Is there some reason not to write all the data that you want played at once other than snd_pcm_writei() may block?
Can you point out some code that detects this underrun condition (I've found a bunch of candidates, but they don't obviously scream "underrun here!".
Thanks again,
On Mon, 4 Oct 2010, Andrew Bell wrote:
On Mon, Oct 4, 2010 at 3:45 PM, Jaroslav Kysela perex@perex.cz wrote:
On Mon, 4 Oct 2010, Andrew Bell wrote:
Hi,
Can somebody explain precisely the circumstances leading to an EPIPE as the result of a pcm_snd_writei()?
Simply, the driver consumed all queued samples in the ring buffer.
What buffer has been underrun that leads to this error? Does providing more data to pcn_snd_writei() help alleviate the issue?
Yes, also the ring buffer size may be increased depending on the stream parameter setup to prevent underruns.
Is there some reason not to write all the data that you want played at once other than snd_pcm_writei() may block?
Can you point out some code that detects this underrun condition (I've found a bunch of candidates, but they don't obviously scream "underrun here!".
snd_pcm_update_state() in pcm_lib.c (driver) the 'if (avail >= runtime->stop_threshold)' condition.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
participants (2)
-
Andrew Bell
-
Jaroslav Kysela