From 348dcd6a31280217cad787f9ee75e607c0f1bf6c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Jun 2009 21:27:02 +0200 Subject: alsa: unify alsa log handling and snd_config_update_free_global() handling in one place --- src/modules/alsa/alsa-sink.c | 1 - src/modules/alsa/alsa-source.c | 2 -- src/modules/alsa/alsa-util.c | 8 +++++--- src/modules/alsa/alsa-util.h | 4 ++-- src/modules/alsa/module-alsa-card.c | 6 ++---- src/modules/alsa/module-alsa-sink.c | 6 ++---- src/modules/alsa/module-alsa-source.c | 6 ++---- 7 files changed, 13 insertions(+), 20 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 34ff6582..281371f7 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -838,7 +838,6 @@ static int unsuspend(struct userdata *u) { pa_log_info("Trying resume..."); - snd_config_update_free_global(); if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_PLAYBACK, /*SND_PCM_NONBLOCK|*/ SND_PCM_NO_AUTO_RESAMPLE| diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index c8244c66..4be27eb0 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -787,8 +787,6 @@ static int unsuspend(struct userdata *u) { pa_log_info("Trying resume..."); - snd_config_update_free_global(); - if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_CAPTURE, /*SND_PCM_NONBLOCK|*/ SND_PCM_NO_AUTO_RESAMPLE| diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 0ed4361c..1f3e5dcd 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -735,20 +735,22 @@ static void alsa_error_handler(const char *file, int line, const char *function, static pa_atomic_t n_error_handler_installed = PA_ATOMIC_INIT(0); -void pa_alsa_redirect_errors_inc(void) { +void pa_alsa_refcnt_inc(void) { /* This is not really thread safe, but we do our best */ if (pa_atomic_inc(&n_error_handler_installed) == 0) snd_lib_error_set_handler(alsa_error_handler); } -void pa_alsa_redirect_errors_dec(void) { +void pa_alsa_refcnt_dec(void) { int r; pa_assert_se((r = pa_atomic_dec(&n_error_handler_installed)) >= 1); - if (r == 1) + if (r == 1) { snd_lib_error_set_handler(NULL); + snd_config_update_free_global(); + } } pa_bool_t pa_alsa_init_description(pa_proplist *p) { diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index c2f0e5b7..830a922e 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -114,8 +114,8 @@ snd_pcm_t *pa_alsa_open_by_template( void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm); void pa_alsa_dump_status(snd_pcm_t *pcm); -void pa_alsa_redirect_errors_inc(void); -void pa_alsa_redirect_errors_dec(void); +void pa_alsa_refcnt_inc(void); +void pa_alsa_refcnt_dec(void); void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *pcm_info); void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card); diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c index e8a7f206..55f6a6e2 100644 --- a/src/modules/alsa/module-alsa-card.c +++ b/src/modules/alsa/module-alsa-card.c @@ -287,8 +287,7 @@ int pa__init(pa_module *m) { const char *description; char *fn = NULL; - pa_alsa_redirect_errors_inc(); - snd_config_update_free_global(); + pa_alsa_refcnt_inc(); pa_assert(m); @@ -443,6 +442,5 @@ void pa__done(pa_module*m) { pa_xfree(u); finish: - snd_config_update_free_global(); - pa_alsa_redirect_errors_dec(); + pa_alsa_refcnt_dec(); } diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c index 058ea205..3aa89b2a 100644 --- a/src/modules/alsa/module-alsa-sink.c +++ b/src/modules/alsa/module-alsa-sink.c @@ -82,8 +82,7 @@ int pa__init(pa_module*m) { pa_assert(m); - pa_alsa_redirect_errors_inc(); - snd_config_update_free_global(); + pa_alsa_refcnt_inc(); if (!(ma = pa_modargs_new(m->argument, valid_modargs))) { pa_log("Failed to parse module arguments"); @@ -124,6 +123,5 @@ void pa__done(pa_module*m) { if ((sink = m->userdata)) pa_alsa_sink_free(sink); - snd_config_update_free_global(); - pa_alsa_redirect_errors_dec(); + pa_alsa_refcnt_dec(); } diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c index 3bd1b451..de8bcd0b 100644 --- a/src/modules/alsa/module-alsa-source.c +++ b/src/modules/alsa/module-alsa-source.c @@ -106,8 +106,7 @@ int pa__init(pa_module*m) { pa_assert(m); - pa_alsa_redirect_errors_inc(); - snd_config_update_free_global(); + pa_alsa_refcnt_inc(); if (!(ma = pa_modargs_new(m->argument, valid_modargs))) { pa_log("Failed to parse module arguments"); @@ -148,6 +147,5 @@ void pa__done(pa_module*m) { if ((source = m->userdata)) pa_alsa_source_free(source); - snd_config_update_free_global(); - pa_alsa_redirect_errors_dec(); + pa_alsa_refcnt_dec(); } -- cgit From 8a5f8f41f6524ff36c473712b073f18b08e6483d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Jun 2009 22:58:58 +0200 Subject: alsa: add profile set for Native Instruments 4 DJ --- .../alsa/mixer/profile-sets/78-pulseaudio.rules | 1 + .../profile-sets/native-instruments-audio4dj.conf | 89 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules index 92a6b034..e3a234f7 100644 --- a/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules +++ b/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules @@ -5,5 +5,6 @@ ACTION!="change", GOTO="pulseaudio_end" KERNEL!="card*", GOTO="pulseaudio_end" 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" LABEL="pulseaudio_end" diff --git a/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf b/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf new file mode 100644 index 00000000..3b119a2c --- /dev/null +++ b/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf @@ -0,0 +1,89 @@ +# 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. + +; Native Instruments Audio 4 DJ +; +; This card has two stereo pairs of input and two stereo pairs of +; output, named channels A and B. Channel B has an additional +; Headphone connector. +; +; We knowingly only define a subset of the theoretically possible +; mapping combinations as profiles here. + +[General] +auto-profiles = no + +[Mapping analog-stereo-a] +description = Analog Stereo Channel A +device-strings = hw:%f,0,0 +channel-map = left,right + +[Mapping analog-stereo-b-output] +description = Analog Stereo Channel B (Headphones) +device-strings = hw:%f,0,1 +channel-map = left,right +direction = output + +[Mapping analog-stereo-b-input] +description = Analog Stereo Channel B +device-strings = hw:%f,0,1 +channel-map = left,right +direction = input + +[Profile output:analog-stereo-all+input:analog-stereo-all] +description = Analog Stereo Duplex Channels A, B (Headphones) +output-mappings = analog-stereo-a analog-stereo-b-output +input-mappings = analog-stereo-a analog-stereo-b-input +priority = 100 +skip-probe = yes + +[Profile output:analog-stereo-a+input:analog-stereo-a] +description = Analog Stereo Duplex Channel A +output-mappings = analog-stereo-a +input-mappings = analog-stereo-a +priority = 40 +skip-probe = yes + +[Profile output:analog-stereo-b+input:analog-stereo-b] +description = Analog Stereo Duplex Channel B (Headphones) +output-mappings = analog-stereo-b-output +input-mappings = analog-stereo-b-input +priority = 50 +skip-probe = yes + +[Profile output:analog-stereo-a] +description = Analog Stereo Output Channel A +output-mappings = analog-stereo-a +priority = 5 +skip-probe = yes + +[Profile output:analog-stereo-b] +description = Analog Stereo Output Channel B (Headphones) +output-mappings = analog-stereo-b-output +priority = 6 +skip-probe = yes + +[Profile input:analog-stereo-a] +description = Analog Stereo Input Channel A +input-mappings = analog-stereo-a +priority = 2 +skip-probe = yes + +[Profile input:analog-stereo-b] +description = Analog Stereo Input Channel B +input-mappings = analog-stereo-b-input +priority = 1 +skip-probe = yes -- 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') 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 11d2a7ee21852d836001e960ffe036f5eda6365b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Jun 2009 23:03:28 +0200 Subject: alsa: move udev rules file behind the other sound related rules --- src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules | 10 ---------- src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules create mode 100644 src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules deleted file mode 100644 index e3a234f7..00000000 --- a/src/modules/alsa/mixer/profile-sets/78-pulseaudio.rules +++ /dev/null @@ -1,10 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="sound", GOTO="pulseaudio_end" -ACTION!="change", GOTO="pulseaudio_end" -KERNEL!="card*", GOTO="pulseaudio_end" - -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" - -LABEL="pulseaudio_end" diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules new file mode 100644 index 00000000..e3a234f7 --- /dev/null +++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules @@ -0,0 +1,10 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="sound", GOTO="pulseaudio_end" +ACTION!="change", GOTO="pulseaudio_end" +KERNEL!="card*", GOTO="pulseaudio_end" + +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" + +LABEL="pulseaudio_end" -- 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/paths/analog-input-aux.conf | 32 ++++++- src/modules/alsa/mixer/paths/analog-input-fm.conf | 20 +++- .../alsa/mixer/paths/analog-input-linein.conf | 20 +++- .../alsa/mixer/paths/analog-input-mic-line.conf | 21 ++++- src/modules/alsa/mixer/paths/analog-input-mic.conf | 20 +++- .../alsa/mixer/paths/analog-input-mic.conf.common | 20 ++++ .../alsa/mixer/paths/analog-input-tvtuner.conf | 20 +++- .../alsa/mixer/paths/analog-input-video.conf | 32 ++++++- src/modules/alsa/mixer/paths/analog-input.conf | 21 ++++- .../alsa/mixer/paths/analog-input.conf.common | 66 ++++++++----- .../alsa/mixer/paths/analog-output-headphones.conf | 20 +++- .../mixer/paths/analog-output-lfe-on-mono.conf | 22 ++++- .../alsa/mixer/paths/analog-output-mono.conf | 20 +++- src/modules/alsa/mixer/paths/analog-output.conf | 20 +++- .../alsa/mixer/paths/analog-output.conf.common | 103 +++++++++++++++++---- .../alsa/mixer/profile-sets/90-pulseaudio.rules | 16 ++++ src/modules/alsa/mixer/profile-sets/default.conf | 15 ++- .../profile-sets/native-instruments-audio4dj.conf | 2 + .../profile-sets/native-instruments-audio8dj.conf | 2 + 19 files changed, 430 insertions(+), 62 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/mixer/paths/analog-input-aux.conf b/src/modules/alsa/mixer/paths/analog-input-aux.conf index 8f480567..db78eb48 100644 --- a/src/modules/alsa/mixer/paths/analog-input-aux.conf +++ b/src/modules/alsa/mixer/paths/analog-input-aux.conf @@ -1,4 +1,22 @@ -# For devices, where we have an Aux element +# 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 devices where an 'Aux' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 90 @@ -29,4 +47,16 @@ override-map.2 = all-left,all-right switch = off volume = off +[Element Mic/Line] +switch = off +volume = off + +[Element TV Tuner] +switch = off +volume = off + +[Element FM] +switch = off +volume = off + .include analog-input.conf.common diff --git a/src/modules/alsa/mixer/paths/analog-input-fm.conf b/src/modules/alsa/mixer/paths/analog-input-fm.conf index 0f78f39f..baf674aa 100644 --- a/src/modules/alsa/mixer/paths/analog-input-fm.conf +++ b/src/modules/alsa/mixer/paths/analog-input-fm.conf @@ -1,4 +1,22 @@ -# For devices where we have an FM element +# 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 devices where an 'FM' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 70 diff --git a/src/modules/alsa/mixer/paths/analog-input-linein.conf b/src/modules/alsa/mixer/paths/analog-input-linein.conf index b6ba738c..4be5722d 100644 --- a/src/modules/alsa/mixer/paths/analog-input-linein.conf +++ b/src/modules/alsa/mixer/paths/analog-input-linein.conf @@ -1,4 +1,22 @@ -# For devices, where we have a Line element +# 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 devices where a 'Line' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 90 diff --git a/src/modules/alsa/mixer/paths/analog-input-mic-line.conf b/src/modules/alsa/mixer/paths/analog-input-mic-line.conf index 7d4addf7..f7f30854 100644 --- a/src/modules/alsa/mixer/paths/analog-input-mic-line.conf +++ b/src/modules/alsa/mixer/paths/analog-input-mic-line.conf @@ -1,4 +1,22 @@ -# For devices where we have a Mic/Lineb element +# 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 devices where a 'Mic/Line' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 90 @@ -42,3 +60,4 @@ switch = off volume = off .include analog-input.conf.common +.include analog-input-mic.conf.common diff --git a/src/modules/alsa/mixer/paths/analog-input-mic.conf b/src/modules/alsa/mixer/paths/analog-input-mic.conf index 004cd24a..2a36f2f3 100644 --- a/src/modules/alsa/mixer/paths/analog-input-mic.conf +++ b/src/modules/alsa/mixer/paths/analog-input-mic.conf @@ -1,4 +1,22 @@ -# For devices where we have a Mic element +# 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 devices where a 'Mic' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 100 diff --git a/src/modules/alsa/mixer/paths/analog-input-mic.conf.common b/src/modules/alsa/mixer/paths/analog-input-mic.conf.common index db70e507..b35e7af8 100644 --- a/src/modules/alsa/mixer/paths/analog-input-mic.conf.common +++ b/src/modules/alsa/mixer/paths/analog-input-mic.conf.common @@ -1,3 +1,23 @@ +# 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. + +; Common element for all microphone inputs +; +; See analog-output.conf.common for an explanation on the directives + ;;; 'Mic Select' [Element Mic Select] diff --git a/src/modules/alsa/mixer/paths/analog-input-tvtuner.conf b/src/modules/alsa/mixer/paths/analog-input-tvtuner.conf index ea0a0b72..8531ec70 100644 --- a/src/modules/alsa/mixer/paths/analog-input-tvtuner.conf +++ b/src/modules/alsa/mixer/paths/analog-input-tvtuner.conf @@ -1,4 +1,22 @@ -# For devices, where we have a TV Tuner element +# 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 devices where a 'TV Tuner' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 70 diff --git a/src/modules/alsa/mixer/paths/analog-input-video.conf b/src/modules/alsa/mixer/paths/analog-input-video.conf index 27acc254..74c76f07 100644 --- a/src/modules/alsa/mixer/paths/analog-input-video.conf +++ b/src/modules/alsa/mixer/paths/analog-input-video.conf @@ -1,4 +1,22 @@ -# For devices, where we have a Video element +# 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 devices where a 'Video' element exists +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 70 @@ -28,4 +46,16 @@ volume = merge override-map.1 = all override-map.2 = all-left,all-right +[Element Mic/Line] +switch = off +volume = off + +[Element TV Tuner] +switch = off +volume = off + +[Element FM] +switch = off +volume = off + .include analog-input.conf.common diff --git a/src/modules/alsa/mixer/paths/analog-input.conf b/src/modules/alsa/mixer/paths/analog-input.conf index b221bb44..5055f90a 100644 --- a/src/modules/alsa/mixer/paths/analog-input.conf +++ b/src/modules/alsa/mixer/paths/analog-input.conf @@ -1,4 +1,23 @@ -# A fallback for devices that lack seperate Mic/Line/Aux/Video elements +# 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. + +; A fallback for devices that lack seperate Mic/Line/Aux/Video/TV +; Tuner/FM elements +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 100 diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common index d34afd04..6728a6ae 100644 --- a/src/modules/alsa/mixer/paths/analog-input.conf.common +++ b/src/modules/alsa/mixer/paths/analog-input.conf.common @@ -1,30 +1,48 @@ -# Mixer path for PulseAudio's ALSA backend. If multiple options by the -# same id are discovered they will be suffixed with a number to -# distuingish them, in the same order they appear here. +# This file is part of PulseAudio. # -# Source selection should use the following names: +# 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. # -# input -- If we don't know the exact kind of input -# input-microphone -# input-microphone-internal -# input-microphone-external -# input-linein -# input-video -# input-radio -# input-docking-microphone -# input-docking-linein -# input-docking -# -# We explicitly don't want to wrap the following sources: -# -# CD -# Synth/MIDI -# Phone -# Mix -# Digital/SPDIF -# Master -# PC Speaker +# 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. + +; Mixer path for PulseAudio's ALSA backend, common elements for all +; input paths. If multiple options by the same id are discovered they +; will be suffixed with a number to distuingish them, in the same +; order they appear here. +; +; Source selection should use the following names: +; +; input -- If we don't know the exact kind of input +; input-microphone +; input-microphone-internal +; input-microphone-external +; input-linein +; input-video +; input-radio +; input-docking-microphone +; input-docking-linein +; input-docking +; +; We explicitly don't want to wrap the following sources: +; +; CD +; Synth/MIDI +; Phone +; Mix +; Digital/SPDIF +; Master +; PC Speaker +; +; See analog-output.conf.common for an explanation on the directives ;;; 'Input Source Select' diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf index 1a172d4c..c018e0eb 100644 --- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf +++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf @@ -1,4 +1,22 @@ -# Path for mixers that have a Headphone slider +# 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. + +; Path for mixers that have a 'Headphone' control +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 90 diff --git a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf index 67031762..7a267890 100644 --- a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf +++ b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf @@ -1,5 +1,23 @@ -# Intended for usage in laptops that have a seperate LFE speaker -# connected to the Master mono connector +# 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. + +; Intended for usage in laptops that have a seperate LFE speaker +; connected to the Master mono connector +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 40 diff --git a/src/modules/alsa/mixer/paths/analog-output-mono.conf b/src/modules/alsa/mixer/paths/analog-output-mono.conf index a23d9b79..f6cb9f8a 100644 --- a/src/modules/alsa/mixer/paths/analog-output-mono.conf +++ b/src/modules/alsa/mixer/paths/analog-output-mono.conf @@ -1,4 +1,22 @@ -# Intended for usage on boards that have a seperate Mono output plug. +# 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. + +; Intended for usage on boards that have a seperate Mono output plug. +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 50 diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf index 15e703c4..ea108aaf 100644 --- a/src/modules/alsa/mixer/paths/analog-output.conf +++ b/src/modules/alsa/mixer/paths/analog-output.conf @@ -1,4 +1,22 @@ -# Intended for the 'default' output +# 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. + +; Intended for the 'default' output +; +; See analog-output.conf.common for an explanation on the directives [General] priority = 100 diff --git a/src/modules/alsa/mixer/paths/analog-output.conf.common b/src/modules/alsa/mixer/paths/analog-output.conf.common index c38eccde..47243dbc 100644 --- a/src/modules/alsa/mixer/paths/analog-output.conf.common +++ b/src/modules/alsa/mixer/paths/analog-output.conf.common @@ -1,26 +1,89 @@ -# Common part of all paths - -# [General] -# priority = ... -# description = ... -# -# [Option ...:...] -# name = ... -# priority = ... -# -# [Element ...] -# required = ignore | switch | volume | enumeration | any -# required-absent = ignore | switch | volume +# This file is part of PulseAudio. # -# switch = ignore | mute | off | on | select -# volume = ignore | merge | off | zero -# enumeration = ignore | select +# 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. # -# direction = playback | capture -# direction-try-other = 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. # -# override-map.1 = ... -# override-map.2 = ... +# 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. + +; Common part of all paths + +; So here's generally how mixer paths are used by PA: PA goes through +; a mixer path file from top to bottom and checks if a mixer element +; described therein exists. If so it is added to the list of mixer +; elements PA will control, keeping the order it read them in. If a +; mixer element described here has set the required= or +; required-absent= directives a path might not be accepted as valid +; and is ignored in its entirety (see below). However usually if a +; element listed here is missing this one element is ignored but not +; the entire path. +; +; When a device shall be muted/unmuted *all* elements listed in a path +; file with "switch = mute" will be toggled. +; +; When a device shall change its volume, PA will got through the list +; of all elements with "volume = merge" and set the volume on the +; first element. If that element does not support dB volumes, this is +; where the story ends. If it does support dB volumes, PA divides the +; requested volume by the volume that was set on this element, and +; then go on to the next element with "volume = merge" and then set +; that there, and so on. That way the first volume element in the +; path will be the one that does the 'biggest' part of the overall +; volume adjustment, with the remaining elements usually being set to +; some value next to 0dB. This logic makes sure we get the full range +; over all volume sliders and a very high granularity of volumes +; already in hardware. +; +; All switches and enumerations set to "select" are exposed via the +; "port" functionality of sinks/sources. Basically every possible +; switch setting and every possible enumeration setting will be +; combined and made into a "port". So make sure you don't list too +; many switches/enums for exposing, because the number of ports might +; rise exponentially. + +; [General] +; priority = ... # Priority for this path +; description = ... +; +; [Option ...:...] # For each option of an enumeration or switch element +; # that shall be exposed as a sink/source port. Needs to +; # be named after the Element, followed by a colon, followed +; # by the option name, resp. on/off if the element is a switch. +; name = ... # Logical name to use in the path identifier +; priority = ... # Priority if this is made into a device port +; +; [Element ...] # For each element that we shall control +; required = ignore | switch | volume | enumeration | any # If set, require this element to be of this kind and available, +; # otherwise don't consider this path valid for the card +; required-absent = ignore | switch | volume # If set, require this element to not be of this kind and not +; # available, otherwise don't consider this path valid for the card +; +; switch = ignore | mute | off | on | select # What to do with this switch: ignore it, make it follow mute status, +; # always set it to off, always to on, or make it selectable as port. +; # If set to 'select' you need to define an Option section for on +; # and off +; volume = ignore | merge | off | zero # What to do with this volume: ignore it, merge it into the device +; # volume slider, always set it to the lowest value possible, or always +; # set it to 0 dB (for whatever that means) +; enumeration = ignore | select # What to do with this enumeration, ignore it or make it selectable +; # via device ports. If set to 'select' you need to define an Option section +; # for each of the items you want to expose +; direction = playback | capture # Is this relevant only for playback or capture? If not set this will implicitly be +; # set the direction of the PCM device is opened as. Generally this doesn't need to be set +; # unless you have a broken driver that has playback controls marked for capture or vice +; # versa +; direction-try-other = no | yes # If the element does not supported what is requested, try the other direction, too? +; +; override-map.1 = ... # Override the channel mask of the mixer control if the control only exposes a single channel +; override-map.2 = ... # Override the channel masks of the mixer control if the control only exposes two channels [Element PCM] switch = mute diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules index e3a234f7..ea1a2fed 100644 --- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules +++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules @@ -1,5 +1,21 @@ # do not edit this file, it will be overwritten on update +# 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. + SUBSYSTEM!="sound", GOTO="pulseaudio_end" ACTION!="change", GOTO="pulseaudio_end" KERNEL!="card*", GOTO="pulseaudio_end" 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? diff --git a/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf b/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf index 3b119a2c..2b835308 100644 --- a/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf +++ b/src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf @@ -22,6 +22,8 @@ ; ; We knowingly only define a subset of the theoretically possible ; mapping combinations as profiles here. +; +; See default.conf for an explanation on the directives used here. [General] auto-profiles = no diff --git a/src/modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf b/src/modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf index fe1e9ae8..3fe3cc56 100644 --- a/src/modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf +++ b/src/modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf @@ -22,6 +22,8 @@ ; ; We knowingly only define a subset of the theoretically possible ; mapping combinations as profiles here. +; +; See default.conf for an explanation on the directives used here. [General] auto-profiles = no -- 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/paths/analog-output.conf.common | 8 ++++++++ src/modules/alsa/mixer/profile-sets/default.conf | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/mixer/paths/analog-output.conf.common b/src/modules/alsa/mixer/paths/analog-output.conf.common index 47243dbc..cc1185f4 100644 --- a/src/modules/alsa/mixer/paths/analog-output.conf.common +++ b/src/modules/alsa/mixer/paths/analog-output.conf.common @@ -48,6 +48,10 @@ ; combined and made into a "port". So make sure you don't list too ; many switches/enums for exposing, because the number of ports might ; rise exponentially. +; +; Only one path can be selected at a time. All paths that are valid +; for an audio device will be exposed as "port" for the sink/source. + ; [General] ; priority = ... # Priority for this path @@ -84,6 +88,10 @@ ; ; override-map.1 = ... # Override the channel mask of the mixer control if the control only exposes a single channel ; override-map.2 = ... # Override the channel masks of the mixer control if the control only exposes two channels +; # Override maps should list for each element channel which high-level channels it controls via a +; # channel mask. A channel mask may either be the name of a single channel, or the words "all-left", +; # "all-right", "all-center", "all-front", "all-rear", and "all" to encode a specific subset of +; # channels in a mask [Element PCM] switch = mute 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 From 6ad38556395fa1ee2020abb258e5f814fef8ad34 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Jun 2009 02:03:03 +0200 Subject: alsa: synthesize volume values more sensibly for channels that are not controllable in hw --- src/modules/alsa/alsa-mixer.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index def26221..a5515e1b 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -479,6 +479,7 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann snd_mixer_elem_t *me; snd_mixer_selem_channel_id_t c; pa_channel_position_mask_t mask = 0; + pa_volume_t max_channel_volume = PA_VOLUME_MUTED; unsigned k; pa_assert(m); @@ -545,6 +546,9 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann f = from_alsa_volume(value, e->min_volume, e->max_volume); } + if (f > max_channel_volume) + max_channel_volume = f; + for (k = 0; k < cm->channels; k++) if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) if (v->values[k] < f) @@ -555,7 +559,7 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (k = 0; k < cm->channels; k++) if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k]))) - v->values[k] = PA_VOLUME_NORM; + v->values[k] = max_channel_volume; return 0; } @@ -677,6 +681,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann snd_mixer_elem_t *me; snd_mixer_selem_channel_id_t c; pa_channel_position_mask_t mask = 0; + pa_volume_t max_channel_volume = PA_VOLUME_MUTED; unsigned k; pa_assert(m); @@ -696,11 +701,21 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (c = 0; c <= SND_MIXER_SCHN_LAST; c++) { int r; pa_volume_t f = PA_VOLUME_MUTED; + pa_bool_t found = FALSE; for (k = 0; k < cm->channels; k++) - if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) + if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) { + found = TRUE; if (v->values[k] > f) f = v->values[k]; + } + + if (!found) { + /* Hmm, so this channel does not exist in the volume + * struct, so let's bind it to the overall max of the + * volume. */ + f = pa_cvolume_max(v); + } if (e->has_dB) { long value = to_alsa_dB(f); @@ -756,6 +771,9 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann f = from_alsa_volume(value, e->min_volume, e->max_volume); } + if (f > max_channel_volume) + max_channel_volume = f; + for (k = 0; k < cm->channels; k++) if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) if (rv.values[k] < f) @@ -766,7 +784,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (k = 0; k < cm->channels; k++) if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k]))) - rv.values[k] = PA_VOLUME_NORM; + rv.values[k] = max_channel_volume; *v = rv; return 0; -- cgit From 32e2cd6d3216f780c4cffed0f8eb3c30f2c8d732 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Jun 2009 21:00:06 +0200 Subject: core: get rid of rt sig/timer handling since modern Linux' ppooll() is finally fixed for granularity --- src/modules/alsa/alsa-sink.c | 1 - src/modules/alsa/alsa-source.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 281371f7..c39a898f 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1212,7 +1212,6 @@ static void thread_func(void *userdata) { pa_make_realtime(u->core->realtime_priority); pa_thread_mq_install(&u->thread_mq); - pa_rtpoll_install(u->rtpoll); for (;;) { int ret; diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 4be27eb0..755ceae2 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -1094,7 +1094,6 @@ static void thread_func(void *userdata) { pa_make_realtime(u->core->realtime_priority); pa_thread_mq_install(&u->thread_mq); - pa_rtpoll_install(u->rtpoll); for (;;) { int ret; -- cgit