Wrong initial sizing in iOS AUv3 plugin


#1

When I run an AUv3 plugin in iOS GarageBand, the GUI is initially squashed to half its height. The width is correct. I’m using the development version of Juce (commit 3852771).

The squashing seems to happen on a painting level: My resized member functions ensure that the GUI always keeps its aspect ratio and can’t be squashed. The sizing becomes correct once I click / touch somewhere in the plugin GUI. I suppose this triggers a repaint() which is otherwise missing. Sometimes, it corrects itself after a delay of a few seconds.

EDIT: If I manually call repaint() from resized(), it becomes less likely to happen, but still happens sometimes. I think there may be a repaint() missing somewhere in Juce…I don’t have to call repaint() from resized() for other Juce Components.

The resized member function of my custom AudioProcessorEditor class gets called 3 times:

  1. From the setSize call I do in the constructor. Size: 1024 x 335. This is the size plugins have available in iOS GarageBand.
  2. From viewDidLayoutSubviews in the juce_AUv3_Wrapper. Size: 1024 x 768.
  3. Again from viewDidLayoutSubviews, this time with size: 1024 x 335. When I break here, the GUI is visible and has the correct sizing.

After (3), it somehow goes from the correct sizing into being squashed.


#2

iOS AUv3 is Fabian’s domain - he’s away for a couple of weeks unfortunately, but thanks for the report, this sounds like something we’ll need to look into.

I do know however that there were some edge-case bugs which were faults in Garageband, not our code, and this could be one of those. (We’re in close contact with the relevant devs at Apple though, so we’ll get everything sorted out one way or another)


#3

Okay, thank you! It seems to be a kind of race, because it only happens sometimes.

Right now I’m working around it by initially hiding the GUI, and showing it after a one second Timer.


#4

This is a known bug and also has been reported to apple. Currently it’s not quite clear if this is an apple bug or a juce bug. But we should be adding your workaround (or similar) to the juce code for now.


#5

Thanks for clearing that up! I will keep using my workaround for now.


#6

Are there any news to this topic? We’re experiencing similar problems.
Why is “viewDidLayoutSubviews” in juce_AUv3_Wrapper reporting a size of 1024 x 768 (which is never true for AUv3 plugins)?


#7

Your guess is as good as mine. It’s the initial size that Apple seems to resize the view to. I’m not sure why. I think this is a JUCE bug but I haven’t been able to solve this despite already investing many hours. I’ll continue to investigate…


#8

Ok, thank you Fabian - I wish you are lucky to find it soon!


#9

any updates on this? trying to understand the space dimensions from the calling app?


#10

Which host are you using and can you provide a simple test case?