I think iOS Audio is broken in develop


#1

I created a new test app, Standalone Plugin for iOS. All it does is generate a sine wave. The only changes from the default app is my processBlock which looks like this:

void IaatestAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
    const int totalNumOutputChannels = getTotalNumOutputChannels();

    buffer.clear();

    float* channelData0 = buffer.getWritePointer (0);
    float* channelData1 = totalNumOutputChannels > 1 ? buffer.getWritePointer (1) : nullptr;
    
    double currentStep = 200 / getSampleRate();
    
    const int num =  buffer.getNumSamples();
    for (int i = 0; i < num; i++)
    {
        phase += currentStep;
        if (phase >= 1.0)
            phase -= 1.0;
        
        float val = 0;
        
        val = std::sin (phase * float_Pi * 2);
        
        channelData0[i] = val;
        if (channelData1 != nullptr) channelData1[i] = val;
    }
}

It works fine on macOS or iOS if I build from master. But if I build from develop, it works fine on macOS but I only get noise in the right channel on iOS. Wave of output here:

https://vocaroo.com/i/s0YR72xPcS61

Any idea what’s changed lately? I’m compiling with Xcode 8.2.1 The code is here in the IAATest folder https://github.com/FigBug/juce_bugs I’ve also reproduced it on another machine running Xcode 8.3.3


#2

The iOSAudioDevice class has been completely refactored. However, I’m afraid I can’t reproduce your problem.

I cloned the GitHub repo, built the project, ran it on an iPad Mini 3 with iOS 11.1 and everything worked as expected.


#3

I’m still on iOS 10, testing on a iPhone 7. Does it on both the device and the simulator.


#4

OK, I can reproduce it in the simulator. Will investigate.


#5

Fixed:

https://github.com/WeAreROLI/JUCE/commit/a2bf8d49b64b1b63e8b850c8a3449cf0a06f033a