surge-synthesizer / stochas

The Stochas Sequencer
https://stochas.org
GNU General Public License v3.0
406 stars 35 forks source link

Crashes in Cantabile #45

Closed toptensoftware closed 3 years ago

toptensoftware commented 3 years ago

Hi,

I'm the developer of VST host Cantabile (https://www.cantabilesoftware.com) and recently received a report from a user that Stochas crashes during reload in Cantabile.

I've reproduced the issue - just load it into Cantabile, save the song file and then try to reload it (or File -> Revert Song). Doesn't happen with other VST 3 plugins, doesn't happen with Stochas in other hosts. Obviously some incompatibility there.

I've not had a chance to try to build stochas and try to figure it out myself and thought I'd post it here in case it's a known issue.

Any help getting this resolved would be appreciated.

Brad

rudeog commented 3 years ago

Brad, coincidentally, I just fixed the issue. I downloaded a Cantabile demo and saw that Cantabile creates and destroys the plugin editor before loading the state to the plugin processor. This is not something other hosts do (or may do things in a different sequence). In any event Stochas should cleanly handle create/destroy in any order. So it was an issue in Stochas.

toptensoftware commented 3 years ago

Hi @rudeog,

Nice... thanks for the fast fix 👍

Just FYI: the reason Cantabile does this is because of HiDPI support. We need to know very early on whether the plugin supports GUI content scaling and the only way to get that is via the plugin view interface. We do this because if the plugin doesn't support it, we use Windows 10's Per-Monitor V2 APIs to scale up the UI ourself but that requires sandboxing the entire plugin to a particular DPI context.

It's messy, but usually works. :)

Brad

baconpaul commented 3 years ago

Ahh this may be why Surge zoom in cantabile seemed off when I tried it.

Are you using the VST3 HDPI api? I went to implement that but couldn't find a DAW which called it.

(Totally off topic though from the stochas problem).

dherndon commented 3 years ago

From the satisfied user.....thanks guys for the teamwork! :-) Stochas and Cantabile make a great pairing for live jamming.....

toptensoftware commented 3 years ago

Hi @baconpaul,

Are you using the VST3 HDPI api?

Which API exactly are you referring to? All Cantabile does is checks if the plugin supports content scaling and if so sets it according to host window dpi scale.

Brad

baconpaul commented 3 years ago

IPlugViewContentScaleSupport

it doesn't seem like many DAWs support it.

How do you check content scaling? But also I haven't tried cantabile in a long time and both it and surge have grown since then so i may be dated.

toptensoftware commented 3 years ago

Yep Cantabile uses IPlugViewContentScaleSupport. It checks for support by calling setContentScaleFactor(1.0f) and checking it returns kResultTrue.