LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB microphone shows up in pulseaudio but doesn't work (http://www.linuxquestions.org/questions/linux-hardware-18/usb-microphone-shows-up-in-pulseaudio-but-doesnt-work-4175469865/)

adrianmariano 07-16-2013 06:35 PM

USB microphone shows up in pulseaudio but doesn't work
 
I have a webcam with USB mic that was working fine on a system with Ubuntu 12.04. I ran some upgrades and it stopped working. At this point, I moved the computer over to an updated box with 13.04 on it, figuring it would work there. But actually it is not working there.

Any advice on how to troubleshoot this? If I go into the sound center the device appears on the list, I can select it and it says "on". I very briefly saw it picking up sound and the input level bar flashed with some activity, but it's been dead since then.

I have also tried using skype (which is the eventual goal) and I have no mic there (as expected). For what it's worth, the video is working fine.

DavidMcCann 07-17-2013 02:28 PM

You may need to edit /etc/modprobe.d/alsa-base.conf (or some file name very like that). There used to be a line (the last) which blocked USB sound devices from working: if it's there, delete it and reboot.

If you still have trouble, do lsmod and see if snd_usb_audio is loaded. Ubuntu used to have a dud version which wouldn't load.

zhjim 07-17-2013 03:14 PM

See if the device is recognised. Should be somewhere in /proc/asound/cards.
Also check if alsa-mixer|alsamixer has the sound volume up.

adrianmariano 07-17-2013 04:47 PM

Doing lsmod shows that snd_usb_audio is loaded. On my old box where this worked I have a /etc/modprobe.d/alsa-base.conf that has been installed for 6 months. This file is identical to the same file installed on the machine where it is not working. Presumably, therefore, I don't need to modify this file to get it working.

The usb audio device shows up in /proc/asound. Note that the usb audio device also shows up in pulse audio on the list. I suspect that if it wasn't showing up in /proc/asound or if snd_usb_audio weren't loaded then pulseaudio wouldn't list it.

zhjim 07-18-2013 06:57 AM

Somehow missed the line of yours that its showing up. Did you check alsamixer? Run from command line.

adrianmariano 07-19-2013 07:15 AM

I did run alsamixer, selected the appropriate channel and it is not muted, and the volume is up. What is the relationship between the alsamixer settings and the pulseaudio settings?

I rebooted my machine and when it started up again, the microphone was responsive (as seen in pavucontrol---the level bar was moving). I noticed that I had a strange audio setting, like "stereo output + digital input" for the regular sound card. I switched that to "stereo output" and the mic quit working. (It was still displayed in pavucontrol, but the level bar was not moving.) I switched it back and the mic was still dead. I rebooted and it did *not* work this time. How can I restart the sound system without rebooting?

zhjim 07-19-2013 09:51 AM

Quote:

Originally Posted by adrianmariano (Post 4993153)
I did run alsamixer, selected the appropriate channel and it is not muted, and the volume is up. What is the relationship between the alsamixer settings and the pulseaudio settings?

Alsa is the hardware side of the linux audio system. Pulse audio uses the devices "generated" by alsa.
So with alsamixer you talk directly with the hardware.

Quote:

Originally Posted by adrianmariano (Post 4993153)
I rebooted my machine and when it started up again, the microphone was responsive (as seen in pavucontrol---the level bar was moving). I noticed that I had a strange audio setting, like "stereo output + digital input" for the regular sound card. I switched that to "stereo output" and the mic quit working. (It was still displayed in pavucontrol, but the level bar was not moving.) I switched it back and the mic was still dead. I rebooted and it did *not* work this time. How can I restart the sound system without rebooting?

Actually if the setup with stereo and digital worked I would dig into this some more. There most of the time is an option also for only input and only output usage of a device. So maybe mono input (as a mic should be only mono) and no output setting might work out.

As far as I recall there is no option to do this anymore. once one could restart alsa but it went out of the services (init.d) sometime. But I'm only recalling this from Ubuntu Studio.

adrianmariano 07-19-2013 05:23 PM

The thing that seems confusing about the relationship between alsa and pulseaudio is that alsa entries sometimes appear as sound sources in the playback tab for controlling pulseaudio. This gives me the impression that pulseaudio is perhaps simulating alsa for programs that want to use it directly, and in turn means that when I think I'm doing direct alsa I might not be.

Just to be clear, I have a USB mic only, not a full USB sound system. A regular sound card provides the (stereo) sound output (and incidentally has a line in jack that nothing is connected to). The system configuration that I changed was for the regular sound card, not for the USB sound "card". That system should be providing stereo output. The USB system provides mono input and that is the only configuration option that appears for that system.

I agree that having seen it working I'd like to dig into that, but it's frustrating that changing the setting back didn't restore it to the working state, and that subsequent rebooting also failed to restore it to the working state it was in the previous time I rebooted. At this point I'm not sure *how* to dig into this.

adrianmariano 07-19-2013 11:27 PM

