iPlug2 Forum

Mac build runs on one computer but not another

I’m in the final stages of preparing support for macOS and had an issue I’m unsure of how to solve. On my personal Mac, the build works fine - but on a school computer, it crashes the DAW immediately.

My Mac:

Other Mac:

My first guess is that the OS difference is causing errors with some internal APIs or something - but I won’t be able to build the product on the school computer because it is not mine (is there a way to do it on mine?).

This is the last thing I need to fix before release. Thanks for any help!

Edit: I’ve ran lipo on the terminal to check whether the binary is universal and got this:
x86_64 arm64 - which should be universal…?

It might be because metal is not supported on that machine

The solution to that is to build using skia CPU mode, The instructions are on the wiki

1 Like

I ran into a collection of similar errors while compiling for Skia -

Any idea on how to fix this?

Because the skia static library still contains the Metal backend, you still need to link against the Metal framework, e.g.

1 Like

Thanks - however now I am getting a crash upon opening the plugin in Garageband.

Process:               GarageBand [8069]
Path:                  /Applications/GarageBand.app/Contents/MacOS/GarageBand
Identifier:            com.apple.garageband10
Version:               10.4.3 (5433)
Build Info:            MALogic-5433000000000000~4 (10Q107)
App Item ID:           682658836
App External ID:       840921930
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           GarageBand [8069]
User ID:               502

PlugIn Path:             /Library/Audio/Plug-Ins/Components/SK100.component/Contents/MacOS/SK100
PlugIn Identifier:       com.SNFK_MUSIC.audiounit.SK100
PlugIn Version:          1.0.0 (1.0.0)

Date/Time:             2021-06-24 09:20:56.440 -0400
OS Version:            macOS 11.4 (20F71)
Report Version:        12
Anonymous UUID:        9562E7B3-B1E1-8700-16F7-BDCB51124D53

Sleep/Wake UUID:       03E9627D-0295-4F55-903D-B672C4EF72E2

Time Awake Since Boot: 11000 seconds
Time Since Wake:       1300 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [8069]

VM Regions Near 0x18:
    __TEXT                      10ec5c000-110410000    [ 23.7M] r-x/r-x SM=COW  /Applications/GarageBand.app/Contents/MacOS/GarageBand

Application Specific Information:
Belfast | da24e8065c7277eca31f326df90a56b21e93bc2197bc03752f8385706f4718f4 | 1667e55a51193c352d8c1356813850f4fe3fb45b | 2021-03-29_13:46:39

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.SNFK_MUSIC.audiounit.SK100	0x000000012cf7a5e3 iplug::igraphics::APIBitmap::GetScale() const + 0 (IGraphicsPrivate.h:143) [inlined]
1   com.SNFK_MUSIC.audiounit.SK100	0x000000012cf7a5e3 iplug::igraphics::IGraphics::LoadBitmap(char const*, int, bool, int) + 595 (IGraphics.cpp:1743)
2   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfdf42d SK100::SK100(iplug::InstanceInfo const&)::$_1::operator()(iplug::igraphics::IGraphics*) const + 824 (SK100.cpp:64) [inlined]
3   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfdf42d decltype(std::__1::forward<SK100::SK100(iplug::InstanceInfo const&)::$_1&>(fp)(std::__1::forward<iplug::igraphics::IGraphics*>(fp0))) std::__1::__invoke<SK100::SK100(iplug::InstanceInfo const&)::$_1&, iplug::igraphics::IGraphics*>(SK100::SK100(iplug::InstanceInfo const&)::$_1&, iplug::igraphics::IGraphics*&&) + 824 (type_traits:3750) [inlined]
4   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfdf42d void std::__1::__invoke_void_return_wrapper<void>::__call<SK100::SK100(iplug::InstanceInfo const&)::$_1&, iplug::igraphics::IGraphics*>(SK100::SK100(iplug::InstanceInfo const&)::$_1&, iplug::igraphics::IGraphics*&&) + 824 (__functional_base:348) [inlined]
5   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfdf42d std::__1::__function::__alloc_func<SK100::SK100(iplug::InstanceInfo const&)::$_1, std::__1::allocator<SK100::SK100(iplug::InstanceInfo const&)::$_1>, void (iplug::igraphics::IGraphics*)>::operator()(iplug::igraphics::IGraphics*&&) + 824 (functional:1554) [inlined]
6   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfdf42d std::__1::__function::__func<SK100::SK100(iplug::InstanceInfo const&)::$_1, std::__1::allocator<SK100::SK100(iplug::InstanceInfo const&)::$_1>, void (iplug::igraphics::IGraphics*)>::operator()(iplug::igraphics::IGraphics*&&) + 861 (functional:1728)
7   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfa3f52 std::__1::__function::__value_func<void (iplug::igraphics::IGraphics*)>::operator()(iplug::igraphics::IGraphics*&&) const + 10 (functional:1881) [inlined]
8   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfa3f52 std::__1::function<void (iplug::igraphics::IGraphics*)>::operator()(iplug::igraphics::IGraphics*) const + 10 (functional:2556) [inlined]
9   com.SNFK_MUSIC.audiounit.SK100	0x000000012cfa3f52 iplug::igraphics::IGEditorDelegate::LayoutUI(iplug::igraphics::IGraphics*) + 34 (IGraphicsEditorDelegate.h:71)
10  com.SNFK_MUSIC.audiounit.SK100	0x000000012cfd5fbc iplug::igraphics::IGraphicsMac::OpenWindow(void*) + 268 (IGraphicsMac.mm:102)
11  com.SNFK_MUSIC.audiounit.SK100	0x000000012cfb2b7f -[SK100_View uiViewForAudioUnit:withSize:] + 95 (IPlugAU_view_factory.mm:60)

Here’s my mac config:

// ------------------------------
EXTRA_LNK_FLAGS = -framework Metal -framework MetalKit -framework OpenGL -framework WebKit $(IGRAPHICS_LNK_FLAGS)




Any ideas on fixing this?

Edit: I removed all of my controls that moved and got it working - I’m guessing this thread will help

Sadly I don’t think SKIA CPU is currently a viable option on macOS. Blitting on a retina screen is just too slow. I tried your plug-in and the UI crawls with Skia CPU.

For info on how hard Apple makes this…


Using IGRAPHICS_GL3 instead of IGRAPHICS_METAL may be an option, if you really must support this machine

Actually debugging SKIA CPU with your plugin I have come across a very strange behaviour. Somehow using a different bitmap for each knob is affecting the frame rate!

Hmmm, interesting. I just tested another product with only 5 knobs on a school computer and got a relatively usable frame rate compared to the other one.

I suppose there’s a nice line in the middle between realism and performance, and performance is more important. I’ve been meaning to build a little framework for brand recognition using vector graphics anyway lol.

Aside from changing the renderer to Skia, I also ended up creating @2x files for my assets and that fixed all of the crashing on the school Mac. I’m seeing pretty good results now, thanks for your work!