MPD
From wikiPodLinux
| MP3 Audio Decoder | |
| |
| Category | Applications |
|---|---|
| Maintainer | Courtney Cavin |
| Last updated | 16 Jan 2006 |
| Version | 0.2 |
| Runs on | All iPods |
| Requires | Podzilla |
| Download | Module, Binary (http://so2.sys-techs.com/ipod/mpdc/mpd) |
| Support | IRC (irc://irc.freenode.net/#ipodlinux) |
Music Player Daemon (http://musicpd.org/) (MPD) was originally intended to allow remote access for playing music files and managing playlists, and was designed for integrating a computer into a stereo system that provides control for music playback locally or over a network.
Work is currently ongoing on a uClinux branch (http://mpd.wikicities.com/wiki/MusicPlayerDaemonUclinuxBranch) for the iPod, as well as a client (http://musicpd.org/clients.shtml) within podzilla. The two communicate over the loopback interface. Theoretically if an iPod were networked via firewire or the serial port, it could also be controlled over the network.
| Table of contents |
FAQ
When will it be done?
When it's done. Don't ask.
What does this mean for users?
- Multitasking - listen to music and play games/spin useless cubes at the same time!
- More formats - FLAC, Ogg and more!
- Better playlisting - on the go, mix and match, whatever takes your fancy.
- No more malloc errors - semi-intelligent file buffering.
- Better support for non-iTunesDB files (tag scanning).
- Gapless playback - great for live and continuously mixed albums.
Will decoding be faster?
Nope, though it may be easier to run codecs on the COP/in IRAM with mpd.
What does this mean for developers?
- More modularity
- Adding codecs should be easier
- Player interface already done for you - just write the decode loop.
- Lower footprint for podzilla.
What's done so far?
The original MPD uClinux branch contains all the file buffering stuff and an optimised FLAC decoder, and a start at an optimised Ogg vorbis decoder. We've added initial MP3 support via the Helix mp3dec library, as well as initial AAC support through the Helix aacdec library. Work is ongoing on an iTunesDB to MPDdb scanner.
Much progress has also been made in writing a client into podzilla using an optimised libmpdclient.
Where can I get it?
The build is currently prone to a few bugs and is alpha quality due to our dodgy addons that have yet to be cleaned up. It is not currently ready for normal usage. Drop by on IRC (irc://irc.freenode.net/#ipodlinux) and prod coob or courtc if you'd like to help with development.
Setting up MPD
Getting what you need
For podzilla2, you can try the MPD module instead of this method. First you'll need to get MPD (http://so2.sys-techs.com/ipod/mpdc/mpd) and a podzilla with mpdc built in (http://www.so2.sys-techs.com/ipod/mpdc/podzilla). One can be built from CVS by specifying MPDC=1 when you make it. (You'll need an optimized libmpdclient (http://so2.sys-techs.com/ipod/mpdc/libmpdclient.tar.gz))
Both the mpd binary and the podzilla one should go in your iPod's /bin directory. Make sure they are executable.
Preparing your iPod
Before you can run free with MPD, some setup is required on your iPod.
MPD's home
MPD needs a place to save its database and playlist files. In this walkthrough we'll let MPD place them in /home/.mpd/playlists/ on your iPod. You'll need to create that directory before MPD will be happy.
/etc/mpd.conf
For the sake of simplicity you can aquire a mpd.conf here (http://so2.sys-techs.com/ipod/mpdc/mpd.conf). This file should be fine unmodified if you are using a vfat iPod and your iPod mounts /dev/hda2 in /mnt. Otherwise you'll need to modify the music_directory line to point to where your music is located. (On Mac iPods, /. On iPods which used the Windows installer, /hp.)
When you're done editing (or not editing) mpd.conf it should go in your iPod's /etc directory.
/etc/rc
You'll need to add a few lines to your iPod's /etc/rc as well.
- First of all, make sure that you have a loopback interface up:
ifconfig lo 127.0.0.1 - Next, make sure MPD updates its database file on each boot:
/bin/mpd --update-db - Now, add a line that starts MPD so that it can be accessed:
/bin/mpd
Ex:
... mknod /dev/ttyp1 c 3 0 ifconfig lo 127.0.0.1 hdparm -q -S 3 /dev/hda hwclock --hctosys /bin/mpd --update-db /bin/mpd podzilla
If you are using the MPD module version 0.3-beta (or higher) then you do not need the two /bin/mpd lines in your rc file; The MPD module should configure itself properly and update its database on startup.
Problems?
Please remember that if you run into problems installing or using MPD, don't go running to a developer for help. Developers can either provide ongoing support or continue development to improve a package. In short, you're on your own.
If you encounter skipping during playback and pressing pause for a few seconds followed by play again solves play for a few seconds then you have trouble decoding your mp3 file in real-time.
1. - try adding two battery meters to the podzilla2 header, each updating once a second. This will cause podzilla2 to sacrifice some processor usage to MPD.
2. - Try down sampling your music. e.g. use lame -B 112 -V 9 to down sample your mp3 (this gives good results on a nano 2Gb when using MPD in podzilla2).
If you see multiple 'blank' lines when entering a Songs menu, this is most likely due to your MP3s having "broken" ID3 tags (wrong encoding). To fix this use a tagger such as easytag (http://easytag.sourceforge.net/) or Musicbrainz Picard (http://musicbrainz.org/news/picard.html).

