-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PipeWire and volume level #1358
Comments
Original Redmine Comment There is nothing in the source code of Audacious' pipewire output plugin that confirms your assumption. Yet Pipewire itself may work differently than Pulseaudio or direct ALSA output due to handling per app volume in different ways. More trouble-shooting will be needed. |
Original Redmine Comment I suspect this is a valid defect. ALSA volume levels are typically percentages (0-100%) that translate linearly to decibel levels. It's been that way as long as I can remember, though it beats me if that's documented anywhere. On my system, each 5% up/down translates to a 3 dB change. (Nowadays, alsamixer uses some different, incomprehensible scheme, but that's just at the UI level; the underlying API calls haven't changed.) On the other hand, the PipeWire documentation for SPA_PROP_channelVolumes says "0.0 is silence, 1.0 is without attenuation". It's exceptionally vague wording, but that suggests to me that the 0-1 range is meant to translate linearly to some reference voltage range. If that's the case, we should probably do some math in the get_volume/set_volume() methods so that the volume level in Audacious still translates to a decibel level. I'm not interested in PipeWire personally, but if someone else wants to take a stab at a patch, the general rule is: a +20 dB increase means the voltage multiplies by 10x. You can also find a sample calculation in the audio_amplify() function (libaudcore/audio.cc). |
Original Redmine Comment This is what MPV/audio/out/ao_pulse.c ( https://github.com/mpv-player/mpv/blob/master/audio/out/ao_pulse.c ) uses for PulseAudio:
Not sure if it's relevant, sorry if it's not. Though for audio/out/ao_pipewire.c ( https://github.com/mpv-player/mpv/blob/master/audio/out/ao_pulse.c ) it's quite different. |
Original Redmine Comment I have asked the PipeWire developer(s), their answer is that PipeWire uses a linear scale for the volume. https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3623 @john: Do you have further questions for them? I'm not sure how to proceed now. |
Original Redmine Comment I think we have all the information we need. We just need to implement the decibel to linear translation now. |
Original Redmine Comment Please see/check my pull request: |
Original Redmine Comment Fixed with audacious-media-player/audacious-plugins@1f02fb1. |
Author Name: grayich grayich
Original Redmine Issue: https://redmine.audacious-media-player.org/issues/1218
Original Date: 2023-07-12
When outputting via (pulse, alsa, etc.), the volume changes in a linear relationship.
When audio is output via PipeWire, the volume changes in a logarithmic relationship.
It's inconvenient, you need to either make it linear like it's always been, or optional.
The text was updated successfully, but these errors were encountered: