[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] sink: Reduce chat sink priority
PulseAudio Marge Bot
gitlab at gitlab.freedesktop.org
Thu Dec 10 16:48:34 UTC 2020
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
6b04e2a8 by Tanu Kaskinen at 2020-12-10T16:43:17+00:00
sink: Reduce chat sink priority
Some gaming sound cards have custom profiles with analog-game and
analog-chat mappings that exist simultaneously. The game sink should
have higher priority than the chat sink, but currently there's no way to
affect the sink priorities from the profile-set configuration (the
mapping priority is not propagated to the sink priority).
I first thought about adding the mapping priority to the sink priority,
but that could mess up the prioritization system in
pa_device_init_priority(). I ended up checking for the intended roles
property to reduce the chat sink priority. I also reduced the iec958
priority so that the chat and iec958 sinks don't end up with the same
priority.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/818
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/266>
- - - - -
1 changed file:
- src/pulsecore/sink.c
Changes:
=====================================
src/pulsecore/sink.c
=====================================
@@ -3609,10 +3609,18 @@ unsigned pa_device_init_priority(pa_proplist *p) {
if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_NAME))) {
- if (pa_startswith(s, "analog-"))
+ if (pa_startswith(s, "analog-")) {
priority += 9;
+
+ /* If an analog device has an intended role of "phone", it probably
+ * co-exists with another device that is meant for everything else,
+ * and that other device should have higher priority than the phone
+ * device. */
+ if (pa_str_in_list_spaces(pa_proplist_gets(p, PA_PROP_DEVICE_INTENDED_ROLES), "phone"))
+ priority -= 1;
+ }
else if (pa_startswith(s, "iec958-"))
- priority += 8;
+ priority += 7;
}
return priority;
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/6b04e2a89e2a0a8b4f6aecb38fd00d82914f7050
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/6b04e2a89e2a0a8b4f6aecb38fd00d82914f7050
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/20201210/d992fffb/attachment.htm>
More information about the pulseaudio-commits
mailing list