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

SoundTouch 1.6.0 portability issue on x86_64 #7727

Closed
mixxxbot opened this issue Aug 22, 2022 · 5 comments
Closed

SoundTouch 1.6.0 portability issue on x86_64 #7727

mixxxbot opened this issue Aug 22, 2022 · 5 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: neogeo-dc
Date: 2014-12-13T15:25:19Z
Status: Fix Released
Importance: Critical
Launchpad Issue: lp1402219


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: neogeo-dc
Date: 2014-12-13T15:53:55Z


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 :)

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2014-12-13T17:20:32Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2014-12-13T21:10:45Z


Fixed in 6349013

@mixxxbot
Copy link
Collaborator Author

Commented by: neogeo-dc
Date: 2014-12-14T13:09:13Z


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')

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.0.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant