iPhone X + OpenGL audio glitch


#1

Hi,

I’ve recently been hunting a strange audio glitch that only affected certain iOS devices, specifically iPhone X running iOS 12.1.

I’d like to share with you how I solved this.

Using JUCE v5.3.2. In my standalone audio plugin, I have the following:

MyAudioProcessorEditor::MyAudioProcessorEditor(MyAudioProcessor& p)
    : AudioProcessorEditor(&p), processor(p) {
    MainComponent* mc = new MainComponent(this, &p);
    mainComponent.reset(mc);
    addAndMakeVisible(mainComponent);

#if JUCE_OPENGL
    glContext.setRenderer(this);
    glContext.setMultisamplingEnabled(true);
    glContext.setContinuousRepainting(true);
    glContext.setComponentPaintingEnabled(true);
    glContext.setSwapInterval(1);
    Component* top = getTopLevelComponent();
    glContext.attachTo(*top);
    
    if (ComponentPeer* peer = getPeer())
        peer->setCurrentRenderingEngine(0);

#endif
}

This caused iPhone X to glitch. On other hardware, e.g. iPad 6th Gen, this works fine.

However, doing the following and turning multi-sampling OFF fixes it.

glContext.setMultisamplingEnabled(false);

I don’t know why this is is, but if anyone else is having this issue, this setting might help you.


#2

What are your results with the latest release of JUCE?


#3

I haven’t upgrade to 5.4.1 yet. Give me a couple of days and I’ll try it.


#4

Just upgraded to 5.4.1 (quicker than I expected). I get the same glitch on iPhone X with multi-sampling enabled.