Files
LibreELEC.tv/projects/Amlogic/devices/AMLGX/patches/linux/amlogic-0009-LOCAL-ASoC-meson-assign-internal-PCM-chmap-ELD-IEC95.patch
Christian Hewitt 8314e2506f linux: update Amlogic to Linux 6.16.y kernel and patches
Includes:
- drop local rtlwifi patches
- Amlogic: disable lock debugging
- Amlogic: disable some ARMv8 features not present in Amlogic SoCs
  Amlogic 64-bit SoC have only ARMv8.1 cores and do not support
  later rev features. Disable them to save a few KBs from kernel
  size.
- Amlogic: disable unused errata
  Disable errata for cores not present in Amlogic's SoCs.
- Amlogic: set THP to madvise
- Amlogic: enable PSCI CPUIdle driver
  With additional entries in device tree, this
  can save approximately 30-40mW when idling.
- Amlogic: set preemption to voluntary
  Aligns Amlogic with (most) other LE projects.
- Amlogic: increase Linux kernel tick-rate to 300Hz
  Aligns Amlogic with (most) other projects.
- Amlogic: disable SCHED_SMT
  Amlogic SoCs do not have hyperthreading, disable it
  to save some space
- Amlogic: adjust kernel config for Docker
  Kernel config adjusted with tools/check_kernel_config script
- enable kernel options IP_SET and NETFILTER_XT_SET
- enable kernel based RTW88_8821AU and RTW88_8812AU
- drop now upstream 6.14 lzma patch
- enable kernel options CONFIG_IP_NF_RAW and CONFIG_IP6_NF_RAW

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
2025-07-21 08:23:36 +00:00

59 lines
2.2 KiB
Diff

From e751b7cfeaca07cef1b14cebbd4dc567ed50ed37 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/37] LOCAL: ASoC: meson: assign internal PCM
chmap/ELD/IEC958 kctls to device 0
On SoC sound devices utilizing codec2codec DAI links with an HDMI codec the kctls
for chmap, ELD, IEC958 are created using internal PCM device numbers. This causes
userspace to not see the actual channel mapping. This affects all Amlogic devices
using the AIU and AXG audio drivers: currently all Amlogic devices.
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>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
---
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 6eaa950504cf..f2f05f1c4f98 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2612,7 +2612,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: 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 31121f9c18c9..606abb3889c1 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -821,7 +821,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.34.1