[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] card-restore: setting preferred ports in entry_from_card
Tanu Kaskinen (@tanuk)
gitlab at gitlab.freedesktop.org
Thu Nov 18 14:50:13 UTC 2021
Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio
Commits:
484b6986 by Hui Wang at 2021-11-18T12:04:16+08:00
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 <hui.wang at canonical.com>
- - - - -
1 changed file:
- src/modules/module-card-restore.c
Changes:
=====================================
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);
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/484b69863f0740cabf1a4e37eae92ffa8d18ee32
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/484b69863f0740cabf1a4e37eae92ffa8d18ee32
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20211118/5f996936/attachment.htm>
More information about the pulseaudio-commits
mailing list