### Build and Install BGMXPCHelper and Background Music App Source: https://github.com/kyleneideck/backgroundmusic/blob/master/DEVELOPING.md This command installs the BGMXPCHelper and the main Background Music application. It uses xcodebuild for compilation and installation, setting the destination root and install path. ```shell sudo xcodebuild -project BGMApp/BGMApp.xcodeproj \ -target BGMXPCHelper \ DSTROOT="/" \ INSTALL_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)" \ -configuration Debug \ install sudo chown -R $(whoami):staff BGMApp/build # Fix build dir ownership xcodebuild -project BGMApp/BGMApp.xcodeproj \ -configuration Debug open "BGMApp/build/Debug/Background Music.app" ``` -------------------------------- ### Install the XPC Helper Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Installs the BGMXPCHelper target, which is required for the application's background services. The installation path is determined by a script. ```shell sudo xcodebuild -project BGMApp/BGMApp.xcodeproj \ -target BGMXPCHelper \ RUN_CLANG_STATIC_ANALYZER=0 \ DSTROOT="/" \ INSTALL_PATH="$(BGMApp/BGMXPCHelper/safe_install_dir.sh)" \ clean install ``` -------------------------------- ### Expand and Manually Install Background Music Package Source: https://github.com/kyleneideck/backgroundmusic/wiki/Installer-Problems? Use this script to expand a .pkg file and manually install its components if the standard installer fails. This method can help diagnose installation issues. ```bash pkgutil --expand-full BackgroundMusic-0.4.0-SNAPSHOT-b38f6dd.pkg ./bgm-pkg-expanded cd bgm-pkg-expanded/Installer.pkg/ # Install the driver. sudo cp -r Payload/Library/Audio/Plug-Ins/HAL/Background\ Music\ Device.driver /Library/Audio/Plug-Ins/HAL/ # Install the app. cp -r Payload/Applications/Background\ Music.app /Applications/ # Install BGMXPCHelper. cd Scripts/ # This will probably print out some errors. The output explains them a bit. sudo ./postinstall echo $? ``` -------------------------------- ### Execute Build and Install Script Source: https://github.com/kyleneideck/backgroundmusic/wiki/Installing-from-Source-Code This command initiates the build and installation process for Background Music. You will be prompted to confirm and may need to enter your password. ```bash /bin/bash build_and_install.sh ``` -------------------------------- ### Find Audio Driver Client Log Source: https://github.com/kyleneideck/backgroundmusic/wiki/App-Volumes-Fixes Example log line showing a client starting I/O. This helps in identifying the bundle ID used by the Background Music virtual audio driver for a specific app. ```log BGM_Clients::StartIO: Client 167 (com.apple.WebKit.WebContent, 37328) starting IO ``` -------------------------------- ### Build and Install Background Music from Source (Master Branch) Source: https://github.com/kyleneideck/backgroundmusic/blob/master/README.md This command downloads the latest source code, builds the application, and installs it. It uses bash and standard utilities, ensuring integrity checks during download and extraction. ```bash (set -eo pipefail; URL='https://github.com/kyleneideck/BackgroundMusic/archive/master.tar.gz'; \ cd $(mktemp -d); echo Downloading $URL to $(pwd); curl -qfL# $URL | gzcat - | tar x && \ /bin/bash BackgroundMusic-master/build_and_install.sh -w && rm -rf BackgroundMusic-master) ``` -------------------------------- ### Install the Virtual Audio Device Driver Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Installs the 'Background Music Device' target to the HAL directory. This installs the virtual audio device driver. ```shell sudo xcodebuild -project BGMDriver/BGMDriver.xcodeproj \ -target "Background Music Device" \ RUN_CLANG_STATIC_ANALYZER=0 \ DSTROOT="/" \ clean install ``` -------------------------------- ### Install Background Music Application Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Installs the 'Background Music' application to the /Applications directory. This is the main user-facing application. ```shell sudo xcodebuild -project BGMApp/BGMApp.xcodeproj \ -target "Background Music" \ RUN_CLANG_STATIC_ANALYZER=0 \ DSTROOT="/" \ clean install ``` -------------------------------- ### Install Background Music with Homebrew Source: https://github.com/kyleneideck/backgroundmusic/blob/master/README.md Use this command to install Background Music via Homebrew Cask. Ensure Homebrew is installed on your macOS system. ```bash brew install --cask background-music ``` -------------------------------- ### Install Xcode Command-Line Tools Source: https://github.com/kyleneideck/backgroundmusic/wiki/Installing-from-Source-Code If you encounter an error related to Xcode Command-Line Tools, use this command to install them. This is a prerequisite for building the application. ```bash xcode-select --install ``` -------------------------------- ### Build the Virtual Audio Device Driver Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Builds the 'PublicUtility' target for the virtual audio device driver. Ensure you have Xcode installed. ```shell sudo xcodebuild -project BGMDriver/BGMDriver.xcodeproj \ -target "PublicUtility" \ RUN_CLANG_STATIC_ANALYZER=0 \ clean build ``` -------------------------------- ### Restart Core Audio Daemon Source: https://github.com/kyleneideck/backgroundmusic/wiki/Installing-from-Source-Code This command is used to restart the core audio daemon if the installation does not function immediately. It may be followed by adjusting audio output settings in System Preferences. ```bash sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod || sudo killall coreaudiod ``` -------------------------------- ### Find App Volume Change Log Source: https://github.com/kyleneideck/backgroundmusic/wiki/App-Volumes-Fixes Example log line indicating an app volume change. This helps in identifying the application's bundle ID. ```log BGMAppVolumes::appVolumeChanged: App volume for com.apple.Safari (1509) changed to 49 ``` -------------------------------- ### Add Safari Bundle ID Mapping Source: https://github.com/kyleneideck/backgroundmusic/wiki/App-Volumes-Fixes Example of how to add a bundle ID mapping for Safari in the Background Music source code. This entry maps the application's bundle ID to the bundle ID used by its audio driver. ```cpp // Safari { "com.apple.Safari", { "com.apple.WebKit.WebContent" } }, ``` -------------------------------- ### Stream Background Music Debug Logs via Terminal Source: https://github.com/kyleneideck/backgroundmusic/wiki/Getting-Debug-Logs Use this command in Terminal.app to stream detailed log messages from coreaudiod, Background Music, and BGMXPCHelper. Ensure Background Music is closed and reopened after running the command to start capturing logs. Remember to disable debug logging after collecting logs to prevent performance issues. ```bash log stream --info --predicate 'process == "coreaudiod" or process == "Background Music" or process == "BGMXPCHelper" or composedMessage contains[cd] "Background Music" or composedMessage contains "BGM"' ``` -------------------------------- ### Restart coreaudiod Service (Method 2) Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Restarts the coreaudiod service using launchctl kickstart if the killall command fails. This is an alternative method to ensure the audio service is reset. ```shell sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod ``` -------------------------------- ### Restart coreaudiod Service (Method 1) Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-INSTALL.md Restarts the coreaudiod service using the killall command. Audio will stop working temporarily. ```shell sudo killall coreaudiod ``` -------------------------------- ### Navigate to Source Directory in Terminal Source: https://github.com/kyleneideck/backgroundmusic/wiki/Installing-from-Source-Code Use this command to change your current directory in the Terminal to the unzipped Background Music source folder. Remember to replace 'YourHomeFolderName' with your actual home directory name. ```bash cd /Users/YourHomeFolderName/Downloads/BackgroundMusic-master ``` -------------------------------- ### Build with xcodebuild Source: https://github.com/kyleneideck/backgroundmusic/blob/master/DEVELOPING.md Builds the 'PublicUtility' target and the main project configuration in Debug mode using xcodebuild. ```shell xcodebuild -project BGMDriver/BGMDriver.xcodeproj -target "PublicUtility" -configuration Debug xcodebuild -project BGMDriver/BGMDriver.xcodeproj -configuration Debug ``` -------------------------------- ### Load coreaudiod Source: https://github.com/kyleneideck/backgroundmusic/blob/master/DEVELOPING.md Loads the coreaudiod daemon after debugging is complete. ```shell sudo launchctl load /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist ``` -------------------------------- ### Verify Background Music Device driver removal Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md List the contents of the HAL directory to verify if the Background Music Device driver has been removed. This is a troubleshooting step if the audio device persists. ```shell sudo ls /Library/Audio/Plug-Ins/HAL ``` -------------------------------- ### Draw Sound Wave in LaTeX Source: https://github.com/kyleneideck/backgroundmusic/blob/master/Images/VolumeIcons.tex Creates a curved sound wave using the 'to' command with specified 'out' and 'in' angles. This snippet is conditional based on 'w1', 'w2', or 'w3' options. ```latex % First sound wave (Curved line) \opt{w1}{ \draw[line width=4.3mm,line cap=round] (44mm, 36.5mm) to[out=46,in=-46] (44mm, 63.5mm); } ``` ```latex % Second sound wave (Curved line) \opt{w2}{ \draw[line width=4.3mm,line cap=round] (57.5mm, 27.5mm) to[out=46,in=-46] (57.5mm, 72.5mm); } ``` ```latex % Third sound wave (Curved line) \opt{w3}{ \draw[line width=4.3mm,line cap=round] (72mm, 18.5mm) to[out=46,in=-46] (72mm, 81.5mm); } ``` -------------------------------- ### Unload BGMXPCHelper (Pre-OS X 10.11) Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md Unload the BGMXPCHelper service on OS X versions earlier than 10.11. This command stops the helper service from running. ```shell sudo launchctl unload /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist ``` -------------------------------- ### Force remove Background Music Device driver Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md Use this command to forcefully remove the Background Music Device driver from the HAL directory if it was not deleted by the standard uninstall process. ```shell sudo rm -rf "/Library/Audio/Plug-Ins/HAL/Background Music Device.driver" ``` -------------------------------- ### Delete BGMXPCHelper launchd.plist Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md Remove the launchd property list file for BGMXPCHelper. This ensures the helper service is not reloaded after manual uninstallation. ```shell sudo rm /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist ``` -------------------------------- ### Unregister BGMXPCHelper (OS X 10.11+) Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md Unregister the BGMXPCHelper service on OS X 10.11 and later. This command removes the helper service from the system's launch daemons. ```shell sudo launchctl bootout system /Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist ``` -------------------------------- ### Delete BGMXPCHelper user and group Source: https://github.com/kyleneideck/backgroundmusic/blob/master/MANUAL-UNINSTALL.md Remove the dedicated user and group accounts created for BGMXPCHelper. This completes the removal of the helper service's system presence. ```shell sudo dscl . -delete /Users/_BGMXPCHelper ``` ```shell sudo dscl . -delete /Groups/_BGMXPCHelper ``` -------------------------------- ### Uninstall Background Music Source: https://github.com/kyleneideck/backgroundmusic/blob/master/README.md To uninstall Background Music, navigate to its application directory in the terminal and execute the uninstall script. Ensure you are in the correct directory before running the script. ```bash cd /Applications/Background\ Music.app/Contents/Resources/ ``` ```bash bash uninstall.sh ``` -------------------------------- ### Ensure Consistent Image Width in LaTeX Source: https://github.com/kyleneideck/backgroundmusic/blob/master/Images/VolumeIcons.tex Draws an invisible copy of the third sound wave to ensure all generated images maintain the same width. This is useful for consistent layout in documents. ```latex % Always draw a transparent copy of the third wave so the images will all have % the same width. \draw[line width=4.3mm,line cap=round,opacity=0] (72mm, 18.5mm) to[out=46,in=-46] (72mm, 81.5mm); ``` -------------------------------- ### Increase BGMAutoPauseMusic.mm kPauseDelayNSec Constant Source: https://github.com/kyleneideck/backgroundmusic/blob/master/README.md If application notification sounds are too short and trigger an auto-pause, increase the `kPauseDelayNSec` constant in `BGMAutoPauseMusic.mm`. This will increase the overlap time for music playback. ```objective-c Increase the `kPauseDelayNSec` constant in [BGMAutoPauseMusic.mm](/BGMApp/BGMApp/BGMAutoPauseMusic.mm). ``` -------------------------------- ### Unload coreaudiod Source: https://github.com/kyleneideck/backgroundmusic/blob/master/DEVELOPING.md Unloads the coreaudiod daemon to allow debugging attachment. ```shell sudo launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist ``` -------------------------------- ### Draw Speaker Shape in LaTeX Source: https://github.com/kyleneideck/backgroundmusic/blob/master/Images/VolumeIcons.tex Defines the shape of a speaker using rounded rectangles and a triangle. Use this for the base visual element of a volume indicator. ```latex % Speaker (Rounded box and triangle) \fill[rounded corners=5mm] (0mm, 62.5mm) rectangle (25mm, 37.5mm) {}; \draw[rounded corners=2.5mm,fill=black] (3mm, 50mm)--(34mm, 76.5mm)--(34mm, 23.5mm)--cycle; ``` -------------------------------- ### Adjust VLC External Music Player Settings Source: https://github.com/kyleneideck/backgroundmusic/blob/master/README.md To prevent VLC from interfering with Background Music's ability to unpause other music players, adjust VLC's preferences. This setting controls how VLC interacts with external music applications like iTunes or Spotify. ```plaintext Under VLC's preferences, select **Show All**. Navigate to **Interface > Main interfaces > macosx** and change *Control external music players* to either *Do nothing* or *Pause and resume iTunes/Spotify*. ``` -------------------------------- ### Fermata Icon TikZ Code Source: https://github.com/kyleneideck/backgroundmusic/blob/master/Images/FermataIcon.tex This TikZ code defines styles and draws a Fermata icon using clipped and filled circles. It's useful for creating musical notation elements. ```latex % A path that follows the edges of the current page \tikzstyle{reverseclip}=[insert path={(current page.north east) -- (current page.south east) -- (current page.south west) -- (current page.north west) -- (current page.north east)}] \begin{scope} \begin{pgfinterruptboundingbox} \path [clip] (0,-62.6mm) circle (33mm) [reverseclip]; \end{pgfinterruptboundingbox} \fill[black] (0,-50mm) circle (44mm); \end{scope} \begin{scope} \fill[black] (0,-68.5mm) circle (26mm); \end{scope} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.