View Sound Card and Device Status

Take the external codec (wm8960) as an example, the virtual sound card is described as follows.
  • For virtual sound card registered in I2S interfaces:
    # cat /proc/asound/cards
    0 [StarfiveMultiSo]: simple-card - Starfive-Multi-Sound-Card
    						  Starfive-Multi-Sound-Card
  • To view the device for recording:
    # arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 0: StarfiveMultiSo [Starfive-Multi-Sound-Card], device 0: 100e0000.i2srx_3ch-wm8960-hifi wm8960-hifi-0 [100e0000.i2srx_3ch-wm8960-hifi wm8960-hifi-0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
  • To view the device for playback:
    # aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: StarfiveMultiSo [Starfive-Multi-Sound-Card], device 1: 120c0000.i2stx_4ch1-wm8960-hifi wm8960-hifi-1 [120c0000.i2stx_4ch1-wm8960-hifi wm8960-hifi-1]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    
Use the following commands to check sound flow settings.
  • To view playback parameters (Check during play. The example is based on checking a file of 32-bit, 48 KHz sampling rate. )
    # aplay -Dhw:0,1 -f S32_LE -r48000 -t wav tdm_32bit_48k.wav &
    # cat /proc/asound/card0/pcm1p/sub0/hw_params
    access: RW_INTERLEAVED
    format: S32_LE // Sample rate: 32-bit
    subformat: STD
    channels: 2 // Number of channels: 2 channels
    rate: 48000 (48000/1) // Sample rate: 48 KHz
    period_size: 512
    buffer_size: 24064
  • To view playback parameters (Check during play.)
    # arecord -Dhw:0,0 -f S32_LE -r16000 -c2 -d 10 -t wav music_32b_16k.wav &
    # cat /proc/asound/card0/pcm0c/sub0/hw_params
    access: RW_INTERLEAVED
    format: S32_LE // Sample rate: 32-bit
    subformat: STD
    channels: 2 // Number of channels: 2 channels
    rate: 16000 (16000/1) // Sample rate: 16 KHz
    period_size: 512
    buffer_size: 8192