Show OSD when default output changes
ClosedPublic

Authored by broulik on Tue, Apr 10, 10:38 AM.

Details

Summary

When the default output changes because a device is plugged in or a Bluetooth headset is connected, show an OSD so the user knows when/that the device is ready to use.

Test Plan

Turned on my Bluetooth headset, took a second two connect (Bluetooth Icon shows dots), and then took another couple of seconds for PulseAudio to recognize the device and then the OSD showed up.
If a device icon is available (e.g. headset) it is shown, otherwise the volume icon (using the correct icon depending on volume) shows up:


  • Verified that no OSD is shown on startup (the default changes once from none to whatever is the default)
  • Verified that no OSD is shown when user explicitly changes the Default in the applet
  • Did not test what happens if I plug in headphone jack (where the profile on the same device changes from speaker to headphones) Plugging in headphone jack also shows an OSD here, the device doesn't have a different icon, though, but could be that a newer PulseAudio version sets formFactor more often
  • Changing default device in applet or changing output configuration will also emit an OSD (not really a way to prevent that as it's all asynchronous and different parts of the stack involved in that)

There's a setting in the applet, default is enabled:

Diff Detail

Repository
R115 Plasma Audio Volume Applet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Tue, Apr 10, 10:38 AM
Restricted Application added a project: Plasma. · View Herald TranscriptTue, Apr 10, 10:38 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Tue, Apr 10, 10:38 AM
broulik edited the test plan for this revision. (Show Details)Tue, Apr 10, 10:52 AM
drosca requested changes to this revision.Tue, Apr 10, 10:53 AM
drosca added inline comments.
applet/contents/ui/ListItemBase.qml
284 ↗(On Diff #31797)

It's possible that changing the sink will fail and pendingPreferredSinkChange will stay true until next sink change (which may not be user-initiated).

applet/contents/ui/main.qml
158

It won't work when default sink is changed from KCM, so I think let's just show the OSD every time (except startup)?

This revision now requires changes to proceed.Tue, Apr 10, 10:53 AM
broulik updated this revision to Diff 31800.Tue, Apr 10, 12:21 PM
broulik edited the test plan for this revision. (Show Details)
  • Use default sink instead of preferred sink as the latter also changes depending on where music is being played
drosca accepted this revision.Tue, Apr 10, 12:27 PM
This revision is now accepted and ready to land.Tue, Apr 10, 12:27 PM
This revision was automatically updated to reflect the committed changes.