Loading PVST dll

Post Reply
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Loading PVST dll

Post 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 ?
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Loading PVST dll

Post 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...
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post 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.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Loading PVST dll

Post 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
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post 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...
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post by polac »

am i supposed to do something before calling the mi destructor ?
No it should work this way.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Loading PVST dll

Post 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.
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post by polac »

Ok I'll take a look.
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post 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.
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post by polac »

Also I cannot find a memory leak with the size of exactly 4 bytes.
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post by polac »

So I suppose all the leaks without the filename and line are from Buzz, not from the loaders.
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Loading PVST dll

Post 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).
User avatar
UNZ
Posts: 808
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Loading PVST dll

Post 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 :)
polac
Posts: 415
Joined: Wed Nov 23, 2011 9:19 am
Contact:

Re: Loading PVST dll

Post by polac »

That's odd.
Post Reply