[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 2 commits: alsa-mixer: Add the ability to pass the intended-role to the mapping

Arun Raghavan gitlab at gitlab.freedesktop.org
Mon Dec 23 11:01:28 UTC 2019



Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
c6a06656 by Laurent Bigonville at 2019-12-23T09:31:41Z
alsa-mixer: Add the ability to pass the intended-role to the mapping

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/640

- - - - -
6438e5c4 by Laurent Bigonville at 2019-12-23T09:33:30Z
alsa-mixer: Set the intended-role of Steelseries Arctis 5/7 headset as phone

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/640

- - - - -


3 changed files:

- src/modules/alsa/alsa-mixer.c
- src/modules/alsa/mixer/profile-sets/steelseries-arctis-common-usb-audio.conf
- src/modules/alsa/mixer/profile-sets/usb-gaming-headset.conf


Changes:

=====================================
src/modules/alsa/alsa-mixer.c
=====================================
@@ -3978,6 +3978,24 @@ static int mapping_parse_fallback(pa_config_parser_state *state) {
     return 0;
 }
 
+static int mapping_parse_intended_roles(pa_config_parser_state *state) {
+    pa_alsa_profile_set *ps;
+    pa_alsa_mapping *m;
+
+    pa_assert(state);
+
+    ps = state->userdata;
+
+    if (!(m = pa_alsa_mapping_get(ps, state->section))) {
+        pa_log("[%s:%u] %s invalid in section %s", state->filename, state->lineno, state->lvalue, state->section);
+        return -1;
+    }
+
+    pa_proplist_sets(m->proplist, PA_PROP_DEVICE_INTENDED_ROLES, state->rvalue);
+
+    return 0;
+}
+
 
 static int profile_parse_mappings(pa_config_parser_state *state) {
     pa_alsa_profile_set *ps;
@@ -4569,6 +4587,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
         { "element-output",         mapping_parse_element,        NULL, NULL },
         { "direction",              mapping_parse_direction,      NULL, NULL },
         { "exact-channels",         mapping_parse_exact_channels, NULL, NULL },
+        { "intended-roles",         mapping_parse_intended_roles, NULL, NULL },
 
         /* Shared by [Mapping ...] and [Profile ...] */
         { "description",            mapping_parse_description,    NULL, NULL },


=====================================
src/modules/alsa/mixer/profile-sets/steelseries-arctis-common-usb-audio.conf
=====================================
@@ -7,6 +7,7 @@ device-strings = hw:%f,0,0
 channel-map = left,right
 paths-input = analog-input-mic
 paths-output = steelseries-arctis-output-chat-common
+intended-roles = phone
 
 [Mapping analog-game]
 description = Game


=====================================
src/modules/alsa/mixer/profile-sets/usb-gaming-headset.conf
=====================================
@@ -34,6 +34,7 @@ device-strings = hw:%f,0,0
 channel-map = mono
 paths-output = usb-gaming-headset-output-mono
 paths-input = usb-gaming-headset-input
+intended-roles = phone
 
 [Mapping analog-stereo]
 device-strings = hw:%f,1,0



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/48545240582cade1cd4e62e2c6c0ad72f33c7014...6438e5c46dc449e4726ec9312859cc70388d2851

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/48545240582cade1cd4e62e2c6c0ad72f33c7014...6438e5c46dc449e4726ec9312859cc70388d2851
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/20191223/14ec3b4e/attachment-0001.htm>


More information about the pulseaudio-commits mailing list