Skip to content

Fix ALSA hardware volume control being too sensitive#186

Merged
maximmaxim345 merged 2 commits intomainfrom
claude/fix-volume-sensitivity-HNw2T
Mar 17, 2026
Merged

Fix ALSA hardware volume control being too sensitive#186
maximmaxim345 merged 2 commits intomainfrom
claude/fix-volume-sensitivity-HNw2T

Conversation

@maximmaxim345
Copy link
Copy Markdown
Member

@maximmaxim345 maximmaxim345 commented Mar 17, 2026

Summary

  • Add -M (mapped volume) flag to all amixer calls in the ALSA volume controller
  • Without -M, amixer maps percentages linearly to the raw hardware register range, which on DACs with wide dB ranges (e.g. HiFiBerry, USB interfaces) causes a given percentage to sound much quieter than expected
  • With -M, percentages use perceptual (dB-aware) mapping so that 90% actually sounds like 90% loudness

claude added 2 commits March 17, 2026 15:57
…e curve

Two changes to reduce excessive volume sensitivity:

1. ALSA volume: Add -M (mapped volume) flag to all amixer calls. Without
   this flag, amixer maps percentages linearly to the raw hardware range,
   which on DACs with wide dB ranges (e.g. HiFiBerry, USB interfaces)
   causes 90% to map to a much lower perceived loudness than expected.
   With -M, percentages map to perceptual loudness.

2. Software volume: Change the power curve from (v/100)^1.5 to linear
   (v/100). The protocol's delta-based group volume mechanism already
   adjusts player volumes proportionally, so the power curve compounds
   the reduction and makes low player volumes inaudible too quickly.

https://claude.ai/code/session_01V1qvDy6hSsJtytm5PVeygU
The (v/100)^1.5 power curve is perceptually correct — restore it.
The volume sensitivity issue is in the ALSA raw-percentage mapping,
not the software volume path.

https://claude.ai/code/session_01V1qvDy6hSsJtytm5PVeygU
@maximmaxim345 maximmaxim345 changed the title Add -M flag to amixer commands for dB volume control Fix ALSA hardware volume control being too sensitive Mar 17, 2026
@maximmaxim345 maximmaxim345 marked this pull request as ready for review March 17, 2026 16:09
Copilot AI review requested due to automatic review settings March 17, 2026 16:09
@maximmaxim345 maximmaxim345 added the bugfix Fixes a bug label Mar 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ALSA volume backend to use amixer’s mapped-volume mode so that 0–100% volume values align with ALSA’s dB-mapped scaling, and adjusts tests to match the updated command invocations.

Changes:

  • Add -M to amixer invocations used for playback capability probing, setting volume, and reading volume.
  • Update ALSA volume controller tests to assert the new amixer -M ... argument order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
sendspin/alsa_volume.py Adds -M to amixer calls so volume set/get uses mapped percentage semantics.
tests/test_alsa_volume.py Updates expected subprocess argument tuples to include -M for set/get flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maximmaxim345 maximmaxim345 merged commit eca78fc into main Mar 17, 2026
5 checks passed
@maximmaxim345 maximmaxim345 deleted the claude/fix-volume-sensitivity-HNw2T branch March 17, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants