pulseaudio/0034-alsa-ucm-correct-the-channel-default-logic-stereo.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

46 lines
1.8 KiB
Diff

From cabd387e26b5fe03661f4b894826c7c6b58d7efa Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 11 Feb 2020 10:54:16 +0100
Subject: [PATCH] alsa-ucm: correct the channel default logic (stereo)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-ucm.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index a57be6d22497..b7d2c5b9c51a 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -377,6 +377,13 @@ static int ucm_get_device_property(
pa_log("UCM playback device %s fetch pcm failed", device_name);
}
+ if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SINK) &&
+ device->playback_channels == 0) {
+ pa_log("UCM file does not specify 'PlaybackChannels' "
+ "for device %s, assuming stereo duplex.", device_name);
+ device->playback_channels = 2;
+ }
+
value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_CHANNELS);
if (value) { /* input */
/* get channels */
@@ -391,10 +398,10 @@ static int ucm_get_device_property(
pa_log("UCM capture device %s fetch pcm failed", device_name);
}
- if (device->playback_channels == 0 && device->capture_channels == 0) {
- pa_log_warn("UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'"
+ if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SOURCE) &&
+ device->capture_channels == 0) {
+ pa_log("UCM file does not specify 'CaptureChannels' "
"for device %s, assuming stereo duplex.", device_name);
- device->playback_channels = 2;
device->capture_channels = 2;
}
--
2.16.4