# Initialising the Device Manager with setAudioDeviceSetup()

**URL:** <https://forum.juce.com/t/initialising-the-device-manager-with-setaudiodevicesetup/67334>\
**Category:** Development\
**Created:** [October 10, 2025, 1:21pm UTC](https://forum.juce.com/t/initialising-the-device-manager-with-setaudiodevicesetup/67334 "2025-10-10T13:21:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julllllius](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@Julllllius](https://forum.juce.com/u/Julllllius)\
**Post date:** [October 10, 2025, 1:21pm UTC](https://forum.juce.com/t/initialising-the-device-manager-with-setaudiodevicesetup/67334/1 "2025-10-10T13:21:06Z")

</div>

I currently saving my AudioDeviceSetup in a .json File.  
So that I am able to reload this Setup Configuration on Startup of my App.  
My current Problem ist that when I am loading my Setup, the Devices are Correctly loaded. I tried it with  
`juce::AudioDeviceManager::AudioDeviceSetup currentSetup = Config::getInstance()->getSavedAudioSetup();`

`deviceManager.initialise(8, 8, nullptr, true, “”, &currentSetup);`

But then all my 8 Channels of My headset were marked as active even Though i set them manually to Channel 1 And 2:  
`juce::BigInteger inMask, outMask;`  
`inMask.setBit(0);`  
`inMask.setBit(1);`  
`outMask.setBit(0);`  
`outMask.setBit(1);`

`currentSetup.inputChannels = inMask;`  
`currentSetup.outputChannels = outMask;`

Then I tried it with  
`deviceManager.initialiseWithDefaultDevices(32, 32); // maxInputChannels, maxOutputChannels`  
`deviceManager.setAudioDeviceSetup(currentSetup, true);`

this doen´t work either and Throws an jassert()

`void MidiMessageCollector::reset (const double newSampleRate) {`  
`const ScopedLock sl (midiCallbackLock);`  
`jassert (newSampleRate > 0);`  
`#if JUCE_DEBUG hasCalledReset = true;`  
`#endif sampleRate = newSampleRate;`  
`incomingMessages.clear();`  
`lastCallbackTime = Time::getMillisecondCounterHiRes(); }`

Has anyone an Idea how to Save the whole Setup and knows how your are then able to Reload it ?  
Greetings and thanks for the Help Julius

---

<div class="post-metadata">

**Author:** ![Julllllius](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@Julllllius](https://forum.juce.com/u/Julllllius)\
**Post date:** [October 10, 2025, 1:32pm UTC](https://forum.juce.com/t/initialising-the-device-manager-with-setaudiodevicesetup/67334/2 "2025-10-10T13:32:19Z")

</div>

I think that I found the Mistake I made, I forgot to set the flags: useDefault”Output/Input”Channel to false
