You are not logged in.

#1 2013-08-14 10:28:08

kamahl
Member
Registered: 2007-09-16
Posts: 61

I am unable to make microphone work

The title pretty much states my problem. I need to use VoIP services and thus I need a working microphone input.

My machine is a lenovo thinkkpad x200s.
I have evertyhing unmuted in alsamixer.
I can record a crackling noise, with the "Digital" control in alsa mixer set to nonzero. (Using arecord.)
Otherwise, I record nothing.
I have no problems with sound output.
I have tried pretty much that's written in the wiki.
The microphone works OK on other computers.
Any suggestions please? What else should I try or where to look to diagnose the problem?

output of lspci|grep Audio

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)

Output of lsmod|grep snd:

snd_hda_codec_conexant    35994  1 
snd_hda_intel          35309  0 
snd_hda_codec         147474  2 snd_hda_codec_conexant,snd_hda_intel
snd_hwdep               6332  1 snd_hda_codec
snd_pcm                77765  2 snd_hda_codec,snd_hda_intel
snd_page_alloc          7234  2 snd_pcm,snd_hda_intel
snd_timer              18718  1 snd_pcm
snd                    58950  7 snd_hwdep,snd_timer,snd_hda_codec_conexant,snd_pcm,snd_hda_codec,snd_hda_intel,thinkpad_acpi
soundcore               5418  1 snd

Output of amixer:

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined
  Playback channels: Mono
  Limits: Playback 0 - 74
  Mono: Playback 74 [100%] [0.00dB]
Simple mixer control 'Headphone',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 74 [100%] [0.00dB]
  Front Right: Playback 74 [100%] [0.00dB]
Simple mixer control 'Speaker',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 74
  Mono:
  Front Left: Playback 55 [74%] [-19.00dB]
  Front Right: Playback 55 [74%] [-19.00dB]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 4
  Front Left: 2 [50%] [20.00dB]
  Front Right: 2 [50%] [20.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 3
  Mono: Playback 0 [0%] [-18.00dB] [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 74 [92%] [0.00dB]
  Front Right: Capture 74 [92%] [0.00dB]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 41 [34%] [-9.50dB]
  Front Right: Capture 41 [34%] [-9.50dB]
Simple mixer control 'Dock Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 4
  Front Left: 2 [50%] [20.00dB]
  Front Right: 2 [50%] [20.00dB]
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 4
  Front Left: 3 [75%] [36.00dB]
  Front Right: 3 [75%] [36.00dB]

Offline

#2 2013-08-14 14:42:51

teckk
Member
Registered: 2013-02-21
Posts: 589

Re: I am unable to make microphone work

To record microphone or sound coming through the sound card I use a virtual loopback device.
In your .asoundrc add something like

pcm.!default {
  type asym
  playback.pcm "LoopAndReal"
  #capture.pcm "looprec"
  capture.pcm "hw:0,0"
}

pcm.looprec {
    type hw
    card "Loopback"
    device 1
    subdevice 0
}


pcm.LoopAndReal {
  type plug
  slave.pcm mdev
  route_policy "duplicate"
}


pcm.mdev {
  type multi
  slaves.a.pcm pcm.MixReale
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}


pcm.MixReale {
  type dmix
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

pcm.MixLoopback {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:Loopback,0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

Then

modprobe snd-aloop

Turn you mixer controls up and find your mic amixer -l. Example to check it.

arecord -vv -fdat out.wav

Or

ffmpeg -f alsa -i hw:0,0 -c:a copy -vn out.wav

Offline

#3 2013-08-14 17:16:35

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: I am unable to make microphone work

amixer -l?  Doesn't do anything for me.  I tried amixer -i.  Or maybe aplay -l.
This is ~/.asoundrc because that's where I put it. 
I have a CX20549 which is documented to be fuzzy with the mic jack, but it works flawlessly (owing to regimented standards) on OpenBSD.  Anything I've tried on Linux so far, is a scratchy recording at best.

Last edited by nomorewindows (2013-08-14 17:17:10)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#4 2013-08-14 18:31:29

teckk
Member
Registered: 2013-02-21
Posts: 589

Re: I am unable to make microphone work

Sorry, that was wrong, I meant

arecord -l

Have you tried making a virtual loopback device like above and using

arecord -vv -fdat out.wav

You should see the #### fluctuate as you speak into the mic. If not, then unmute and turn up your mic in alsamixer. That loopback device will allow you to capture your sound card and hear it at the same time. Another way to do it is to use a jumper from line out to line in on your sound device. You won't be able to hear it while you record though.
If your sound device works, then you can capture what's going through it. You'll need to determine which vitual device your mic is.
Example

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 2: ALC662 rev1 Alt Analog [ALC662 rev1 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  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: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  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

Offline

#5 2013-08-14 19:16:56

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: I am unable to make microphone work

I did it, but it still doesn't work, it is just a documented bug with the CX20549 under Linux, I don't know what OpenBSD is doing different, but it is clear as a bell.  The ### don't move, so it's not getting any sound.  On other sound cards, I get mostly static.
------ OpenBSD is using sndiod.-------

Last edited by nomorewindows (2013-11-25 14:52:56)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#6 2013-08-15 11:30:01

kamahl
Member
Registered: 2007-09-16
Posts: 61

Re: I am unable to make microphone work

I also tried it and the ####  doesn't move. (Actually it fluctuates in the range from 4% to 6%, but regardless if i speak or not.) Only quiet noise is produced in the output file. Capture controls in the alsamixer are up and there is no mute/unmute option.

Offline

#7 2013-08-15 15:31:35

teckk
Member
Registered: 2013-02-21
Posts: 589

Re: I am unable to make microphone work

(Actually it fluctuates in the range from 4% to 6%

Kamahl, amixer doesn't mention mic anywhere? I need to turn up the mic and mic boost to get response from the mic. Also need PCM and master up, and there is one named digital that has to be up also. It sounds like yours is working, you just need to turn some mixer controls up or unmute. Also gnome-alsamixer is a handy little GUI to use.

amixer snip

Simple mixer control 'Front Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Front Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Front Mic' 'Rear Mic' 'Line'
  Item0: 'Rear Mic'
Simple mixer control 'Rear Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 25 [81%] [3.00dB] [off]
  Front Right: Playback 25 [81%] [3.00dB] [off]
Simple mixer control 'Rear Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]

Offline

Board footer

Powered by FluxBB