SoundTouch 1.6.0 portability issue on x86_64

Bug #1402219 reported by shalty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Critical
RJ Skerry-Ryan

Bug Description

Hi

This is one of the "typical" reported crash on startup on x64 systems. The 32bit build works fine on the same system.

After a build from sources, this is what i can report...

    // rearrange the filter coefficients for mmx routines
    for (i = 0; i < newLength; i ++)
    {
        filterCoeffsAlign[2 * i + 0] =
        filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider; <<---- fails here
    }

the stack trace:

mixxx.exe!soundtouch::FIRFilterSSE::setCoefficients(const float * coeffs, unsigned int newLength, unsigned int uResultDivFactor) Line 296 C++
mixxx.exe!soundtouch::AAFilter::calculateCoeffs() Line 167 C++
mixxx.exe!soundtouch::AAFilter::setLength(unsigned int newLength) Line 93 C++
mixxx.exe!soundtouch::AAFilter::AAFilter(unsigned int len) Line 66 C++
mixxx.exe!soundtouch::RateTransposer::RateTransposer() Line 135 C++
mixxx.exe!RateTransposerFloat::RateTransposerFloat() Line 514 C++
mixxx.exe!soundtouch::RateTransposer::newInstance() Line 121 C++
mixxx.exe!soundtouch::SoundTouch::SoundTouch() Line 101 C++
mixxx.exe!EngineBufferScaleST::EngineBufferScaleST(ReadAheadManager * pReadAheadManager) Line 40 C++
mixxx.exe!EngineBuffer::EngineBuffer(QString group, ConfigObject<ConfigValue> * _config, EngineChannel * pChannel, EngineMaster * pMixingEngine) Line 277 C++
mixxx.exe!EngineDeck::EngineDeck(QString group, ConfigObject<ConfigValue> * pConfig, EngineMaster * pMixingEngine, EffectsManager * pEffectsManager, EngineChannel::ChannelOrientation defaultOrientation) Line 61 C++
mixxx.exe!BaseTrackPlayerImpl::BaseTrackPlayerImpl(QObject * pParent, ConfigObject<ConfigValue> * pConfig, EngineMaster * pMixingEngine, EffectsManager * pEffectsManager, EngineChannel::ChannelOrientation defaultOrientation, QString group, bool defaultMaster, bool defaultHeadphones) Line 42 C++
mixxx.exe!Deck::Deck(QObject * pParent, ConfigObject<ConfigValue> * pConfig, EngineMaster * pMixingEngine, EffectsManager * pEffectsManager, EngineChannel::ChannelOrientation defaultOrientation, QString group) Line 10 C++
mixxx.exe!PlayerManager::addDeckInner() Line 274 C++
mixxx.exe!PlayerManager::addDeck() Line 252 C++
mixxx.exe!PlayerManager::addConfiguredDecks() Line 260 C++
mixxx.exe!MixxxMainWindow::MixxxMainWindow(QApplication * pApp, const CmdlineArgs & args) Line 250 C++
mixxx.exe!main(int argc, char * * argv) Line 338 C++

So it seems a problem with sountouch (not portaudio as previously assumed), probably a mismatch with datatypes on x64 environment, or packing the data (default aligment issues).

I don't know this code, but i'll try to see if i can find a patch around it.

Revision history for this message
shalty (neogeo-dc) wrote :

Well, that was an easy one ;)

(at FIRFilterSSE::setCoefficients)

just replace

filterCoeffsAlign = (float *)(((unsigned long)filterCoeffsUnalign + 15) & (ulong)-16);

with this

filterCoeffsAlign = (float *)(((unsigned long long)filterCoeffsUnalign + 15) & (unsigned long long)-16);

and all works fine!

pointer aritmetic kills portability :)

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 1.12.0
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Ah! Thanks a bunch shalty.

I took a look and we are using a really old version of soundtouch! This is fixed in their latest version. We should upgrade.

Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
RJ Skerry-Ryan (rryan)
summary: - Crash at startup in Win8.1 x64 (1.12 beta). Not opengl related
+ SoundTouch 1.6.0 portability issue on x86_64
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :
Changed in mixxx:
status: Confirmed → Fix Committed
Revision history for this message
shalty (neogeo-dc) wrote :

Apparently the x64 build on windows is broken since.

For what i've seen, the problem is in depends.py, where its missing this part from the old version

        if build.platform_is_windows:
            # Regardless of the bitwidth, ST checks for WIN32
            env.Append(CPPDEFINES='WIN32')

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers