Record issue with codec max9867

Hi,

I have a custom board with codec max9867.
The codec codes has been modified and ported, and the asoc drive can load normally.

The playback testing is ok with setting:

amixer -c 1 cset name=‘I2S5 Mux’ ADMAIF1

however, capture testing failed with setting:

amixer -c 1 cset name=‘ADMAIF1 Mux’ I2S5
amixer -c 1 cset name=‘x Right Input Mux’ Line
amixer -c 1 cset name=‘x Left Line Switch’ on
amixer -c 1 cset name=‘x Right Line Switch’ on

I enable tracing of some of the dapm functions:

echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_path/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_start/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_walk_done/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable

Then result after runing arecord -Dhw:1,0 -r 44100 -c 2 -f S16_LE <filename>.wav is just:

root@nvidia-desktop:/sys/kernel/debug/tracing# cat trace
# tracer: nop
#
# entries-in-buffer/entries-written: 415/415   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
         arecord-8899  [000] ....   394.210926: snd_soc_dapm_start: card=tegra-snd-t19x-mobile
         arecord-8899  [000] ....   394.211163: snd_soc_dapm_walk_done: tegra-snd-t19x-mobile: checks 2 power, 2 path, 0 neighbour
         arecord-8899  [000] ....   404.355425: snd_soc_dapm_start: card=tegra-snd-t19x-mobile
         arecord-8899  [000] ....   404.355511: snd_soc_dapm_path: *ADMAIF1 Transmit -> (direct) -> Capture 1
         arecord-8899  [000] ....   404.355514: snd_soc_dapm_path: *ADMAIF1 Transmit -> (direct) -> ADMAIF1 Transmit-ADMAIF1 CIF Transmit
         arecord-8899  [000] ....   404.355591: snd_soc_dapm_walk_done: tegra-snd-t19x-mobile: checks 2 power, 2 path, 2 neighbour

max9867.c (15.4 KB) max9867.h (2.5 KB) tegra_machine_driver_mobile.c (22.3 KB)
sound.dtsi (672 Bytes)

Hello!

Can you run the following commands and share the generated file?

outfile="${HOME}/tegra-audio-debug.txt"

alsactl store -f "${outfile}"

dapm_dirs=$(sudo find /sys/kernel/debug/asoc -type d -name dapm)

for dir in ${dapm_dirs}; do
    sudo find ${dir} -type f -exec echo {} \; -exec cat {} \; >> "${outfile}"
done

Thanks
Jon

Hi,

Thank you for reply.

The generated file when arecord -Dhw:1,0 -r 44100 -c 2 -f S16_LE <filename>.wav running is:tegra-audio-debug.txt (541.4 KB)

Hello!

Thanks for the log. I don’t see anything particularly wrong. The only thing I noticed on the playback side is that both I2S1 and I2S5 are muxed to ADMAIF1. So you should …

amixer -c 1 cset name="I2S1 Mux" None

What do you see if you use a different I2S interface without the codec. For example …

amixer -c 1 cset name=‘ADMAIF2 Mux’ I2S1
echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_path/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_start/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_walk_done/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
arecord -Dhw:1,1 -r 44100 -c 2 -f S16_LE -d 10 cap.wav
sudo cat /sys/kernel/debug/tracing/trace

Regards,
Jon

Hi,

Thank you.

I test according to your reply, but the result is the same as before.

Hello!

Thanks for confirming. I am wondering if any of your changes to either the machine driver or device-tree are causing this. You may wish to revert all your changes, then verify that you can record with I2S1, then start to re-introduce your changes and see where things break.

Regards,
Jon