JoepVanlier / ysfx

Hosting library for JSFX
Apache License 2.0
37 stars 3 forks source link

[BUG] Crash when interacting with GUI #57

Closed LarsMS97 closed 1 month ago

LarsMS97 commented 1 month ago

I tried the two latest 64bit VST3 and CLAP releases for Windows (v0.0.26 and v0.0.25), and both crash in Bitwig Studio when pressing any botton on the ysfx GUI. I can drag and drop .jsfx files into the GUI and it loads and shows the GUI, but it also crashes when I interact with the GUI of the loaded jsfx plugin itself.

I am on Windows 10. I don't know if there's a log file I can upload or something, if there is or if you need any additional info please hit me up. Thank you for your time and effort on this, I am really looking forward to using your plugins :)

JoepVanlier commented 1 month ago

Hey, sorry to hear that you're having trouble with the plugins, but thanks for reporting it. Hopefully we can figure out together what's going on.

I've just installed the latest bitwig demo, and unfortunately I have been unable to reproduce it so far.

A few things just to double check so I have them clear for me before we start attempting to reproduce the bug on my end:

Right now there is no logging in ysfx itself. What I could do is make a debug build, but let's see if the bitwig logs tell us more first.

LarsMS97 commented 1 month ago

Hi, ofc let me quickly run through these. Sorry I did not do this in the initial message, I also figured out some additional stuff while checking through these. My response got a bit messy so I will regroup these in a different order so that its easier to read.

TL;DR:

Crash happens when pressing any part of the GUI but plugin is completely useable otherwise.

Software / Installation:

I used the pre-build releases on the releases panel. I took both of the sub-folders from the VST3 folder and put those into the VST3 folder on my PC. They now sit at C:\Program Files\Common Files\VST3\ysfx-s FX.vst3 and C:\Program Files\Common Files\VST3\ysfx-s instrument.vst3. The crash happens both with the fx and the instrument version, as well as the CLAP version of the plugin. For the logs later, I removed the CLAP version from my PC. Bitwig is on v5.2.4, which i think is the latest. It uses the CLAP API v1.2.1 and the VST API v3.7.9, with the skia-d3d graphics backend. I have a NVIDIA GTX 1060.

Details:

I load an empty project in Bitwig and add (+) either the fx or instrument version to a track. The GUI will show and I can open and close it, I can move the window, I can load .jsfx files by drag and drop, I can change plugin parameters through Bitwigs internal parameter view and it will reflect these changes in the GUI of a loaded .jsfx plugin and process audio. So it is completely usable if you ignore the GUI and only drag and drop the .jsfx files. But it will crash as soon as I click anywhere on the plugin window itself or resize the interface. So it doesn't seem to be the GUI buttons that are causing this issue. So e.g. adding the ysfx plugin to a track and then pressing "load" will crash the plugin, but so will adding the plugin and then clicking the empty space between "load" and "recent", or clicking anywhere on the GUI of a loaded .jsfx plugin withing ysfx.

Crash behaviour:

When it crashes, everything just kind of freezes for a solid 5s, I can no longer interact with the ysfx GUI or the GUI of Bitwig itself, move the window or shutdown the project. This part is a bit weird because Bitwig has a plugin-sandbox feature which should prevent plugins from hanging Bitwig even if they crash, and it also doesn't matter at which "safety" level I put that sandbox feature. It even happens if you sandbox all plugins individually. I have never seen this behaviour from Bitwig with any plugin, so that's interesting, but I can imagine that this particular behaviour is specific to Bitwig. I will try out a different DAW and see how it behaves there and report back soon. It then says "ysfx-s FX hung while processing audio" in the top right corner, but I don't know if it actually has anything to do with audio processing, since it also says that if there is no audio playing, or if the plugin is suspsended or deactivated. It offers you to shut down the plugin with a button below the message but I can't click it at that point yet because the Bitwig GUI is still hanging. After another 5s, the plugin sandbox crashes, the ysfx window dissapears, and I can interact with Bitwig again and reload the plugin.

Logs:

These logs are for the VST3 version. I attached the complete logs in case you want to see them. They are for starting Bitwig studio, opening an empty project, loading the plugin, clicking somewhere, waiting for it to crash and then closing Bitwig again, just like I described above.

The logs are filled with random bits about scanning other plugins, which Bitwig always does at startup, so I have tried to extract just the part about your plugin:

The part in engine.log about ysfx is this:

