MPD audio/musicpd is one of the lightest, most responsive methods to access mp3, ogg files and internet streams. Installation entails 2 components; the daemon and one of a number of front ends. On an older i386, playback of locally stored mp3's or internet music streams uses less than 2% of the CPU.
This configuration differs from the default musicpd.conf in the following ways:
1. The daemon is started on a per user basis rather than system wide. See Arch Linux mpd wiki for more details.
2. The daemon uses a unix socket rather than going through the TCP/IP stack.
3. The music directory has been moved from /var/mpdmusic to ~/Music for file location consistency with Common Desktops
4. The volume control has been moved from "PCM" to "vol". In the standard OSS setup, "vol" is the master volume control as used by system tray volume apps. The volume setting in your mpd front end will match the system tray app.
To start, install audio/musicpd and one or more front ends. I use audio/ncmpc as a front end
.
You can delete the default /usr/local/etc/musicpd.conf as it is already backed up by /usr/local/etc/musicpd.conf.sample.
Paste the following into ~/.mpd/musicpd.conf and replace "XXX" with your user name.
As user, populate the previously created ~/.mpd with a playlists directory and db, log, pid, state, socket, sticker.sql files.
To start the musicpd at each boot, place musicpd_enable="YES" in /etc/rc.conf
To start mpd, run the following command in your DE's autostart, ~/.xsession or ~/.xinitrc.
Lastly, your front end will need to be configured to use the unix socket as the host. In audio/ncmpc, start ncmpc with
or place
in the ncmpc configuration file.
My ncmpc configuration file for xterm-color (The "color background = none" entry uses the default terminal background color, in my case a dark grey):
Place your music files in ~/Music/ and verify that the individual music files and the chain of directories are executable.
Either log out and back in or start musicpd with
Edits:
1. Added executable for music files and chain of directories.
2. Changed from system wide to per user basis.
3. Corrected musicpd start command in the prior paragraph.
Credit to David Coppa, mpd port maintainer for OpenBSD for sharing his mpd.conf and uzsolt for his mailing list post on the syntax for OSS mixer_control.
This configuration differs from the default musicpd.conf in the following ways:
1. The daemon is started on a per user basis rather than system wide. See Arch Linux mpd wiki for more details.
2. The daemon uses a unix socket rather than going through the TCP/IP stack.
3. The music directory has been moved from /var/mpdmusic to ~/Music for file location consistency with Common Desktops
4. The volume control has been moved from "PCM" to "vol". In the standard OSS setup, "vol" is the master volume control as used by system tray volume apps. The volume setting in your mpd front end will match the system tray app.
To start, install audio/musicpd and one or more front ends. I use audio/ncmpc as a front end
.
You can delete the default /usr/local/etc/musicpd.conf as it is already backed up by /usr/local/etc/musicpd.conf.sample.
Paste the following into ~/.mpd/musicpd.conf and replace "XXX" with your user name.
Code:
music_directory "/usr/home/XXX/Music"
playlist_directory "/usr/home/XXX/.mpd/playlists"
db_file "/usr/home/XXX/.mpd/db"
log_file "/usr/home/XXX/.mpd/log"
pid_file "/usr/home/XXX/.mpd/pid"
state_file "/usr/home/XXX/.mpd/state"
sticker_file "/usr/home/XXX/.mpd/sticker.sql"
user "XXX"
group "XXX"
bind_to_address "/usr/home/XXX/.mpd/socket"
# Input #######################################################################
#
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
#
# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an OSS output:
#
audio_output {
type "oss"
name "My OSS Device"
device "/dev/dsp" # optional
mixer_type "hardware" # optional
mixer_device "/dev/mixer" # optional
mixer_control "vol" # optional
}
#
As user, populate the previously created ~/.mpd with a playlists directory and db, log, pid, state, socket, sticker.sql files.
$ cd ~/.mpd && mkdir playlists
$ touch {db,log,pid,state,socket,sticker.sql}
To start mpd, run the following command in your DE's autostart, ~/.xsession or ~/.xinitrc.
/usr/local/bin/musicpd ~/.mpd/musicpd.conf
Lastly, your front end will need to be configured to use the unix socket as the host. In audio/ncmpc, start ncmpc with
ncmpc --host=~/.mpd/socket
or place
Code:
host = /usr/home/XXX/.mpd/socket
My ncmpc configuration file for xterm-color (The "color background = none" entry uses the default terminal background color, in my case a dark grey):
Code:
host = /usr/home/XXX/.mpd/socket
enable-mouse = no
welcome-screen-list = yes
list-format = "%file%"
enable-colors = yes
color background = none
color title = cyan
color line = blue
color list = white
color status-song = white
Place your music files in ~/Music/ and verify that the individual music files and the chain of directories are executable.
Either log out and back in or start musicpd with
$ /usr/local/bin/musicpd ~/.mpd/musicpd.conf
. If you do not see any of your music files in the front end, run mpd update. In audio/ncmpc <CTL-U> will update the playlist directory.Edits:
1. Added executable for music files and chain of directories.
2. Changed from system wide to per user basis.
3. Corrected musicpd start command in the prior paragraph.
Credit to David Coppa, mpd port maintainer for OpenBSD for sharing his mpd.conf and uzsolt for his mailing list post on the syntax for OSS mixer_control.
Last edited: