Author Topic: Help for Vst on OSX  (Read 1383 times)

Chris

  • Posts: 2221
Re: Help for Vst on OSX
« Reply #25 on: 27 Sep '24 - 21:31 »
dsp := BASS_VST_ChannelSetDSP(0, pChar(Filename), BASS_UNICODE, 0);

The first Variable must be a Valid HSTREAM and not Zero.


« Last Edit: 29 Sep '24 - 00:18 by Chris »

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #26 on: 30 Sep '24 - 16:39 »
Thank you
 :)

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #27 on: 5 Oct '24 - 00:44 »
Unfortunately I have to give you bad news: the file you gave me corrected does not work on OSX.
entering this crashes:
dsp := BASS_VST_ChannelSetDSP(0, pChar(Filename), BASS_UNICODE, 0);


Apple's response is this:
Application Specific Information:
*** CFRelease() called with NULL ***


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   CoreFoundation                          0x1859e75f4 CFRelease.cold.1 + 16
1   CoreFoundation                          0x185806d44 CFRelease + 132
2   libbass_vst.dylib                       0x106df8890 0x106df4000 + 18576
3   CoreFoundation                          0x185893e28 __CFRunLoopDoTimer + 1012
4   CoreFoundation                          0x185893938 __CFRunLoopDoTimers + 356
5   CoreFoundation                          0x1858790f0 __CFRunLoopRun + 1856
6   CoreFoundation                          0x185878334 CFRunLoopRunSpecific + 572
7   HIToolbox                               0x190cb10cc RunCurrentEventLoopInMode + 292
8   HIToolbox                               0x190cb6ebc ReceiveNextEventCommon + 636
9   HIToolbox                               0x190cb7020 _BlockUntilNextEventMatchingListInModeWithFilter + 76
10  AppKit                                  0x1893bca70 _DPSNextEvent + 660
11  AppKit                                  0x189ce27b8 -[NSApplication(NSEventRouting)
« Last Edit: 5 Oct '24 - 11:54 by Salvo »

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #28 on: 5 Oct '24 - 10:14 »
I put a message before it crashed (normally it takes 3 seconds before it crashes)
showmessage(Bass_ErrorGetCode)
and it always gives me 41.
I can't understand why compiling and running the program under IDE delphi instead does not give me the error.
Outside IDE DELPHI instead crashes.

 
« Last Edit: 5 Oct '24 - 11:55 by Salvo »

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #29 on: 5 Oct '24 - 16:43 »
From many tests done I am 100% sure that there is an error on the libbass_vst.dylib library on the call
dsp := BASS_VST_ChannelSetDSP(ch, pChar(Filename), BASS_UNICODE, 0);

compiling in debug mode, it works without Apple's signature.
compiling in release mode with Apple signature the program crashes.
Library that cannot be used for OSX.
Ian only you can get rid of this bug. >:(
« Last Edit: 5 Oct '24 - 16:57 by Salvo »

Ian @ un4seen

  • Administrator
  • Posts: 26209
Re: Help for Vst on OSX
« Reply #30 on: 7 Oct '24 - 12:41 »
I guess the BASS_VST_ChannelSetDSP call failed, ie. returned 0? It looks like BASS_VST will still try to unload the VST (with NULL handle) then. Here's an update that should stop doing that:

   www.un4seen.com/stuff/bass_vst-osx.zip

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #31 on: 7 Oct '24 - 15:43 »
returns BASS_VST_ChannelSetDSP -> 0.

« Last Edit: 8 Oct '24 - 09:37 by Salvo »

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #32 on: 7 Oct '24 - 15:47 »
Compiling in debug mode, it works without Apple's signature.
compiling in release mode with Apple signature, returns BASS_VST_ChannelSetDSP -> 0.

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #33 on: 8 Oct '24 - 09:34 »
Nothing to do gives me :
BASS_VST_ChannelSetDSP -> 0.
Bass_ErrorGetCode -> 41

and it always crashes.

Ian @ un4seen

  • Administrator
  • Posts: 26209
Re: Help for Vst on OSX
« Reply #34 on: 8 Oct '24 - 13:22 »
Is it actually crashing now or just failing to load the VST? And are all VST affected? You could try loading the VST bundle in your own code using CFBundleCreate and CFBundleLoadExecutableAndReturnError, and seeing whether that also fails in your release/signed build. If it does, you can check the error from CFBundleLoadExecutableAndReturnError to hopefully find out why.

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #35 on: 8 Oct '24 - 14:17 »
It doesn't crash but it always comes back
BASS_VST_ChannelSetDSP -> 0.
Bass_ErrorGetCode -> 41

implement CFBundleCreate and CFBundleLoadExecutableAndReturnError, from delphi I don't know how to do it.

"""""And are all VST affected? """"
Yes

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #36 on: 8 Oct '24 - 14:36 »
CFBundleCreate ??
I didn't understand whether to load the vst like "limeter.svt" or the "bass_vst.dylib" library ?

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #37 on: 8 Oct '24 - 15:22 »
BundleURL := CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR('/Library/Audio/plug-Ins/VST/TDR Nova.vst'), kCFURLPOSIXPathStyle, True);

          // Create the CFBundle
          Bundle := CFBundleCreate(kCFAllocatorDefault, BundleURL);

I loaded the bundle "TDR Nova.vst" and it gives me : Unable to load the package "TDR Nova".
If I run the program by launching it from the Delphi IDE with debug instead it loads it perfectly.

So the problem is delphi ???
« Last Edit: 8 Oct '24 - 15:29 by Salvo »

Ian @ un4seen

  • Administrator
  • Posts: 26209
Re: Help for Vst on OSX
« Reply #38 on: 8 Oct '24 - 16:39 »
To find the cause, perhaps you could compare Delphi's "release" and "debug" build settings, and change the "release" settings to be more like the "debug" settings. The linker (and signing) settings would probably be a good place to start.

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #39 on: 8 Oct '24 - 21:32 »
Thanks Ian for the suggestion but I already did it to no avail,, I put the linker settings the same as the debug, but nothing to do.
Maybe there is a problem on Delphi 12.
However, I won't give up, I'll let you know when I've found the cause.

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #40 on: 9 Oct '24 - 14:34 »
Going through the Apple logs I found this:
2024-10-09 13:40:17.617246+0200 0x2478e    Error       0x0                  0      0    kernel: (AppleMobileFileIntegrity) Library Validation failed: Rejecting '/Users/salvo/Music/Karaoke5/TDR Nova.vst/Contents/MacOS/TDR Nova' (Team ID: xxxxxxxxxxxxT, platform: no) for process 'KaraokeFive(2692)' (Team ID: xxxxxxxxx, platform: no), reason: mapping process and mapped file (non-platform) have different Team IDs
« Last Edit: 9 Oct '24 - 16:12 by Salvo »

Chris

  • Posts: 2221
Re: Help for Vst on OSX
« Reply #41 on: 9 Oct '24 - 14:50 »
« Last Edit: 9 Oct '24 - 16:45 by Chris »

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #42 on: 9 Oct '24 - 15:36 »
Ok Chris and so you can't upload the signed VST files?

Salvo

  • Posts: 175
Re: Help for Vst on OSX
« Reply #43 on: 9 Oct '24 - 16:08 »
Problem solved :)

It was enough to put a flag on Delphi - > Disable Library validation

Thank you all for your help.