Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools
Old 12-09-2024, 03:41 AM   #1
Reaktor:[Dave]
Human being with feelings
 
Reaktor:[Dave]'s Avatar
 
Join Date: Jun 2010
Location: Berlin
Posts: 680
Default [7.27]CLAP: Invalid State Transiton on request_restart()

A CLAP plugin changing its parameter count at runtime loaded in REAPER will trigger a misbehaving host check when using the clap-helpers. These helpers include some checks enforcing the correct interaction between a CLAP plugin and a CLAP host.

Most of the time, it goes like this:
  1. (during clapProcess) plugin calls host->request_restart
  2. (host calls) clapStopProcessing
  3. (host calls) clapStartProcessing (weird?)
  4. (host calls) clapDeactivate
  5. (during clapDeactivate) plugin applies parameter changes and calls paramsExtension->rescan()
  6. (host calls) clapActivate
  7. (host calls) clapStartProcessing (self._isProcessing is already true due to 'weird?', triggers hostMisbehaving)

That will trigger this check to fail: https://github.com/free-audio/clap-h...lugin.hxx#L392

The first clapStartProcessing is called on a different thread than the second clapStartProcessing call.

Sometimes the check in "clapProcess()" at check "!self._isActive" fails: https://github.com/free-audio/clap-h...lugin.hxx#L449
When that happens in the debugger, the _isActive state is already at true, which shouldn't have triggered the check. This is likely due to the clapStartProcessing calls happening on different threads, but I'm guessing.

I'd expect REAPER to not call clapStartProcessing before clapDeactivate and also not to call that twice. I'm also not sure why the two clapStartProcessing calls happen on different threads. This is happening on Windows 10 with REAPER v7.27.
Reaktor:[Dave] is offline   Reply With Quote
Old 12-09-2024, 05:01 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,783
Default

ah, I think I see why this would be, fixing!
Justin is offline   Reply With Quote
Old 12-09-2024, 06:52 AM   #3
Reaktor:[Dave]
Human being with feelings
 
Reaktor:[Dave]'s Avatar
 
Join Date: Jun 2010
Location: Berlin
Posts: 680
Default

Can confirm v7.28 fixes this. Thanks a lot!
Reaktor:[Dave] is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.