# DemoRunner fails to initialise audio I/O

**URL:** <https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315>\
**Category:** General JUCE discussion\
**Created:** [March 5, 2024, 1:44pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315 "2024-03-05T13:44:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 1:44pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/1 "2024-03-05T13:44:28Z")

</div>

Hi,

When I set the sample rate of the Macbook Air speakers to 48Khz using Audio MIDI Setup, the DemoRunner input/output devices are initialized as \<\< none \>\>.  
Upon reopening the DemoRunner, the input/output devices are correctly initialised to “Macbook Air Speakers” and “Macbook Air Microphone” with the sample rate set to 44.1KHz.

Furthermore, while the DemoRunner is running, if you modify the samplerate in the Audio Midi Setup, the samplerate within the DemoRunner fails to follow along with the settings in the Audio Midi Setup.

Tested with:

- macOS 14.3.1
- M1
- JUCE 7.0.10

Best,

Jelle

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 5, 2024, 2:47pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/2 "2024-03-05T14:47:07Z")

</div>

I’m unable to repro with Macbook Pro / M1 Pro, macOS 14.3.1, JUCE develop.

Changing the sample rate appears to work in both directions: setting the rate in Audio Midi Setup updates the DemoRunner and vice versa.

Do you have other Macs you can use for testing? Maybe there’s something unusual about the environment on the Macbook Air.

---

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 2:59pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/3 "2024-03-05T14:59:06Z")

</div>

We concluded the same behaviour on another mac mini m1 machine.

Have you tried to set the samplerate of the macbook air speakers to 48K before launching the DemoRunner?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 5, 2024, 3:01pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/4 "2024-03-05T15:01:49Z")

</div>

> [@jellebakker](#):
>
> Have you tried to set the samplerate of the macbook air speakers to 48K before launching the DemoRunner?

Yes, after the DemoRunner launches, I see “MacBook Pro Speakers” and “MacBook Pro Microphone” selected, with a samplerate of 48KHz and a buffer size of 512 samples.

---

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 3:02pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/5 "2024-03-05T15:02:36Z")

</div>

Hmm that’s strange, I’ll investigate it a bit more and let you know my findings.

Thanks for testing.

---

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 3:20pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/6 "2024-03-05T15:20:56Z")

</div>

@reuk

I just played a bit more with it, and I found that in order to reproduce it, I have to change the samplerate a few times in Audio Midi Setup before launching DemoRunner.

Could you try this:

1. Close DemoRunner
2. Set Macbook Air Speakers samplerate to 44.1K from within Audio Midi Setup
3. Set Macbook Air Speakers samplerate to 48K from within Audio Midi Setup
4. Launch DemoRunner

After step 4, the DemoRunner shows input and output devices as \<\< none \>\>.

1. Close and relaunch DemoRunner

After step 5, the DemoRunner shows “MacBook Pro Speakers” and “MacBook Pro Microphone”.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 5, 2024, 5:39pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/7 "2024-03-05T17:39:41Z")

</div>

I can repro something similar. It looks like this only happens when there are different sample rates set for the speakers and microphone in Audio Midi Settings before launching the DemoRunner.

---

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 7:07pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/8 "2024-03-05T19:07:00Z")

</div>

Do you think this is a JUCE bug?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 5, 2024, 7:07pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/9 "2024-03-05T19:07:48Z")

</div>

Likely, but will need a bit more investigation.

---

<div class="post-metadata">

**Author:** ![jellebakker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jellebakker/32/17053_2.png) [@jellebakker](https://forum.juce.com/u/jellebakker)\
**Post date:** [March 5, 2024, 7:13pm UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/10 "2024-03-05T19:13:50Z")

</div>

Thanks, I’ll help wherever I can.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 7, 2024, 11:45am UTC](https://forum.juce.com/t/demorunner-fails-to-initialise-audio-i-o/60315/11 "2024-03-07T11:45:20Z")

</div>

Thanks for reporting this issue. We’ve pushed a fix to the develop branch:

Please test this out and let us know if you encounter any new issues.

> <https://github.com/juce-framework/JUCE/commit/5d0584059c0d14aba85322deda579699440446f1>
>
> The device may need to stop because it is about to restart with new
> settings.
> 
> e….g. When the DemoRunner is started while the microphone is set to
> 44.1KHz and the speakers are set to 48KHz in Audio MIDI Settings, one of
> the devices must be restarted in order for the AudioDeviceCombiner to
> work. In this situation, stopping one device shouldn't count as an
> error, because the device will be started again with new, compatible,
> settings.
