TX2 Audio Processing Engine multi-channel MIXER problem

Jon,
Thanks for information, it is really nice tip about 256 ( to ignore).
You got my mapping properly.
I will definitely try, actual codec is just A2B bus to external device ( 8 channels 32 bit each), or you can say generic audio codec controlled by other device/cpu with wich we have no way to communicate. My existing solution switching between AMX2/3 causing clock glitch,
so it is why I am looking not to reconfigure alsa route/mixing at all.

Hi Andrei,

In that case, it makes life even easier as we only need to set the ‘I2S1 codec bit format’ to convert to 32-bits.

Regards,
Jon

Hi, Jon

Yes, but has it been already set by dtb? It is already specify 32 bit format for I2S1.

Andrei

Hi Andrei,

It still needs to be set by the mixer control. You can confirm by reading the I2S_AXBAR_RX_CIF_CTRL_0 register while playback is active …

$ sudo grep "60:" /sys/kernel/debug/regmap/tegra186-i2s.0/registers

We need the AXBAR_BITS [14:12] in this register to be 3 (for 16-bit) and the CLIENT_BITS [10:8] in this register to be 7 (for 32-bit) and EXPAND [7:6] to be 0 (for zero fill). The value in DTB does not configure these, this is purely configure at runtime based upon the sample-size played. Therefore, if you play a 16-bit sample, then both the AXBAR_BITS and CLIENT_BITS will be set to 3 for 16-bit. We need to override the CLIENT_BITS in this case using the above mixer control.

You can refer to the hw_params() function in the I2S driver to see how this is programmed …

https://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=blob;f=sound/soc/tegra-alt/tegra210_i2s_alt.c;h=8345ef5c8a8af531321d4cb368edab2071db6024;hb=l4t/l4t-r28.3#l510

Regards,
Jon

Jon,
Thanks for update.
I was bit busy to check, but I will found time next week to try and finalize my configuration.
As I mentioned before, I am trying to avoid any patches to code itself, dts is fine.
With such approach I think ADMAIF-> ADX-> MIXER → AMX → I2S or
ADMAIF → AMX → ADX → MIXER ->AMX ->I2S path probably preferable
if Mixer handling only stereo pares. Demux 6 chan 16 bit to 3 pairs and Let Mixer work after that.
AMX will convert it to 32bit 8 channels.

Andrei

Jon,
As I have an issues with switching I2S1 between 2 AMX’s I have to return to this issue.
I have try my way and it is not working even I demux it propely ( I Have add a code to dump ADX slot map)
I my case I think I2S already configured tome 32bit:

#grep "60:" /sys/kernel/debug/regmap/tegra210-i2s.0/registers 
60: 00007700

What is surprise for me - AXBAR_bits set to 32bit (as I undrestand) also.

I have done few extra try:

amixer sset "I2S1 Mux" "ADMAIF9"
speaker-test -D hw:0,8 -c 6 -F S16_LE -t sine -f 400
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error

But this:

amixer sset "I2S1 Mux" "ADMAIF9"
speaker-test -D hw:0,8 -c 6 -F S32_LE -t sine -f 400

working, but have garbage (0xFFFFF )on slot 7/8 when play slot 1. ( counting slots 1-8).

Andrei

Hi Andrei,

The above is incorrect. Offset 60 is for capture and offset 20 is for playback. So the command you want is …

$ sudo grep "20:" /sys/kernel/debug/regmap/tegra186-i2s.0/registers

Regards,
Jon