Commit 45c0c2b
playback: fall back to raw-range mapping for Alsa mixers without dB info
Some Alsa mixer controls expose no dB information at all, most notably
the Alsa pulse plugin's `Master`, which maps onto the PulseAudio sink
volume. AlsaMixer::open() failed with "Could not get Alsa softvol dB
range" for such controls, making them unusable as `--mixer alsa`
targets.
Instead of failing, map the volume linearly onto the control's raw
range and force `VolumeCtrl::Linear`, since without dB information
other taper curves cannot be applied faithfully. The softvol antilog
compensation is also skipped for these controls: it counteracts Alsa's
internal linear-to-dB conversion, which does not happen when the raw
volume is applied directly. For PulseAudio a linear raw mapping is the
desired behavior anyway, as its raw volume scale is already
perceptually (cubically) tapered.
This allows `--mixer alsa --alsa-mixer-device pulse
--alsa-mixer-control Master` to control the PulseAudio sink (master)
volume from Spotify Connect while playing back through the pulseaudio
backend.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 9c7d756 commit 45c0c2b
2 files changed
Lines changed: 32 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
| |||
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
| |||
190 | 210 | | |
191 | 211 | | |
192 | 212 | | |
| 213 | + | |
193 | 214 | | |
194 | 215 | | |
195 | 216 | | |
| |||
312 | 333 | | |
313 | 334 | | |
314 | 335 | | |
315 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
316 | 341 | | |
317 | 342 | | |
0 commit comments