diff --git a/spa/plugins/alsa/90-pipewire-alsa.rules b/spa/plugins/alsa/90-pipewire-alsa.rules index 1752402af..d27c63667 100644 --- a/spa/plugins/alsa/90-pipewire-alsa.rules +++ b/spa/plugins/alsa/90-pipewire-alsa.rules @@ -110,9 +110,7 @@ ATTRS{idVendor}=="0763", ATTRS{idProduct}=="2012", ENV{PULSE_PROFILE_SET}="maudi ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bb", ENV{PULSE_PROFILE_SET}="kinect-audio.conf" ATTRS{idVendor}=="041e", ATTRS{idProduct}=="322c", ENV{PULSE_PROFILE_SET}="sb-omni-surround-5.1.conf" ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="4014", ENV{PULSE_PROFILE_SET}="dell-dock-tb16-usb-audio.conf" -ATTRS{idVendor}=="08bb", ATTRS{idProduct}=="2902", ENV{PULSE_PROFILE_SET}="behringer-umc22.conf" -ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0269", ENV{PULSE_PROFILE_SET}="hp-tbt-dock-120w-g2.conf" -ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0567", ENV{PULSE_PROFILE_SET}="hp-tbt-dock-audio-module.conf" + # ID 1038:12ad is for the 2018 refresh of the Arctis 7. # ID 1038:1294 is for Arctis Pro Wireless (which works with the Arctis 7 configuration). diff --git a/spa/plugins/alsa/acp/alsa-mixer.c b/spa/plugins/alsa/acp/alsa-mixer.c index 8ac687994..f8935c572 100644 --- a/spa/plugins/alsa/acp/alsa-mixer.c +++ b/spa/plugins/alsa/acp/alsa-mixer.c @@ -3191,7 +3191,7 @@ void pa_alsa_element_dump(pa_alsa_element *e) { pa_assert(e); alsa_id_str(buf, sizeof(buf), &e->alsa_id); - pa_log_debug("Element %s, direction=%i, switch=%i, volume=%i, volume_limit=%li, enumeration=%i, required=%i, required_any=%i, required_absent=%i, mask=0x%llx, n_channels=%u, override_map=%s", + pa_log_debug("Element %s, direction=%i, switch=%i, volume=%i, volume_limit=%li, enumeration=%i, required=%i, required_any=%i, required_absent=%i, mask=0x%llx, n_channels=%u, override_map=%02x", buf, e->direction, e->switch_use, @@ -3203,7 +3203,7 @@ void pa_alsa_element_dump(pa_alsa_element *e) { e->required_absent, (long long unsigned) e->merged_mask, e->n_channels, - pa_yes_no(e->override_map)); + e->override_map); PA_LLIST_FOREACH(o, e->options) pa_alsa_option_dump(o); @@ -4313,42 +4313,28 @@ fail: } /* the logic is simple: if we see the jack in multiple paths */ -/* assign all those paths to one availability_group */ -static void profile_set_set_availability_groups(pa_alsa_profile_set *ps) { - pa_dynarray *paths; - pa_alsa_path *p; - void *state; - unsigned idx1; +/* assign all those jacks to one availability_group */ +static void mapping_group_available(pa_hashmap *paths) +{ + void *state, *state2; + pa_alsa_path *p, *p2; + pa_alsa_jack *j, *j2; uint32_t num = 1; - /* Merge ps->input_paths and ps->output_paths into one dynarray. */ - paths = pa_dynarray_new(NULL); - PA_HASHMAP_FOREACH(p, ps->input_paths, state) - pa_dynarray_append(paths, p); - PA_HASHMAP_FOREACH(p, ps->output_paths, state) - pa_dynarray_append(paths, p); - - PA_DYNARRAY_FOREACH(p, paths, idx1) { - pa_alsa_jack *j; + PA_HASHMAP_FOREACH(p, paths, state) { const char *found = NULL; bool has_control = false; - PA_LLIST_FOREACH(j, p->jacks) { - pa_alsa_path *p2; - unsigned idx2; - if (!j->has_control || j->state_plugged == PA_AVAILABLE_NO) continue; has_control = true; - PA_DYNARRAY_FOREACH(p2, paths, idx2) { - pa_alsa_jack *j2; - + PA_HASHMAP_FOREACH(p2, paths, state2) { if (p2 == p) - break; + break; PA_LLIST_FOREACH(j2, p2->jacks) { if (!j2->has_control || j2->state_plugged == PA_AVAILABLE_NO) continue; - if (pa_streq(j->alsa_name, j2->alsa_name)) { + if (pa_streq(j->name, j2->name)) { j->state_plugged = PA_AVAILABLE_UNKNOWN; j2->state_plugged = PA_AVAILABLE_UNKNOWN; found = p2->availability_group; @@ -4369,8 +4355,6 @@ static void profile_set_set_availability_groups(pa_alsa_profile_set *ps) { if (!found) num++; } - - pa_dynarray_free(paths); } static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile, @@ -4421,6 +4405,8 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile, PA_HASHMAP_FOREACH(p, ps->paths, state) pa_hashmap_put(used_paths, p, p); + mapping_group_available(ps->paths); + pa_log_debug("Available mixer paths (after tidying):"); pa_alsa_path_set_dump(ps); } @@ -4429,8 +4415,6 @@ static int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) { static const struct description_map well_known_descriptions[] = { { "analog-mono", N_("Analog Mono") }, - { "analog-mono-left", N_("Analog Mono (Left)") }, - { "analog-mono-right", N_("Analog Mono (Right)") }, { "analog-stereo", N_("Analog Stereo") }, { "mono-fallback", N_("Mono") }, { "stereo-fallback", N_("Stereo") }, @@ -4441,8 +4425,6 @@ static int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) { * multichannel-input and multichannel-output. */ { "analog-stereo-input", N_("Analog Stereo") }, { "analog-stereo-output", N_("Analog Stereo") }, - { "analog-stereo-headset", N_("Headset") }, - { "analog-stereo-speakerphone", N_("Speakerphone") }, { "multichannel-input", N_("Multichannel") }, { "multichannel-output", N_("Multichannel") }, { "analog-surround-21", N_("Analog Surround 2.1") }, @@ -4599,8 +4581,6 @@ static int profile_verify(pa_alsa_profile *p) { static const struct description_map well_known_descriptions[] = { { "output:analog-mono+input:analog-mono", N_("Analog Mono Duplex") }, { "output:analog-stereo+input:analog-stereo", N_("Analog Stereo Duplex") }, - { "output:analog-stereo-headset+input:analog-stereo-headset", N_("Headset") }, - { "output:analog-stereo-speakerphone+input:analog-stereo-speakerphone", N_("Speakerphone") }, { "output:iec958-stereo+input:iec958-stereo", N_("Digital Stereo Duplex (IEC958)") }, { "output:multichannel-output+input:multichannel-input", N_("Multichannel Duplex") }, { "output:unknown-stereo+input:unknown-stereo", N_("Stereo Duplex") }, @@ -5179,8 +5159,6 @@ void pa_alsa_profile_set_probe( pa_hashmap_free(used_paths); pa_xfree(probe_order); - profile_set_set_availability_groups(ps); - ps->probed = true; } diff --git a/spa/plugins/alsa/acp/alsa-util.c b/spa/plugins/alsa/acp/alsa-util.c index ab0b85035..48f553e03 100644 --- a/spa/plugins/alsa/acp/alsa-util.c +++ b/spa/plugins/alsa/acp/alsa-util.c @@ -1172,7 +1172,7 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa PA_ONCE_BEGIN { char *dn = pa_alsa_get_driver_name_by_pcm(pcm); - pa_log_debug(ngettext("snd_pcm_avail() returned a value that is exceptionally large: %lu byte (%lu ms).\n" + pa_log(ngettext("snd_pcm_avail() returned a value that is exceptionally large: %lu byte (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", "snd_pcm_avail() returned a value that is exceptionally large: %lu bytes (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", @@ -1181,7 +1181,7 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC), pa_strnull(dn)); pa_xfree(dn); - pa_alsa_dump(PA_LOG_DEBUG, pcm); + pa_alsa_dump(PA_LOG_ERROR, pcm); } PA_ONCE_END; /* Mhmm, let's try not to fail completely */ @@ -1238,7 +1238,7 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes PA_ONCE_BEGIN { char *dn = pa_alsa_get_driver_name_by_pcm(pcm); - pa_log_debug(ngettext("snd_pcm_delay() returned a value that is exceptionally large: %li byte (%s%lu ms).\n" + pa_log(ngettext("snd_pcm_delay() returned a value that is exceptionally large: %li byte (%s%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", "snd_pcm_delay() returned a value that is exceptionally large: %li bytes (%s%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", @@ -1248,7 +1248,7 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes (unsigned long) (pa_bytes_to_usec(abs_k, ss) / PA_USEC_PER_MSEC), pa_strnull(dn)); pa_xfree(dn); - pa_alsa_dump(PA_LOG_DEBUG, pcm); + pa_alsa_dump(PA_LOG_ERROR, pcm); } PA_ONCE_END; /* Mhmm, let's try not to fail completely */ @@ -1266,7 +1266,7 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes PA_ONCE_BEGIN { char *dn = pa_alsa_get_driver_name_by_pcm(pcm); - pa_log_debug(ngettext("snd_pcm_avail() returned a value that is exceptionally large: %lu byte (%lu ms).\n" + pa_log(ngettext("snd_pcm_avail() returned a value that is exceptionally large: %lu byte (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", "snd_pcm_avail() returned a value that is exceptionally large: %lu bytes (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", @@ -1275,7 +1275,7 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC), pa_strnull(dn)); pa_xfree(dn); - pa_alsa_dump(PA_LOG_DEBUG, pcm); + pa_alsa_dump(PA_LOG_ERROR, pcm); } PA_ONCE_END; /* Mhmm, let's try not to fail completely */ @@ -1328,7 +1328,7 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas k >= pa_bytes_per_second(ss)*10)) PA_ONCE_BEGIN { char *dn = pa_alsa_get_driver_name_by_pcm(pcm); - pa_log_debug(ngettext("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu byte (%lu ms).\n" + pa_log(ngettext("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu byte (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", "snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms).\n" "Most likely this is a bug in the ALSA driver '%s'. Please report this issue to the ALSA developers.", @@ -1337,7 +1337,7 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC), pa_strnull(dn)); pa_xfree(dn); - pa_alsa_dump(PA_LOG_DEBUG, pcm); + pa_alsa_dump(PA_LOG_ERROR, pcm); } PA_ONCE_END; return r; diff --git a/spa/plugins/alsa/mixer/paths/analog-output-headphones.conf b/spa/plugins/alsa/mixer/paths/analog-output-headphones.conf index 14fb81481..d4ad7777d 100644 --- a/spa/plugins/alsa/mixer/paths/analog-output-headphones.conf +++ b/spa/plugins/alsa/mixer/paths/analog-output-headphones.conf @@ -160,8 +160,4 @@ volume = off switch = off volume = off -[Element Speaker Center/LFE] -switch = off -volume = off - .include analog-output.conf.common diff --git a/spa/plugins/alsa/mixer/paths/analog-output-lineout.conf b/spa/plugins/alsa/mixer/paths/analog-output-lineout.conf index 61df49965..9a6af3ad8 100644 --- a/spa/plugins/alsa/mixer/paths/analog-output-lineout.conf +++ b/spa/plugins/alsa/mixer/paths/analog-output-lineout.conf @@ -181,12 +181,6 @@ volume = merge override-map.1 = all-center override-map.2 = all-center,lfe -[Element Center/LFE] -switch = mute -volume = merge -override-map.1 = all-center -override-map.2 = all-center,lfe - [Element Bass Speaker] switch = off volume = off diff --git a/spa/plugins/alsa/mixer/paths/analog-output-speaker-always.conf b/spa/plugins/alsa/mixer/paths/analog-output-speaker-always.conf index bf781c671..71f356dce 100644 --- a/spa/plugins/alsa/mixer/paths/analog-output-speaker-always.conf +++ b/spa/plugins/alsa/mixer/paths/analog-output-speaker-always.conf @@ -174,10 +174,4 @@ volume = merge override-map.1 = all-center override-map.2 = all-center,lfe -[Element Center/LFE] -switch = mute -volume = merge -override-map.1 = all-center -override-map.2 = all-center,lfe - .include analog-output.conf.common diff --git a/spa/plugins/alsa/mixer/paths/analog-output-speaker.conf b/spa/plugins/alsa/mixer/paths/analog-output-speaker.conf index 1610b9a05..27a3983d5 100644 --- a/spa/plugins/alsa/mixer/paths/analog-output-speaker.conf +++ b/spa/plugins/alsa/mixer/paths/analog-output-speaker.conf @@ -220,12 +220,6 @@ volume = merge override-map.1 = all-center override-map.2 = all-center,lfe -[Element Center/LFE] -switch = mute -volume = merge -override-map.1 = all-center -override-map.2 = all-center,lfe - [Element Speaker CLFE] switch = mute volume = merge diff --git a/spa/plugins/alsa/mixer/paths/analog-output.conf b/spa/plugins/alsa/mixer/paths/analog-output.conf index 0f6b5f5a0..e6ba98358 100644 --- a/spa/plugins/alsa/mixer/paths/analog-output.conf +++ b/spa/plugins/alsa/mixer/paths/analog-output.conf @@ -79,10 +79,4 @@ volume = merge override-map.1 = all-center override-map.2 = all-center,lfe -[Element Center/LFE] -switch = mute -volume = merge -override-map.1 = all-center -override-map.2 = all-center,lfe - .include analog-output.conf.common diff --git a/spa/plugins/alsa/mixer/profile-sets/behringer-umc22.conf b/spa/plugins/alsa/mixer/profile-sets/behringer-umc22.conf deleted file mode 100644 index cc74852c3..000000000 --- a/spa/plugins/alsa/mixer/profile-sets/behringer-umc22.conf +++ /dev/null @@ -1,68 +0,0 @@ -# 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, see . - -; Behringer U-Phoria UMC22 -; -; Default mapping only allows to use stereo input and sound card has two -; physical input channels. -; -; However in case of only using a single input channel (like condenser -; microphone) only one channel will have any sound, which is often -; inconvenient for casual use. -; -; This config includes mono input options which makes it much more -; friendly in single input configuration. -; -; This config also removes default digital input/output mappings that do -; not physically exist on this card. -; -; Added by Nazar Mokrynskyi - -[General] -auto-profiles = yes - -[Mapping analog-stereo-input] -device-strings = hw:%f -channel-map = left,right -paths-input = analog-input-mic -direction = input -priority = 4 - -[Mapping analog-mono] -device-strings = hw:%f -channel-map = mono,mono -paths-input = analog-input-mic -direction = input -priority = 3 - -[Mapping analog-mono-left] -device-strings = hw:%f -channel-map = mono,aux1 -paths-input = analog-input-mic -direction = input -priority = 2 - -[Mapping analog-mono-right] -device-strings = hw:%f -channel-map = aux1,mono -paths-input = analog-input-mic -direction = input -priority = 1 - -[Mapping analog-stereo-output] -device-strings = front:%f -channel-map = left,right -paths-output = analog-output -direction = output diff --git a/spa/plugins/alsa/mixer/profile-sets/default.conf b/spa/plugins/alsa/mixer/profile-sets/default.conf index 9b691fed4..c517d2b95 100644 --- a/spa/plugins/alsa/mixer/profile-sets/default.conf +++ b/spa/plugins/alsa/mixer/profile-sets/default.conf @@ -44,11 +44,7 @@ ; [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 = ... # Description for the mapping. Note that it's better to set the description -; # in the well_known_descriptions table in alsa-mixer.c than with this -; # option, because the descriptions in alsa-mixer.c are translatable. -; description-key = ... # A custom key for the well_known_descriptions table (by default the mapping -; # name is used). +; 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 = ... @@ -468,6 +464,7 @@ exact-channels = false fallback = yes priority = 1 direction = output +paths-output = multichannel-output [Mapping multichannel-input] device-strings = hw:%f @@ -476,6 +473,7 @@ exact-channels = false fallback = yes priority = 1 direction = input +paths-input = multichannel-input ; An example for defining multiple-sink profiles #[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo] diff --git a/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-120w-g2.conf b/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-120w-g2.conf deleted file mode 100644 index a683a4e4e..000000000 --- a/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-120w-g2.conf +++ /dev/null @@ -1,35 +0,0 @@ -# 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, see . - -; HP Thunderbolt Dock 120W G2 -; -; This dock has a 3.5mm headset connector. Both input and output are stereo. -; -; There's a separate speakerphone module called "HP Thunderbolt Dock Audio -; Module", which can be attached to this dock. The module will appear in ALSA -; as a separate USB sound card, configuration for it is in -; hp-tbt-dock-audio-module.conf. - -[General] -auto-profiles = no - -[Mapping analog-stereo-headset] -device-strings = hw:%f,0,0 -channel-map = left,right - -[Profile output:analog-stereo-headset+input:analog-stereo-headset] -output-mappings = analog-stereo-headset -input-mappings = analog-stereo-headset -skip-probe = yes diff --git a/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-audio-module.conf b/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-audio-module.conf deleted file mode 100644 index 692ab8dd0..000000000 --- a/spa/plugins/alsa/mixer/profile-sets/hp-tbt-dock-audio-module.conf +++ /dev/null @@ -1,36 +0,0 @@ -# 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, see . - -; HP Thunderbolt Dock Audio Module -; -; This device attaches to the "HP Thunderbolt Dock 120W G2" dock. The audio -; module provides a speakerphone with echo cancellation and appears in ALSA as -; a USB sound card with stereo input and output. -; -; The dock itself has a 3.5mm headset connector and appears as a separate USB -; sound card, configuration for it is in hp-tbt-dock-120w-g2.conf. - -[General] -auto-profiles = no - -[Mapping analog-stereo-speakerphone] -device-strings = hw:%f,0,0 -channel-map = left,right -intended-roles = phone - -[Profile output:analog-stereo-speakerphone+input:analog-stereo-speakerphone] -output-mappings = analog-stereo-speakerphone -input-mappings = analog-stereo-speakerphone -skip-probe = yes