Normalizer stereo imaging and performance improvements#1485
Merged
roderickvd merged 3 commits intoAug 14, 2025
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
playback/src/player.rs:1611
- [nitpick] Consider renaming 'normalisation_channel' to something like 'current_channel' (or adding a clarifying comment) to better convey its purpose as a toggling index for stereo channels.
self.normalisation_channel ^= 1;
playback/src/player.rs:1758
- Review the change in the state match pattern: switching from 'PlayerState::Invalid { .. }' to 'PlayerState::Invalid' may bypass handling of extra data previously matched; ensure that this change correctly covers all intended invalid states.
if matches!(self.state, PlayerState::Invalid) {
Member
|
So I used the state of the branch for a bit (with normalization enabled) and it seems to not have (at least for me) noticeable interference or audio spikes. I will test it for a day more and then we could probably get it merged :D |
photovoltex
reviewed
Apr 12, 2025
photovoltex
left a comment
Member
There was a problem hiding this comment.
So, testing wise I would approve these changes. Just two small comments that didn't make quite a lot of sense to me.
photovoltex
previously approved these changes
Apr 28, 2025
photovoltex
left a comment
Member
There was a problem hiding this comment.
Ah dang it, forgot to approve it sooner. After the conflict is resolved you can merge it :)
Member
Author
|
No prob I'll make some minor changes anyway. |
roderickvd
added a commit
that referenced
this pull request
Aug 14, 2025
- Add pre-computed knee factor to eliminate division in sample loop - Replace if-else chain with match pattern for cleaner branching - Use direct references to reduce repeated array indexing - Maintain existing stereo imaging via channel coupling Addresses review comments from #1485 and incorporates optimizations inspired by Rodio's limiter implementation for improved performance in the stereo case.
- Add pre-computed knee factor to eliminate division in sample loop - Replace if-else chain with match pattern for cleaner branching - Use direct references to reduce repeated array indexing - Maintain existing stereo imaging via channel coupling Addresses review comments from librespot-org#1485 and incorporates optimizations inspired by Rodio's limiter implementation for improved performance in the stereo case.
72718e2 to
56611d8
Compare
yanyaoer
pushed a commit
to yanyaoer/librespot
that referenced
this pull request
Aug 19, 2025
…ibrespot-org#1485) - Add pre-computed knee factor to eliminate division in sample loop - Replace if-else chain with match pattern for cleaner branching - Use direct references to reduce repeated array indexing - Maintain existing stereo imaging via channel coupling Addresses review comments from librespot-org#1485 and incorporates optimizations inspired by Rodio's limiter implementation for improved performance in the stereo case.
paulfariello
pushed a commit
to paulfariello/librespot
that referenced
this pull request
Sep 23, 2025
…ibrespot-org#1485) - Add pre-computed knee factor to eliminate division in sample loop - Replace if-else chain with match pattern for cleaner branching - Use direct references to reduce repeated array indexing - Maintain existing stereo imaging via channel coupling Addresses review comments from librespot-org#1485 and incorporates optimizations inspired by Rodio's limiter implementation for improved performance in the stereo case.
CreatorMetaSky
pushed a commit
to StreamMediaSpace/librespot-zig
that referenced
this pull request
Feb 9, 2026
…ibrespot-org#1485) - Add pre-computed knee factor to eliminate division in sample loop - Replace if-else chain with match pattern for cleaner branching - Use direct references to reduce repeated array indexing - Maintain existing stereo imaging via channel coupling Addresses review comments from librespot-org#1485 and incorporates optimizations inspired by Rodio's limiter implementation for improved performance in the stereo case.
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.
Previously, the normalizer integrator and peak were recalculated as if the samples were a mono stream. If actually one channel required limiting and the other not, this could cause nervousness in the stereo imaging.
This PR changes the normalizer to:
Again, please test this for me as I don't have a Spotify account anymore. I ported it from pleezer with my permission.
My "go to" track to test limiting is "Blumine" by Mahler on "Masterpieces in Miniature".