2

I would like to use Amazon Alexa or Steven Hicksons Voicecommander (uses Google) on my Pi to automate some tasks by voice command, but I am having trouble getting the microphone to work in the first place.

I have a Pi 2 with Raspbian Jessie. I bought a 'Speedlink' USB soundcard which uses a C-media chipset and connected it directly to my Pi. I have a couple of microphones laying around and plugged the (mono) jack of one of those into the mic line in of the USB dongle. I use the hdmi out for sound output and would like to keep it that way.

Already in the GUI I can see the USB card and I can unmute the mic, boost its gain and turn off auto-gain. The same goes for alsamixer (they show identical settings). lsusb shows the dongle, cat /proc/asound/cards shows it as device 1 (not 0) and arecord -l shows the usb as the only capture device (which is correct).

Running arecord -D plughw:1 --duration=5 -v -V mono testmic.wav starts the recording without errors, shows the settings of the device (format = S16_LE, which is correct) and a vumeter (showing between 0 and 2% even if I bang the mic on the table). Playing back the file I hear nothing, if I turn up the volume really high I hear some static.

I have found many people running into problems setting up a mic on the Pi, some people run into extra problems when using the C-media chipset. All of them list the problem as solved in the end and all the solutions amount to one of the following (some seemed specific for Wheezy):

-make sure the system sees the usb dongle (it does)

-make sure your user has audio rights (mine did from the start)

-add sndbcm2835 (did that but already seemed to be there)

-make sure you boost the mic gain (I did)

-set usb card as default (shouldnt matter when using -plughw:1 right?)

-set format to S16_LE (arecord already showed this)

-set the 'speed' to 1 (didnt understand this one)

-set the rate to 16000 (didnt help)

-edit /etc/asound.conf (wheezy only?)

-make sure your mic plug is stereo (is that a possible cause?)

I thought since a mono jack connects to all wires even if in a stereo jack. On the other hand I already tried pretty much every software solution I could find but I really think the settings are correct. So I tried all kinds of combinations with my mono mics and some stereo jack plugs: recording with mic fully plugged in, plugged in half, plugged in a stereo jack splitter with one mic plugged in full and one mic plugged in half.

Still I havent been able to get the mic to record anything and Im getting a little hopeless. Im kind of leaning to it being a connector problem in some way, but still might be some software issue I dont understand too. Anyone got some ideas?

Update: problem probably with input type / power

Putting the line out (stereo) of my laptop in the mic in of the usb card it did record! Putting the mic of my turtle beach headset (stereo jack, although might be mono output) in the mic in of the usb card did not result in a signal. So either its a power issue or it really needs to be stereo somehow.This guy also reports he had to turn down the volume to about 50% to record anything.

Leo
  • 121
  • 1
  • 5

3 Answers3

2

I've finally solved this issue on my side. I hope this ends up being the problem you had too...

The problem was the microphone plug. I was unaware there are two kinds out there: 3-pole, and 4-pole. The C-media USB card I have assumes that you have a 3-pole (older-style) microphone, and did not work with the original 4-pole one I had. Sometimes these are also called "4-position" & "3-position" or TRS & TRRS (Tip, Ring, Ring, Sleeve). Newer headset & mic combos come with TRRS (extra ring for mic), whereas older ones had two separate plugs for mic & headphones, each TRS/3-pole.

I bet most C-media cards out there assume you have an older setup -- separate mic from headphones. But many mics being sold these days for smartphones are configured as TRRS in order to work with the single-plug solution. So, you'll either need an adapter (search Amazon for TRRS to TRS or 3-pole to 4-pole adapter) or a mic that is TRS/3-pole.

R Porter
  • 121
  • 4
  • I remember trying several mics with different plugs, including manually playing around with the contacts. Didnt get it the work, but also not sure if anything I tried was equivalent to TRS/3-pole. – Leo Aug 18 '17 at 14:21
1

Some C-Media sound cards are bad manufactured, e. g. the Renkforce external sound card.

See customer reviews here, the one of pizzamann of 13th of July 2020 gets it right "Der Mikrofoneingang ist intern falsch angeschlossen" (= "Microphone input is wrongly wired internally") -> see following ASCII drawing

                                       ▄▄
TRS plug (stereo speakers/microphone): ▓▓====┊==┊-=>
                                       ▀▀
                                   ▄▄

TS plug (mono speaker/microphone): ▓▓=======┊-=> ▀▀

                                    ▕▁▁▁▁▁▁▁▁▁▁▁

TRS jack (stereo) ▏ ▕▔▔^▔▔▔^▔▔^▔

                                    ▕▁▁▁▁▁▁▁▁▁▁▁

TS jack (mono, normal manufacturers) ▏ ▕▔▔^▔▔▔▔▔▔^▔

                                    ▕▁▁▁▁▁▁▁▁▁▁▁

TS jack (mono, Renkforce) ▏ ▕▔▔^▔▔▔^▔▔▔▔

In effect, mono microphones do work only plugged halfway-in, like this:

                                    ▄▄  ▕▁▁▁▁▁▁▁▁▁▁▁
TS plug (mono speaker/microphone):  ▓▓=======┊-=>   ▏
TS jack (Renkforce mic port)        ▀▀  ▕▔▔^▔▔▔^▔▔▔▔
u_Ltd.
  • 111
  • 1
1

I have a similar aim as the OP and encountered the same problems with mic output but I am using a Raspberry Pi Zero W. USB is also a C-Media.

After extensive testing and reading including the above I discovered that the microphone sensitivity or maybe input impedance is the key to these issues.

The microphone I set out to use was a Sony make from a media center or some such but with 3.5 mm mono plug (i.e. 2-pole) but could get no useful sound recorded. I then tried a microphone recovered from a car hands-free installation (3-pole plug). Again I could get not useful recorded sound. An interesting aside is that when this combo was plugged into my laptop running Ubuntu 16.04 it works clearly.

However the revelation comes when I plug in a headset/microphone combo supplied with a cordless phone. This worked without crackle, without static and gave clear voice quality. This indicates the basis of my claim in my second sentence above.

As a final demo of what I found I used a 1-1/2" x 3" 4 ohm speaker as a microphone plugged in with a 3-pole 3.5mm plug and again clear voice recording resulted.

Sorry about the novel but I thought this may clear things up for a number of people trying this.

Bex
  • 2,929
  • 3
  • 25
  • 34
Rob B
  • 11
  • 1