diff -Nru pulseaudio-15.0+dfsg1/debian/changelog pulseaudio-15.0+dfsg1/debian/changelog --- pulseaudio-15.0+dfsg1/debian/changelog 2021-10-22 10:28:32.000000000 +0000 +++ pulseaudio-15.0+dfsg1/debian/changelog 2021-11-20 04:15:12.000000000 +0000 @@ -1,3 +1,11 @@ +pulseaudio (1:15.0+dfsg1-1ubuntu2.2) impish; urgency=medium + + * d/p/0001-card-restore-setting-preferred-ports-in-entry_from_c.patch + - cherry pick an upstream commit to fix the issue of hdmi can't be + restored after s3 resume (LP: #1951667) + + -- Hui Wang Sat, 20 Nov 2021 12:15:12 +0800 + pulseaudio (1:15.0+dfsg1-1ubuntu2.1) impish; urgency=medium * debian/patches/gitlab_ice_error.patch: diff -Nru pulseaudio-15.0+dfsg1/debian/patches/0001-card-restore-setting-preferred-ports-in-entry_from_c.patch pulseaudio-15.0+dfsg1/debian/patches/0001-card-restore-setting-preferred-ports-in-entry_from_c.patch --- pulseaudio-15.0+dfsg1/debian/patches/0001-card-restore-setting-preferred-ports-in-entry_from_c.patch 1970-01-01 00:00:00.000000000 +0000 +++ pulseaudio-15.0+dfsg1/debian/patches/0001-card-restore-setting-preferred-ports-in-entry_from_c.patch 2021-11-20 04:15:12.000000000 +0000 @@ -0,0 +1,46 @@ +From 484b69863f0740cabf1a4e37eae92ffa8d18ee32 Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Thu, 11 Nov 2021 19:05:20 +0800 +Subject: [PATCH] card-restore: setting preferred ports in entry_from_card + +If the preferred ports are not set in this function, the +entrys_equal() always returns false in the card_put_hook_callback(). +This will make the entry be written into the metadata and the +preferred ports will be cleaned by a mistake. + +And we met a hdmi audio bug which has sth to do with this issue, on +the machines with the legacy HDA audio driver, the hdmi port has lower +priority than speaker, users need to manually select the hdmi to be +active output port, then the preferred output port is hdmi for this +sound card, after reboot, the card_put_hook_callback() in the +module-card-restore.c will be called and the preferred ports are +cleaned by a mistake, then the hdmi output port or hdmi sink couldn't +switch to be active after reboot or resume automatically. That is +because the preferred ports are cleaned and hdmi port has lower +priority than speaker, the profile_good_for_output() in the +module-switch-on-port-available.c always returns false. + +Signed-off-by: Hui Wang +--- + src/modules/module-card-restore.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c +index 08f8333e4..c93d584ef 100644 +--- a/src/modules/module-card-restore.c ++++ b/src/modules/module-card-restore.c +@@ -158,6 +158,11 @@ static struct entry *entry_from_card(pa_card *card) { + if (card->save_profile || entry->profile_is_sticky) + entry->profile = pa_xstrdup(card->active_profile->name); + ++ if (card->preferred_input_port) ++ entry->preferred_input_port = pa_xstrdup(card->preferred_input_port->name); ++ if (card->preferred_output_port) ++ entry->preferred_output_port = pa_xstrdup(card->preferred_output_port->name); ++ + PA_HASHMAP_FOREACH(port, card->ports, state) { + p_info = port_info_new(port); + pa_assert_se(pa_hashmap_put(entry->ports, p_info->name, p_info) >= 0); +-- +2.25.1 + diff -Nru pulseaudio-15.0+dfsg1/debian/patches/series pulseaudio-15.0+dfsg1/debian/patches/series --- pulseaudio-15.0+dfsg1/debian/patches/series 2021-10-22 10:28:32.000000000 +0000 +++ pulseaudio-15.0+dfsg1/debian/patches/series 2021-11-20 04:15:12.000000000 +0000 @@ -17,3 +17,4 @@ 0701-enable-snap-policy-module.patch 0702-add-snappy-policy-module.patch 0016-check_off_profile_when_switching_profile.patch +0001-card-restore-setting-preferred-ports-in-entry_from_c.patch