I have discovered that if I go to the pavucontrol pulseaudio configuration tab and turn off the USB sound and then turn it back on---it starts working. It shows activity in the level bar. If I use arecord then it records correctly---but once recording is complete the mic is dead. And in skype activity on the mic stops at the moment that the test call starts recording. This seems rather bizarre. I seem to be able to reliable restart it by toggling the device off and back on in the config tab. But it won't stay on.

zhjim 07-22-2013 01:51 AM

Turning a device on and off again should have the kernel reload the module. Just some more background for all this alsa pulse thing. Normaly programs would talk directly to a sound device. But as design permits only one program is allowed to talk to a device in parrallel. Thats the main reason there are programs like pulse. So pulse emulates hardware for the programs so they can all use one device. Think about pulse as a giant mixer where you can just plugin everything you want and as many. And it all goes out one main output. In this case would be alsa which controls the hardware. But by simulating the hardware comes trouble. Cause normally programs are compiled for uasge with alsa. So now when using pulse they have to be compiled against pulse.

So now we have that out of the way I would go like this.
1.) Make sure all the alse setup is correct.
As you have checked alsamixer and turned up the volume this should be okay.
Else you would have needed to check the output of dmesg if your soundcard would be recognised. And/or check /proc/asound/devices for a list of your cards.
One thing that might have to be done here is to change the input and output device. But I would not touch this but instead do this in pulse. It can be adjusted in both pulse and alsa. Dunno which one is best. But I would go with pulse.
After having alsa setup correct. Just leave it alone. We go one step higher in the chain of audio processing.
2.) Choose the right device for pulse. Don't know if you can use pavucontrol for this. In Ubuntu Studio there is an extra gui for this one. Make sure to set the output device as well as the input device. Also only change one thing at a time. Normally you should go with stereo or mono input without digital. Digital should only be needed for SPDIF connections.
After that use the normal volume controls for your desktop and make sure nothing is muted or too low on volume. Maybe active microphone boost.

I'd say the most important things is not to work in both stages of the sound system. With aplay and arecord you have the controls for alsa, test-speakers also nice. Pulse can be checked with nearly every program. But I'd say a music player would be suited best. Make sure to have the right system selected in the options. Definetly make sure to check the settings of skype for the audio hardware to use.

adrianmariano 07-22-2013 10:03 PM

I tried a skype call and the mic works for a minute or two and then quits. Cycling the device and and off in pavucontrol worked for a while, but then quit working. Quitting skype and cycling the device restored it. This behavior suggests that something more subtle is wrong than a simple configuration mistake.

I looked in /proc/asound/cards which is fairly clear and displays both cards:
Code:

0 [AudioPCI      ]: ENS1371 - Ensoniq AudioPCI
                      Ensoniq AudioPCI ENS1371 at 0xdf00, irq 20
 1 [U0x46d0x992    ]: USB-Audio - USB Device 0x46d:0x992
                      USB Device 0x46d:0x992 at usb-0000:00:1d.7-7, high speed

Lookint at /proc/asound/devices I see this, which I don't know how to interpret:

Code:

  1:        : sequencer
  2: [ 1- 0]: digital audio capture
  3: [ 1]  : control
  4: [ 0- 0]: raw midi
  5: [ 0- 1]: digital audio playback
  6: [ 0- 0]: digital audio playback
  7: [ 0- 0]: digital audio capture
  8: [ 0]  : control
 33:        : timer

I looked at the dmesg output. I see just a few lines relating to the audio/sound system:
Code:

[    9.122192] usb_audio: Warning! Unlikely big volume range (=3072), cval->res is probably wrong.
[    9.122200] usb_audio: [5] FU [Mic Capture Volume] ch = 1, val = 4608/7680/1<6>[    9.122744] usbcore: registered new interface driver snd-usb-audio

I wonder if that warning is a sign of a real problem. I do have a logitech device, and I ran across this:
http://ubuntu.5.x6.nabble.com/3-5-y-...td5028845.html

zhjim 07-23-2013 01:47 AM

Most likely thats the root cause. I'd first would rule out that error and then go on.

adrianmariano 07-24-2013 05:40 AM

It doesn't seem very easy to rule this out. It appears that the patch doesn't address my device, which is 0x0992, and my device isn't on the list that gets the special volume settings in mixer.c. So to test this I need to modify mixer.c myself and recompile the kernel. It's been a long time since I had to compile a kernel...

I saw one post from someone who said his usb mic was working and had quit working and he noticed the same message about volume. I have to admit, though, that it seems odd that a volume resolution setting would lead to the mic working intermittently the way I observe.

zhjim 07-25-2013 01:38 AM

If you at one time had build a kernel I guess you can do it again :). Or can use the ubuntu way like here
Maybe you can give the guy in the link with the kernel patch a shout and ask him if he can incorperate the changes?

I would not rule out that a false volume setting disables a card. Some music progamms shut of the sound if whe have to high volume coming out or in to protect hardware as well as software (read software as your ears). But I dunno if this is a kernel (alsa) thing or just special to those programs.

adrianmariano 07-25-2013 09:47 AM

It's the intermittent behavior that seems odd to me. I would expect a false volume setting to be harmless or to completely disable the "card," not to give intermittent function.


All times are GMT -5. The time now is 01:51 PM.