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

Handle automation on processing thread #4692

merged 1 commit into from Nov 12, 2018


None yet
2 participants
Copy link

DomClark commented Nov 1, 2018

Connections that update values for remote plugins are now all DirectConnections. The result is that changes to these values no longer always come from the main thread, but instead from the thread that changed them, which in the case of automation or controllers will be the processing thread.

This fixes the following issues:

  • Hangs occurring when the project is saved while Zyn or VSTs are being automated. Value updates were sometimes sent while LMMS was waiting to receive the save data from the remote plugin, resulting in a deadlock trying to lock the plugin mutex twice on the same thread. Sending the update on a different thread solves this. (Fixes #4543, fixes #4584.)
  • Stuttering audio during automation of Zyn or VSTs. Since #4460, the plugin mutex is locked using tryLock before getting audio from the remote plugin. If a value was being automated, the main thread was sometimes holding the lock to update the value which caused a buffer of audio to be skipped for the plugin. Sending the automation on the processing thread ensures the updates are finished before audio is rendered. (Fixes #4625.)
  • Choppy/laggy/missing VST automation, especially during export. The automation used to get caught up on the main thread (a problem that was much worse on export), but is now delivered immediately on the processing thread. (I can't find an issue for this, but I've seen it mentioned from time to time on the Discord server.)
if( == IdStartProcessing || == IdMidiEvent )
if( == IdStartProcessing
|| == IdMidiEvent
|| == IdVstSetParameter )

This comment has been minimized.


PhysSong Nov 4, 2018


Good point! 👍


This comment has been minimized.

Copy link

PhysSong commented Nov 9, 2018

@DomClark Is it ready to merge?


This comment has been minimized.

Copy link
Member Author

DomClark commented Nov 9, 2018

I think so, yes.

@PhysSong PhysSong merged commit 2070ef2 into LMMS:stable-1.2 Nov 12, 2018

2 checks passed

ci/circleci Your tests passed on CircleCI!
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.