On 03. 01. 22 10:57, Jerome Brunet wrote:
On Sun 26 Dec 2021 at 18:30, Jaroslav Kysela <perex@xxxxxxxx> wrote:
On 26. 12. 21 12:43, Christian Hewitt wrote:
**** List of PLAYBACK Hardware Devices ****
card 0: LIBRETECHCC [LIBRETECH-CC], device 0: fe.dai-link-0 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
numid=12,iface=PCM,name='ELD',device=2
numid=11,iface=PCM,name='IEC958 Playback Default',device=2
numid=10,iface=PCM,name='IEC958 Playback Mask',device=2
numid=9,iface=PCM,name='Playback Channel Map',device=2
https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts#L136-L188
Have you tried to reorder the dai-link-# sections in DT? It appears to me that sound/soc/codecs/hdmi-codec.c / hdmi_codec_pcm_new() gets the internal PCM
device rather than the exported PCM device for the user space.
If the DAI routing cannot be changed, then the hdmi-codec.c should be modified to export the correct device number for the user space:
The DAI routing is dynamic, especially on the AXG series.
There is actually two routing stages:
1) Between the user interfaces (DMA) and the i2s/TDM encoders/decoders:
-> This is using DPCM
2) Between the i2s/TDM encoders and the HDMI controller:
-> This is using Codec-to-Codec links
The problem exposed here is
- How to get the get the "Playback Channel Map" related to the pcm
device of a given playback ?
The PCM device exported to the user space should be able to export this
information correctly. The kcontrols in hdmi-codec.c refers to an unknown
(internal) PCM codec2codec device (from the user space view) which is created
in the SoC layer.
It seems that kcontrols in hdmi-codec.c should not be created for the internal
SoC PCMs. A new layer which translate the kcontrol handling between the
exported (user space) PCM device and internal (SoC) PCM device is required.
Problematic code in hdmi_codec_pcm_new() / hdmi-codec.c:
- snd_pcm_add_chmap_ctls()
- kctl->id.device = rtd->pcm->device
Jaroslav
--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.