Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

wireplumber plugin should be able to view/control the audio input (source), not just the audio output (sink)

Open dkg opened this issue 1 year ago • 1 comments

It is great that by default, the wireplumber plugin binds itself to the volume level of the default audio sink for wireplumber, via this line in src/modules/wireplumber.cpp:

  g_signal_emit_by_name(self->def_nodes_api_, "get-default-node", "Audio/Sink", &defaultNodeId);

However, it would also be nice to have the wireplumber plugin work for the default input level as well. That is, the default Audio/Source instead of the Audio/Sink.

In particular, when on a call, i might want to use the waybar to both see and adjust my mic level.

Please consider adding a configuration option direction to the wireplumber plugin that can be either source or sink (defaulting to sink). Then a user who wants to control their mic from the waybar should be able to just add a second copy of the wireplumber plugin with direction set to source.

dkg avatar Mar 29 '24 15:03 dkg

I had originally phrased this as asking the wireplumber plugin to be configurable enough to select "any other device" but i think that might be too much flexibility.

If you really wanted to aim for more flexibility, instead of naming the config variable direction you could name it perhaps node, and it could default to something that means "the default audio sink". It should be easy to choose instead "the default audio source". But what you then do with other strings i don't really know. there are so many different (and overlapping) possible labels and identifiers within pipewire that you could potentially try to match on to select a node that i am dizzy thinking about it. (for a sense of what might be matchable, consider the output of wpctl inspect @DEFAULT_AUDIO_SINK@).

So if you want to preserve room for more flexibility for targeting arbitrary nodes, without committing to any particular search/match pattern amid the bewildering options, you could just:

  • reserve two keywords that mean "default audio source" and "default audio sink", and
  • make "default audio sink" the default, and
  • reject any other string for now.

dkg avatar Mar 29 '24 16:03 dkg