djice
Posts: 4
Joined: Tue May 12, 2015 7:12 am

USB Micro not working on raspberry pi 2

Tue May 12, 2015 12:07 pm

Hi,

I have just bought an USB microphone to interact vocaly with my raspberry. I test the microphone on windows and it works like a charm. My raspberry is under raspbian. I plug the microphone on the raspberry and in the file "/etc/modprobe.d/alsa-base.conf" I add the lines

Code: Select all

options snd-usb-audio index=0
options snd-bcm2835 index=1
I restarted my raspberry.

My microphone is well recognized by the system

Code: Select all

pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
My USB microphone is before the "bcm2835" card

Code: Select all

pi@raspberrypi ~ $ cat /proc/asound/cards
 0 [Device         ]: USB-Audio - USB PnP Sound Device
                      C-Media Electronics Inc. USB PnP Sound Device at usb-bcm2708_usb-1.3, full spee
 1 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA
BUT

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
and

Code: Select all

pi@raspberrypi ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
When I record a sound with the command "arecord test.wav" a file is well recorded but when I play it there is no sound...

I don't understand why "aplay -l" or "aplay -L" does not proive me a reference to my USB microphone.

Someone can help me please ?

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: USB Micro not working on raspberry pi 2

Tue May 12, 2015 4:08 pm

Aplay -l and aplay -L show only playback devices. Try arecord -l.

Your onboard audio is no longer the default. Are you using 'aplay -D hw:1,0 test.wav' for playback?

djice
Posts: 4
Joined: Tue May 12, 2015 7:12 am

Re: USB Micro not working on raspberry pi 2

Tue May 12, 2015 4:33 pm

Code: Select all

pi@raspberrypi ~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Douglas6 wrote:Your onboard audio is no longer the default. Are you using 'aplay -D hw:1,0 test.wav' for playback?
Yes

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: USB Micro not working on raspberry pi 2

Tue May 12, 2015 5:31 pm

Either recording is not working, or playback is not working. Divide and conquer. Start with playback. Try

Code: Select all

aplay -d hw:1,0 /usr/share/sounds/alsa/Front_Center.wav
If you hear nothing, go thru some troublingshooting steps from here. Also make sure that you have powered speakers properly attached. Check your volume levels with alsamixer.

If the above aplay command works to your satisfaction, concentrate on recording. Can the resulting .wav file be played on another system? Use alsamixer to set the recording levels.

djice
Posts: 4
Joined: Tue May 12, 2015 7:12 am

Re: USB Micro not working on raspberry pi 2

Wed May 13, 2015 4:49 am

Hi,

playback is working fine.

I already set the volume with alasmixer and check the micrphone is not muted.

I use this on http://www.amazon.co.uk/TRIXES-Micropho ... B007RMPV62

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: USB Micro not working on raspberry pi 2

Sat Aug 29, 2015 1:17 am

Guys,
If it helps...
I've just bought the StarTech USB sound 'card' and found this thread among others to get it going. I struggled at first, followed the info on Adafruits pages, used "alsamixer" to select my USB audio dongle, wind all the agains up and tried various arecord/aplay attempts stabbing in various parameters

using "lsusb" got me:

Code: Select all

pi@raspberrypiplus ~ $ lsusb
....<snipped>
Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
....<snipped>
In the end I got record/ replay to work with an old stereo Mic I've had for years and headphones both connected to the USB sound dongle:

Code: Select all

pi@raspberrypiplus ~ $ arecord foo1.wav -D sysdefault -d 10
Recording WAVE 'foo1.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
pi@raspberrypiplus ~ $ aplay foo1.wav -D sysdefault
Playing WAVE 'foo1.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
I originally fiddled with 44100Hz sample rates and struggled more with replay, initially it failed on output device error. Finally could replay my first recording via the BCM chip set via HDMI or headphones via the dongle using:

Code: Select all

pi@raspberrypiplus ~ $ aplay foo.wav -D sysdefault:CARD=1
Playing WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
pi@raspberrypiplus ~ $ aplay foo.wav -D sysdefault:CARD=0
Playing WAVE 'foo.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Still not sure what I'm doing but that above works for me. Hope it helps. What I really want to do is use the sound dongle to connect my Bluetooth helmet system to my PMR transceiver.
Edit: I'm using a Pi B+ not a Pi2 as per thread owner. Also thread title needs more detail ("USB Micro..." -> "USB Microphone...").
Share and Enjoy.

Return to “Troubleshooting”