dmix, snd_pcm_drain(), SND_PCM_NONBLOCK - bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have received a bug report for the Music Player Daemon which
complains about a freezing MPD process, after I switched MPD's ALSA
output to non-blocking mode:

 https://bugs.musicpd.org/view.php?id=4662

This happens when snd_pcm_drain() is used on a dmix PCM which is in
SND_PCM_NONBLOCK mode.  snd_pcm_drain() will be called repeatedly,
because ALSA's file descriptor is always ready.

According to my research, the bug is in __snd_pcm_dmix_drain().  This
function always returns -EAGAIN when SND_PCM_NONBLOCK is set:

  if (pcm->mode & SND_PCM_NONBLOCK)
        return -EAGAIN;

This comes very early in the function, before any other relevant
checks.  It can never finish that way, and calling it again at any
time will never do anything.  Thus, snd_pcm_drain() appears to be
broken in non-blocking mode.

Or am I misunderstanding how snd_pcm_drain() is supposed to be used in
non-blocking mode?

Max
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux