0

I got myself one of those cheap USB microphones and it basically works out of the box with arecord, it's just way too quiet. The level on the virtual UV meter never passes 1%.

Here's what I got, starting from the hardware up to the alsa config:

$ lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8086:0808 Intel Corp. 
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ dmesg

[165443.535864] usb 1-1.4: new full-speed USB device number 3 using xhci_hcd
[165443.679497] usb 1-1.4: New USB device found, idVendor=8086, idProduct=0808, bcdDevice= 1.00
[165443.679513] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[165443.679526] usb 1-1.4: Product: USB PnP Sound Device
[165443.679539] usb 1-1.4: Manufacturer: C-Media Electronics Inc.      
[165443.698880] input: C-Media Electronics Inc.       USB PnP Sound Device as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:8086:0808.0001/input/input0
[165443.766033] hid-generic 0003:8086:0808.0001: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc.       USB PnP Sound Device] on usb-0000:01:00.0-1.4/input2

$ arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord -L

null
    Discard all samples (playback) or generate zero samples (capture)
mic_hw
mic_sv
default:CARD=Device
    USB PnP Sound Device, USB Audio
    Default Audio Device
sysdefault:CARD=Device
    USB PnP Sound Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Front speakers
surround21:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Direct sample mixing device
dsnoop:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Direct sample snooping device
hw:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Hardware device with all software conversions

$ arecord -Dplughw:1,0 -c1 -r44100 -fS16_LE -twav -Vmono test.wav

Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
#+                                                 | 01%

Note that I had a speaker 5cm away from the microphone, playing pretty loud music. The level never exceeds 1%. When I playback the test.wav file, I can hear the music, so the basic recording mechanism works. It's just way too quiet.

Whenever I run alsamixer, I see that the recording device is cranked to 100, but it only goes up to 23.81 dB of gain.

I tried to play around with the alsa config, found some examples online, but it just doesn't seem to work.

Here's my /etc/asound.conf

pcm.mic_hw {
    type hw
    card "USB PnP Sound Device"
    channels 1
    format S16_LE
}

pcm.mic_sv {
    type softvol
    slave.pcm mic_hw
    control {
        name "Boost Capture Volume"
        card "USB PnP Sound Device"
    }
    min_dB -3.0
    max_dB 50.0
}

Alsa uses the config, because whenever I add a mistake, alsamixer complains about it and aborts. However, the configured max_dB of 50 doesn't seem to work, can't find it anywhere in alsamixer.

Also, the playback device for this card always says auto gain control.

Any hint on how I can increase the mic gain is appreciated.

mefiX
  • 101
  • 3
  • Well, there are two types of microphones, (1) moving coil/dynamic, and (2) Electret. I found electret mics usually have higher output than moving coil. (Yes, cheap things are sadly weak power) But you can always use cheap digital power amplifiers to adjust volume. In short, don't try to increase mic gain, instead, use a power amp. – tlfong01 May 01 '20 at 10:27
  • Or you can try my toys: "MAX4466/Max9814 microphone notes": (1) https://datasheets.maximintegrated.com/en/ds/MAX9814.pdf, (2) https://raspberrypi.stackexchange.com/questions/107778/how-to-use-rpi-python-to-control-pcm1802-24-bit-hifi-stereo-adc-and-max4466-micr. (3) https://fr.aliexpress.com/item/32863693402.html?spm=a2g0o.productlist.0.0.599ddadbkdKo4S&algo_pvid=69212b72-375c-4b0f-9b86-9451f134abf7&algo_expid=69212b72-375c-4b0f-9b86-9451f134abf7-12&btsid=b3428fe9-8691-48fa-a780-47ef6621a934&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53. – tlfong01 May 01 '20 at 10:34
  • Or use a good quality USB sound card, such as those by Ugreen: (1) https://raspberrypi.stackexchange.com/questions/111426/reducing-sound-noise-when-recording-with-pi, (2) https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=224976&start=25#p1396404. – tlfong01 May 01 '20 at 10:42
  • 1
    Increasing gain has to be sufficient in my case. I don't need high quality audio, I just want to detect the beat of music in order to control the intensity of rgb leds. But in order for this to work, I only need a decent audio level. – mefiX May 01 '20 at 11:06
  • I see. So MAX9814 with adj gain 40~60dB might fit your requirement. – tlfong01 May 01 '20 at 11:24
  • Actually you can consider, *without using any USB sound card*, just use Max9814 and an ADC to detect primary and secondary beats and then use DAC for RGB LED intensity control. – tlfong01 May 02 '20 at 01:05
  • It's an HID so it's hidden behind the HID layer. https://en.wikipedia.org/wiki/Human_interface_device Notice the hid in your dmesg. From Wikipedia "The host needs to retrieve the HID descriptor from the device and parse it before it can fully communicate with the device. Parsing the HID descriptor can be complicated." I get a lot of digital noise but I can hear my voice in there weakly too. – Alan Corey Sep 11 '20 at 15:48
  • try lsusb -t, which for me shows partly: |__ Port 3: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M |__ Port 1: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid , 1.5M |__ Port 1: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid , 1.5M |__ Port 2: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid , 1.5M |__ Port 3: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480 M – Alan Corey Sep 11 '20 at 18:16

0 Answers0