2015-04-18 4:26 GMT+08:00 Tanu Kaskinen <tanu.kaskinen at linux.intel.com>: > This card can be used in analog or digital mode, and in the digital > mode there's no hardware volume or mute 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 > 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..4bb4746 > --- /dev/null > +++ b/src/modules/alsa/mixer/paths/terratec-aureon-dual-usb-output.conf > @@ -0,0 +1,37 @@ > +# 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-key = output-speaker > +default-volume = 30% > + > +# 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 doesn't have effect in the > digital > +# mode, 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 eeb6ac4..7c8c14f 100644 > --- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules > +++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules > @@ -97,5 +97,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..e6b6573 > --- /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] > +device-strings = hw:%f > +channel-map = front-left,front-right > +paths-output = terratec-aureon-dual-usb-output > +priority = 1 > +direction = output > + > +[Mapping analog-mono] > +device-strings = hw:%f > +channel-map = mono > +paths-input = analog-input-mic > +priority = 1 > +direction = input > -- > Are there any pulseaudio verbose log when switching between analog and optical output before and after this patch ? http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/USB-Audio.conf;hb=HEAD alsa use same device for analog and digital, this mean that pulseaudio still have analog output profile and IEC958 profile http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/iec958-stereo-output.conf Pulseaudio should ignore speaker playback volume when using iec958 stereo profile -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20150422/3dba8e22/attachment-0001.html>