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
16.12k stars 675 forks source link

Error connecting to BGMXPCHelper #753

Open SpikeyMikey opened 3 months ago

SpikeyMikey commented 3 months ago

Every time I power on/restart my Mac mini 2018 (Ventura 13.6.7), I get this error msg: Error connecting to BGMXPCHelper

Screenshot 2024-06-09 at 2 21 40 PM

And then Background Music will not work. I then need to reinstall "BackgroundMusic-0.4.3.pkg" in order for it to work again. However, once I shut down/restart my computer again, I have to go through that all over again.

I love Background Music! I've been using it for years without any issues, so I'm not sure what suddenly caused this issue, just in the past month or two. Maybe a MacOS Ventura update?

Anyone know how to resolve this? Thanks in advance for any help.

kyleneideck commented 2 months ago

I haven't heard of that happening before. Do you get any logs if you search for "BGMXPCHelper" in Console.app and then start Background Music (after restarting so the bug will occur)?

Can you also try this command and paste the output in here?

launchctl print system/com.bearisdriving.BGM.XPCHelper

It should give you some info about the BGMXPCHelper launch daemon.

And can you try unloading and reloading the launch daemon to see if that fixes it the same way reinstalling Background Music does?

sudo launchctl bootout system /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist
SpikeyMikey commented 2 months ago

Thanks for the reply. I haven't used Console.app before, but I just opened it and tried searching for "BGMXPCHelper" in the upper-right search field, with my hard drive selected in the left column – No Messages. And I restarted my computer this morning, got the bug msg, then reinstalled Background Music. Not sure if I'm using the Console.app correctly.

I do know how to use Terminal a bit. Here's the output from that command:

system/com.bearisdriving.BGM.XPCHelper = {
    active count = 2
    path = /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist
    type = LaunchDaemon
    state = running

    program = /usr/local/libexec/BGMXPCHelper.xpc/Contents/MacOS/BGMXPCHelper
    arguments = {
        /usr/local/libexec/BGMXPCHelper.xpc/Contents/MacOS/BGMXPCHelper
    }

    default environment = {
        PATH => /usr/bin:/bin:/usr/sbin:/sbin
    }

    environment = {
        XPC_SERVICE_NAME => com.bearisdriving.BGM.XPCHelper
    }

    domain = system
    username = _BGMXPCHelper
    group = _BGMXPCHelper

    minimum runtime = 10
    exit timeout = 5
    runs = 1
    pid = 1527
    immediate reason = ipc (mach)
    forks = 0
    execs = 1
    initialized = 1
    trampolined = 1
    started suspended = 0
    proxy started suspended = 0
    last exit code = (never exited)

    endpoints = {
        "com.bearisdriving.BGM.XPCHelper" = {
            port = 0xa6b0b
            active = 1
            managed = 1
            reset = 0
            hide = 0
            watching = 0
        }
    }

    spawn type = adaptive (6)
    jetsam priority = 40
    jetsam memory limit (active) = (unlimited)
    jetsam memory limit (inactive) = (unlimited)
    jetsamproperties category = daemon
    jetsam thread limit = 32
    cpumon = default
    probabilistic guard malloc policy = {
        activation rate = 1/1000
        sample rate = 1/0
    }

    properties = inferred program | system service
}

In terms of unloading/reloading the launch daemon, not sure I did that right. First I entered the top 'sudo' line in Terminal and it asked me for my password. I entered my password and then nothing happened and Terminal just went back to waiting for the next prompt. Then I entered the 2nd 'sudo' line prompt and nothing happened. I also tried entering both lines together at the same time, but same result. No output code.

SpikeyMikey commented 2 months ago

FYI - just did a minor OS update – Ventura 13.6.8, but still having the same issue.

SpikeyMikey commented 1 month ago

Ventura 13.6.9 - same issue

npmstart-pray commented 1 month ago

Have you tried the homebrew install? Have you tried Blackhole?

SpikeyMikey commented 1 month ago

Thanks for the reply. I'm not familiar with either of those things. Can you please explain? I'm not very code-savvy.

npmstart-pray commented 1 month ago

Homebrew instructions are on the main page for this project in the readme, and I'm sure there are tutorials elsewhere online for the terminal/command line aspects of it. If I were you, I'd uninstall the package file and give the homebrew version a shot.

SpikeyMikey commented 1 month ago

Thank you for the tips. I looked into Homebrew, but am not confident I can handle installing/utilizing it properly...sounds a bit beyond my technical knowledge. I also installed and tried Blackhole, as an alternative. However, the reason I use Background Music is for the individual app volume controls. I could not find an option to do that with Blackhole, so I uninstalled it.