-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use tryLock in audio threads for VST/ZynAddSubFX #4460
Conversation
Prevent loading VST or toggling ZynAddSubFX GUI from blocking entire audio processing.
@@ -62,7 +62,7 @@ void VstEffectControls::loadSettings( const QDomElement & _this ) | |||
{ | |||
//m_effect->closePlugin(); | |||
//m_effect->openPlugin( _this.attribute( "plugin" ) ); | |||
m_effect->m_pluginMutex.lock(); | |||
if (!m_effect->m_pluginMutex.tryLock()) {return;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this cause the plugin settings not to be loaded if the mutex can't be locked? I think this code runs on the main thread anyway so it shouldn't affect audio processing if it has to wait for the mutex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right here, probably a mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e79aeb7.
Merge? |
won't this produce lag noise when the lock is on (GUI doing stuff) because we are not clearing the buffer? |
|
If that is the case then all is good :) |
I guess the mutex can be dropped with a proper workaround for race conditions(maybe |
I guess this patch might break rendering. Should I restrict this fix to playback only? |
I found that this is insufficient because |
Prevent loading VST or toggling ZynAddSubFX GUI from blocking entire audio processing
Prevent loading VST or toggling ZynAddSubFX GUI from blocking entire audio processing. It still blocks audio output from specific VeSTige/ZynAddSubFX but not whole playback.
Address #1825.