On 2017/02/23 21:44, Joerg Raftopoulos <jo...@raftopoulos.net> wrote:
> MPD's ALSA input plugin works since
> 791efc171a35848bb062aad0aee41220cd1f62ba in SND_PCM_NONBLOCK mode.
> According to ALSA documentation
> http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ga4c2c7bd26cf221268d59dc3bbeb9c048
> snd_pcm_readi does not wait in non-blocking mode.

I'm well aware of that, and that was the one and only goal of this
commit.

> This causes a loop, resulting in a high cpu load.

This needs further explanation.  Where's the loop?

Does this mean that the ALSA file descriptor becomes readable over and
over, and DispatchSockets() gets called again and again, but every
time, snd_pcm_readi() returns -EAGAIN?  If that is the case, then
we're seeing an ALSA bug.

Or do I miss something obvious?

> Patch adds wait with 500ms timeout. Thanks to kuikka for
> clarification.

This is illegal.  You must not block the I/O thread!  Whatever problem
your patch aims to fix, this is a bad solution.
_______________________________________________
mpd-devel mailing list
mpd-devel@musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to