Skip to content

fix(volume): never raise the volume above 100% - #11

Open
manio wants to merge 1 commit into
birdayz:mainfrom
manio:vol_cap
Open

manio wants to merge 1 commit into
birdayz:mainfrom
manio:vol_cap

Conversation

@manio

@manio manio commented Nov 15, 2026

Copy link
Copy Markdown

Scrolling (or ezbar msg volume up) ran pactl set-sink-volume @DEFAULT_SINK@ +5%, which PulseAudio does not cap: the sink kept climbing to 105%, 110%, ... and well past what speakers handle cleanly.

When raising, read the current level first and set an absolute value, capped at 100%. If the sink is already at or above 100% (e.g. raised elsewhere), raising is a no-op instead of lowering it or pushing it further. Lowering is unchanged. If PulseAudio can't be read, the old relative step and the amixer fallback apply as before; amixer is bounded by the hardware range anyway.

Scrolling (or `ezbar msg volume up`) ran `pactl set-sink-volume
@DEFAULT_SINK@ +5%`, which PulseAudio does not cap: the sink kept
climbing to 105%, 110%, ... and well past what speakers handle cleanly.

When raising, read the current level first and set an absolute value,
capped at 100%. If the sink is already at or above 100% (e.g. raised
elsewhere), raising is a no-op instead of lowering it or pushing it
further. Lowering is unchanged. If PulseAudio can't be read, the old
relative step and the amixer fallback apply as before; amixer is
bounded by the hardware range anyway.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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