audio – alsa – arecord generating blank wav file

I’m trying to record an audio file via arecord on embeded Linux, but the file is blank. In Audacity, it looks like this:

The audio file's wave

But I could play ordinary audio file via aplay. I use RK809 as the sound card, which is connected to the cpu via I2S. There is an analog microphone connected to RK809, and the analog audio is processed by RK809 and transmitted to CPU through I2S bus.

Here is some information about it:

[root@DCIR:~]# cat /proc/asound/cards
 0 [rockchiprk809co]: rockchip_rk809- - rockchip,rk809-codec
                      rockchip,rk809-codec
 7 [Loopback       ]: Loopback - Loopback
                      Loopback 1

[root@DCIR:~]# amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Playback Path',0
Simple mixer control 'Capture MIC Path',0
Simple mixer control 'Digital',0

[root@DCIR:~]# amixer controls
numid=3,iface=MIXER,name="Master Playback Volume"
numid=2,iface=MIXER,name="Capture MIC Path"
numid=1,iface=MIXER,name="Playback Path"
numid=4,iface=MIXER,name="Digital Capture Volume"

[root@DCIR:~]# amixer scontents
Simple mixer control 'Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 100
  Mono:
  Front Left: Playback 100 [100%] [0.00dB]
  Front Right: Playback 100 [100%] [0.00dB]
Simple mixer control 'Playback Path',0
  Capabilities: enum
  Items: 'OFF' 'RCV' 'SPK' 'HP' 'HP_NO_MIC' 'BT' 'SPK_HP' 'RING_SPK' 'RING_HP' 'RING_HP_NO_MIC' 'RING_SPK_HP'
  Item0: 'SPK_HP'
Simple mixer control 'Capture MIC Path',0
  Capabilities: enum
  Items: 'MIC OFF' 'Main Mic' 'Hands Free Mic' 'BT Sco Mic'
  Item0: 'Main Mic'
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 100
  Front Left: Capture 100 [100%] [0.00dB]
  Front Right: Capture 100 [100%] [0.00dB]

alsamixer

Here is what I’ve tried:

  1. Record at least 10 seconds to make sure it’s not I/O error.
  2. Check the hardware. I checked MIC, but it’s hard for me to check I2S bus, because to measure the I2S signal, you can only directly measure the pins of the chip.

The following is the method suggested by the chip manufacturer, but I don’t know how to implement it:

  1. “Use amixer or tinymix to check if the ADC channel inside the CODEC is open and the volume is muted.” In alsamixer, i’m sure the Capture MIC Path is not off, and Digital is not muted. I don’t know how to check ADC’s status.
  2. “Codec end input a 10k Hz wave signal which is produced by signal generator.” Is this means send sigal on I2S bus?
  3. “Use arecord or tinycap to record, whether the positioning problem occurs in user mode or kernel mode.” I use command arecord -D hw:0,0 -d 2 -f cd -c 2 -vv -t wav test.wav to record, generating a blank file.

Read more here: Source link