[pulseaudio-commits] Branch 'next' - 2 commits - src/Makefile.am src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Wed Feb 21 12:34:41 UTC 2018


 src/Makefile.am                                                         |   11 ++--
 src/modules/alsa/alsa-mixer.c                                           |    2 
 src/modules/alsa/mixer/paths/steelseries-arctis-5-output-chat.conf      |   27 ++++++++++
 src/modules/alsa/mixer/paths/steelseries-arctis-5-output-game.conf      |   27 ++++++++++
 src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules                 |    3 -
 src/modules/alsa/mixer/profile-sets/steelseries-arctis-5-usb-audio.conf |   22 ++++++++
 src/modules/alsa/mixer/profile-sets/steelseries-arctis-7-usb-audio.conf |    6 +-
 src/modules/module-null-sink.c                                          |    4 -
 src/modules/module-pipe-sink.c                                          |    6 +-
 9 files changed, 95 insertions(+), 13 deletions(-)

New commits:
commit b5607aafa57bbd92342f512deb3bd0ff670cea38
Author: Bert Hekman <demontpx at gmail.com>
Date:   Tue Feb 13 20:06:12 2018 +0100

    alsa-mixer: add support for SteelSeries Arctis 5 and renamed Arctis 7 files appropriately

diff --git a/src/Makefile.am b/src/Makefile.am
index 45616c01..91c18b71 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1316,7 +1316,8 @@ dist_alsaprofilesets_DATA = \
 		modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf \
 		modules/alsa/mixer/profile-sets/kinect-audio.conf \
 		modules/alsa/mixer/profile-sets/sb-omni-surround-5.1.conf \
-		modules/alsa/mixer/profile-sets/steelseries-arctis-usb-audio.conf \
+		modules/alsa/mixer/profile-sets/steelseries-arctis-5-usb-audio.conf \
+		modules/alsa/mixer/profile-sets/steelseries-arctis-7-usb-audio.conf \
 		modules/alsa/mixer/profile-sets/dell-dock-tb16-usb-audio.conf
 
 if HAVE_UDEV
@@ -1360,9 +1361,11 @@ dist_alsapaths_DATA = \
 		modules/alsa/mixer/paths/hdmi-output-5.conf \
 		modules/alsa/mixer/paths/hdmi-output-6.conf \
 		modules/alsa/mixer/paths/hdmi-output-7.conf \
-		modules/alsa/mixer/paths/steelseries-arctis-input.conf \
-		modules/alsa/mixer/paths/steelseries-arctis-output-mono.conf \
-		modules/alsa/mixer/paths/steelseries-arctis-output-stereo.conf
+		modules/alsa/mixer/paths/steelseries-arctis-5-output-chat.conf \
+		modules/alsa/mixer/paths/steelseries-arctis-5-output-game.conf \
+		modules/alsa/mixer/paths/steelseries-arctis-7-input.conf \
+		modules/alsa/mixer/paths/steelseries-arctis-7-output-mono.conf \
+		modules/alsa/mixer/paths/steelseries-arctis-7-output-stereo.conf
 
 endif
 
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 7de1c7de..b8c2bc72 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -2480,6 +2480,8 @@ static int path_verify(pa_alsa_path *p) {
         { "iec958-passthrough-output",  N_("Digital Passthrough (S/PDIF)") },
         { "multichannel-input",         N_("Multichannel Input") },
         { "multichannel-output",        N_("Multichannel Output") },
+        { "steelseries-arctis-5-output-game", N_("Game Output") },
+        { "steelseries-arctis-5-output-chat", N_("Chat Output") },
     };
 
     pa_alsa_element *e;
diff --git a/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-chat.conf b/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-chat.conf
new file mode 100644
index 00000000..5842bfe8
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-chat.conf
@@ -0,0 +1,27 @@
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# PulseAudio is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+
+; Steelseries Arctis 5 USB headset stereo chat path. The headset has two
+; output devices. The first one is meant for voice audio, and the second
+; one meant for everything else. The purpose of this unusual design is to
+; provide separate volume controls for voice and other audio, which can be
+; useful in gaming.
+
+[General]
+priority = 50
+
+[Element Com Speaker]
+switch = mute
+volume = merge
diff --git a/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-game.conf b/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-game.conf
new file mode 100644
index 00000000..b758a6fe
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/steelseries-arctis-5-output-game.conf
@@ -0,0 +1,27 @@
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# PulseAudio is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+
+; Steelseries Arctis 5 USB headset stereo game path. The headset has two
+; output devices. The first one is meant for voice audio, and the second
+; one meant for everything else. The purpose of this unusual design is to
+; provide separate volume controls for voice and other audio, which can be
+; useful in gaming.
+
+[General]
+priority = 99
+
+[Element PCM]
+switch = mute
+volume = merge
diff --git a/src/modules/alsa/mixer/paths/steelseries-arctis-input.conf b/src/modules/alsa/mixer/paths/steelseries-arctis-7-input.conf
similarity index 100%
rename from src/modules/alsa/mixer/paths/steelseries-arctis-input.conf
rename to src/modules/alsa/mixer/paths/steelseries-arctis-7-input.conf
diff --git a/src/modules/alsa/mixer/paths/steelseries-arctis-output-mono.conf b/src/modules/alsa/mixer/paths/steelseries-arctis-7-output-mono.conf
similarity index 100%
rename from src/modules/alsa/mixer/paths/steelseries-arctis-output-mono.conf
rename to src/modules/alsa/mixer/paths/steelseries-arctis-7-output-mono.conf
diff --git a/src/modules/alsa/mixer/paths/steelseries-arctis-output-stereo.conf b/src/modules/alsa/mixer/paths/steelseries-arctis-7-output-stereo.conf
similarity index 100%
rename from src/modules/alsa/mixer/paths/steelseries-arctis-output-stereo.conf
rename to src/modules/alsa/mixer/paths/steelseries-arctis-7-output-stereo.conf
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
index 4dacb62b..ceb61d9e 100644
--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
+++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
@@ -105,7 +105,8 @@ ATTRS{idVendor}=="0763", ATTRS{idProduct}=="2012", ENV{PULSE_PROFILE_SET}="maudi
 ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bb", ENV{PULSE_PROFILE_SET}="kinect-audio.conf"
 ATTRS{idVendor}=="041e", ATTRS{idProduct}=="322c", ENV{PULSE_PROFILE_SET}="sb-omni-surround-5.1.conf"
 ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="4014", ENV{PULSE_PROFILE_SET}="dell-dock-tb16-usb-audio.conf"
-ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1260", ENV{PULSE_PROFILE_SET}="steelseries-arctis-usb-audio.conf"
+ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1250", ENV{PULSE_PROFILE_SET}="steelseries-arctis-5-usb-audio.conf"
+ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1260", ENV{PULSE_PROFILE_SET}="steelseries-arctis-7-usb-audio.conf"
 ATTRS{idVendor}=="147a", ATTRS{idProduct}=="e055", ENV{PULSE_PROFILE_SET}="cmedia-high-speed-true-hdaudio.conf"
 
 LABEL="pulseaudio_end"
