Normalize CSAMPLE (float) to 1.0

Bug #1204039 reported by Daniel Schürmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
RJ Skerry-Ryan

Bug Description

I think from historical reasons our CSAMPLES are normalized to SHORT_MAX.

This requires two unnecessary sample multiplications when copying to portaudio and when receiving from SoundSource.
(after applying Bug #1156569 "Change Soundsource API to reading float samples")

We may also incompatible when using external effect in future.

This fix sound quite easy, but I am afraid when we try to fix this, we will suffer some side effects.

Does one know what we have take into account for a fix?
Is it worth to do the work?

Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 1204039] [NEW] Normalize CSAMPLE (float) to 1.0

I've wanted to do this for a long while. That division by SHRT_MAX when
pushing samples to PA is something we could eliminate early on in the
reader threads. All the analysers take samples between -1.0 and 1.0 already
(and the AQ normalizes the samples after reading). Nothing off the top of
my head in the engine would go badly wrong if we normalize either. The VU
meters and clipping will need updating since they rely on samples being in
[-SHRT_MAX, SHRT_MAX]. I think rubberband and soundtouch are not specific
about the range of samples they receive. The EQs are the only question I
have but we could just test them. It's true this could cause problems in
the future for effects but [-1,1] normalized samples are pretty standard.

On Tue, Jul 23, 2013 at 5:31 AM, Daniel Schürmann <
<email address hidden>> wrote:

> Public bug reported:
>
> I think from historical reasons our CSAMPLES are normalized to
> SHORT_MAX.
>
> This requires two unnecessary sample multiplications when copying to
> portaudio and when receiving from SoundSource.
> (after applying Bug #1156569 "Change Soundsource API to reading float
> samples")
>
> We may also incompatible when using external effect in future.
>
> This fix sound quite easy, but I am afraid when we try to fix this, we
> will suffer some side effects.
>
> Does one know what we have take into account for a fix?
> Is it worth to do the work?
>
> ** Affects: mixxx
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1204039
>
> Title:
> Normalize CSAMPLE (float) to 1.0
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1204039/+subscriptions
>

Changed in mixxx:
status: New → Confirmed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
importance: Undecided → Low
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

This changes the engine and doesn't touch the SoundSources:
https://github.com/mixxxdj/mixxx/pull/126

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 1.12.0
status: Confirmed → Fix Committed
RJ Skerry-Ryan (rryan)
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/7112

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.