[alsa-devel] How to report error in _pointer function?

Takashi Iwai tiwai at suse.de
Thu Aug 7 18:29:38 CEST 2008

At Wed, 06 Aug 2008 16:54:38 -0500,
Timur Tabi wrote:
> Takashi Iwai wrote:
> > You can return SNDRV_PCM_POS_XRUN from the pointer callback (with
> > kernel messages if you like).  Then the PCM stream is stopped and the
> > status is changed to SND_PCM_STATUS_XRUN.  Further access will result
> > in -EPIPE.
> This doesn't seem to work.  I don't get any more underrun/overrun messages, but
>  the application doesn't know that something's failed.
> With mplayer, I see this message:
> alsa-lib: pcm_hw.c:405:(snd_pcm_hw_hwsync) SNDRV_PCM_IOCTL_HWSYNC failed: Broken
> pipe
> And then mplayer hangs with the status bar here:
> A:   0.0 (00.0) of 249.0 (04:09.0) ??,?% $<50>
> aplay just hangs.

Hm... The behavior with returning SNDRV_PCM_POS_XRUN is basically
identical with the real XRUN detection.  I guess the XRUN-stop
mechanism doesn't work well with the case of hwsync.

How is the PCM status during hang?  Check
/proc/asound/card0/pcm*/sub*/* files.
Also, could you run with gdb and check at which code-path is it



More information about the Alsa-devel mailing list