switch-on-connect: Blacklist HDMI devices by default
authorTanu Kaskinen <tanuk@iki.fi>
Fri, 27 Dec 2019 09:10:54 +0000 (11:10 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 27 Dec 2019 09:24:36 +0000 (11:24 +0200)
commitcdcb01889c785f16ca8893ee4735ea31f710bdb7
tree570f7cc6aac2e0c7cc9b27f30b20e0cc5835848c
parent4dba56c1af96b4b93574a18e878d054e70bcaa62
switch-on-connect: Blacklist HDMI devices by default

As the comment says, switching to HDMI automatically often causes
problems. Commit bae8c16bfadb43c596b03f9c7ff7c9e9f1709b76
("switch-on-connect: Do not ignore HDMI sinks") enabled switching to
HDMI earlier. It was known already then that HDMI monitors don't
necessarily have speakers on them, but I accepted the patch on the
basis that module-switch-on-connect acts only if the card profile is
switched to HDMI, so if switching to HDMI is wrong, then already the
profile switch should cause problems. I didn't think of the case where
the default sink is on some other card, in which case switching the
profile on the HDMI card doesn't cause problems by itself.

I don't want to revert bae8c16bfa, because João needs to be able to
configure their systems to automatically switch to HDMI. Instead, this
patch utilizes the new blacklisting feature in module-switch-on-connect
to blacklist HDMI sinks by default. Switching to HDMI can be enabled by
setting the blacklist modarg to an empty string or something that
doesn't match HDMI sinks.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/749
src/modules/module-switch-on-connect.c