Wikia

Music Player Daemon Community Wiki

MPD on OSX

Talk0
544pages on
this wiki

Contents

InstallationEdit

HomebrewEdit

brew install mpd #ncmpcpp mpc mpdscribble

Homebrew is a package management system for OSX with some similarities to GNU Stow.


MacPorts MacPorts is a packaging system for OSX based on BSD's port system. You will issue these commands from within Terminal.app or a sufficient replacement, such as iTerm.

You can install and launch mpd simply by using
$sudo port install mpd && sudo port load mpd
(assuming you have administrator or higher privileges).


FinkEdit

Fink is a package management system for OSX that utilizes the apt-get utility. Usage is similar to MacPorts.

$sudo fink install mpd...

If you are trying to run on OSX 10.5, you may have to use the --no-daemon option as documented in the Fink package description.


Building from sourceEdit

MPD should build fine in recent versions of Mac OS X without any problems. You will need to download and install the Apple Developer Tools [1]. Compiling without support for M4A is recommended. For this example, we're going to use mpd version 0.13.0.

curl http://www.musicpd.org/uploads/files/mpd-0.13.0.tar.gz -o mpd.tar.gz
open mpd.tar.gz
cd mpd-0.13.0
./configure --prefix=/usr/local
make
sudo make install

Running Edit

Example .mpdconfEdit

MPD's CoreAudio implementation is an output called 'osx'. It takes care of most of your typical usage cases. Unlike some older MPD builds, you can safely hot-swap output devices, plug headphones in, take them out. It all works as you'd expect, and as it works in GNU/Linux.

​~/.mpdconf
music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/database"
log_file "~/.mpd/log"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
sticker_file "~/.mpd/sticker.sql"
auto_update "yes"
auto_update_depth "2"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
audio_output {
    type "osx"
    name "CoreAudio"
    mixer_type "software"
}

LaunchingEdit

Some prefer to simply start and stop the daemon manually with 'mpd' and 'mpd --kill.'

For a single-user system, we can use OS X's launchd to govern our session. This is the OS X way to schedule tasks and control services of all kinds, with the raw rc system only used by root (mainly to start launchd.)

Example launchd jobEdit

Copy this into ~/Library/LaunchAgents, then issue 'launchctl load ~/Library/LaunchAgents' to merge it. It will begin immediately; use 'launchctl list' to inspect. It can easily be modified to suit other related services like mpdscribble.

~/Library/LaunchAgents/com.wikia.mpd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.wikia.mpd</string>
    <key>WorkingDirectory</key>
    <string>~</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/mpd</string>
        <string>--no-daemon</string>
        <string>~/.mpdconf</string>
    </array>
    <key>EnableGlobbing</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

Note that plist files can be troublesome to write or paste manually. Check this write up if you have additional problems.

Troubleshooting Edit

If you have issues with mpd crashing when you change songs mid-song, try adding mixer_type "software" to your mpd conf file. If the change of the mixer_type doesn't solve the problems, try to run mpd in foreground with the option "--no-daemon"

If caught in a play-crash-play loop, try 'rm .mpd/state && mpd --kill'

The latest version (0.17+) can handle external output devices by specifying the "device" parameter in the audio_output section of the mpd.conf file.

Advertisement | Your ad here

Photos

Add a Photo
138photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki