Bug 434976 - [PipeWire] Switching to internal speaker impossible after unplugging default output
Summary: [PipeWire] Switching to internal speaker impossible after unplugging default ...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma-pa
Classification: Plasma
Component: applet (show other bugs)
Version: 5.21.3
Platform: Fedora RPMs Linux
: HI normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-03-26 14:23 UTC by Bernie Innocenti
Modified: 2022-01-23 02:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernie Innocenti 2021-03-26 14:23:19 UTC
SUMMARY

When the default output is unplugged (for example by disconnecting an external HDMI output), the applet correctly detects the unplug event and removes the output, but sound doesn't automatically switch back to the internal speaker.

Furthermore, there's no way to switch manually because the radio buttons disappear when there's a single output left.

STEPS TO REPRODUCE
1. Connect an external HDMI monitor
2. Switch sound to the HDMI output using the radio buttons of the audio applet
3. Unplug the HDMI monitor

OBSERVED RESULT
 - The HDMI output is removed (correctly)
 - The radio buttons are also removed (correctly, since there's a single output)
 - However, sound isn't playing through the internal speakers

EXPECTED RESULT
 - Sound should either automatically switch to the only remaining output OR it should be possible to select it manually

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80
Qt Version: 5.15.2

ADDITIONAL INFORMATION

NOTE: This is happening on Fedora 34 beta, which recently switched to PipeWire.
Comment 1 r.kunschke 2021-06-15 08:28:52 UTC
I have this issue too but found this issue too late. https://bugs.kde.org/show_bug.cgi?id=438604
hope this behavior gets fixed soon
Comment 2 Nate Graham 2021-06-15 14:47:46 UTC
This is a PipeWire bug; please report upstream. It bugs me too. :)
Comment 3 Nate Graham 2021-06-15 14:48:07 UTC
Oops, wrong bug report.
Comment 4 Nate Graham 2021-06-15 14:48:49 UTC
Possibly an upstream issue because the active/default output should switch automatically; see Bug 438604.

However maybe there's something we can do in this case anyway.
Comment 5 Nicolas Fella 2022-01-22 13:54:05 UTC
Please report this to Pipewire. Plasma is not involved in determining where audio should play, except for the case where the user explicitly moves a stream. But even then it should be PipeWire's responsibility to ensure that the stream is switched away once the device becomes unavailable

> However maybe there's something we can do in this case anyway.

I really really don't want Plasma to do any kind of "Business logic" about what should happen in such cases. It would only lead to conflicts, chaos, and confusion with PipeWire's builtin handling
Comment 6 Bernie Innocenti 2022-01-23 02:08:22 UTC
(In reply to Nicolas Fella from comment #5)
> Please report this to Pipewire. Plasma is not involved in determining where
> audio should play, except for the case where the user explicitly moves a
> stream. But even then it should be PipeWire's responsibility to ensure that
> the stream is switched away once the device becomes unavailable
> 
> > However maybe there's something we can do in this case anyway.
> 
> I really really don't want Plasma to do any kind of "Business logic" about
> what should happen in such cases. It would only lead to conflicts, chaos,
> and confusion with PipeWire's builtin handling

I understand and strongly agree: putting policy and bug workarounds in the UI layer would be the wrong solution.

The behavior changed slightly in the current Fedora Rawhide (pipewire-0.3.43 + plasma-pa-5.23-90):

1. Connect a laptop to an external HDMI monitor
2. Switch sound to the HDMI output using the radio buttons of the Audio Volume applet's menu
3. Unplug the HDMI monitor
4. As previously reported, the sound does not automatically switch back to the laptop's internal speakers
5. Open the Audio Volume menu by clicking on the icon
6. The sound immediately returns to the speakers (no need to interact with the controls)

So it looks like plasma-pa *is* doing something to switch the sound output... it just doesn't do it when pipewire sends the unplug event.