60

When I plug my (HDMI) display into my laptop, the sound output switches to it. I can switch it back, but is there any way to stop this automatic switch?

(I've found many people complaining, but no answers. A script which reversibly disabled HMDI audio would be acceptable.)

tog22
  • 921
  • 3
  • 10
  • 22

3 Answers3

31

I have multiple devices I connect to my mac and for some they had the same issue.


The work around (or actual fix) is to open 'Audio MIDI setup' in your Applications>Utility and:

  • Click + in the lower left corner.
  • Click Create Aggregate Device
  • Turn off/on the inputs/outputs sound based on needs.

Screenshot of Audio MIDI Setup

fabian789
  • 209
  • 1
  • 4
  • 11
norcal johnny
  • 1,688
  • 8
  • 10
  • 3
    Awesome! Thanks a bunch. Only problem is the sound keys and system audio slider don't work: http://prntscr.com/feufup . What ways have you found of adjusting volume? I have quicksilver and Karabiner so perhaps I could map some key or keystroke sequence to a script which controls the volume? – tog22 Jun 01 '17 at 22:05
  • ALoha, sorry for the delay. Just click on the configure speakers and you can adjust sliders there, cheers :) – norcal johnny Jun 14 '17 at 20:16
  • Not on 10.11 - the MIDI app looks different from your screenshot on that too. I'll say if it works on 10.12. – tog22 Jun 14 '17 at 23:45
  • As @tog22 says, the midi app seems to have changed as of 10.13, and It's not obvious how you turn inputs on/off in an aggregate device. I *think* that by clicking configure speakers you can choose which device is used for which speaker channel. – ForeverWintr May 26 '18 at 03:01
  • 5
    Needing to open the MIDI app just to change volume is crazy. – Matthew Read Oct 08 '18 at 17:18
  • 11
    I don't understand how this is the correct answer. You create an aggregate for multiple sound devices and then what? For me if I connect via Airplay to my AppleTV it still tries to use the speakers connected on that monitor. – JackyJohnson Mar 07 '19 at 20:47
  • 1
    i loose the ability to adjust volume when i do this (similar to the HDMI out), so it's not workable for me unfortunately. Aggregate devices are super useful in the studio too. – Tomachi Apr 23 '19 at 13:04
  • 2
    It seems that simply opening the MIDI app, right-clicking on "Built-in Output" and setting "Use this device for sound output" was sufficient. No need to create an aggregate device – Noel Sep 18 '19 at 15:43
  • 1
    I wish I had googled this a long time ago, thanks! – powerj1984 Feb 23 '20 at 20:08
  • 1
    I'm trying to figure out how (or whether it's possible) to have the MacBook use only my wireless headset for input/output when the headset is turned on, and use only my MacBook for (input/)output otherwise. My MacBook sometimes switches to my external HDMI-connected monitors for audio, but those monitors don't have speakers. Does creating an aggregate device work for this case? – V2Blast Nov 05 '21 at 22:42
  • Does not work in macOS 11.6.1 Big Sur. – Conrad Nov 23 '21 at 19:32
8

I made an app for this. It allows you to pin input/output so it cannot be changed for every particular set of connected devices.

Pavel S.
  • 191
  • 1
  • 2
  • 1
    Welcome to Ask Different, and thanks for your contribution. Your duplicate answers have been flagged, so I've taken a look. It's good you've disclosed your affiliation with the app, but please be careful with how often you promote it. If users see no other contributions except for ones promoting your software, you may run into problems. All the best. – Monomeeth Oct 21 '19 at 23:33
  • 1
    This app works beautifully, and the idea is simple targets the pain point. The accepted answer above didn't work for me. – sarimarton Jan 29 '21 at 16:54
8

You just need to specify a preferred audio device once and the Mac system will remember your choice and won't switch the next time.

  1. Open System Preferences -> Sound.
  2. Opt-in "Show Volume in menu bar", you will see a sound icon on the status bar.
  3. Connect to your monitor if not.
  4. Click on the icon and choose a preferred output device.
  5. Disconnect monitor and retry, you will see the system remembered your choice.

Select Output Device

Mclamee
  • 81
  • 1
  • 3
  • This seems to work. No idea why selecting from this menu behaves differently from selecting in system preferences, but I'll take it! – kotoole May 22 '20 at 14:11
  • It doesn't work on Mojave. When reconnecting an external device macOS will see just that device for few seconds, stop the audio from the External Headphones (that disappears for those few seconds); then External Headphones appear again and the audio is restored. Yes, the systems remembers to re-select, but it actually switches around devices before doing so, leading to audio disappearing, switching on external device, and finally coming back to the pre-selected device. – Yes, I already tried either via System Preferences and via the Volume Icon as shown above. – Kamafeather Jul 13 '20 at 12:28
  • Doesn't work in Catalina, at least not when also using Boom (haven't tried without). – John Bachir Nov 09 '20 at 11:48
  • I'm trying to figure out how (or whether it's possible) to have the MacBook use only my wireless headset for input/output when the headset is turned on, and use only my MacBook for (input/)output otherwise. My MacBook sometimes switches to my external HDMI-connected monitors for audio, but those monitors don't have speakers. Does your solution work for this case? – V2Blast Nov 05 '21 at 22:43
  • I have been using a Mac with three monitors for over a year now. Can confirm this doesn't work. I want audio output to only come from the central monitor. Seems simple right? It's not. Eventually something will cause the monitor that audio comes from to seemingly randomly change. I have not been able to resolve this. – Matthaeus Gaius Caesar Apr 23 '22 at 18:59