akrutzler / plasma-audio-device-switcher

Simple widget to change the default audio output device/sink.
https://store.kde.org/p/1195707
Other
20 stars 24 forks source link

Hide inactive devices from the list #19

Open joestringer opened 1 year ago

joestringer commented 1 year ago

I use an HDMI output which for some reason has three subdevices attached, but only one of them is ever used for audio output through HDMI:

$ aplay -l
...
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Recently after switching to pipewire it seems that in the configuration settings of my desktop environment, it automatically detects that device 4 and device 5 are "inactive" and hides them from the default audio configuration view. However, the plasma audio device switcher still shows these extra devices. If I switch output to them, the audio output automatically switches away from them.

It would be neat if this widget could detect when the underlying devices are inactive and hide them by default (optionally with a checkbox to un-hide them in the configuration menu for the widget)

denilsonsa commented 11 months ago

Hi! I had this very specific need, and I ended up creating my own fork: https://github.com/denilsonsa/plasma-audio-device-switcher And it filters out inactive devices.