alsa: fix infinite loop with Intel HDMI LPE 67/178067/1
authorTanu Kaskinen <tanuk@iki.fi>
Thu, 28 Dec 2017 10:09:17 +0000 (12:09 +0200)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 8 May 2018 03:36:20 +0000 (12:36 +0900)
commitc8dd742a036cede706716f055b6900ea7531da44
tree05eecb99aeb1abc0551ca99e3fe435caccaad581
parent3d610c101b2eb63b159ff2ed7fcf6a4a382f00f9
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.

Change-Id: I440b50d4a3804d1a6f6e7cd9d036a1a4230c02eb
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=100488
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/modules/alsa/alsa-mixer.h
src/modules/alsa/alsa-sink.c
src/modules/alsa/module-alsa-card.c
src/pulsecore/core.h