Skip to content

volume-pipewire: add flat-list sink+port cycling on click#549

Open
brkay54 wants to merge 1 commit intovivien:masterfrom
brkay54:master
Open

volume-pipewire: add flat-list sink+port cycling on click#549
brkay54 wants to merge 1 commit intovivien:masterfrom
brkay54:master

Conversation

@brkay54
Copy link
Copy Markdown

@brkay54 brkay54 commented Apr 5, 2026

Summary

  • Replace sink-only cycling with a flat-list approach that enumerates all (sink, port) pairs across every available sink
  • Left/right click now cycles through every distinct output (e.g. Bluetooth → Speaker → Headphones) instead of being stuck when multiple ports exist on a single sink
  • Active port label is appended to the display name when a sink has more than one port (e.g. ALC257 Analog/Headphones)

Problem

When a system has a single sink with multiple ports (e.g. built-in audio with Speaker and Headphones), the previous set_default_playback_device_next function found only one sink and did nothing on click.

Solution

Added two functions:

  • get_all_outputs — enumerates all sink|port pairs via pactl list sinks
  • set_next_audio_output — finds the current (sink, port) in the flat list, advances by ±1, then calls pactl set-default-sink and/or pactl set-sink-port as needed

Test plan

  • Left-click cycles forward through all outputs
  • Right-click cycles backward
  • Audio streams follow to the new output
  • Block label updates to reflect active port when sink has multiple ports
  • Works with Bluetooth sink connected alongside internal audio

Replace sink-only cycling with a flat-list approach that enumerates all
(sink, port) pairs. Left/right click now cycles through every output
(e.g. BT → Speaker → Headphones) instead of skipping ports on the same
sink. Also appends the active port label to the display name when a sink
has multiple ports.
@brkay54
Copy link
Copy Markdown
Author

brkay54 commented Apr 5, 2026

@vivien need just a quick look, i have tested on my device it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant