alsa: fix infinite loop with Intel HDMI LPE
authorTanu Kaskinen <tanuk@iki.fi>
Thu, 28 Dec 2017 10:09:17 +0000 (12:09 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 3 Jan 2018 14:16:43 +0000 (16:16 +0200)
commit94fc586c011537536cfb434376354699357af785
treed3121712148aaa56e0082974ef924d1703bfe411
parentd9624e0382aabc106252e3a39665293e72ed08bb
alsa: fix infinite loop with Intel HDMI LPE

The Intel HDMI LPE driver works in a peculiar way when the HDMI cable is
not plugged in: any written audio is immediately discarded and underrun
is reported. That resulted in an infinite loop, because PulseAudio tried
to keep the buffer filled, which was futile since the written audio was
immediately consumed/discarded.

This patch adds special handling for the LPE driver: if the active port
of the sink is unavailable, the sink suspends itself. A new suspend
cause is added: PA_SUSPEND_UNAVAILABLE.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
src/modules/alsa/alsa-mixer.h
src/modules/alsa/alsa-sink.c
src/modules/alsa/module-alsa-card.c
src/pulsecore/core.h