Bug 422612 - Don't display devices with a single unplugged port
Summary: Don't display devices with a single unplugged port
Status: RESOLVED FIXED
Alias: None
Product: plasma-pa
Classification: Plasma
Component: applet (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Nate Graham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-08 05:35 UTC by Nate Graham
Modified: 2020-06-19 05:07 UTC (History)
3 users (show)

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


Attachments
Messy audio device display (761.59 KB, image/png)
2020-06-08 05:35 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-06-08 05:35:20 UTC
Created attachment 129134 [details]
Messy audio device display

My new laptop--a Lenovo ThinkPad X1 Yoga--has a very messy audio device selection in the plasma-pa KCM and applet. It displays three devices for HDMI/DisplayPort audio (two for the two Thunderbolt+DisplayPort ports, and one for the HDMI port). Each of these devices has a single port, which is listed as "unplugged" in pavucontrol, accurately reflecting their status.

We should consider filtering out devices with a single port that is listed as "unplugged" because interacting with them does nothing and therefore they are simply visual clutter.
Comment 1 Nate Graham 2020-06-10 18:13:20 UTC
A kernel update fixed this issue. I guess lower in the stack is the right place to go when you've got this problem.
Comment 2 Nate Graham 2020-06-11 02:19:12 UTC
Nah, that's not correct. Re-opening since it's still sometimes relevant.
Comment 3 Nate Graham 2020-06-12 20:22:28 UTC
Submitted a merge request for this: https://invent.kde.org/plasma/plasma-pa/-/merge_requests/5
Comment 4 Nate Graham 2020-06-13 03:02:42 UTC
*** Bug 422733 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2020-06-19 05:07:51 UTC
Git commit 6611ff9e89ecedbedb38c630ece042d57832f72c by Nate Graham.
Committed on 19/06/2020 at 05:07.
Pushed by ngraham into branch 'master'.

Filter out currently unused devices

Right now devices that have only a single unplugged port are visible in the applet and the KCM.
For all intents and purposes, these devices are useless as they are inactive and unused.
Therefore, let's filter them out so they're not distracting and confusing to the user. An option
to see them all again is provided in the KCM on the off chance that a person needs to configure
the volume or balance of an unused device *before* it's used.

This patch is principally aimed at people using hardware where PulseAudio represents multiple
input and output sources as separate devices rather than separate ports of the same device.
I asked the PA people about this and they said that for certain hardware, it's intentional,
and the correct approach is to filter out the unused devices over here [1]. So, that's what
this patch does.

Thanks to @nicolasfella for his help with getting the initial prototype working!

FIXED-IN: 5.20

[1] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/913

M  +3    -11   applet/contents/ui/main.qml
M  +2    -2    src/kcm/package/contents/ui/Applications.qml
M  +2    -0    src/kcm/package/contents/ui/DeviceListItem.qml
M  +37   -2    src/kcm/package/contents/ui/Devices.qml
M  +2    -2    src/kcm/package/contents/ui/main.qml
M  +3    -2    src/pulseaudio.h
M  +24   -3    src/qml/PulseObjectFilterModel.qml

https://invent.kde.org/plasma/plasma-pa/commit/6611ff9e89ecedbedb38c630ece042d57832f72c