DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th December 2013
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 595
Thanked 9 Times in 9 Posts
Default Music Player Daemon (MPD) OpenBSD Howto

Music Player Daemon (MPD) OpenBSD Howto

MPD /audio/mpd 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.

In OpenBSD, the /audio/mpd port has two flavors, the basic port and a flavor that enables the tremor integer decorder. The tremor option enhances performance on *ogg files at the expense of network streaming.

There are multiple front ends that function as traditional clients to the music player daemon. Clients can be command line, console, embedded, or GTK+, Qt or Java based gui's. Plugin interfaces ranging from a Firefox extensions, desktop specific controllers and emacs plugins are available. The clients also can control some aspects of the daemon.

In OpenBSD, configuration is easy, just edit /etc/mpd.conf to delineate where your music is stored.
Code:
music_directory                 "/home/user/music"
The port maintainers have set defaults for local users with the libao (sndio) backend. For Gnome3 users, libao will work in parallel with pulseaudio or /etc/mpd.conf can be edited to change mpd output from libao to pulseaudio.

The music files and the chain of directories all need to be executable. In OpenBSD, the executable directory chain is there by default when using /home/user/music. On initial startup and after any additions to the music folder, an update command will need to be run. Once the music directory is in place and configured in /etc/mpd.conf, add mpd to collection of package script daemons to be started in /etc/rc.conf.local. For example:
Code:
pkg_scripts="dbus_daemon avahi_daemon mpd"
Either reboot or run
Code:
/etc/rc.d/mpd -f start
as su/root to start the daemon.

I'll mention two mpd clients; audio/ncmpc and audio/sonata.

Ncmpc can be run in the console or in a terminal. With the setup described above you should see that it is connected to the localhost. Ctrl-U will start a music database update. The F1 key will show the help file, F2 the playlist and F3 will let you browse the music folder.
Internet music streams can be added in the F2 playlist panel with the 'a' key. The 'S' key will save the music stream url where it can be found in the F3 panel. Two of my favorite stream sources are:
Code:
http://audio-mpd.ibiblio.org:8000/wncw-128k
WNCW, an NPR station out of North Carolina
and
Code:
http://stream-tx1.radioparadise.com:80/mp3-128
Radio Paradise which is a commercial free station out of California. Ncmpc also supports lyrics but at the expense of increase bandwidth and cpu cycles.

Some example menu entries:
For those using xterm:
Code:
xterm -g 54x18 +sb -T "NcMpc Music" -e ncmpc
.
Alternative terminals that support changing title bar icons, such as /x11/rxvt-unicode can use
Code:
urxvt -g 54x18 +sb -icon /usr/local/share/pixmaps/music.png -T "NcMpc Music" -e ncmpc
after copying an icon to the file path specified. Those running a desktop environment that supports freedestop menu entries can use the following entry in /usr/local/share/applications/ncmpd.desktop
Code:
[Desktop Entry]
Name=NcMpc
Comment=MPD Front end
Exec=xterm -g 54x18 +sb -T "NcMpc Music" -e ncmpc
Terminal=false
Type=Application
Icon=music.png
Categories=GTK;AudioVideo;
An example music.png icon and a screenshot of ncmpc running in rxvt-unicode:
Name:  music.png
Views: 427
Size:  1.5 KB

Name:  ncmpc.png
Views: 443
Size:  30.4 KB


Sonata, /audio/sonata, provides the same functionality with a mouse pointer interface and a system tray icon. Internet streams are added and stored under the 'streams' tab. Album art is available in addition to lyrics for those with bandwidth and cpu cycles to burn.

Last edited by shep; 28th May 2014 at 02:07 PM. Reason: Update RadioParadise to more robust server
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD : Ripping and writing music CDs with cdio(1) J65nko Guides 5 30th November 2011 08:33 PM
New to OpenBSD: problem with music, raid? barum87 OpenBSD General 3 24th June 2010 04:04 AM
Howto Compile in OpenBSD 4.5 shep OpenBSD Packages and Ports 2 7th May 2009 11:25 PM
I'm looking for a music text based music player that can play .m4p and .m4a formats cssgalactic FreeBSD Ports and Packages 4 14th July 2008 04:16 AM
whats playing on your music player? ephemera Off-Topic 22 10th June 2008 06:57 PM


All times are GMT. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick