You probably have several audio devices connected to your Mac, either for output or input. And you have set in the System Preferences > Sound which device is responsible for what. However, this is constantly changing, and it’s annoying you.
The good news first: the problem can be solved and the shown behavior is actually quite practical: If you connect for example a Bluetooth speaker to your Mac, it is automatically the default device for sound input and output. And that is so far also quite sensible.
Creating aggregated devices in the Audio Midi Tool
It gets annoying when you run a slightly more professional setup at home: Maybe the system sounds should be played back via the Thunderbolt display, the music output via the stereo system and the sound input via an extra connected microphone. And this is quite simple with the Audio Midi Setup Tool, which you can find in the “Other” folder in the program folder. If you create a device in this folder and select it in the system preferences, macOS respects these settings permanently. And that’s why we’re doing this now:
Just press the small plus at the bottom left and add an “Aggregated Device”. Then put a check mark by the corresponding device. We do this twice: once we create a device for the Output, once for the Input. For example, in the picture you can see the setting for a mic and then each for mic and speaker on the Thunderbolt display.
With the Thunderbolt display shown here, the microphone and the speakers are not displayed separately in the Midi Tool, but you can of course create two devices for the microphone and the output. However, this is double work: you can also just create the TB display as an aggregated device once.
This is enough so that you can select it in the system settings without it changing the settings when a new device is logged in.
macOS: Multi-output device for simultaneous sound output
An alternative is to create a multi-output device: here you combine two devices. So you can combine the audio port of the Mac and the Bluetooth speaker – the sound will then be output on both.
If you then select this multi-output device in the System Preferences, this setting will also be preserved. No matter if the respective Bluetooth speaker is currently active or not – what counts for the system settings is the abstract midi device. Whether the set devices in it are active or not is not interested.
Volume settings in the Midi Tool
Now it is likely that the volume control is no longer offered in the system settings. You will now have to set this in the Midi Tool.
To do this, simply select the device directly in the left bar and set the desired volume there – this will also be permanently maintained.