Bug 105350

Summary: ID 046d:0802 Microphone needs restart through configuration tab to work
Product: PulseAudio Reporter: Vasilis <btoumbas>
Component: pavucontrolAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: pulseverbose.log
pulseverbose.log.1
test after reboot.wav
test - first profile restart
test - second profile restart.wav

Description Vasilis 2018-03-05 20:03:26 UTC
I have ID 046d:0802 Logitech, Inc. Webcam C200


My machine is:

Intel Core2 CPU 6300 1.86GHz ‖ RAM 1997 MiB ‖ ASUS INC. P5B-VM
nVidia G73 [GeForce 7300 GT] [10de:0393] {nvidia}
wlx14cc2016487d: 0bda:8178 Realtek RTL8192CU 802.11n WLAN Adapter ⋮ enp2s0: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 01)


After every reboot I have to operate my microphone twice,through configuration tab, in order to make it usable.

This computer runs Lubuntu 17.10.
Comment 1 Tanu Kaskinen 2018-03-06 12:38:57 UTC
Does the microphone appear in the "Input Devices" tab of pavucontrol before the microphone restart? By "restart", do you mean setting the card profile to "Off" and then back to "Analog Input" (or whatever the profile is called)?

The verbose server log would be interesting. To get the log, put this to /etc/pulse/daemon.conf:

log-target = newfile:/tmp/pulselog.txt
log-level = debug

After reboot there should be file /tmp/pulselog.txt, and quite possibly also /tmp/pulselog.txt.1, /tmp/pulselog.txt.2 etc. If there are multiple files, attach the file with the highest number. (Please use the "Add an attachment" link. Sometimes people paste the log into the comment box, which makes it hard to read the discussion.)

To return things back to normal, undo the changes in daemon.conf.
Comment 2 Vasilis 2018-03-06 21:35:56 UTC
Created attachment 137841 [details]
pulseverbose.log
Comment 3 Vasilis 2018-03-06 21:36:34 UTC
Created attachment 137842 [details]
pulseverbose.log.1
Comment 4 Vasilis 2018-03-06 21:37:20 UTC
Tanu, exactly!

Microphone does appear in the "input devices" and by restart I set card profile to "off" and then back to "Analog Input mono"!

Unfortunately I couldn't generate the log with your instructions but, I followed "Logging startup (advanced)" guide from:

https://wiki.ubuntu.com/PulseAudio/Log


Before powering off this card profile, input devices "sound level bar" react really slow compared with normal mic behavior!
Comment 5 Tanu Kaskinen 2018-03-07 11:07:42 UTC
I didn't see anything unusual in the log. It's strange if switching the profile is required. The source will suspend itself after being idle for a while, and I'd expect that to reset the kernel driver or the hardware equally well as a profile switch. Running pavucontrol prevents the source from suspending, but the log showed that the source was idle for long enough to suspend before you opened pavucontrol. So at least one suspension isn't enough.

Could you try the following:

After a reboot, check that the microphone is suspended with this command:

    pactl list sources short | grep usb

At the end of the line it should say SUSPENDED. If it says RUNNING or IDLE, wait for a few seconds and run the command again. If it's not changing to SUSPENDED, something is keeping the microphone open. Don't run pavucontrol, since it will keep all devices open all the time.

When you've checked that the microphone is suspended, record some audio from it with this command:

    parecord --device=alsa_input.usb-046d_0802_033D4660-02.analog-mono test.wav

Does that work? Is the audio ok? If it doesn't work, wait until the microphone is suspended again and try again. Repeat this a couple of times. If it doesn't start to work, then clearly suspending is not sufficient. Then try these commands:

    pactl set-card-profile alsa_card.usb-046d_0802_033D4660-02 off
    pactl set-card-profile alsa_card.usb-046d_0802_033D4660-02 input:analog-mono

That should have the same effect as changing the profile in pavucontrol. Does recording audio with parecord now work?
Comment 6 Vasilis 2018-03-07 19:36:51 UTC
Created attachment 137872 [details]
test after reboot.wav

 pactl list sources short | grep usb
1	alsa_input.usb-046d_0802_033D4660-02.analog-mono	module-alsa-card.c	s16le 1ch 48000Hz	SUSPENDED
Comment 7 Vasilis 2018-03-07 19:45:18 UTC
Created attachment 137873 [details]
test - first profile restart
Comment 8 Vasilis 2018-03-07 19:50:25 UTC
Created attachment 137874 [details]
test - second profile restart.wav

test - second profile restart.wav
Comment 9 Tanu Kaskinen 2018-03-10 17:11:23 UTC
So "test after reboot.wav" and "test - first profile restart.wav" play too fast, but "test - second profile restart.wav" is fine.

The file names say "profile restart", but I'm not sure what you mean by that. I requested that you don't change the profile until you have tested a few times without changing the profile, so are all three files recorded without changing the profile at any point?

What if you just wait for a while after reboot, does the microphone work with the first try? Or is it really so that the first two recordings will always fail, no matter how long you wait, and from the third recording onwards things start to work?
Comment 10 Vasilis 2018-03-13 21:24:35 UTC
Excuse my recklessness Tanu! I was so excited to show you a view of this mic behavior! 

I did not checked suspending sufficiency and proceeded changing the profile in pavucontrol with those commands you provided to me! 

But I'm pretty sure, although I lack your tecnical knowledge, that is suspension problem because I tried numerous times to use duolingo's microphone feature in the past!

Should I follow your directions and record some audio once more?
Comment 11 Tanu Kaskinen 2018-03-14 19:33:08 UTC
Yes, it would be good to do some more testing. The purpose is to figure out what exactly makes the microphone work. It seems unlikely that a profile switch is really required.

So, in summary: after rebooting, don't open pavucontrol or other audio programs, just record a bit of audio with parecord a few times. Before each recording, check that the source is suspended with the pactl command I gave earlier. If all of the recordings are bad, then switch the profile with pactl (still don't open pavucontrol) and try again. If that fixes the audio, then that suggests that a profile switch is indeed required (though I don't understand why that would be the case).

Also try the other thing I suggested: after a reboot, wait for a while without doing anything and then try recording. Maybe the hardware just takes some time to initialize itself properly.

(Note that in the end you're most likely going to file a bug for kernel/alsa, since this doesn't sound like anything that PulseAudio would be causing.)
Comment 12 GitLab Migration User 2018-07-30 09:30:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/31.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.