diff --git a/src/modules/alsa/mixer/profile-sets/steelseries-arctis-5-usb-audio.conf b/src/modules/alsa/mixer/profile-sets/steelseries-arctis-5-usb-audio.conf
new file mode 100644
index 00000000..fe353c38
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/steelseries-arctis-5-usb-audio.conf
@@ -0,0 +1,22 @@
+[General]
+auto-profiles = yes
+
+[Mapping analog-chat]
+description = Chat
+device-strings = hw:%f,0,0
+channel-map = left,right
+paths-input = analog-input-mic
+paths-output = steelseries-arctis-5-output-chat
+
+[Mapping analog-game]
+description = Game
+device-strings = hw:%f,1,0
+channel-map = left,right
+paths-output = steelseries-arctis-5-output-game
+direction = output
+
+[Profile output:analog-chat+output:analog-game+input:analog-chat]
+output-mappings = analog-chat analog-game
+input-mappings = analog-chat
+priority = 5100
+skip-probe = yes
diff --git a/src/modules/alsa/mixer/profile-sets/steelseries-arctis-usb-audio.conf b/src/modules/alsa/mixer/profile-sets/steelseries-arctis-7-usb-audio.conf
similarity index 91%
rename from src/modules/alsa/mixer/profile-sets/steelseries-arctis-usb-audio.conf
rename to src/modules/alsa/mixer/profile-sets/steelseries-arctis-7-usb-audio.conf
index d3563a16..8c061e1a 100644
--- a/src/modules/alsa/mixer/profile-sets/steelseries-arctis-usb-audio.conf
+++ b/src/modules/alsa/mixer/profile-sets/steelseries-arctis-7-usb-audio.conf
@@ -27,13 +27,13 @@ auto-profiles = yes
 [Mapping analog-mono]
 device-strings = hw:%f,0,0
 channel-map = mono
-paths-output = steelseries-arctis-output-mono
-paths-input = steelseries-arctis-input
+paths-output = steelseries-arctis-7-output-mono
+paths-input = steelseries-arctis-7-input
 
 [Mapping analog-stereo]
 device-strings = hw:%f,1,0
 channel-map = left,right
-paths-output = steelseries-arctis-output-stereo
+paths-output = steelseries-arctis-7-output-stereo
 direction = output
 
 [Profile output:analog-mono+output:analog-stereo+input:analog-mono]

commit bffe871b8b37d7c48e6679c1b8fd57efc63620ff
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Wed Feb 21 11:54:41 2018 +0200

    null-sink, pipe-sink: some state variable cleanups
    
    pa_sink_get_state() is supposed to be used from the main thread. In this
    case it doesn't really matter, because the SET_STATE handler is executed
    while the main thread is waiting, but since the state is available also
    in thread_info, let's use that. All other modules use thread_info.state
    too, so at least this change improves consistency.
    
    Also, we can use the PA_SINK_IS_OPENED macro to simplify the code a bit.

diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 25b0f309..3ace082d 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -91,8 +91,8 @@ static int sink_process_msg(
     switch (code) {
         case PA_SINK_MESSAGE_SET_STATE:
 
-            if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED || pa_sink_get_state(u->sink) == PA_SINK_INIT) {
-                if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING || PA_PTR_TO_UINT(data) == PA_SINK_IDLE)
+            if (u->sink->thread_info.state == PA_SINK_SUSPENDED || u->sink->thread_info.state == PA_SINK_INIT) {
+                if (PA_SINK_IS_OPENED(PA_PTR_TO_UINT(data)))
                     u->timestamp = pa_rtclock_now();
             }
 
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index a2074c1f..995785e1 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -111,10 +111,10 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
 
     switch (code) {
         case PA_SINK_MESSAGE_SET_STATE:
-            if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED || pa_sink_get_state(u->sink) == PA_SINK_INIT) {
-                if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING || PA_PTR_TO_UINT(data) == PA_SINK_IDLE)
+            if (u->sink->thread_info.state == PA_SINK_SUSPENDED || u->sink->thread_info.state == PA_SINK_INIT) {
+                if (PA_SINK_IS_OPENED(PA_PTR_TO_UINT(data)))
                     u->timestamp = pa_rtclock_now();
-            } else if (pa_sink_get_state(u->sink) == PA_SINK_RUNNING || pa_sink_get_state(u->sink) == PA_SINK_IDLE) {
+            } else if (u->sink->thread_info.state == PA_SINK_RUNNING || u->sink->thread_info.state == PA_SINK_IDLE) {
                 if (PA_PTR_TO_UINT(data) == PA_SINK_SUSPENDED) {
                     /* Clear potential FIFO error flag */
                     u->fifo_error = false;



More information about the pulseaudio-commits mailing list