From 31575f7766d6ff39665b64a3a04412eff1c39957 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jun 2009 03:45:14 +0200 Subject: alsa: rework mixer logic Completely rework mixer logic. This now allows controlling a full set of elements from a single sink's volume slider/mute button. This also introduces sink and source "ports" that can be used to choose different input or output ports with the UI. (i.e. "mic"/"line-in" or "speaker"/"headphones". The mixer paths and device maps are now configered in external configuration files and can be tweaked as necessary. --- src/modules/alsa/mixer/profile-sets/default.conf | 105 +++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/modules/alsa/mixer/profile-sets/default.conf (limited to 'src/modules/alsa/mixer/profile-sets/default.conf') diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf new file mode 100644 index 00000000..bced10ad --- /dev/null +++ b/src/modules/alsa/mixer/profile-sets/default.conf @@ -0,0 +1,105 @@ +# Profile definitions for PulseAudio's ALSA backend +# +# [Mapping id] +# device-strings = ... +# channel-map = ... +# description = ... +# paths-input = ... +# paths-output = ... +# element-input = ... +# element-output = ... +# priority = ... +# direction = any | input | output +# +# [Profile id] +# input-mappings = ... +# output-mappings = ... +# description = ... +# priority = ... +# skip-probe = no | yes + +[General] +auto-profiles = yes + +[Mapping analog-mono] +device-strings = hw +channel-map = mono +paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono +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 hw +channel-map = left,right +paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono +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 + +[Mapping analog-surround-40] +device-strings = surround40 +channel-map = front-left,front-right,rear-left,rear-right +paths-output = analog-output analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping analog-surround-41] +device-strings = surround41 +channel-map = front-left,front-right,rear-left,rear-right,lfe +paths-output = analog-output analog-output-lfe-on-mono +priority = 8 +direction = output + +[Mapping analog-surround-50] +device-strings = surround50 +channel-map = front-left,front-right,rear-left,rear-right,front-center +paths-output = analog-output analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping analog-surround-51] +device-strings = surround51 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +paths-output = analog-output analog-output-lfe-on-mono +priority = 8 +direction = output + +[Mapping analog-surround-71] +device-strings = surround71 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right +description = Analog Surround 7.1 +paths-output = analog-output analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping iec958-stereo] +device-strings = iec958 +channel-map = left,right +priority = 5 + +[Mapping iec958-surround-40] +device-strings = iec958 +channel-map = front-left,front-right,rear-left,rear-right +priority = 1 + +[Mapping iec958-ac3-surround-40] +device-strings = a52 +channel-map = front-left,front-right,rear-left,rear-right +priority = 2 +direction = output + +[Mapping iec958-ac3-surround-51] +device-strings = a52 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 3 +direction = output + +[Mapping hdmi-stereo] +device-strings = hdmi +channel-map = left,right +priority = 4 +direction = output + +#[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo] +#description = Foobar +#output-mappings = analog-stereo iec958-stereo +#input-mappings = analog-stereo -- cgit From 334325efd7d8ba32ca3c4ba8f90dccae7abe914c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jun 2009 04:17:25 +0200 Subject: alsa: allow placing device id in alsa device strings at arbitrary positions --- src/modules/alsa/mixer/profile-sets/default.conf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/modules/alsa/mixer/profile-sets/default.conf') diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf index bced10ad..bbe53410 100644 --- a/src/modules/alsa/mixer/profile-sets/default.conf +++ b/src/modules/alsa/mixer/profile-sets/default.conf @@ -22,49 +22,49 @@ auto-profiles = yes [Mapping analog-mono] -device-strings = hw +device-strings = hw:%f channel-map = mono paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono 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 hw +device-strings = front:%f hw:%f channel-map = left,right paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono 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 [Mapping analog-surround-40] -device-strings = surround40 +device-strings = surround40:%f channel-map = front-left,front-right,rear-left,rear-right paths-output = analog-output analog-output-lfe-on-mono priority = 7 direction = output [Mapping analog-surround-41] -device-strings = surround41 +device-strings = surround41:%f channel-map = front-left,front-right,rear-left,rear-right,lfe paths-output = analog-output analog-output-lfe-on-mono priority = 8 direction = output [Mapping analog-surround-50] -device-strings = surround50 +device-strings = surround50:%f channel-map = front-left,front-right,rear-left,rear-right,front-center paths-output = analog-output analog-output-lfe-on-mono priority = 7 direction = output [Mapping analog-surround-51] -device-strings = surround51 +device-strings = surround51:%f channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe paths-output = analog-output analog-output-lfe-on-mono priority = 8 direction = output [Mapping analog-surround-71] -device-strings = surround71 +device-strings = surround71:%f channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right description = Analog Surround 7.1 paths-output = analog-output analog-output-lfe-on-mono @@ -72,29 +72,29 @@ priority = 7 direction = output [Mapping iec958-stereo] -device-strings = iec958 +device-strings = iec958:%f channel-map = left,right priority = 5 [Mapping iec958-surround-40] -device-strings = iec958 +device-strings = iec958:%f channel-map = front-left,front-right,rear-left,rear-right priority = 1 [Mapping iec958-ac3-surround-40] -device-strings = a52 +device-strings = a52:%f channel-map = front-left,front-right,rear-left,rear-right priority = 2 direction = output [Mapping iec958-ac3-surround-51] -device-strings = a52 +device-strings = a52:%f channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe priority = 3 direction = output [Mapping hdmi-stereo] -device-strings = hdmi +device-strings = hdmi:%f channel-map = left,right priority = 4 direction = output -- cgit From 0fd17c6cb9733e11f81a90d7a5799caaea7357d4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Jun 2009 23:00:53 +0200 Subject: alsa: document default profile set a bit better --- src/modules/alsa/mixer/profile-sets/default.conf | 56 +++++++++++++++++------- 1 file changed, 39 insertions(+), 17 deletions(-) (limited to 'src/modules/alsa/mixer/profile-sets/default.conf') diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf index bbe53410..ebd4ff45 100644 --- a/src/modules/alsa/mixer/profile-sets/default.conf +++ b/src/modules/alsa/mixer/profile-sets/default.conf @@ -1,22 +1,43 @@ -# Profile definitions for PulseAudio's ALSA backend +# This file is part of PulseAudio. # -# [Mapping id] -# device-strings = ... -# channel-map = ... -# description = ... -# paths-input = ... -# paths-output = ... -# element-input = ... -# element-output = ... -# priority = ... -# direction = any | input | output +# 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. # -# [Profile id] -# input-mappings = ... -# output-mappings = ... -# description = ... -# priority = ... -# skip-probe = no | yes +# 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. + +; Default profile definitions for the ALSA backend of PulseAudio. This +; is used as fallback for all cards that have no special mapping +; assigned. (and should be good enough for the vast majority of cards) +; +; [General] +; auto-profiles = no | yes # Instead of defining all profiles manually, autogenerate them by combining every input mapping with every output mapping. +; +; [Mapping id] +; device-strings = ... # ALSA device string. %f will be replaced by the card identifier. +; channel-map = ... # Channel mapping to use for this device +; description = ... +; paths-input = ... # A list of mixer paths to use. Every path in this list will be probed. If multiple are found to be working they will be available as device ports +; paths-output = ... +; element-input = ... # Instead of configuring a full mixer path simply configure a single mixer element for volume/mute handling +; element-output = ... +; priority = ... +; direction = any | input | output # Only useful for? +; +; [Profile id] +; input-mappings = ... # Lists mappings for sources on this profile, those mapping must be defined in this file too +; output-mappings = ... # Lists mappings for sinks on this profile, those mappings must be defined in this file too +; description = ... +; priority = ... # Numeric value to deduce priority for this profile +; skip-probe = no | yes # Skip probing for availability? [General] auto-profiles = yes @@ -99,6 +120,7 @@ channel-map = left,right priority = 4 direction = output +; An example for defining multiple-sink profiles #[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo] #description = Foobar #output-mappings = analog-stereo iec958-stereo -- cgit From b70b5edcfc95b5cb258caacc21ffbe255d70ece6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Jun 2009 01:30:24 +0200 Subject: alsa: add copyright blobs and comments to all mixer paths/profile sets --- src/modules/alsa/mixer/profile-sets/default.conf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/modules/alsa/mixer/profile-sets/default.conf') diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf index ebd4ff45..6ae11b47 100644 --- a/src/modules/alsa/mixer/profile-sets/default.conf +++ b/src/modules/alsa/mixer/profile-sets/default.conf @@ -19,22 +19,27 @@ ; assigned. (and should be good enough for the vast majority of cards) ; ; [General] -; auto-profiles = no | yes # Instead of defining all profiles manually, autogenerate them by combining every input mapping with every output mapping. +; auto-profiles = no | yes # Instead of defining all profiles manually, autogenerate +; # them by combining every input mapping with every output mapping. ; ; [Mapping id] ; device-strings = ... # ALSA device string. %f will be replaced by the card identifier. ; channel-map = ... # Channel mapping to use for this device ; description = ... -; paths-input = ... # A list of mixer paths to use. Every path in this list will be probed. If multiple are found to be working they will be available as device ports +; paths-input = ... # A list of mixer paths to use. Every path in this list will be probed. +; # If multiple are found to be working they will be available as device ports ; paths-output = ... -; element-input = ... # Instead of configuring a full mixer path simply configure a single mixer element for volume/mute handling +; element-input = ... # Instead of configuring a full mixer path simply configure a single +; # mixer element for volume/mute handling ; element-output = ... ; priority = ... ; direction = any | input | output # Only useful for? ; ; [Profile id] -; input-mappings = ... # Lists mappings for sources on this profile, those mapping must be defined in this file too -; output-mappings = ... # Lists mappings for sinks on this profile, those mappings must be defined in this file too +; input-mappings = ... # Lists mappings for sources on this profile, those mapping must be +; # defined in this file too +; output-mappings = ... # Lists mappings for sinks on this profile, those mappings must be +; # defined in this file too ; description = ... ; priority = ... # Numeric value to deduce priority for this profile ; skip-probe = no | yes # Skip probing for availability? -- cgit From b1ea7c0d89a9516f89a7eed5d7a2f121d639b10a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Jun 2009 01:55:59 +0200 Subject: alsa: document alsa mixer path/profile sets a bit more --- src/modules/alsa/mixer/profile-sets/default.conf | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/modules/alsa/mixer/profile-sets/default.conf') diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf index 6ae11b47..ac41a8d3 100644 --- a/src/modules/alsa/mixer/profile-sets/default.conf +++ b/src/modules/alsa/mixer/profile-sets/default.conf @@ -16,8 +16,18 @@ ; Default profile definitions for the ALSA backend of PulseAudio. This ; is used as fallback for all cards that have no special mapping -; assigned. (and should be good enough for the vast majority of cards) -; +; assigned. (and should be good enough for the vast majority of +; cards). Use the udev property PULSE_PROFILE_SET to assign a +; different profile set than this one to a device. So what is this +; about? Simply, what we do here is map ALSA devices to how they are +; exposed in PA. We say which ALSA device string to use to open a +; device, which channel mapping to use then, and which mixer path to +; use. This is encoded in a 'mapping'. Multiple of these mappings can +; be bound together in a 'profile' which is then directly exposed in +; the UI as a card profile. Each mapping assigned to a profile will +; result in one sink/source to be created if the profile is selected +; for the card. + ; [General] ; auto-profiles = no | yes # Instead of defining all profiles manually, autogenerate ; # them by combining every input mapping with every output mapping. @@ -42,7 +52,9 @@ ; # defined in this file too ; description = ... ; priority = ... # Numeric value to deduce priority for this profile -; skip-probe = no | yes # Skip probing for availability? +; skip-probe = no | yes # Skip probing for availability? If this is yes then this profile +; # will be assumed as working without probing. Makes initialization +; # a bit faster but only works if the card is really known well. [General] auto-profiles = yes -- cgit