Music Player Daemon Community Wiki


525pages on
this wiki
Add New Page
Talk0 Share

TomTom is a manufacturer of Linux based car navigation devices. The OpenTom project has a lot of information on how to hack the TomTom devices. Fortunately, TomTom itself was quite helpful, and they published all patches including the build toolchain on their home page.

We are working on creating a MPD package for the TomTom. pympdtouchgui might be a good client.

This page desribes work-in-progress. It might be helpful to give you a clue where to start.

Porting MPD Edit

I recommend that you use "stow" to manage the following packages on your build host.

The toolchain is accessible in /usr/local/cross/gcc-3.3.4_glibc-2.3.2 in this example, and the cross-compiled libraries are installed in /usr/local/arm-linux.

The toolchain Edit

First, install the toolchain: download the tarball, and unpack it in /usr/local/stow/arm-toolchain. "stow" it. Add /usr/local/cross/gcc-3.3.4_glibc-2.3.2/bin to your PATH. This is a patched gcc. You can try to build your own toolchain, but getting the floating point support right is difficult.

Building libraries Edit

Build zlib:

CC=arm-linux-gcc ./configure --prefix=/usr
make install prefix=/usr/local/stow/arm-zlib/arm-linux

Build libid3tag:

CFLAGS="-I/usr/local/arm-linux/include" LDFLAGS="-L/usr/local/arm-linux/lib" \
  ./configure --prefix=/usr --host=arm-linux --disable-shared
make install prefix=/usr/local/stow/arm-libid3tag/arm-linux

Build libmad. Delete the lines containing "-fforce-mem" from configure, they will break the build.

CFLAGS="-I/usr/local/arm-linux/include" LDFLAGS="-L/usr/local/arm-linux/lib" \
  ./configure --prefix=/usr --host=arm-linux --disable-shared --enable-fpm=arm
make install prefix=/usr/local/stow/arm-libmad/arm-linux

Build GLib. This requires some hacks, because GLib doesn't allow cross-compilation out-of-the-box:

echo glib_cv_stack_grows=no >arm.cache 
echo glib_cv_long_long_format=I64 >>arm.cache
echo glib_cv_uscore=no >>arm.cache
echo ac_cv_func_posix_getpwuid_r=yes >>arm.cache
echo ac_cv_func_posix_getgrgid_r=yes >>arm.cache
echo glib_cv_use_pid_surrogate=no >>arm.cache
./configure --prefix=/usr --host=arm-linux --disable-shared \
  --disable-selinux --disable-fam --disable-xattr --cache-file=arm.cache 
make install prefix=/usr/local/stow/arm-glib/arm-linux

Building MPD Edit

Finally, build MPD (from git):

./configure --prefix=/mnt/sdcard/mpd --host=arm-linux --enable-werror --enable-debug \
  --enable-un --disable-tcp --enable-oss \
  --disable-flac --disable-oggflac --disable-audiofile --disable-wavpack \
  --disable-ffmpeg \
  --disable-lsr --with-zeroconf=no --disable-curl \
  --disable-alsa --disable-jack --disable-id3tag --disable-oggvorbis --disable-lame \
  --disable-pulse --disable-fifo --disable-shout-mp3 --disable-shout-ogg

This should create a static MPD binary, which you can copy to the TomTom.

Configuring MPD Edit

The following configuration file works:

music_directory /mnt/sdcard/mp3 playlist_directory /mnt/sdcard/mpd/playlists

db_file /mnt/sdcard/mpd/db                  
log_file /mnt/sdcard/mpd/log                
state_file /mnt/sdcard/mpd/state_file       
audio_output_format "48000:16:2"
mixer_type "software"                       
bind_to_address /tmp/mpd.socket

If you don't specify a forced audio_output_format, the OSS kernel driver will fall back to 16 kHz output.

MPD is currently quite slow, but we will work on optimizing it. Unfortunately, TomTom's "ttn" application consumes a large chunk of memory and always consumes 70% CPU, even when it's not active.

Controlling MPD Edit

mpc is known to work on the TomTom, and it's quite easy to cross-compile it.

Porting pympdtouchgui Edit

Building Python Edit

Cross-compiling Python to ARM can be quite a challenge, but fortunately others have already struggled with this, and have created a solution. I was successful with these instructions. The patch is for Python 2.5, but this old version should be enough for us.

I used the following commands:

patch -p1 <../Python2.5_xcompile.patch
./configure && make python Parser/pgen
mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean
./configure --prefix=/usr --host=arm-linux --disable-ipv6
make HOSTPYTHON=./hostpython  HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=yes
make HOSTPYTHON=./hostpython  HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=yes install prefix=/usr/local/stow/arm-python/arm-linux

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.