As I discussed with Tanu Kaskinen yesterday, we should do something about when one profile path prevents another from using the hw volume capabilities. However, with Ubuntu a few weeks from release, I went for the workaround approach and created a separate profile for the devices instead to minimise regression potential.
So, until this is fixed the right way, feel free to use the attached patch.

Bug reference: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/671560

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
>From 6f41a4140013dac7737847bb5eddc78906eb09b7 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.hennings...@canonical.com>
Date: Tue, 5 Apr 2011 11:37:59 +0200
Subject: [PATCH] alsa-mixer: Add workaround for some USB headsets

This is a workaround - these usb headsets have one output volume
control only, labeled "Speaker". This causes the default profile
set to not control the volume at all, which is a bug. Workaround
that by creating a separate profile set.

Signed-off-by: David Henningsson <david.hennings...@canonical.com>
---
 src/Makefile.am                                    |    3 +-
 .../alsa/mixer/profile-sets/90-pulseaudio.rules    |    3 ++
 .../alsa/mixer/profile-sets/usb-headset.conf       |   35 ++++++++++++++++++++
 3 files changed, 40 insertions(+), 1 deletions(-)
 create mode 100644 src/modules/alsa/mixer/profile-sets/usb-headset.conf

diff --git a/src/Makefile.am b/src/Makefile.am
index cc38db2..0a4862f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -115,7 +115,8 @@ ALSA_PROFILES = \
 		modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf \
 		modules/alsa/mixer/profile-sets/native-instruments-audio8dj.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/native-instruments-korecontroller.conf \
+		modules/alsa/mixer/profile-sets/usb-headset.conf
 
 ALSA_PATHS = \
 		modules/alsa/mixer/paths/analog-input-aux.conf \
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
index f964b00..ff91ccf 100644
--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
+++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
@@ -20,6 +20,9 @@ SUBSYSTEM!="sound", GOTO="pulseaudio_end"
 ACTION!="change", GOTO="pulseaudio_end"
 KERNEL!="card*", GOTO="pulseaudio_end"
 
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="01ab", ENV{PULSE_PROFILE_SET}="usb-headset.conf"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0a0c", ENV{PULSE_PROFILE_SET}="usb-headset.conf"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1395", ATTRS{idProduct}=="0002", ENV{PULSE_PROFILE_SET}="usb-headset.conf"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="1978", ENV{PULSE_PROFILE_SET}="native-instruments-audio8dj.conf"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="0839", ENV{PULSE_PROFILE_SET}="native-instruments-audio4dj.conf"
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="baff", ENV{PULSE_PROFILE_SET}="native-instruments-traktorkontrol-s4.conf"
diff --git a/src/modules/alsa/mixer/profile-sets/usb-headset.conf b/src/modules/alsa/mixer/profile-sets/usb-headset.conf
new file mode 100644
index 0000000..adf78d1
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/usb-headset.conf
@@ -0,0 +1,35 @@
+# 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.
+
+; This is a workaround - these usb headsets have one output volume control only, labeled "Speaker".
+; This causes the default profile set to not control the volume at all, which is a bug.
+
+[General]
+auto-profiles = yes
+
+[Mapping analog-mono]
+device-strings = hw:%f
+channel-map = mono
+paths-output = analog-output-speaker
+paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
+priority = 1
+
+[Mapping analog-stereo]
+device-strings = front:%f hw:%f
+channel-map = left,right
+paths-output = analog-output-speaker
+paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
+priority = 10
-- 
1.7.4.1

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

Reply via email to