Microphone plays thro speakers but dead in audacity and skype
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Microphone plays thro speakers but dead in audacity and skype
Hi,
I've got a weird problem with my sound card config.
I usually use a USB webcam with a built-in mic that works fine when I select it in audacity and skype, but I have a soundcard too and I just wanted to check out another microphone I've got.
I plugged it in and played around with alsamixer and managed to get it so that I can hear it through the speakers, but I can't use it in audacity and skype.
There are 3 options (apart from the USB mic) in audacity, and all of them are dead silent. In skype there are even more options for the mic. Same problem.
Audacity has recording device choices of ALSA HDA Intel ALC882 Analog hw:0,0, hw:0,1 and hw:0,2
How can I get the microphone to appear in that list - or is it already one of those options but somehow not configured right? I can't figure out the Alsa config stuff despite reading several introductions to it. Probably too late at night for my brain.
Plus the last symptom - I broke the sound coming from a java app while fiddling with this setup. It used to give alerts and alarms quite frequently, but since yesterday it's been silent, with errors in the log like
"Error: Sound line is not available.javax.sound.sampled.LineUnavailableException: line with format PCM_UNSIGNED 11025.0 Hz, 8 bit, mono, 1 bytes/frame, not supported. "
If anyone here can tell me what's wrong, I'd be massively grateful!
Mencoder seems to always assumes the abilities of the capture device, even when drawing an element (audio) from another source with different abilities. ffmpeg does audio better in this regard. But not quite there either. Lots of options depending on your configuration. jackd / artsd / pulse audio / esd / ???
Hi, thanks for replying. You mean Edit -> Preferences in Audacity? That's the problem: none of the options that I select in Audacity are the microphone on the hardware. It shows
ALSA HDA Intel ALC882 Analog hw:0,0
ALSA HDA Intel ALC882 Analog hw:0,1
ALSA HDA Intel ALC882 Analog hw:0,2
USB xxxx x xx x
Choosing any of those doesn't work. It's like they're not the hardware, but I don't know why it decided they are the hardware and put them in its options for selection.
I have a problem working out what linux is doing here. It seems that there's this list of hardware with chip names on the one hand, and there's a long list of controls in my desktop/window manager:
Master, PCM, Front, Front Mic, Front Mic Boost, Surround, Center, LFE, Side, Line, CD, Mic, Mic Boost, Capture, Capture.1, Capture.2, Digital
I can adjust the volume of the mic using Mic and Mic Boost. but it makes no difference to Audacity.
There are also three option boxes in my desktop volume control called Input Source, Input Source.1 and Input Source.2
These 3 have the same options: Mic (selected), Front Mic, Line, CD
So I don't know how to get the configuration configured properly - I believe this is ALSA - I'm pretty sure I'm not using any of jackd, artsd, pulse audio or esd. No: just grepped lsmod for them. None present.
where pcm0c is capture and pcm0p is playback. From what I recall 0,0 and 0,1 and such are basically different names for the playback and capture parts of the device. If you setup a ~/.asoundrc file it should list what you list in there. i.e. logical / humanized names.
$ amixer
(lists your various channels)
$ alsamixer
(lets you change those channels)
(F1 for help / TAB to toggle between playback and capture channels / ESC to exit)
I use aumix myself. When it works / runs. There's an obvious red button (or green) to select your recording device as it may not be the microphone and it is selectable. If you have multiple cards -c # for the alsa apps to choose a different card. Default is 0 and assumed. Which might not be what you want. # is based on what's listed in /proc/asound/cards.
What mic are we talking about? In monitor mic? Some small electret mic plugged into the mic port. NOTE: those require a small voltage only available in the mic port. And not all devices supply it. i.e. it may all be working as designed, but you mic is OFF for all intents. If the mic is plugged into the line input that has no voltage (or at least shouldn't). And otherwise expects a rather hot line level signal. Or are we talking some other mic type?
cat /proc/asound/cards
0 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xfebfc000 irq 16
1 [U0x46d0x9a4 ]: USB-Audio - USB Device 0x46d:0x9a4
USB Device 0x46d:0x9a4 at usb-0000:00:1d.7-7, high speed
So those are my cards. I can really understand that!
Then for Intel:
adam@isengard:~/junk$ ls /proc/asound/card0
codec#0 id pcm0c pcm0p pcm1c pcm1p pcm2c
So it has 3 capture devices. Those are obviously the 3 listed by Audacity, and the hw:0,0 must refer to card0, device0 and so on, right?
Then in amixer I see controls:
[....]
Simple mixer control 'Front Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 24 [77%] [1.50dB] [on]
Front Right: Playback 24 [77%] [1.50dB] [on]
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: 2 [67%]
Front Right: 2 [67%]
[....]
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'CD'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'CD'
Simple mixer control 'Input Source',2
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Front Mic'
I don't understand how I am meant to use that info to configure the chips that are mentioned in Audacity and listed in /proc/asound/cards. This amixer output is different to the xfce volume control that I quoted in my first message. It looks to me as if it's reading from a different computer. Does Item0: 'CD' mean that it's streaming sound from the CD? Argh, confusion!
Simple mixer control 'Front Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 24 [77%] [1.50dB] [on]
Front Right: Playback 24 [77%] [1.50dB] [on]
Note the [on]
What's plugged into the pink mic port? You might consider plugging your CD players headphone out in there at a very low volume (1 of 10 for line level 0.5-ish of 10.0 for mic). Just to make sure that it's something hardware after the jack that's the issue. Not all mic ports provide the plugin power needed for some mics. You might need a battery box to bridge that gap. Or a mic that takes a battery and has a good one in it.
It does say FRONT mic. Is your mic plugged into the FRONT mic port? My setup just says Mic.
$ amixer -c 1
To see the USB abilities. Logitech Quickcam E 3500 by the looks of the vendor:device value. Which mic / device are you trying to use? uvcvideo module for the webcam. I'm not sure of the state of audio on the one though. My Sanyo FH1 functions under that module and I have no audio abilities that route that I know of.
I'm really sorry, but I edited too much out of the amixer output.
Not only is there "Front Mic" with "[on]" but there is also:
Simple mixer control 'Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 25 [81%] [3.00dB] [on]
Front Right: Playback 25 [81%] [3.00dB] [on]
this one is the control for the mic, I know because changing the volume control in the xfce gui mixer controls it.
it is plugged into the pink port and the input is channeled through to the speakers where I can hear it. So I don't think it needs power.
Not massively useful and I'd like to be able to use it in Audacity or Skype!
The USB webcam mic is also enabled and I can select that in Audacity or Skype if necessary.
However, I still have zero idea whether the "Input Source" devices are relevant for instance, and how to get this mic to appear as one of the options in Audacity and Skype etc. I've still got a fundamental disconnect on my system (and in my brain unfortunately)
Last edited by TreeHugger; 05-27-2010 at 06:21 PM.
The default behavior should NOT be to play mic input through the speakers. That will result in feedback. Past certain levels anyway. i.e. move said mic towards said speakers and see for yourself. It's probably already showing up in audacity. You're just not recognizing it. Or maybe your user isn't in the audio group and doesn't have permissions? It happens. Not likely since you have other access to it.
I guess one should ask. What version of audacity? What hardware mic? Perhaps it's hardwired into the line input or cdrom channel(s).
# apt-get install aumix-gtk
$ aumix -q
The one with the R is set as the recording device. In aumix terminology, mic + igain need to be > 0 to have your mic work. If it's tied into some other channel, running the aumix gui puts a little box next to channels that are selectable as recordable from. This is the only way I'm able to select PCM as input to capture output from festival and other odd sources. You can also do it at the cli.
$ aumix -q
$ aumix -v R
$ aumix -q
$ aumix -m R
$ aumix -q
(aumix -h) Should list what each -X represents. And other information. Alsamixer should list all of your channels (where aumix might not). But I've never had any luck changing the selected record from channel with alsamixer. And other quirkiness. When aumix works, it's a pretty nice way to make adjustments. More so than kmix, gmix and others as aumix also works on the console alone without a gui. Just another option that might help you sort out which end is up. If you make changes in aumix, they should show up in the results of amixer. You can actively change things in aumix while running audacity without having to restart audacity. If you want to just keep pushing buttons until something works.
Thanks for your post, a lot of it makes sense - although I still don't grasp the heart of the matter. For instance, I think I threw a spanner in the works somehow because when I run aumix, it says "aumix: error opening mixer: No such file or directory"
There is no /dev/mixer (which it wants by default), and the only info I can find on substituting /dev/mixer is to use OSS and /dev/dsp which doesn't sound right (sorry, bad metaphor!) - that info was from 2000 anyway.
Secondly, I checked all the input devices shown in audacity and none of them work and now also the USB mic makes audacity throw an error message "error while opening sound device: please check input device settings and project sample rate"
I think this error with the USB mic might be related to the java problem, which can't use sound anymore since I started trying to configure this properly.
Audacity is v1.3.5-beta and the mic hardware is plugged into the pink socket on the motherboard.
I should write down everything I do when I start doing something in linux that I don't know about - but of course I always think it'll be ok.
Last edited by TreeHugger; 05-28-2010 at 05:23 AM.
Running alsaconf and other things might help. I've always done it full manual myself. But I generally had odd soundcards that alsaconf never quite worked for. Many means to an end. aumix shouldn't fail, it's one of the more *cough* stable *cough* mixer apps I've used. Now if you have multiple soundcards it might not behave as expected, but it shouldn't fail.
# find /lib/modules/`uname -r`/ -iname '*snd-*'
I have:
/dev/mixer
/dev/dsp
/dev/audio
/dev/sequencer
and variants with 1 and 2 tagged on. atiixp + atiixp-modem + usb-audio in my case. And a few other audio group stuff. timer, rtc, pcmC* controlC*, .......
Actually I never realised oss was a part of alsa. I thought alsa replaced it.
Anyway, the alsa-base alsa-tools alsa-utils and libasound2 packages were already installed. I just installed libasound2-dev.
I ran alsaconf.
And then I started trying the mixers, and aumix wouldn't work with the 'error opening mixer'. Since inserting the modules before had worked, I loaded those 3 modules again and it recreated /dev/mixer and aumix then worked. The volumes looked to be set ok and nothing was muted, although there were not as many devices shown as by xfce-mixer.
So running alsaconf unloaded the modules and didn't reload them. I guess i need to put them into my config - in /etc/modules is that right?
Now audacity: instead of the input showing nothing, just a flat line, it now records fuzz and it picks up input from the mic but at a lower volume than the fuzz, on ALSA: default.
The other options for the input device have changed now, I have some OSS: devices - but they cause errors if I try using them.
I have the mic levels set to 80/100 in the mixer and the mic boost at 100.
The mic input also still goes straight to the speakers.
The java app can't use sound either and throws errors.
On a positive note though, the USB mic is working again.
Arrrghgh! I have now just managed to lose that input channel in audacity. Instead of fuzz and a really low volume mic level, I'm just getting a flat line with zero sound.
I guess that's enough random configuration nonsense for one message. Does it make any more sense?
How about some output from amixer, if that helps:
adam@isengard:~$ amixer
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 31
Mono: Playback 23 [74%] [-12.00dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pswitch
Playback channels: Front Left - Front Right
Mono:
Front Left: Playback [on]
Front Right: Playback [on]
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 'Front',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 23 [74%] [-12.00dB] [on]
Front Right: Playback 23 [74%] [-12.00dB] [on]
Simple mixer control 'Front Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 26 [84%] [4.50dB] [on]
Front Right: Playback 26 [84%] [4.50dB] [on]
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: 3 [100%]
Front Right: 3 [100%]
Simple mixer control 'Surround',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 23 [74%] [-12.00dB] [on]
Front Right: Playback 23 [74%] [-12.00dB] [on]
Simple mixer control 'Center',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 31
Mono: Playback 23 [74%] [-12.00dB] [on]
Simple mixer control 'LFE',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 31
Mono: Playback 24 [77%] [-10.50dB] [on]
Simple mixer control 'Side',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 24 [77%] [-10.50dB] [on]
Front Right: Playback 24 [77%] [-10.50dB] [on]
Simple mixer control 'Line',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 23 [74%] [0.00dB] [on]
Front Right: Playback 23 [74%] [0.00dB] [on]
Simple mixer control 'CD',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 24 [77%] [1.50dB] [on]
Front Right: Playback 24 [77%] [1.50dB] [on]
Simple mixer control 'Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 24 [77%] [1.50dB] [on]
Front Right: Playback 24 [77%] [1.50dB] [on]
Simple mixer control 'Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 3 [100%]
Front Right: 3 [100%]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Mono
Capture channels: Mono
Mono: Playback [on] Capture [off]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 18 [58%] [15.00dB] [on]
Front Right: Capture 18 [58%] [15.00dB] [on]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 19 [61%] [16.50dB] [on]
Front Right: Capture 19 [61%] [16.50dB] [on]
Simple mixer control 'Capture',2
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 31
Front Left: Capture 17 [55%] [13.50dB] [on]
Front Right: Capture 17 [55%] [13.50dB] [on]
Simple mixer control 'Digital',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 120
Front Left: Capture 67 [56%] [3.50dB]
Front Right: Capture 67 [56%] [3.50dB]
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Line'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Front Mic'
Simple mixer control 'Input Source',2
Capabilities: cenum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'CD'
adam@isengard:~$
Last edited by TreeHugger; 05-29-2010 at 06:35 AM.
Alsa "emulates" OSS with the snd-oss-* modules. And many apps (including web browsers) still assume OSS devices. As they have not been modernized to handle alsa natively or jackd or esd, pulse audio, artsd, .. . . . . . . You can start said apps with esddsp -m and artsdsp or even aoss to wrap them up and enable audio sharing. But not all apps take kindly to it, and in the case of browsers, when a child window is launched it's NOT wrapped up like the parent. And your efforts are otherwise defeated. Although audacity (if compiled with --port-audio= / not a default) should handle alsa natively.
Alsa should auto load when you try to use it if properly configured. This generally happens at boot when the mixer tries to restore settings. And like I said, I generally go full manual because alsaconf almost never works for me.
It sounds like you're missing your alsa configuration. Formerly /etc/modules.conf, but these days is broken into parts in /etc/modprobe.d/*. Probably in /etc/modprobe.d/alsa-base if you're using your distro's configuration(s). Adding the oss modules in /etc/modules isn't a bad ideal, but it's not necessary if properly configured. As I realize why I went full manual in the first place. Even my distros defaults lack mention of oss. A fairly recent install for me (late april 2010) so I guess I'll follow my own advice. This probably explains why Muse was misbehaving when I gave it a whirl.
In short replace your /etc/modprobe.d/alsa* with
Code:
alias char-major-116 snd
alias char-major-14 soundcore
options snd major=116 cards_limit=3
#---START--- machine specific ---#
options snd-atiixp index=0
options snd-atiixp-modem index=1
options snd-usb-audio index=2
alias snd-card-0 snd-atiixp
alias snd-card-1 snd-atiixp-modem
alias snd-card-2 snd-usb-audio
#--- END --- machine specific ---#
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss
alias sound-slot-2 snd-card-2
alias sound-service-2-0 snd-mixer-oss
alias sound-service-2-1 snd-seq-oss
alias sound-service-2-3 snd-pcm-oss
alias sound-service-2-8 snd-seq-oss
alias sound-service-2-12 snd-pcm-oss
Replacing the primary module specific to your card where appropriate. Once replaced /etc/init.d/alsasound stop (and start or just restart) should load the OSS stuff automagically. (in theory).
# mv /etc/modprobe.d/alsa* /home/user/
# mv /home/user/alsa_custom /etc/modprobe.d/
(the above code chunk customized to YOUR cards)
# /etc/init.d/alsa-utils stop
# /etc/init.d/alsa-utils start
$ alsamixer -c 0
$ lsmod
Note the index=# portion. You can re-arrange your soundcards by modifying that. OSS based applications (web browsers / festival / ...) will always default to card 0. Even if your .asoundrc includes the "defaults.pcm.card #" option to NOT default to card 0. Otherwise applications that use alsa natively will obey your commands / configuration.
Just trying to wrap timidity to play some midi files on the other soundcard.
Well I hope you're not hoping that I can help :lol:
Much as I'd like to, I am still way behind on the path to alsa enlightenment.
It still bugs me that amixer, xfce-mixer, alsamixer, aumix, audacity, skype etc all show variations in the number and names of the devices, as if they're reading from different configurations. At least they keep the same level for the master so it must be coming from the same place.
And none of them can control the USB mic volume.
But anyway, I moved my alsa-base out the way and put your config (with card snd-hda-intel) into /etc/modprobe.d/alsa-custom and restarted alsa.
It made no difference to audacity and the mic.
I also then did a system reboot to see if the modules would be automatically loaded and unfortunately they weren't.
But my browser with youtube and flash and all that seems fine, as before.
Have you got any idea what the problem with the java output error could be? (Audio device unavailable)
And just to recap, the input from the non-USB mic is still going straight to the speakers, and in fact I've lost the ability to hear it at all in audacity anymore (wracking my brain to work out what I did to enable it there, even at that low volume).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.