Music Player Daemon on the MusicPal

Some time ago I recived a MusicPal as a gift. Out of the box the device is great fun, and made a very good present. The device is designed to work as an internet radio, It can connect to a wireless network and stream radio from various internet radio stations. However the device does have a few limitations when you want to play your own music. The device can connect to Media servers that use the UPnP Media Devices Protocol and the device is operated using two rotary knobs. For me the combination of these two features is the major design flaw in the product.  I don’t want to walk over to the device, twiddle some knobs and play a tune that is on my laptop, instead I want to select songs from my laptop and queue them up for playing on the device. There are two remote control applications for the MusicPal, one which is accessible through a web interface, and another which is Windows™ software. However both of the remote control applications are useless, all one can do is pause music, you can’t select a new song to be played, change the position of playback or even fast-forward and rewind!

Well a while ago,  I found a blog from someone who goes by the name of Nerdy Toad who was trying to run Music Player Deamon on his MusicPal.  At the time he had only managed to make a test sinewave come out of the devices internal speaker, and we worked together to see if we could get output from the line-out of the device. We were somewhat unsuccessful. However, about half a year later, someone called Maz took our research further. He was able not only to get sound fully working on the device, he was also able to patch Music Player Deamon to work on the device aswell.

For anyone else who has a MusicPal and wants to use it in conjunction with Linux you will need to do the following. First you have to enable the telnet interface for the device. You can enable it via a hidden web interface page:
http://musicpal/admin/cgi-bin/debug

You can then telnet to the device, login as root, and issue the following command.
wget http://musicpal.v3v.de/cifs/cifs.ko

This will get you a kernel module will will allow you to access a samba share on the device. This is important because the device has very limited disk space, and so its preferable to put mpd, config files, etc. In a samba share. Of course you will probably have your mp3 files in a samba share aswell. You will need to create an smb.conf on the machine that you will be sharing files from, (not the MusicPal). This is my smb.conf

[global]
server string = masala
security = SHARE
guest account = giles
[mpd]
comment = mpd
path = /home/giles/mpd
guest ok = Yes
read only = No
[music]
comment = Music
path = /home/giles/Music
guest ok = Yes

In my setup I have mpd on the machine sharing music, this is because of the limited space on the MusicPal, so still on this machine download the mpd binary

wget http://musicpal.v3v.de/mpd-testing/mpd.tar.gz

Then expand the gzip into the mpd directory. You will have to modify the mpd.conf file so that the directories are correct. Once you have done all this, you can mount the shares from the MusicPal telnet session

mount -t cifs //192.168.2.4/mpd /tmp/mnt/mpd
mount -t cifs //192.168.2.4/music /tmp/mnt/mpd/music

Finally from the telnet session you can launch mpd. Back on the client you should now be able to connect to mpd via your favorite mpd client program.

Advertisements

