[RESEND] Amlogic DPCM audio card(s) speaker placement issue

Jerome Brunet jbrunet at baylibre.com
Mon Jan 3 01:57:00 PST 2022


On Sun 26 Dec 2021 at 18:30, Jaroslav Kysela <perex at perex.cz> 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 ?

I don't really know how to answer this.
As you noted above, given the routing is dynamic, I don't think the
problem can be solved with a specific link ordering

However, on these platforms, there will only be one such control
AFAIK. The one you get is the one you are looking for. It's not ideal
but it's a start.

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/codecs/hdmi-codec.c?h=v5.16-rc6#n805
>
> 						Jaroslav




More information about the linux-amlogic mailing list