SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

Pipewire/Wireplumber support [Feature]

Open mrpingo opened this issue 1 year ago • 3 comments

Hello!

Would be nice to add new pipewire/wireplumber volume support.

Volume control with pulseaudio daemon is not compatible with pipewire as is if it is not compiled with pulseaudio server support which increases packages and binaries weight. Also pulseaudio would be deprecated in favor of pipewire in a near future because it has no extra latency.

Pipewire/Wireplumber support would be a great addon for new systems with pipewire.

mrpingo avatar Apr 02 '23 11:04 mrpingo

I'm not very familiar with how the pipewire API works and the current pulse implementation works for users who use pulseaudio and pipewire-pulse. Adding a new different audio server API widget would be a big hassle when the current one works for almost everyone.

I'm of course open to a PR if someone would like to add it :)

ErikReider avatar Apr 10 '23 15:04 ErikReider

Instead of using Pipewire's API, what if you can just let the user select how they want to control the volume?

I get this error when I have "volume" to widgets array:

...
PulseAudio connection lost. Will retry connection.
PulseAudio connection lost. Will retry connection.
PulseAudio connection lost. Will retry connection.
...

I have no experience with vala but if possible, we can expose a callback that passes the percentage based on the slider position to the passed function from the json file? I don't even think that's possible but maybe there's some way to do that in vala. Let me know.

For now, this is how I change my volume in sway:

wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle

Similarly, it would be great if swaync gives an option to set the backend functions instead of default ones. For example, I use playerctl like this:

playerctl previous
playerctl play-pause
playerctl next

to control media and

brightnessctl --save set 1%-
brightnessctl --save set 1%+

to change brightness and swaycn is not working by default. This is the error I'm getting:

...
** (swaync:83604): CRITICAL **: 14:22:40.842: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:40.860: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:40.875: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:42.827: sway_notification_center_widgets_backlight_util_close: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed
...

ABSanthosh avatar Jul 30 '24 08:07 ABSanthosh

Instead of using Pipewire's API, what if you can just let the user select how they want to control the volume?

I get this error when I have "volume" to widgets array:

...
PulseAudio connection lost. Will retry connection.
PulseAudio connection lost. Will retry connection.
PulseAudio connection lost. Will retry connection.
...

I have no experience with vala but if possible, we can expose a callback that passes the percentage based on the slider position to the passed function from the json file? I don't even think that's possible but maybe there's some way to do that in vala. Let me know.

For now, this is how I change my volume in sway:

wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle

Similarly, it would be great if swaync gives an option to set the backend functions instead of default ones. For example, I use playerctl like this:

playerctl previous
playerctl play-pause
playerctl next

to control media and

brightnessctl --save set 1%-
brightnessctl --save set 1%+

to change brightness and swaycn is not working by default. This is the error I'm getting:

...
** (swaync:83604): CRITICAL **: 14:22:40.842: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:40.860: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:40.875: sway_notification_center_widgets_backlight_util_set_brightness: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed

** (swaync:83604): CRITICAL **: 14:22:42.827: sway_notification_center_widgets_backlight_util_close: assertion 'SWAY_NOTIFICATION_CENTER_WIDGETS_IS_BACKLIGHT_UTIL (self)' failed
...

Running external commands (new processes) also has an overhead. It might be even worse than using PipeWire's PulseAudio proxy interface.

Anyway, the increases packages and binaries weight argument still valid.

zefr0x avatar Jul 30 '24 13:07 zefr0x