NSLU2-Linux
view · edit · print · history

The MPD music player (www.musicpd.org) is a good basis for the SlugAsAudioPlayer.

Native build

MPD can be built natively without too much effort, as the only required dependency is libao.

Cross-compile for OpenSlug

There is an MPD package in OpenEmbedded, which can be built with the OpenSlug 2.0 source tree (once set up as described by BuildingTheSource) as follows:

 ln -s ../../openembedded/packages/mpd \ 
       ../../openembedded/packages/libvorbis \ 
       ../../openembedded/packages/libogg \ 
       ../../openembedded/packages/libao \ 
       ../../openembedded/packages/libmikmod \ 
       ../../openembedded/packages/libmad \ 
       ../../openembedded/packages/flac \ 
       ../../openembedded/packages/audiofile \ 
       nslu2-linux/packages
 source setup-env
 bitbake mpd
 bitbake package-index

Native compile for DebianSlug

See http://www.nslu2-linux.org/wiki/DebianSlug/BuildMPD

Cross-compile for Unslung

mpd ipk is in optware feed. Please add wiki page on its usage.

Native compile for Unslung

Stripwax: I'm one of those lazy types who'd rather build natively on Unslung. I've got mpd running successfully in Unslung 5.5, here's what I did:

1. Once you have a working development environment, you'll need to build libao (download tarball from http://www.xiph.org/ao). 0.8.6 worked fine for me. I also made some hacks to my development environment on the nslu2 so that I could compile without having to do the whole master Makefile thing:

 CPATH=/opt/lib:/opt/bin:/opt/include
 CPPFLAGS=-I/opt/include
 LDFLAGS=-L/opt/lib

and that /usr/local/lib, /usr/local/bin, /usr/local/include and /usr/local/src are symbolic links to /opt/usr/lib, .. etc. That last bit's not probably recommended but it meant that all I needed to do to install libao was ./configure; make install !

2. Download an mpd source tarball e.g. http://musicpd.org/~normalperson/debian/experimental/mpd/mpd_0.12.0~svn+r3454.orig.tar.gz I had hell trying to get the tremor patch (mentioned in the next section of this page) to work with 0.11.5 or earlier so went with the 0.12.0 version which has the patch built in. I used the svn snapshot @ 3454 and it seems fine for me.

Again, ./configure; make install *should* work fine. But note the following comprehensively- recalled (from memory) list of problems I encoutered:

2a. To use the integer tremor decoder (*recommended!!*) you'll need to configure using "./configure --with-tremor" before making

2b. Because of buggy config script in 0.12.0, the config step fails (says the vorbis is unusable even when it isn't). Either edit the "configure" (search for "#ifdef TREMOR" and comment out eveything in main() except vorbis_info vi; vorbis_info_init(&vi) ) or just configure with

 ./configure --with-tremor --disable-vorbistest.

2c. *ONLY* the ao driver works for me in 0.12.0 (The OSS driver 'works' but byteswaps all the audio data so the result is nasty white noise instead of music :-( ). So in your mpd.conf you'll need to use the audio_output type "ao" stuff. Oh, and ao isn't compiled in by default (of course!) which means the actual configure you want to run is probably

 ./configure --enable-ao --with-tremor --disable-vorbistest

2d. I couldn't get mpd to build successfully using it's built-in mad decoder or id3tag parser. You may well find the same. If so, "ipkg install libid3tag" and "ipkg install libmad" onto your slug, and re-run the configure script above. Configure will detect the external libid3tag and libmad libs and defer to those instead of compiling the supplied-with sources. (Thanks to Daniel Locantore for reminding me about this!)

Then you're pretty much set! Contact me (dave at beermex dot com) if the above instructions don't get you going.

bwalle The way described above didn't work for me, I didn't get the ao output working. I used following patch to get oss working: http://www.bwalle.de/patches/mpd-big-endian.diff

ogg-vorbis performance

MPD can play ogg-vorbis files using libogg, which relies on floating point math, which is slow. Glen Harris reports that a TurboSlug can play 64kbit/s ogg-vorbis with 96% CPU load.

To play higher-quality ogg-vorbis files (or anything at all on a non-turbo slug), we need to switch to an integer-based decoder. This decoder is called Tremor and is available in the libvorbisidec package:

 ipkg install libvorbisidec

Using the Tremor decoder, playing a 192kbit/s ogg file takes 40% CPU on a non-turbo slug.

libvorbisidec package is not available for SlugOS. However it's not hard to build it yourself using the native build environment, using the source from xiph.org Tremor. stripwax - I've just done this, and manually applied a number of the patches developed by the Rockbox guys - end result is I can now decode using 10% CPU on a turbo slug

Tremor support is already built in to MPD v0.12.0 and above. Older versions of MPD will need to be patched. A patch (and modified bb file for OpenEmbedded) is available for MPD v0.11.2 to make MPD use the Tremor library. See http://www.musicpd.org/mantis/view.php?id=353 for details. To build a patched MPD for OpenSlug, simply replace packages/mpd/mpd_0.11.2.bb with http://reich.sdf-eu.org/hannes/code/mpd_0.11.2-tremorSupport.bb

libmikmod problems

Glen Harris says MPD on OpenSlug will currently segfault if it tries to play a mod file.

MPD doesn't work on MyBook? World Edition Problem with MBWE/gumstix1151 missing /opt/lib/uClib

view · edit · print · history · Last edited by stripwax.
Based on work by Jeff, BrianZhou, AlienZ, bwalle, Daniel Locantore, DaveHooper, and HannesReich.
Originally by HannesReich.
Page last modified on August 03, 2008, at 02:36 PM