From 3cc01560be6cd62122b1a853638e2bf3395e432a Mon Sep 17 00:00:00 2001 From: Mike Choi Date: Thu, 3 Jan 2013 17:22:26 +0100 Subject: [PATCH] VST Automation: lock prevention src/core/RemotePlugin.cpp @ RemotePlugin::process Above function should be now more thread safe, but functionality remains. This prevent lmms locks, when automation is connected to lmms VST plugin wrappers controler / knob on Linux. On win32 build whenever is lmms wrapper parameter controler / knob amended. plugins/vst_base/VstPlugin.cpp @ VstPlugin::setParam plugins/vst_base/RemoteVstPlugin.cpp @ RemoteVstPlugin::processMessage In above functions we dont wait for message confirmation when parameter setter function finish, and dont send such confirmations. This workaround prevent locks on Linux, whenever there is automation connected and if you try to move with VST plugin (not via lmms plugins wrapper, but with VSTs internal window) than it freezes, on win32 build it will freeze whenever you connect automation and than if you move your mouse above this VST plugin window. Signed-off-by: Tobias Doerffel --- plugins/vst_base/RemoteVstPlugin.cpp | 2 +- plugins/vst_base/VstPlugin.cpp | 2 +- src/core/RemotePlugin.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index aaae0c270..40d02cacb 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -451,7 +451,7 @@ bool RemoteVstPlugin::processMessage( const message & _m ) lock(); m_plugin->setParameter( m_plugin, _m.getInt( 0 ), _m.getFloat( 1 ) ); unlock(); - sendMessage( IdVstSetParameter ); + //sendMessage( IdVstSetParameter ); break; diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index 59d75fb53..c986de2d8 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -574,7 +574,7 @@ void VstPlugin::setParam( int i, float f ) { lock(); sendMessage( message( IdVstSetParameter ).addInt( i ).addFloat( f ) ); - waitForMessage( IdVstSetParameter ); + //waitForMessage( IdVstSetParameter ); unlock(); } diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index dd6a237dd..bb755bf40 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -230,14 +230,13 @@ bool RemotePlugin::process( const sampleFrame * _in_buf, lock(); sendMessage( IdStartProcessing ); - unlock(); if( m_failed || _out_buf == NULL || m_outputCount == 0 ) { + unlock(); return false; } - lock(); waitForMessage( IdProcessingDone ); unlock();