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

Knobs and sliders do not update #2

Closed
falkTX opened this issue Oct 18, 2021 · 9 comments
Closed

Knobs and sliders do not update #2

falkTX opened this issue Oct 18, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@falkTX
Copy link
Contributor

falkTX commented Oct 18, 2021

They are stuck in their initial position somehow

@falkTX falkTX added the bug Something isn't working label Oct 18, 2021
@zezic
Copy link
Contributor

zezic commented Oct 18, 2021

Here the internal->lastValue is always NaN: https://github.com/VCVRack/Rack/blob/219bbaf137d5dc70c96bd4206c3f8aad5524a81b/src/app/ParamWidget.cpp#L200-L204

And this comparison always resolves to false in Cardinal for some reason.
Is -ffast-math enabled for Cardinal builds? What else can affect float != NaN behaviour?

P.S. If you adjust this condition check to handle NaN correctly, it will solve some problems with widgets (knobs, switches), but I don't like this solution because it requires patching.

@falkTX
Copy link
Contributor Author

falkTX commented Oct 18, 2021

Great find!
And yes I am using -ffast-math as typical for plugin builds. We can add in the usual -fno-finite-math-only and see if it improves this, will add that now as a test.

@zezic
Copy link
Contributor

zezic commented Oct 18, 2021

Maybe the -funsafe-math-optimizations should be added as well? Just guessing.

@zezic
Copy link
Contributor

zezic commented Oct 18, 2021

This helped me:

-BASE_OPTS  = -O3 -ffast-math -fdata-sections -ffunction-sections
+BASE_OPTS  = -O3 -funsafe-math-optimizations -fdata-sections -ffunction-sections

Changes were made in Makefile.base.mk inside the dpf dir.

@zezic
Copy link
Contributor

zezic commented Oct 18, 2021

So, the -ffast-math is actually broke this condition. Removing it or replacing it with the -funsafe-math-optimizations helps.

@falkTX
Copy link
Contributor Author

falkTX commented Oct 18, 2021

The -ffast-math implies/includes -funsafe-math-optimizations, no need to add in specific.
But -ffast-math also adds in a bunch of other flags, so there must be one that breaks things.

We can just bruteforce the build with the flags in -ffast-math all specified manually, and remove one by one until we find the culprit.
And then say "well that was obvious" at the end 😅

@falkTX
Copy link
Contributor Author

falkTX commented Oct 18, 2021

hmm I only got to testing now, was fixing the window builds, but I see -fno-finite-math-only already works here.

@zezic can you confirm? after a rebuild I have this working without issues here.

@zezic
Copy link
Contributor

zezic commented Oct 18, 2021

@falkTX Confirmed. -fno-finite-math-only helps on my system too.

@falkTX
Copy link
Contributor Author

falkTX commented Oct 18, 2021

Cool, closing the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants