Extremely weird bug : MIDI plugin built on Intel Big Sur works but same code built on M1 Monterey doesn't

I’ve run into something that has been driving me nuts for the last week.

A plugin that we’ve been working on was working fine for another developer, but when I tried to build it on my M1 Mini it would refuse to show up in Live, but worked (mostly) fine in Bitwig and Logic.

To try and figure out if this was something to do with the plugin itself I created a barebones plugin with what I know to be a good setup for MIDI plugins (having developed another MIDI plugin that worked fine in all hosts before).

This is where it gets weird.

On the M1 Mini (Monterey 12.5.1 - Xcode 13.4.1) even the barebones plugin refused to show up in Live’s plugin list, but worked fine in Bitwig and Logic.

However building the same project on my Mac Pro (Big Sur 11.6.8 - Xcode 13.2.1) it works absolutely fine, on both the Mac Pro and Mac Mini, in all hosts.

I only tried building on the Mac Pro as a last resort since I knew the previous plugin I had developed worked fine from that machine, and it was the only variable remaining (just wish I’d thought of it sooner :man_facepalming:).

I’ve no idea if this is some problem with Xcode or it’s something in JUCE, just reporting here in case anyone else either ends up going as crazy as I have been trying to get a MIDI plugin to work properly, or knows what the solution is to be able to build such a plugin on Apple Silicon.

I have an inkling that the issue lies with Xcode though, as I was experiencing a weird bug in the new plugin we’re working on that only showed up in Logic on the M1 (when built on the M1) but has since gone away with the build from the Intel machine.

I’m attaching the barebones test plugin in case anyone from JUCE team feels like looking into this madness.
MidiTest.zip (5.4 KB)

I recommend checking whether the plugin is signed:
codesign -dv --verbose=4 /path/to/plugin.component

On M1, the shared library must be signed in order to load. Some hosts are more picky about this, and require the entire plugin bundle (not just the shared library inside the bundle) to be signed.

2 Likes

OK, I will test this, but doesn’t Projucer set up ad-hoc signing by default these days?

Executable=/Users/richelmes/Library/Audio/Plug-Ins/VST3/MidiTest.vst3/Contents/MacOS/MidiTest
Identifier=MidiTest
Format=bundle with Mach-O thin (arm64)
CodeDirectory v=20400 size=232513 flags=0x20002(adhoc,linker-signed) hashes=7263+0 location=embedded
VersionPlatform=1
VersionMin=720896
VersionSDK=787200
Hash type=sha256 size=32
CandidateCDHash sha256=bb75b0f5bee5ce5c9f92e1c85103e39393cdecfc
CandidateCDHashFull sha256=bb75b0f5bee5ce5c9f92e1c85103e39393cdecfc2b7cb1d1581b6e9c4b9d633f
Hash choices=sha256
CMSDigest=bb75b0f5bee5ce5c9f92e1c85103e39393cdecfc2b7cb1d1581b6e9c4b9d633f
CMSDigestType=2
Executable Segment base=0
Executable Segment limit=7585792
Executable Segment flags=0x0
Page size=4096
CDHash=bb75b0f5bee5ce5c9f92e1c85103e39393cdecfc
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements=none

I could try re-signing it with my proper certificate perhaps?

edit:
:man_facepalming:

I see what has happened… the plugin was only building for ARM, I was using Live 10 to test.

Feel like an idiot now :joy:

1 Like

I think that even in Live 11 (Universal), plug-ins must be built as universal-binaries in order to show up in the plug-in browser. When building in Debug mode, and testing in Live, make sure that the “Build Active Architecture Only” option is set to “No”.

Sorry, I should have thought of that too!

1 Like

Thanks for this, I was wondering why the hell it wasn’t building a fat binary even though Projucer showed that it should be.

1 Like

For me ARM-only plugins show up just fine in Live 11/ARM, it used to be a problem but then fixed once you added the ad-hoc signature to the build process in JUCE.

1 Like

Weird, I tested it out too. I only have Live 11 and 11.1 installed on my M1 machine. Have you been using the 11.2 beta?

1 Like

No, I’m on 11.1.6, this is the behavior I’m seeing here on multiple M1 machines since the official release of the M1-native Live (which you might you want to check you’re running…). I’ve been constantly debugging here like that without building a universal binary which is quite a hassle as the build times are 2x…

1 Like

I think you’re right, I must have tested with the Intel-only copy of Live 11 I had installed. I’d better get rid of that copy and install the newest beta so that doesn’t catch me out in the future!

Ahh. that might be it.
I’ve had a mixed bag and maybe it’s because some projects are always signed while other projects aren’t.