kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
15.9k stars 674 forks source link

Wrong device on reboot #167

Open foxt opened 5 years ago

foxt commented 5 years ago

After rebooting my computer, Background Music switches to Soundflower, from my USB headset, requiring me to reselect my headset in the preferences, Would it be possible to always use a specified output device, even if it's unavailable unless the user specifies a different device

kyleneideck commented 5 years ago

When you open Background Music, it tries to use the device set as your default device in macOS, so this might be happening because macOS is switching to Soundflower when you reboot.

Could you try 0.3.0-SNAPSHOT-4c0c656 and see if it fixes the problem? It should try to switch to your USB headset when it's connected if macOS would normally switch to it.

If that doesn't help, as a temporary workaround, you could try using AppleScript to force a certain output device when you open Background Music:

#!/bin/bash

open "/Applications/Background Music.app"

applescript=" \
    tell application \"Background Music\" to \
    set selected of output device \"Your Output Device\" to true"

while ! osascript -e "$applescript"; do
    sleep 1
done

It works for me, but I haven't tried setting it to run when I log in. You might need to save it with a .command extension for that.

foxt commented 5 years ago

-I downloaded new version and it's working fine, then again I took the shotgun approach of disabling every other audio device on my system image