BackgroundMusic icon indicating copy to clipboard operation
BackgroundMusic copied to clipboard

Native Apple Silicon support

Open KovalevArtem opened this issue 3 years ago • 9 comments

Add full support for new processors Apple Silicon

KovalevArtem avatar Nov 29 '20 23:11 KovalevArtem

Are there any updates to this? I would love to see a native version vor the M1 chips, because I don't like it to be running under rosetta in the background.

ridicolos avatar Aug 20 '21 13:08 ridicolos

@ridicolos Have you tried the latest snapshot build 0.4.0-SNAPSHOT-b38f6dd? It has universal binaries, so should run natively on Apple Silicon. I think I tested that at some point, but not 100% sure.

kyleneideck avatar Aug 20 '21 13:08 kyleneideck

@kyleneideck I tried to install the version, but got an error. The old version, which I installed with homebrew, was removed with

cd /Applications/Background\ Music.app/Contents/Resources/
bash uninstall.sh
brew remove background-music --cask

if I try to install the latest snapshot build you suggested it always fails after 10 seconds of the installation. I have the lastest version of macOS (11.5.2) installed.

Also, when will this be available in the normal version so tools like homebrew will download the universal binaries?

ridicolos avatar Aug 20 '21 16:08 ridicolos

@ridicolos Just a generic "install failed" error? Does it log anything interesting in /var/log/install.log?

I haven't installed 11.5 yet, so that could be it. New major versions of the OS seem to always break Background Music in some way.

Can you try extracting the files from the .pkg and installing them manually to see if that helps narrow down the problem? This should work:

pkgutil --expand-full BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg ./BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd
cd BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd/Installer.pkg/
sudo cp -r Payload/Library/Audio/Plug-Ins/HAL/Background\ Music\ Device.driver /Library/Audio/Plug-Ins/HAL/
cp -r Payload/Applications/Background\ Music.app /Applications/
cd Scripts/

# This will probably print out some errors. The output explains them a bit.
sudo ./postinstall
echo $?

Also, when will this be available in the normal version so tools like homebrew will download the universal binaries?

Releasing a new stable version is high on my to-do list, but I've been too busy for a while. Hopefully I'll get around to it soon. In the meantime, you should be able to use the prerelease (i.e. snapshot) cask:

brew tap homebrew/cask-versions
brew install --cask background-music-pre

kyleneideck avatar Aug 21 '21 07:08 kyleneideck

I don't know if this is helpful, but this is what I found when trying to install it in the var/log/install.log

2021-08-25 22:50:15+02 GLaDOS package_script_service[3057]: ./postinstall: 	help            Prints the usage for a given subcommand.
2021-08-25 22:50:15+02 GLaDOS package_script_service[3057]: ./postinstall: /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist: Could not find specified service
2021-08-25 22:50:15+02 GLaDOS package_script_service[3057]: ./postinstall: Unload failed: 113: Could not find specified service
2021-08-25 22:50:15+02 GLaDOS package_script_service[3057]: ./postinstall: ----
2021-08-25 22:50:15+02 GLaDOS package_script_service[3057]: ./postinstall: Started the BGMXPCHelper service.
2021-08-25 22:50:17+02 GLaDOS package_script_service[3057]: ./postinstall: Background Music device not found. Trying again in 3 seconds...
2021-08-25 22:50:21+02 GLaDOS package_script_service[3057]: ./postinstall: Background Music device not found. Trying again in 3 seconds...
2021-08-25 22:50:24+02 GLaDOS package_script_service[3057]: ./postinstall: Background Music device not found. Trying again in 3 seconds...
2021-08-25 22:50:27+02 GLaDOS package_script_service[3057]: ./postinstall: Background Music device not found. Trying again in 3 seconds...
2021-08-25 22:50:31+02 GLaDOS package_script_service[3057]: ./postinstall: Background Music device not found. Installation failed.
2021-08-25 22:50:31+02 GLaDOS package_script_service[3057]: Responsibility set back to self.
2021-08-25 22:50:31+02 GLaDOS install_monitor[3056]: Re-included: /Applications, /Library, /System, /bin, /private, /sbin, /usr
2021-08-25 22:50:31+02 GLaDOS installd[802]: PackageKit: releasing backupd
2021-08-25 22:50:31+02 GLaDOS installd[802]: PackageKit: allow user idle system sleep
2021-08-25 22:50:31+02 GLaDOS installd[802]: PackageKit: Cleared responsibility for install from 3048.
2021-08-25 22:50:31+02 GLaDOS installd[802]: PackageKit: Cleared permissions on Installer.app
2021-08-25 22:50:31+02 GLaDOS installd[802]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "Beim Ausführen der Skripts aus dem Paket „BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg“ ist ein Fehler aufgetreten." UserInfo={NSFilePath=./postinstall, NSURL=file:///Users/dennis/Downloads/BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg#Installer.pkg, PKInstallPackageIdentifier=com.bearisdriving.BGM, NSLocalizedDescription=Beim Ausführen der Skripts aus dem Paket „BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg“ ist ein Fehler aufgetreten.} {
	    NSFilePath = "./postinstall";
	    NSLocalizedDescription = "Beim Ausf\U00fchren der Skripts aus dem Paket \U201eBackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg\U201c ist ein Fehler aufgetreten.";
	    NSURL = "file:///Users/dennis/Downloads/BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg#Installer.pkg";
	    PKInstallPackageIdentifier = "com.bearisdriving.BGM";
	}

