You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a plugin that may change latency on the fly. However, I've found that when changing the latency, it might crash the plugin when using the CLAP version.
Here's a recording of me causing a crash by change the latency a bunch (with a debugger attached):
Code_Wiz7EV7vaP.mp4
The crash seems to start from the CLAP wrapper's activate function, this part:
// This preallocates enough space so we can transform all of the host's raw channel// pointers into a set of `Buffer` objects for the plugin's main and auxiliary IO*wrapper.buffer_manager.borrow_mut() =
BufferManager::for_audio_io_layout(max_frames_count asusize, audio_io_layout);
Trying to borrow the buffer manager causes this error:
The code I used to change latency is the following:
// self.latency_changed is a `Arc<AtomicBool, Global>`// code from Diopser example pluginlet latency_changed = self.latency_changed.compare_exchange(true,false,Ordering::Acquire,Ordering::Relaxed).is_ok();if latency_changed {let lookahead_samples =
self.params.lookahead.value() / 1000.0* ctx.transport().sample_rate;nih_log!("Changing latency samples to:");nih_dbg!(lookahead_samples.round()asu32);// update latency for daw, is no-op if value is same
ctx.set_latency_samples(lookahead_samples.round()asu32);}
That code is run in the process() loop
The text was updated successfully, but these errors were encountered:
I'm trying to write a plugin that may change latency on the fly. However, I've found that when changing the latency, it might crash the plugin when using the CLAP version.
Here's a recording of me causing a crash by change the latency a bunch (with a debugger attached):
Code_Wiz7EV7vaP.mp4
The crash seems to start from the CLAP wrapper's
activate
function, this part:Trying to borrow the buffer manager causes this error:
The code I used to change latency is the following:
That code is run in the
process()
loopThe text was updated successfully, but these errors were encountered: