[pulseaudio-discuss] [PATCH 3/3] alsa-mixer: Improve volume handling for Terratec Aureon Dual USB

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Nov 16 00:10:29 PST 2014


This card can be used in analog or digital mode, and in the digital
mode there's no hardware volume support. With the default
configuration PulseAudio only sees a single "speaker" port, and
assumes that controlling the Speaker element has some effect, which
is not true in the digital mode. To work around this, let's add a
special path configuration for this card to disable hardware volume.

It would be better to disable hardware volume only in the digital
mode, but I believe there's no way to automatically figure out which
mode is in use, and requiring the user to tell which mode is in use
at any given time would not be user-friendly.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81777
---
 src/Makefile.am                                    |  6 ++--
 .../paths/terratec-aureon-dual-usb-output.conf     | 36 +++++++++++++++++++
 .../alsa/mixer/profile-sets/90-pulseaudio.rules    |  1 +
 .../profile-sets/terratec-aureon-dual-usb.conf     | 42 ++++++++++++++++++++++
 4 files changed, 83 insertions(+), 2 deletions(-)
 create mode 100644 src/modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf
 create mode 100644 src/modules/alsa/mixer/profile-sets/terratec-aureon-dual-usb.conf

diff --git a/src/Makefile.am b/src/Makefile.am
index 4e60a98..8fea633 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1260,7 +1260,8 @@ dist_alsaprofilesets_DATA = \
 		modules/alsa/mixer/profile-sets/native-instruments-traktor-audio10.conf \
 		modules/alsa/mixer/profile-sets/native-instruments-traktorkontrol-s4.conf \
 		modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf \
-		modules/alsa/mixer/profile-sets/kinect-audio.conf
+		modules/alsa/mixer/profile-sets/kinect-audio.conf \
+		modules/alsa/mixer/profile-sets/terratec-aureon-dual-usb.conf
 
 if HAVE_UDEV
 dist_udevrules_DATA = \
@@ -1301,7 +1302,8 @@ dist_alsapaths_DATA = \
 		modules/alsa/mixer/paths/hdmi-output-4.conf \
 		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/hdmi-output-7.conf \
+		modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf
 
 endif
 
diff --git a/src/modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf b/src/modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf
new file mode 100644
index 0000000..b8f8968
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf
@@ -0,0 +1,36 @@
+# 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, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+# For Terratec Aureon Dual USB.
+#
+# See analog-output.conf.common for an explanation on the directives.
+
+[General]
+description = Output
+
+# We set the hardware volume to maximum and do the volume control in software,
+# because the hardware volume only has effect when the card is in analog mode.
+# In the digital mode there's no hardware volume. Since we don't have any way
+# to know which mode is in use, we disable hardware volume control in both
+# modes. Otherwise the sink volume control wouldn't work properly in the
+# digital mode.
+#
+# Similarly as with volume, the Speaker mute probably doesn't have effect
+# either in the digital mode (this is unverified), so we unmute the element
+# unconditionally and implement muting in software.
+[Element Speaker]
+volume = zero
+switch = on
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
index b34b90b..d05e1f4 100644
--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
+++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
@@ -98,5 +98,6 @@ ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="1011", ENV{PULSE_PROFILE_SET}="nativ
 ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="1021", ENV{PULSE_PROFILE_SET}="native-instruments-traktor-audio10.conf"
 ATTRS{idVendor}=="0763", ATTRS{idProduct}=="2012", ENV{PULSE_PROFILE_SET}="maudio-fasttrack-pro.conf"
 ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bb", ENV{PULSE_PROFILE_SET}="kinect-audio.conf"
+ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="0077", ENV{PULSE_PROFILE_SET}="terratec-aureon-dual-usb.conf"
 
 LABEL="pulseaudio_end"
diff --git a/src/modules/alsa/mixer/profile-sets/terratec-aureon-dual-usb.conf b/src/modules/alsa/mixer/profile-sets/terratec-aureon-dual-usb.conf
new file mode 100644
index 0000000..04ed6a8
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/terratec-aureon-dual-usb.conf
@@ -0,0 +1,42 @@
+# 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, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+# Terratec Aureon Dual USB
+#
+# This card has one stereo output jack and one analog mono mic jack.
+#
+# The output jack supports both analog and digital output, but there's no way
+# to detect which one is currently in use (or if there is a way, the PulseAudio
+# developers don't know that).
+#
+# See default.conf for an explanation on the directives used here.
+
+[General]
+auto-profiles = yes
+
+[Mapping stereo-output]
+description = Stereo output
+device-strings = hw:%f
+channel-map = front-left,front-right
+paths-output = terratec-aureon-dual-usb-output
+direction = output
+
+[Mapping mono-input]
+description = Mono input
+device-strings = hw:%f
+channel-map = mono
+paths-input = analog-input-mic
+direction = input
-- 
1.9.3



More information about the pulseaudio-discuss mailing list