I tried the normal installation again to get some output from var/log/install.log and besides the error when installing the software it seems to work fine... just the installers seems to have a little problem and show the message that the installation failed.

I am looking forward for the stable release 👍

ridicolos avatar Aug 25 '21 21:08 ridicolos

Thanks, it looks like this is the command that failed: system_profiler SPAudioDataType | grep "Background Music"

What do you get for system_profiler SPAudioDataType?

kyleneideck avatar Sep 07 '21 23:09 kyleneideck

I just tried

brew tap homebrew/cask-versions
brew install --cask background-music-pre

and /var/log/install.log tells me that:

51381   │ 2022-03-29 15:15:59+02 silverlining installd[5130]: PackageKit: suspending backupd
51382   │ 2022-03-29 15:15:59+02 silverlining installd[5130]: PackageKit (package_script_service): Preparing to execute script "./preinstall" in /private/tmp/PKInstallSandbox.2iJQ9f/Scripts/com.bearisdriving.BGM.OGwv
        │ 4d
51383   │ 2022-03-29 15:15:59+02 silverlining package_script_service[13440]: PackageKit: Executing script "preinstall" in /tmp/PKInstallSandbox.2iJQ9f/Scripts/com.bearisdriving.BGM.OGwv4d
51384   │ 2022-03-29 15:15:59+02 silverlining package_script_service[13440]: Set responsibility to pid: 50112, responsible_path: /Applications/iTerm.app/Contents/MacOS/iTerm2
51385   │ 2022-03-29 15:15:59+02 silverlining package_script_service[13440]: Preparing to execute with Rosetta Intel Translation: '/tmp/PKInstallSandbox.2iJQ9f/Scripts/com.bearisdriving.BGM.OGwv4d/preinstall'
51386   │ 2022-03-29 15:15:59+02 silverlining install_monitor[64843]: Temporarily excluding: /AppleInternal, /Applications, /Library, /System, /bin, /private, /sbin, /usr
51387   │ 2022-03-29 15:15:59+02 silverlining package_script_service[13440]: ./preinstall: safe_install_dir.sh: line 74: python: command not found
51388   │ 2022-03-29 15:16:00+02 silverlining package_script_service[13440]: ./preinstall:  is not a directory.
51389   │ 2022-03-29 15:16:00+02 silverlining package_script_service[13440]: Responsibility set back to self.
51390   │ 2022-03-29 15:16:00+02 silverlining install_monitor[64843]: Re-included: /AppleInternal, /Applications, /Library, /System, /bin, /private, /sbin, /usr
51391   │ 2022-03-29 15:16:00+02 silverlining installd[5130]: PackageKit: releasing backupd
5

This is sort of natural since python is no longer in Monterey; only /usr/bin/python3 is present.

It would make sense if the installer disambiguates what it needs: python2 or python3.

adavidzh avatar Mar 29 '22 13:03 adavidzh

Have you tried the latest snapshot build

yes but it says to install bgmxpchelper but doesn't say how/where to

dannymichel avatar May 20 '22 12:05 dannymichel

yes but it says to install bgmxpchelper but doesn't say how/where to

I have the same issue 🥲

maximkrouk avatar Jun 08 '22 12:06 maximkrouk