USB Microphone on Jetson Nano

Hi,

I would like to use a USB microphone and record wav file.
I tried two different USB microphone and get same results on both.
Sometimes i can get it working, but most of the time i get an error

arecord: pcm_read:2103: read error: Input/output error

using this command

arecord -vvv -d 5 -D hw:2,0 -f S16_LE -c 1 -t wav > test.wav

Did some research on Google but found nothing fancy about this error code.

dmesg

[   22.830282] usb 1-2.2: new full-speed USB device number 3 using tegra-xusb
[   22.856762] usb 1-2.2: New USB device found, idVendor=0d8c, idProduct=0134
[   22.856828] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   22.856875] usb 1-2.2: Product: TONOR TC-777 Audio Device
[   22.856918] usb 1-2.2: Manufacturer: C-Media Electronics Inc.
[   22.873158] input: C-Media Electronics Inc. TONOR TC-777 Audio Device as /devices/70090000.xusb/usb1/1-2/1-2.2/1-2.2:1.2/0003:0D8C:0134.0001/input/input2
[   22.873412] hid-generic 0003:0D8C:0134.0001: input,hidraw0: USB HID v1.11 Device [C-Media Electronics Inc. TONOR TC-777 Audio Device] on usb-70090000.xusb-2.2/input2

Here is output of arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 8: ADMAIF9 CIF ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt210ref [tegra-snd-t210ref-mobile-rt565x], device 9: ADMAIF10 CIF ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Device [TONOR TC-777 Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Of course the exact same process work on any “standard” computer i have (Ubuntu18.04)
Is there anything special about driver or so ?
Am i doing something wrong ?

Thanks in advance,

I got my microphone problem solved by dumping and reviewing all the parameters.

$ arecord -D hw:2,0 --dump-hw-params

https://devtalk.nvidia.com/default/topic/1072949/jetson-nano/how-to-name-the-sound-hw-device-usb-microphone-l4t-32-2-3-/

Also, make sure if the device is Linux compatible so you don’t have the driver issue. The easiest way to tell is open System -> Sound; click on the “Input” tab, select the mic corresponding to your device, and test the mic on-fly.

Thanks for your answer,

Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:2,0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: [8000 48000]
PERIOD_TIME: [1000 16384000]
PERIOD_SIZE: [16 131072]
PERIOD_BYTES: [64 524288]
PERIODS: [2 1024]
BUFFER_TIME: (666 32768000]
BUFFER_SIZE: [32 262144]
BUFFER_BYTES: [128 1048576]
TICK_TIME: ALL
--------------------
arecord: set_params:1299: Sample format non available
Available formats:
- S16_LE

Don’t know if there is anything wrong with this output.
I found a Jetson Xavier and tried these two mics, they worked fine.
May it be that Jetson Nano system doesn’t embedd some drivers compared to its elder brother ?

Perhaps try

arecord -vvv -d 5 -D hw:2,0 -f S16_LE -c 2 -t wav > test.wav

The dump indicates the mic is a stereo device (CHANNELS: 2).

Ok, excuse me, i tested differents mics and the dump i posted was in fact with a 2 channels one.
But this has no effect has when channel number is incorrect the recording instantly fail.
Sorry again, only a bad reporting from my side with different microphone.

I have found one that works and came to the conclusion that it is a ‘nano system’ issue.

Please send the problem Jetson Nano for RMA: https://developer.nvidia.com/embedded/faq#rma-process