flac encoder clips poorly

Bug #1915298 reported by Owen Williams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Daniel Schürmann

Bug Description

I recorded a set and there was some clipping, but it didn't sound bad out of my speakers. However the recorded flac has awful popping noises wherever the clipping happens. I did some testing and discovered that it clips incorrectly. If I record with WAVE, clipping looks like you'd expect (first image). But in flac, the clipped value bounces from 0 to 1 crazily (second image). I wonder if this is an issue with going from float to int?

Revision history for this message
Owen Williams (ywwg) wrote :
Revision history for this message
Owen Williams (ywwg) wrote :
Revision history for this message
Owen Williams (ywwg) wrote :

this might be a bug in sndfile

Revision history for this message
Owen Williams (ywwg) wrote :

According to our code:

// Tell the encoder that, when converting to integer formats, clip
    // automatically the values that go outside of the allowed range.
    // Warning! Depending on how libsndfile is compiled autoclip may not work.
    // Ensure CPU_CLIPS_NEGATIVE and CPU_CLIPS_POSITIVE is setup properly in the build.

So this may be a case where the ubuntu-built sndfile is not compiled correctly. I am trying disabling clipping to see what happens.

Revision history for this message
Owen Williams (ywwg) wrote :

Setting it to false appears to fix the issue, I'll make a PR and we should have people test it.

Changed in mixxx:
assignee: nobody → Owen Williams (ywwg)
Revision history for this message
Be (be.ing) wrote :

Upstream bug in libsndfile, already fixed: https://github.com/libsndfile/libsndfile/issues/309
libsndfile was practically unmaintained for a while so there was not a release with this fix until recently and Linux distros may still be shipping old libsndfile versions. 1.0.29 was the first version with the fix. https://github.com/mixxxdj/mixxx/pull/3615 will fix this for WIndows.

Changed in mixxx:
status: New → Fix Committed
status: Fix Committed → In Progress
assignee: Owen Williams (ywwg) → Be (be.ing)
milestone: none → 2.3.0
Revision history for this message
Owen Williams (ywwg) wrote :
Be (be.ing)
Changed in mixxx:
importance: Undecided → Low
Revision history for this message
Owen Williams (ywwg) wrote :

oh cool thanks. yeah playing with the setting did not help. In the interim, using WAV output is a lot better

Revision history for this message
Owen Williams (ywwg) wrote :

ubuntu 20.04 has 1.0.28-7

Revision history for this message
Owen Williams (ywwg) wrote :

thanks <3

Revision history for this message
Owen Williams (ywwg) wrote :

yup, updating to git sndfile fixes the issue

Revision history for this message
Be (be.ing) wrote :

Fixed for Windows and macOS: https://github.com/mixxxdj/mixxx/pull/3615
Linux distros update at their own pace.

Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
Daniel Schürmann (daschuer) wrote :

The fix was done in this commit.
https://github.com/libsndfile/libsndfile/commit/b9e544328e423ac01cac14436b41942e27b6b5aa
part of v1.0.29

Ubuntu Bionic LTS has 1.0.28-4ubuntu0.18.04.1
Ubuntu Focal LTS has 1.0.28-7
Ubuntu Groovy has 1.0.28-8
Ubuntu Hisure has 1.0.31-1ubuntu1

Fedora 33 has 1.0.31

https://repology.org/project/libsndfile/versions

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I cannot confirm that the issue is fixed after upgrade, because we don't set
SFC_SET_CLIPPING for flac.

Changed in mixxx:
status: Fix Committed → In Progress
assignee: Be (be.ing) → Daniel Schürmann (daschuer)
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Oh, we do set it.. strange, something else must be wrong.

Revision history for this message
Daniel Schürmann (daschuer) wrote :
Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10318

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.