all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob ba65fe5e6e5379d471dec63623c577c492bc3e74 2202 bytes (raw)
name: gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
From 04bdcad098193dda5988bb96bfae7178834b13b0 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Sun, 17 Apr 2022 04:37:48 +0000
Subject: [PATCH 09/73] LOCAL: ALSA: Assign internal PCM chmap/ELD/IEC958 kctls
 to device 0

On SoC sound devices utilizing codec2codec DAI links with a HDMI codec
the kctls for chmap, ELD, IEC958 are currently created using the
internal PCM device numbers. This causes userspace to not see the
actual channel mapping.

Affected devices include LibreTech LePotato and Wetek Play 2.

The proper fix would be not create these kctls for internal PCMs and
instead create them for the real userspace-visible PCMs, somehow
forwarding the controls between the HDMI codec and the real PCM.

As a workaround, simply use device=0 for all channel map controls and
SoC HDMI codec controls for internal PCM devices.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
---
 sound/core/pcm_lib.c          | 5 ++++-
 sound/soc/codecs/hdmi-codec.c | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 40751e5aff09..1461463dc320 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2514,7 +2514,10 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
 		knew.name = "Playback Channel Map";
 	else
 		knew.name = "Capture Channel Map";
-	knew.device = pcm->device;
+	if (pcm->internal && pcm->device)
+		dev_info(pcm->card->dev, "workaround active: internal PCM chmap controls mapped to device 0\n");
+	else
+		knew.device = pcm->device;
 	knew.count = pcm->streams[stream].substream_count;
 	knew.private_value = private_value;
 	info->kctl = snd_ctl_new1(&knew, info);
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 5679102de91f..aa2ca5078551 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -797,7 +797,8 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
 		if (!kctl)
 			return -ENOMEM;
 
-		kctl->id.device = rtd->pcm->device;
+		if (!rtd->pcm->internal)
+			kctl->id.device = rtd->pcm->device;
 		ret = snd_ctl_add(rtd->card->snd_card, kctl);
 		if (ret < 0)
 			return ret;
-- 
2.17.1


debug log:

solving ba65fe5e6e ...
found ba65fe5e6e in https://yhetil.org/guix/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/

applying [1/1] https://yhetil.org/guix/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/
diff --git a/gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch b/gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch
new file mode 100644
index 0000000000..ba65fe5e6e

1:38: space before tab in indent.
 		knew.name = "Playback Channel Map";
1:39: space before tab in indent.
 	else
1:40: space before tab in indent.
 		knew.name = "Capture Channel Map";
1:46: space before tab in indent.
 	knew.count = pcm->streams[stream].substream_count;
1:47: space before tab in indent.
 	knew.private_value = private_value;
Checking patch gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch...
Applied patch gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch cleanly.
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.

index at:
100644 ba65fe5e6e5379d471dec63623c577c492bc3e74	gnu/packages/patches/amlogic-0009-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.