Audio Input testing

Hi,

In Jetson Tx2 board, replaced the camera module with HDMI2CSI interface board, i.e. HDMI Input is converted to CSI data, audio data. Here, Audio input is connected to I2S4 Controller. Need to test this audio input.

In device tree, sound device node has audio routing details and /proc/asound and /dev/snd files are created. Want to know the cmd to test the I2S4 controller audio input.

In tools alsamixer, aplay and arecord, not sure that how to give the arguments and it is confusing since /dev/snd and /proc/asound values are different from arguments.

-Thanks.

Hi,

In one example, they are given as:

arecord -f S16_LE -c 2 -r 48000 -d 5 -D hw:1,0 test.wav

For I2S4 controller, What values, we have to give in -D hw:1,0 parameter?

The available devices:

nvidia@tegra-ubuntu:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: tegrahda [tegra-hda], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 8: ADMAIF9 CIF ADMAIF9-8
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 9: ADMAIF10 CIF ADMAIF10-9
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 10: ADMAIF11 CIF ADMAIF11-10
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 11: ADMAIF12 CIF ADMAIF12-11
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 12: ADMAIF13 CIF ADMAIF13-12
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 13: ADMAIF14 CIF ADMAIF14-13
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 14: ADMAIF15 CIF ADMAIF15-14
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 15: ADMAIF16 CIF ADMAIF16-15
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 16: ADMAIF17 CIF ADMAIF17-16
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 17: ADMAIF18 CIF ADMAIF18-17
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 18: ADMAIF19 CIF ADMAIF19-18
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 19: ADMAIF20 CIF ADMAIF20-19
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 154: ADSP PCM1 ADSP-FE1-154
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 155: ADSP PCM2 ADSP-FE2-155
Subdevices: 1/1
Subdevice #0: subdevice #0

-Thanks.

@BalajiNP
Try below command.

amixer cset -Dhw:1 name=“ADMAIF1 Mux” ‘I2S4’
arecord -Dhw:1,0 -f S16_LE -c 2 -r 48000 -t wav test.wav

Hi ShaneCCC,

The below cmd, what it will do related to I2S4?

amixer cset -Dhw:1 name=“ADMAIF1 Mux” ‘I2S4’

-Thanks.

Hi,

Tried the above cmds as:

amixer cset -Dhw:1 name=“ADMAIF1 Mux” ‘I2S1’

arecord -Dhw:1,0 -f S16_LE -c 2 -r 48000 -t wav test.wav

Here, I2S1 controller is used.

The recorded file has noise sounds, not proper sounds. What is the problem? How to debug this further.

-Thanks.

Why I2S1 instead of I2S4? Did you rework the audio input to I2S1?
For the noise could you disconnect the device to record to check if still have noise. If there’s no any noise like mute the noise should be out from device need to figure out what happen to the device.

Hi,

Yes. We connected to the I2S1 via J21A connector in board.

Tried this cmd:

arecord -f S16_LE -c 2 -r 48000 -d 20 -D hw:tegrasndt186ref,0 test7.wav

and we did not use this amixer cset -Dhw:1 name=“ADMAIF1 Mux” ‘I2S1’ cmd in here.

Then noise was there in recorded file. If we disconnect the device, then noise is not there in recorded file.

Note: In file, /etc/amixer_settings, some cmds are there as:

Reset controls

amixer cset -c tegrasndt186ref name=“ADMAIF1 Mux” ‘I2S1’
amixer cset -c tegrasndt186ref name=“x Int Spk Switch” 0
amixer cset -c tegrasndt186ref name=“x Int Mic Switch” 0
amixer cset -c tegrasndt186ref name=“x Headphone Jack Switch” 0
amixer cset -c tegrasndt186ref name=“x Mic Jack Switch” 0
.
.
.

How to debug this?

-Thanks.

Hi ShaneCCC,

Ran the below cmds:

amixer cset -Dhw:1 name=“ADMAIF1 Mux” ‘I2S4’
arecord -Dhw:1,0 -f S16_LE -c 2 -r 48000 -t wav test.wav

Then we can record the audio in file. But audio has small original sound, then noise, then sound, then noise, like this.

Not full proper audio sound.

-Thanks.

@BalajiNP
I verify the wav file gen by the command from my Jetson board without connect any of audio device I got no any noise. Did you connect any device to I2S4? The noise could be out from device.