Page 1 of 1

Loading PVST dll

Posted: Sat May 02, 2020 10:38 am
by UNZ
i'm trying to load the PVST dll in my buzz machine loader, so far everything works ok, but two things don't work:

pLI->GetInstrumentList() doesn't seem to return anything, this is strange as buzé seems to be able to get a list of instruments, but i never get the Write() callbacks in CMachineDataOutput

when i bring up the "Open" dialog and choose a VST, it doesn't look like pvst is loading it
Command(0) brings up the file open dialog as expected
Command(3) or DoubleClickMachine should then show the GUI i think, but it just brings up the "Open" dialog again, as the vst was never loaded.

any ideas ?

Re: Loading PVST dll

Posted: Sat May 02, 2020 1:24 pm
by UNZ
nevermind, the problem solved itself by updating to the latest PVST! :)

EDIT: the real problem seems to have been that i can't just load machines.dll and Polac VSTi 1.1.dll from my normal buzz folder, but have to place the whole contents of the zip file into my DEBUG / RELEASE folder... quite obviously...

Re: Loading PVST dll

Posted: Sat May 02, 2020 7:22 pm
by polac
when i bring up the "Open" dialog and choose a VST, it doesn't look like pvst is loading it
Without the machines.dll you cannot load the vst in pvst, it scans the vst at first, the open dialog will fail then.

Re: Loading PVST dll

Posted: Sat May 02, 2020 8:14 pm
by UNZ
thanks for your reply!
i got it to work, but now i have another small problem:

mi->Init(nullptr);
mi_ex->SetInstrument("mda Piano");
delete mi;

this sequence leads to a 4 byte memory leak.

mi->Init(nullptr);
//mi_ex->SetInstrument("mda Piano");
delete mi;

this does not leak.

(btw, happens with other VST too, so i think it's something to do with the loader?)

am i supposed to do something before calling the mi destructor ?
using v1.1.10b33

Re: Loading PVST dll

Posted: Sun May 03, 2020 9:38 am
by polac
I think the mda piano(or was it the epiano) was a little bit buggy on closing the vst, but you say it also happens with other plugins, odd. Hard to say where the leaking comes from as i do lots of things in SetInstrument/destructor. I would say 4 bytes is not much but...

Re: Loading PVST dll

Posted: Sun May 03, 2020 9:39 am
by polac
am i supposed to do something before calling the mi destructor ?
No it should work this way.

Re: Loading PVST dll

Posted: Sun May 03, 2020 11:59 am
by UNZ
i use this to find leaks, it served me very well:
https://docs.microsoft.com/en-us/visual ... ew=vs-2019

basically if you load 1 plugin: 4 bytes leak, if you load 2 plugins: 8 bytes leak and so on, so yeah it's probably something allocated after SetInstrument() that does not get free'd in the destructor.

Re: Loading PVST dll

Posted: Sun May 03, 2020 5:45 pm
by polac
Ok I'll take a look.

Re: Loading PVST dll

Posted: Sun May 03, 2020 8:00 pm
by polac
Doesn't help me as it seems, it shows a ton of memory leaks, even if i call _CrtDumpMemoryLeaks() in the constructor. Also i defined _CRTDBG_MAP_ALLOC, it should show up filename and line number of the memory leak but it doesn't.

Re: Loading PVST dll

Posted: Sun May 03, 2020 8:08 pm
by polac
Also I cannot find a memory leak with the size of exactly 4 bytes.

Re: Loading PVST dll

Posted: Sun May 03, 2020 8:15 pm
by polac
So I suppose all the leaks without the filename and line are from Buzz, not from the loaders.

Re: Loading PVST dll

Posted: Sun May 03, 2020 9:16 pm
by UNZ
it's easier to test in a .exe, i will try to make a minimal repro .exe to send you.

this is just a wild guess, but 4 bytes sounds like a pointer (testing this in a 32bit exe), and since it only occurs when loading a vst dll, maybe it is a missing freelibrary matching the loadlibrary ? or missing a closehandle somewhere? i also don't get a line number, so it must be somewhere in external code i think (at least somewhere where i don't have a pdb).

Re: Loading PVST dll

Posted: Sun May 03, 2020 11:55 pm
by UNZ
OK, this looks like it's something on my end, i copied the exact same code into a new project (to make a minimal repro), but then just compiled and it doesn't leak! So it must be something with my project / compiler settings, sorry to bother you :)

Re: Loading PVST dll

Posted: Mon May 04, 2020 10:21 am
by polac
That's odd.