[2024-10-13 11:59:39.584 BITWIG_ENGINE info] About to start the following process:  C:\Program Files\Bitwig Studio\bin\BitwigPluginHost-X64-SSE41.exe host all 17756-1 8 48000 480 dpi-aware 20a8b7cd-dc84-a546-80a4-90eb21cec8cf
[2024-10-13 11:59:39.602 BITWIG_ENGINE info] Plug-in host process successfully initialized
[2024-10-13 11:59:39.602 BITWIG_ENGINE info] Creating plugin audio thread proxy 0
[2024-10-13 11:59:39.602 BITWIG_PLUGIN_HOST info] PluginHost: Starting new audio thread for processing plugin 0
[2024-10-13 11:59:39.608 BITWIG_PLUGIN_HOST info] About to create a VST 3 plugin instance for ABCDEF019182FAEB5334494B7973667A (C:\Program Files\Common Files\VST3\ysfx-s FX.vst3\Contents\x86_64-win\ysfx-s FX.vst3)
[2024-10-13 11:59:42.795 BITWIG_PLUGIN_HOST Jean Pierre Cimalando / Joep Vanlier ysfx-s FX info] Closing plug-in undo history file
[2024-10-13 11:59:45.733 BITWIG_ENGINE error] Phase 1 of audio timeout elapsed: 2509 ms, current time: 328706.0, lastProcessCallTime: 328704.0
[2024-10-13 11:59:48.246 BITWIG_ENGINE error] Phase 2 of audio timeout elapsed: 2512 ms, current time: 328709.0, lastProcessCallTime: 328704.0
[2024-10-13 11:59:48.246 BITWIG_ENGINE error] Phase 3 of audio timeout elapsed: 5021 ms, current time: 328709.0, lastProcessCallTime: 328704.0
[2024-10-13 11:59:48.246 BITWIG_ENGINE error] Audio thread hung inside engine process call
[2024-10-13 12:0:4.935 BITWIG_ENGINE error] Could not read repsonses: End of stream: Broken pipe
[2024-10-13 12:0:4.935 BITWIG_ENGINE error] Could not process audio on client audio thread 4 using remote audio thread 0: End of stream: Broken pipe
[2024-10-13 12:0:4.935 BITWIG_ENGINE info] Killing pluginhost process
[2024-10-13 12:0:4.950 BITWIG_ENGINE error] Audio thread no longer hung inside engine process call
[2024-10-13 12:0:4.950 BITWIG_ENGINE info] Waiting for plugin host process to exit
[2024-10-13 12:0:4.950 BITWIG_ENGINE info] Plugin host process exited with code: -1073740771

And for BitwigStudio.log:

[2024-10-13 11:59:39.242 notifications info] Analyzing audio...: 
[2024-10-13 11:59:39.265 float-document-master info] Loaded 0 of 1 plug-ins
[2024-10-13 11:59:39.266 Jean Pierre Cimalando / Joep Vanlier ysfx-s FX 1 info] Started loading plug-in (0 queued)
[2024-10-13 11:59:39.266 float-document-master info] FloatDocument.isEngineReadyChanged(true->false)
[2024-10-13 11:59:39.274 float-library-metadata info] Starting plugin host process with command: "C:\Program Files\Bitwig Studio\bin\BitwigPluginHost-X64-SSE41.exe" check-dpi-aware ABCDEF019182FAEB5334494B7973667A "C:\Program Files\Common Files\VST3\ysfx-s FX.vst3\Contents\x86_64-win\ysfx-s FX.vst3"
[2024-10-13 11:59:39.807 Jean Pierre Cimalando / Joep Vanlier ysfx-s FX 1 info] Engine loaded plug-in
[2024-10-13 11:59:39.808 Jean Pierre Cimalando / Joep Vanlier ysfx-s FX 1 info] Finished loading plug-in  (0 queued)
[2024-10-13 11:59:39.809 float-document-master info] Loaded 1 of 1 plug-ins
[2024-10-13 11:59:39.809 float-document-master info] Loading all plug-ins took 543 ms
[2024-10-13 11:59:39.847 float-document-master info] FloatDocument.isEngineReadyChanged(false->true)
[2024-10-13 11:59:40.694 float-document-master info] FloatDocument.isEngineReadyChanged(true->false)
[2024-10-13 11:59:40.735 float-document-master info] FloatDocument.isEngineReadyChanged(false->true)
[2024-10-13 11:59:48.248 notifications error] ysfx-s FX hung while processing audio: The plug-in is no longer processing audio.
You can wait a bit longer to see if it starts responding again or terminate the plug-in.
[2024-10-13 12:00:04.936 Jean Pierre Cimalando / Joep Vanlier ysfx-s FX 1 error] Plug-in crashed
[2024-10-13 12:00:04.938 float-document-master info] FloatDocument.isEngineReadyChanged(true->false)
[2024-10-13 12:00:04.944 float-document-master info] FloatDocument.isEngineReadyChanged(false->true)
[2024-10-13 12:00:04.947 notifications error] Plug-ins crashed: 

I hope this helps. If you want me to compile from source or want to shoot me a debug version I would gladly help you. I could also see if I could upload a video of the problem if there's still anything unclear, since you said that you are not familiar with Bitwig. I will also now go and try it in another DAW (which I probably should have done to begine with...)

Again, thank you for your time and effort!

LarsMS97 commented 1 month ago

Okay this is emberrassing especially after spending 30m writing that report, but I was about to install Repear to try it there but had to restart my PC due to updates, and I tried Bitwig again and now it just works...? I guess I should have tried turning it on and off again, like you should always do. Oh well.

In any case, sorry for the inconvenience and thank you for this awesome piece of software. I will be using it alot in the future now that it works.

JoepVanlier commented 1 month ago

Interesting. From the logs and behavior description alone, I am not able to gauge what exactly went wrong, other than that it seems that from bitwig's point of view the plugin stopped responding entirely. What I don't quite get is why both the message thread and the audio thread seem to just hang (I would expect those to work independently).

Do you remember what you updated that you had to reboot for?

Considering it doesn't reproduce right now anymore, I think it is indeed probably best to leave it closed for now, but please don't hesitate to reopen if it starts happening again.

LarsMS97 commented 3 weeks ago

As far as I could tell it was just a regular Windows Update, I wish I could provide more info on this. If this occurs again I will bump this tread. Thanks again for your time