Repository navigation
Device-independent volume fix - #379
Merged
Merged
Conversation
A vendor's `getStreamVolumeDb()` table is not necessarily a usable gain curve. The protocol assumes dB attenuation (negative below full scale), but some devices (e.g. Samsung One UI) return values at or above zero for non-maximal steps. Using those values would select a near-mute volume at high requested volumes. Reject such tables on any device/output and use native volume steps as a fallback.
Contributor
Author
|
I have since installed LineageOS 23.2 GSI on the SM-X216B and can confirm that the regular volume curve logic works fine, isolating the issue to OneUI itself and clearing the hardware of any suspicion. |
isUsableCurve read index 1, which is minus infinity where the stream's minimum is 2 or more, so a valid curve was refused. Start from the lowest audible index instead. The curve is read on every volume change, so warn about an unusable one only when the output changes. Drop the 100% shortcuts in indexFor and trackGainFor: a table that is not in dB no longer reaches them. Test the service with a table of linear amplitudes, as reported in chrisuthe#380: nothing failed with the check disconnected. Test a table that dips too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a regression introduced with #342
A vendor's
getStreamVolumeDb()table is not necessarily a usable gain curve. The protocol assumes dB attenuation (negative below full scale), but some devices (e.g. Samsung One UI) return values at or above zero for non-maximal steps. Using those values would select a near-mute volume at high requested volumes. Reject such tables on any device/output and use native volume steps as a fallback.Compiled and tested on: