Bug 7442 - Microphone not working on USB headset
Summary: Microphone not working on USB headset
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Sound (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.11.0
Assignee: Pierre Ossman
URL:
Keywords: relnotes, samuel_tester
Depends on:
Blocks:
 
Reported: 2019-11-21 14:59 CET by Pierre Ossman
Modified: 2019-11-26 15:15 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2019-11-21 14:59:13 CET
Using a USB headset on Linux with ThinLinc isn't working correctly. Playback works fine, but the microphone does not.

Investigation shows that the ThinLinc client doesn't get connected to the default source in the local PulseAudio server. We seem to be getting the first instead, which is usually the onboard sound card. However "parec" works just fine, so there is something different about what ThinLinc does.

Cannot see anything obvious in the code, so need to dig deeper. Might be a bug in the system PulseAudio.
Comment 2 Pierre Ossman cendio 2019-11-21 15:42:12 CET
The bug has something to do with module-stream-restore. It seems to insist on remembering our previously used source even though it shouldn't. More debugging is required.
Comment 3 Pierre Ossman cendio 2019-11-22 11:02:51 CET
The documentation states that NULL as the device will give you the default device. This doesn't seem to be true as this is when module-stream-restore does its magic.

Fortunately you can be more explicit and _really_ request the default device using the magical strings "@DEFAULT_SINK@" and "@DEFAULT_SOURCE@". That should work as a workaround until we can figure out the root bug and fix that.
Comment 4 Pierre Ossman cendio 2019-11-22 13:18:59 CET
I think this part of module-stream-restore is just a solution looking for a problem and needs to be taken out back and shot. It seems to eagerly lock things down and mess it up for the user.

I've reported it upstream:

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/767

Let's see what they think.

But for now we'll try the workaround.
Comment 5 Pierre Ossman cendio 2019-11-22 13:42:47 CET
Another workaround that seems to work is:

1. Connect the client
2. Go in to GNOMEs sound settings.
3. Toggle mute for the input source (the microphone, not just ThinLinc)
Comment 7 Pierre Ossman cendio 2019-11-22 13:52:37 CET
Seems to work better now.

To provoke this, do:

1. Plug in a local analog microphone
2. Start the ThinLinc client
3. Toggle mute in the local GNOME sound settings
4. Stop the ThinLinc client
5. Remove the local analog microphon
6. Plug in a USB microphon
7. Start the ThinLinc client

At this point recording did not work without this fix.
Comment 8 Samuel Mannehed cendio 2019-11-26 15:15:08 CET
(In reply to comment #7)
> To provoke this, do:
> 
> 1. Plug in a local analog microphone
> 2. Start the ThinLinc client
> 3. Toggle mute in the local GNOME sound settings
> 4. Stop the ThinLinc client
> 5. Remove the local analog microphon
> 6. Plug in a USB microphon
> 7. Start the ThinLinc client
> 
> At this point recording did not work without this fix.

We could reproduce the problem with these steps using the 4.10.1 tlclient on Fedora 30 and can verify that build 6306 fixes it.

However, on Fedora 31 we could not reproduce the issue like that. It seems Fedora 31 has some additional magic, making things work a bit better. If you open the GNOME sound settings the microphone used by tlclient is updated. One related issue that we did see on Fedora 31 could be reproduced like this:

 1. Plug in both an analog mic and an USB mic
 2. Use `pactl info` to find the mic that is marked as the "Default Source"
 3. Connect to a ThinLinc session using tlclient
 4. Verify that the default mic works in the session and not the other one
 5. Close the ThinLinc client
 6. Without opening the GNOME settings change the default mic by using pacmd: "pacmd set-default-source <device>"
 7. Verify that the default mic has changed by using `pactl info`
 8. Reconnect to the ThinLinc session
 9. Now the new default mic doesn't work and that the old default mic still works

The above issue on Fedora 31 is also fixed in build 6306. Looks good.

Note You need to log in before you can comment on or make changes to this bug.