-
-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Describe the bug
The volume slider in the controls window fails to properly set volume on audio devices with more than 2 channels. When adjusting the slider, the volume briefly changes but immediately reverts to the previous value.
To Reproduce
Steps to reproduce the behavior:
- Use a system with a 4-channel audio device (common on Apple Silicon Macs)
- Open nwg-panel controls window
- Attempt to adjust volume slider
- Observe volume briefly changes then reverts, with errors in console
Expected behavior
Volume slider should set volume for all channels on the device.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Linux distribution: Arch Linux ARM (Asahi Linux)
- Sway version: sway version 1.11 (Note: Using Hyprland 0.49.0 as compositor)
- Panel version: nwg-panel version 0.10.12
Additional context
Audio Device Details:
Sink: Built-in Audio Speakers
Sample Specification: s32le 4ch 48000Hz
Channel Map: front-left,front-right,rear-left,rear-right
Console Errors:
Failed to set volume: You tried to set volumes for 2 channels, whereas channel(s) supported = 4
Root Cause:
The issue is in tools.py line 579. The set_volume() function uses:
subprocess.call(f"pactl set-sink-volume @DEFAULT_SINK@ {left}% {right}%".split())
This command explicitly sets only 2 channels (left and right), which fails on devices with 4 channels. The command should either:
- Set all channels to the same value: pactl set-sink-volume @DEFAULT_SINK@ {percent}%
- Use pamixer --set-volume {percent} which handles multi-channel devices correctly