Audio playback is sluggish when Mic (input device) is unplugged from the system

I have observed a weird behaviour in our application (on Mac OS) which I was able to reproduce in JUCE Demo as well. If we select an audio input device for which appropriate hardware is not connected and then play audio, the playback becomes very sluggish and has noisy artefacts.
These are the steps to reproduce to this issue.

  1. Create Aggregate Device with Built-In Microphone through Audio MIDI Setup
  2. Plug headphone with Mic in your system
  3. Select Aggregate Device as input in Settings of JUCE Demo. You should be able to use headphone and Mic as output and input device respectively.
  4. Unplug headphone from the system
  5. Test audio playback by clicking on “Test” button in Settings.

JUCE Version: 5.2.0
Mac OS: 10.13.2
Headphone Used: Standard earphones available with iPhone

1 Like

I’m not an expert but could it be a Sample Rate issue?

Are you using the latest version of juce (i.e. the develop brach)?

There was some work recently on CoreAudio devices that might make a difference.

Hi Ian,

Thanks for taking time to respond. I investigated this issue and found that it has nothing to do with sample rate.


Hi Jules,

Thanks for taking time to respond to this issue!

We are using develop branch. I tried Time Profiler instrument (on Debug config) to find the root cause. It seems that there is some issue in AudioIODeviceCombiner::DeviceWrapper::audioDeviceIOCallback function. There is a sleep of 1 ms when this situation occurs, which does not happen in normal playback.

This is the last commit that we are using.


I can reproduce this - we’re looking at it now.

1 Like


1 Like

I will fetch these changes from develop branch and test the issue.


Wait a little while - I’ve uncovered some additional problems. Should have them sorted today.

Use this commit: