Skip to content
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

Disable cross-fading between tracks with different sample rates #3

Conversation

hickinbottoms
Copy link
Contributor

Cross-fading between tracks with differing sample rates (eg 44.1kHz ripped from CD and 48kHz high quality downloads) appears to cause an alarming burst of white noise at full volume during the cross-fade period. This is the case for my Squeezebox Touch when using the analogue outputs, at least.

This modification is an extension of the method used for 'smart' cross-fade and temporarily disables cross-fading when transitioning between tracks with different sample rates.

I believe this might fix bug#1884 (http://bugs.slimdevices.com/show_bug.cgi?id=1884) -- a golden oldie that is more than seven years old.

Cross-fading between tracks with differing sample rates (eg 44.1kHz
ripped from CD and 48kHz high quality downloads) appears to cause an
alarming burst of white noise at full volume during the cross-fade
period. This is the case for my Squeezebox Touch when using the
analogue outputs, at least.

This modification is an extension of the method used for 'smart'
cross-fade and temporarily disables cross-fading when transitioning
between tracks with different sample rates.

I believe this might fix
bug#1884 (http://bugs.slimdevices.com/show_bug.cgi?id=1884) -- a
golden oldie that is more than seven years old.
@hickinbottoms
Copy link
Contributor Author

Sorry to bump this, but I was wondering if there was going to be any interest in merging this, or if some other information was going to be required. I'd be happy for any other solution, but this seems a cheap and cheerful way of fixing it.

I find this is still needed for me to avoid bursts of full-volume noise on SB Touch, so I have to merge it when updating my installation.

I can probably knock up a test case if anyone needs to see that.

@mherger
Copy link
Contributor

mherger commented Aug 5, 2014

Thanks for the reminder. I've merged your change in to 7.9. Please let me know if there is any issue. Thanks again!

@mherger mherger closed this Aug 5, 2014
@hickinbottoms
Copy link
Contributor Author

Yes, that's now working a treat from public/7.9. Many thanks for merging that in.

@hickinbottoms hickinbottoms deleted the feature/fix-transition-sample-rates2 branch August 5, 2014 21:11
@mherger
Copy link
Contributor

mherger commented Nov 27, 2015

Stuart - I think we run into a bug with your change: the transition from the second-to-last to the last track would always disable crossfading, as we call trackSampleRateMatch($master, +1) and there's no next track available. Most users obviously didn't notice, as it's probably one out of a dozen tracks which doesn't crossfade. But if you eg. set RandomPlay to only add one track at a time, it becomes obvious, as we're always at the bottom of the playlist.

Could you imagine a good fix for this?

@hickinbottoms
Copy link
Contributor Author

It's been so long I can't remember the details, but with that
description I should be able to fix it and work up a pull request.

I'll get onto it and should have something in a few days when I
get a moment.

Stuart

mherger notifications@github.com writes:

Stuart - I think we run into a bug with your change: the
transition from the second-to-last to the last track would
always disable crossfading, as we call
trackSampleRateMatch($master, +1) and there's no next track
available. Most users obviously didn't notice, as it's probably
one out of a dozen tracks which doesn't crossfade. But if you
eg. set RandomPlay to only add one track at a time, it becomes
obvious, as we're always at the bottom of the playlist.

Could you imagine a good fix for this?

— Reply to this email directly or view it on GitHub.

hickinbottoms added a commit to hickinbottoms/slimserver that referenced this pull request Jan 2, 2016
This is an updated fix for temporarily disabling crossfade (if enabled)
between tracks that have different sample rates. As in the original PR
for this, this appears necessary for (at least) the Squeezebox Touch
which will produce an alarming blast of white noise in such a situation.

As reported in PR#3 (LMS-Community#3),
this fix didn't work correctly when near the end of a playlist, for
example when Random Play is adding a track at a time.

The bug was caused because as well has looking between the new track and
previous track to compare for a compatible sample rate, it was actually
looking back even earlier in the playlist for no reason. This was
because I didn't understand the meaning of the offset at this point in
the code.
@hickinbottoms
Copy link
Contributor Author

I've just created a new PR for this with what I think is a better fix. It passes the case described (Random Play). See #65.

Sorry it's taken a while -- outside distractions were to blame!

mherger pushed a commit that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants