linux-stable/sound
Takashi Iwai 2c6334d1dd ALSA: hda/hdmi: Preserve the previous PCM device upon re-enablement
[ Upstream commit f785f5ee96 ]

When a DRM driver turns on or off the screen with the audio
capability, it notifies the ELD to HD-audio HDMI codec driver via
component ops.  HDMI codec driver, in turn, attaches or detaches the
PCM stream for the given port on the fly.

The problem is that, since the recent code change, the HDMI driver
always treats the PCM stream assignment dynamically; this ended up the
confusion of the PCM device appearance.  e.g. when a screen goes once
off and on again, it may appear on a different PCM device before the
screen-off.  Although the application should treat such a change, it
doesn't seem working gracefully with the current pipewire (maybe
PulseAudio, too).

As a workaround, this patch changes the HDMI codec driver behavior
slightly to be more consistent.  Now it remembers the previous PCM
slot for the given port and try to assign to it.  That is, if a port
is re-enabled, the driver tries to use the same PCM slot that was
assigned to that port previously.  If it conflicts, a new slot is
searched and used like before, instead.

Note that multiple monitor connections are the only typical case where
the PCM slot preservation is effective.  As long as only a single
monitor is connected, the behavior isn't changed, and the first PCM
slot is still assigned always.

Fixes: ef6f5494fa ("ALSA: hda/hdmi: Use only dynamic PCM device allocation")
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217259
Link: https://lore.kernel.org/r/20230331142217.19791-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 17:02:38 +02:00
..
ac97
aoa ALSA: aoa: tas: Convert to i2c's .probe_new() 2022-11-19 09:43:27 +01:00
arm ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq() 2022-10-29 10:45:27 +02:00
atmel
core ALSA: usb-audio: Fix recursive locking at XRUN during syncing 2023-04-06 12:12:31 +02:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2022-12-06 11:12:12 +01:00
firewire ALSA: firewire-motu: fix unreleased lock warning in hwdep device 2023-01-31 09:34:04 +01:00
hda ALSA: hda: intel-dsp-config: add MTL PCI id 2023-03-22 13:38:02 +01:00
i2c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
isa
mips
oss
parisc
pci ALSA: hda/hdmi: Preserve the previous PCM device upon re-enablement 2023-04-13 17:02:38 +02:00
pcmcia
ppc ALSA: ppc: keywest: Convert to i2c's .probe_new() 2022-11-19 09:43:50 +01:00
sh
soc ASoC: codecs: lpass: fix the order or clks turn off during suspend 2023-04-13 17:02:36 +02:00
sparc
spi
synth ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-07 14:32:33 +01:00
usb ALSA: usb-audio: Fix regression on detection of Roland VS-100 2023-04-06 12:12:44 +02:00
virtio
x86
xen xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c driver core: make struct class.devnode() take a const * 2022-11-24 17:12:27 +01:00