pulseaudio/0040-alsa-sink-source-fix-the-mixer-initialization.patch
Takashi Iwai 1de102e500 Accepting request 809086 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes for ALSA UCM profile handling
  (boo#1171492):
  0033-alsa-Document-that-mixer-elements-can-be-identified-.patch
  0034-alsa-ucm-correct-the-channel-default-logic-stereo.patch
  0035-alsa-ucm-do-not-assign-JackHWMute-when-JackControl-i.patch
  0036-ucm-Don-t-log-errors-during-normal-operation.patch
  0037-alsa-handle-unavailbale-HW-volume-in-UCM.patch
  0038-alsa-ucm-use-the-right-profile-name.patch
  0039-ucm-fix-the-port-ucm-device-activation-on-boot.patch
  0040-alsa-sink-source-fix-the-mixer-initialization.patch

OBS-URL: https://build.opensuse.org/request/show/809086
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=219
2020-05-27 06:23:43 +00:00

62 lines
2.5 KiB
Diff

From 5eb02e31a6de116395075f814123daaad424d5a4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 31 Mar 2020 13:32:46 +0200
Subject: [PATCH] alsa sink/source: fix the mixer initialization
- remove duplicate mixer initialization in sink
- use the similar mixer initialization for source like for sink
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-sink.c | 2 --
src/modules/alsa/alsa-source.c | 12 +++++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 7048371e1832..b5fc0cd93972 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2511,8 +2511,6 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
/* ALSA might tweak the sample spec, so recalculate the frame size */
frame_size = pa_frame_size(&ss);
- find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
-
pa_sink_new_data_init(&data);
data.driver = driver;
data.module = m;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index bf9e093b336a..829216a8a1a1 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -2198,8 +2198,6 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
/* ALSA might tweak the sample spec, so recalculate the frame size */
frame_size = pa_frame_size(&ss);
- find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
-
pa_source_new_data_init(&data);
data.driver = driver;
data.module = m;
@@ -2254,10 +2252,14 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
goto fail;
}
- if (u->ucm_context)
+ if (u->ucm_context) {
pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, false, card, u->pcm_handle, ignore_dB);
- else if (u->mixer_path_set)
- pa_alsa_add_ports(&data, u->mixer_path_set, card);
+ find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
+ } else {
+ find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
+ if (u->mixer_path_set)
+ pa_alsa_add_ports(&data, u->mixer_path_set, card);
+ }
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
volume_is_set = data.volume_is_set;
--
2.16.4