16 thoughts on “Music Player Daemon on the MusicPal”

  1. Very good job! Works great! The only thing that stops me from really using it is that there is a clear bass boost or loudness enabled on the Wolfson codec which sounds horrible on my hifi system. Would be great to have the patched mpd with flat equalizer settings.

  2. I did not ebable bass boost via the web interface so I guess the patch is overwriting this. I could not figure out where this happens as the Wolfson addresses in the patch do not map with the datasheet.

    So I added flat equalizer settings at the end of oss_open() and rebuilt mpd. Now it sounds fine:

    ioctl(od->fd, AUDIO_ALL_ON, NULL);

    eq.bass = 0;
    eq.treble = 0;
    eq.dac = 255;
    eq.flags = 0;
    if (ioctl (od->fd, AUDIO_SET_EQUALIZER, &eq) == -1)
    {
    perror (“AUDIO_SET_EQUALIZER”);
    exit (-1);
    }
    else
    fprintf(stderr,”AUDIO_SET_EQUALIZER called successfullyn”);

    audioOutput->open = 1;

    return 0;

  3. Hi,

    that’s right. I forgot to turn off bass boost. Thanks for the patch.

    I played a little bit with mpd and when you’ve got a huge mp3 list, swap space is required! My mpd runs with nearly 24 mb of ram 😉

    Unfortunately, swap is not activated in the musicpal firmware by default. I’ve got an FW-Replacement kit that unpacks the fw-image, replaces the kernel, compiles packages and compresses the fw-image again. Just like OpenWRT. When I finished it, I release it under GPL.

    Cheers,
    Marco

  4. The firmware replacement sounds like a great idea. Ultimately I would like to replace all the proprietry MusicPal software (nashville) with Free Software. Prehaps the first step would be to write a mpd client that runs on the device itself and makes use of the LCD and control knobs.

  5. The only thing we need to exchange would be nashville and the wlandrv module. The second thingy is a little bit harder to do but who needs wlan anyway 😉 – maybe the USB-Host can manage other devices.

    The mainapp would be the most work. I also dunno if we need a vtuner account. Without would be much easier.

    The thing that’s not so good about mpd is the ram problem. mpd is nice with a lot of swap, but not so good as standalone app.

    My experiences for now:
    – Busybox v1.13.4 is a little bit smaller (about 100KB) and works when you use a cgi_wrapper
    – Removing some timezones in /usr/share/zoneinfo can free about ~200KB compressed flash memory
    – Removing the jpg files in /var/www/images, converting the html files from mac to unix and removing some languages (/var/www/text_*) can also free about ~200KB

    After all, there are 900 KB free compressed rootfs on the MusicPal. That should be enough for some apps.

    But to change kernel and toolchain, we really need to replace the third-party components.

  6. maz :
    The thing that’s not so good about mpd is the ram problem. mpd is nice with a lot of swap, but not so good as standalone app.

    It certainly seems ok with my setup, but maybe I don’t have as many songs as you. I suppose using smbfs as swap has too large a performance impact?

  7. Hi,

    since FW 1.64, CIFS is included 🙂

    I don’t have any experiences about putting mpd to a samba share, but afaik, the performance impact shouldn’t be too large. This is because mpd stores any information in memory. A second read/write should only occur on database updates.

  8. I forgot to mention:

    1.64 had a torrent client which was removed in 1.65 (I don’t know why ;-)). The (hidden) CGI file was ‘torrent.cgi’.

  9. Hey,
    any chance I can find “http://musicpal.v3v.de/mpd-testing/mpd.tar.gz” someplace else? I even tried the way back machine to no avail. Any help would be greatly appreciated 🙂

  10. Hi,
    I see that the last post is very old… But, i am also trying to re-use my old Musicpal by installing mpd.

    Is there anyone who can point to the relevant links that used to be on v3v.de ?
    Thanks !

    Alex

    1. I did try contacting maz (Marco Zissen <maz@v3v.de>) but he didn’t reply. It was his mod to the software and I am not sure of the details. Unfortunately he didn’t publish the code to something like github.

      1. Hi Giles,

        Thanks for your reply.

        It is a bit of a pity indeed the code is not on github since the device is nice (I have been using it a as a ‘radio’ for many years now) but adding MPD would be great 🙂 .

        Also, in general, I feel that there are not so much ‘ready to go’ hardware-alternatives around that are still open. (i.e. hardware, all in, which you can install MPD , mopidy etc on.
        I know the Pi is an option, but that always requires additional stuff like the screen ,a nice box, buttons, speakers etc, so re-using the old musicpal would be great.

        I will try to look around some more (but up to now without succes).
        Anyway, thanks, I will post back if i find more info somewhere.

        Alex.

      2. Good news, I have found a copy of the mpd binary in my backups. I will be providing it shortly. The only trouble is I don’t think it will be useful without the cifs.ko module. I think the cifs.ko module must be on my MusicPal hardware, but I have no idea where I’ve put it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s