Bug 392103 - Enable switchOnConnect by default
Summary: Enable switchOnConnect by default
Status: REOPENED
Alias: None
Product: plasma-pa
Classification: Plasma
Component: general (show other bugs)
Version: 5.12.3
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords: usability
: 378018 413283 417901 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-20 14:45 UTC by Nate Graham
Modified: 2024-01-23 10:14 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-03-20 14:45:26 UTC
The fact that audio doesn't automatically switch to a newly-connected output device is a source of confusion and frustration for a lot of new users, and represents a usability papercut that falls under https://phabricator.kde.org/T6831.

We should consider enabling switchOnConnect by default.
Comment 1 David Rosca 2018-03-20 15:37:47 UTC
module-switch-on-connect conflicts with module-device-manager which is loaded by default in Plasma (see /usr/bin/start-pulseaudio-x11).
Disabling module-device-manager would mean that the entire "Audio/Video settings" KCM (phonon) won't work anymore.
Comment 2 Nate Graham 2018-03-20 16:05:30 UTC
Are you saying that the setting in the KCM itself doesn't actually work because it conflicts with something else?
Comment 3 David Edmundson 2018-03-20 16:48:11 UTC
he's saying if you turn this setting on, you break all of something else.
Comment 4 David Edmundson 2018-03-20 16:50:01 UTC
Also, it's not necessarily a better default.

I had a monitor in an office with inbuilt speakers, I still wanted audio to come out my headphone jack.

I'm not convinced you'd have fewer complaints, they'd just be from a different group.
Comment 5 Nate Graham 2018-03-20 16:56:37 UTC
> he's saying if you turn this setting on, you break all of something else.

If that's the case, should the setting even exist? This smells like a deeper bug.

> I had a monitor in an office with inbuilt speakers, I still wanted audio to come out my headphone jack.

If you plugged in your headphones last, then the audio would/should come out of them, right?
Comment 6 David Edmundson 2018-03-20 18:17:57 UTC
>If you plugged in your headphones last, then the audio would/should come out of them, right?

Unfortunately not.
Comment 7 Nate Graham 2018-03-20 18:20:09 UTC
That seems like another bug that needs fixing, then. I don't have hardware that can replicate that setup; could you file a bug for the issue if you still do?

I'll mention that the use case of plugging headphones into my laptop and having the audio automatically transferred there works fine for me, even without this setting turned on. But maybe that's because the internal speakers and headphones are both on the same device?
Comment 8 David Rosca 2018-03-20 20:06:26 UTC
> That seems like another bug that needs fixing, then. I don't have hardware that can replicate that setup; could you file a bug for the issue if you still do?

What bug? That's a behavior of pulseaudio itself and I don't really see any issue with it. Both modules (switch-on-connect and device-manager) are trying to do the same thing (automatic routing of streams), so it makes sense that they conflict with each other.

Audio/Video KCM interacts directly with the module-device-manager, so it is also expected to not be working when you unload this module from pulseaudio.
Comment 9 David Edmundson 2018-03-20 21:04:45 UTC
>But maybe that's because the internal speakers and headphones are both

Yes. Which is also why it's not a bug that it doesn't auto switch back. The sound card of my laptop doesn't get added when I plug something into the jack.

I don't like bug reports in the form of proposing a solution rather than in the form of a bug so I'm closing this.
Comment 10 Nate Graham 2018-03-21 04:34:22 UTC
OK, here's a bug report that describes the bug without proposing a solution: https://bugs.kde.org/show_bug.cgi?id=392117

In the process, I learned a lot about PulseAudio, so thanks for pushing me a bit.
Comment 11 Nate Graham 2019-08-28 17:56:12 UTC
The Phonon KCM has now been removed, so there is no longer a technical barrier to implementing switch-on-connect.  Any remaining objections are whether or not the user experience is better than the current one. Re-opening the bug so we can have that discussion.

If I'm understanding correctly, the objection to switch-on-connect is that if the user plugs in a new device such as an HDMI monitor whose transport protocol has both audio and video capabilities, but the device does not actually have speakers capabilities, then switch-on-connect behavior will inappropriately cause audio to be inappropriately routed there anyway, effectively muting the system.

If this is accurate, is there any way we can add some more intelligence to detect devices that could-but-don't handle audio output and avoid automatically switching to them? Or would that have to be done in the PulseAudio switch-on-connect module itself? Or something else?
Comment 12 David Edmundson 2019-08-28 19:44:29 UTC
>then switch-on-connect behavior will inappropriately cause audio to be inappropriately routed there anyway, effectively muting the system.

That wasn't my gripe last time this came up. Even if it has speakers I still didn't want to disable my laptops headphone jack. 

I haven't retested the behaviour of that.

That's a reason for it to still be an option, doesn't necessarily mean it's reason for it to not be default.

>Would that have to be done in the PulseAudio switch-on-connect module itself?

It would.

---

I also don't know how we would (in any non terrible way) enable this by default on the client side.
Comment 13 Nate Graham 2020-01-31 15:58:48 UTC
*** Bug 413283 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2020-01-31 16:20:25 UTC
*** Bug 378018 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2020-02-20 23:34:50 UTC
*** Bug 417901 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2020-06-16 00:53:51 UTC
As I understand it, the only remaining objection to doing this by default is that HDMI devices would be automatically switched to (whether or not they can play audio), which would be very annoying. The changelog for PulseAudio 14 indicates that HDMI are now excluded from switch-on-connect behavior: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/14.0/ (https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/225).

With that done, perhaps we will be able to enable this behavior by default.
Comment 17 Harald Sitter 2024-01-23 10:14:09 UTC
Needs re-investigation with pipewire :|

There is also the question why upstreams don't enable it.