Tuesday, 7 July 2009

Re-Programming MusicPal

I have not made any progress with the MusicPal since Christmas, but someone else has been busy and made a good start on some alternative software to run on it, which he has published here http://musicpal.v3v.de/.
Well done Marco - you have got much further than I have!
Giles also made progress with sound output and left his code in a comment to one of my earlier posts here.
Maybe it would be worth starting a project on Google Code or somewhere so other people can help develop it?

18 comments:

  1. Great to hear that someone has done some work on getting alternative software working on the Music Pal. Have you tried out this software yet, if so what features and capabilities does it have.

    ReplyDelete
  2. Thats Great News, I would like to be able to stream (mp3/wav) from my laptop to the musicpal. Do you think you might implement this?

    (I know that you can do this via upnp and stuff like MediaTomb, but that requires me to walk over to the device and press buttons, I want to do it remotely)

    ReplyDelete
  3. It sounds like you want it to do the same as me. I set about trying to port the Music Player Daemon (http://mpd.wikia.com) to the MusicPal. It looks like it just needs a different output module writing using the audio control procedures we have worked out.
    I think the only reason it stalled (apart from me starting on something else...) was that I struggled to get autoconf to compile my new module.

    ReplyDelete
  4. Ok.. I gave it a try... but those depencies drove me crazy ;-)

    I already compiled madplay without any problems. It needs libmad and libid3-tag. These are also needed by mpd, when you want to play MP3.

    mpd >= 0.14 needs glib, so I tried 0.13.2 and it compiles cleanly, supporting mp3, mp2 and oss:

    ./configure --disable-oggflac --disable-oggvorbis --build=i386-linux-gnu --target=arm-linux --host=arm-linux --with-mad-libraries=/home/maz/MusicPal/madplay/libmad-0.15.1b/.libs/ --with-mad-includes=/home/maz/MusicPal/madplay/libmad-0.15.1b/ --with-id3tag-libraries=/home/maz/MusicPal/madplay/libid3tag-0.15.1b/.libs/ --with-id3tag-includes=/home/maz/MusicPal/madplay/libid3tag-0.15.1b/

    It starts on the MusicPal, but OSS wouldn't work, I think.

    ReplyDelete
  5. mpd output:

    list: play 0:"Bill Wyman's Rhythm Kings - Groovin' - 13 - Streamline Woman.mp3"
    copyMpdTagToOB: !acceptMetadata || !tag
    interface 0: command returned 0
    interface 0: process command "status"
    interface 0: command returned 0
    interface 0: process command "outputs"
    interface 0: command returned 0
    interface 0: process command "status"
    interface 0: command returned 0
    interface 0: process command "outputs"
    interface 0: command returned 0
    OSS device "/dev/audio" does not support 2 channels: Inappropriate ioctl for device
    problems opening audio device while playing "Bill Wyman's Rhythm Kings - Groovin' - 13 - Streamline Woman.mp3"
    playlist: stop
    interface 0: process command "status"
    interface 0: command returned 0
    interface 0: process command "clearerror"
    interface 0: command returned 0
    interface 0: process command "outputs"
    interface 0: command returned 0
    interface 0: process command "

    I modify mpd later.

    ReplyDelete
  6. Wow - such progress!
    You are right that OSS output will not work - the MusicPal audio interface looks similar to OSS, but not the same.
    I think the thing to do is to look in src/output in the mpd source directory and create a new output plugin for the MusicPal. I had a quick go at this based on the OSS one, but then I failed to get autoconf to link my new code into it....
    I seem to have lost my code though - If I find it I will post it somewhere for you.

    ReplyDelete
  7. Here the precompiled version with patch for the source: mpd

    libid3tag and libmad:
    #################################
    ./configure --build=i386-linux-gnu --host=arm-linux --target=arm-linux --prefix=/usr/local/arm/
    make
    #################################

    mpd:
    #################################
    patch -p1 < mpd-0.13.2.musicpal.patch
    ./configure --disable-oggflac --disable-oggvorbis --build=i386-linux-gnu --target=arm-linux --host=arm-linux --with-mad-libraries=/home/maz/MusicPal/madplay/libmad-0.15.1b/.libs/ --with-mad-includes=/home/maz/MusicPal/madplay/libmad-0.15.1b/ --with-id3tag-libraries=/home/maz/MusicPal/madplay/libid3tag-0.15.1b/.libs/ --with-id3tag-includes=/home/maz/MusicPal/madplay/libid3tag-0.15.1b/ CFLAGS="-Os -s"
    make
    cd src
    arm-linux-strip --remove-section={.comment,.note,.pdr} mpd
    #################################

    ReplyDelete
  8. I forgot something to mention:

    The paths in mpd.conf should be changed! They show to my usb drive.

    Everything else is preconfigured.
    It also works, when nashville is running (but not playing).

    ./mpd --no-daemon --stdout --verbose mpd.conf

    ReplyDelete
  9. Wow, it works!

    I don't have an usb drive attached to my musicpal (yet) so I had to fiddle with mpd.conf, and put all the test music in the limited space in /tmp

    Once running I attached to the mpd running on musicpal with Gnome Music Player Client.

    I can't stream audio from my pc to the musicpal, I don't know if this is a limitation of mpd or gmpc. But I think once I have soldered a usb drive socket to the musicpal it will do what I want it to.

    Thanks to Maz and NT for all the effort, I look forward to seeing what else can be done ;)

    ReplyDelete
  10. Actually, I just realised, you made a samba plugin for palmod, could I prehaps use this to mount an smb share in which my music is kept?

    It would be nice to have a standalone version of smbmount if you would be so kind Maz ;)

    ReplyDelete
  11. You'll need CIFS or SMB kernel module for that. I think, the smbmount wrapper isn't needed for that.

    cd /tmp
    wget http://musicpal.v3v.de/cifs/cifs.ko
    insmod cifs.ko
    mkdir /tmp/mnt/share
    mount -t cifs //ip/share /tmp/mnt/share -o user=username,pass=password

    ReplyDelete
  12. My god, that was quick!

    Can't wait to try it...

    ReplyDelete
  13. There are ~220kb left on the device, but the jffs filesystem should compress that file about 50%.

    /tmp seems to be fixed size, but enough for loading cifs with a boot script using wget.

    ReplyDelete
  14. Ah ha it fits afterall, well it wouldn't before because I had a huge mpd.conf in my /home dir, anyway, so now I basically just have cifs.ko in my /home dir aswell as the following script:

    #!/bin/sh

    insmod cifs.ko
    mkdir /tmp/mpd
    mount -t cifs -o username=guest //192.168.2.4/mpd /tmp/mpd
    mount -t cifs -o username=guest //192.168.2.4/music /tmp/mpd/music/

    /tmp/mpd/mpd /tmp/mpd/mpd.conf

    ReplyDelete
  15. You can also write to /usr. You only have to remount the filesystem rewriteable:

    # writeable
    mount -o remount,rw /
    # readonly
    mount -o remount,ro /

    root is mtdblock0 and home is mtdblock1, so you've got two partitions.

    I think, it would be better to put mpd to the samba share and start it from there. At least the database.

    ReplyDelete
  16. That's cool.

    NFS may be faster than CIFS/SMB.
    I'll put this into the FW replacement kit.

    MpPong is really funny :-)

    ReplyDelete
  17. I blogged about this on my own blog To which someone posted a patch to the mpd patch for setting the equaliser settings to zero.

    ReplyDelete
  18. To answer Stu's question, USB hubs seem to work fine with the MusicPal (at least with flash drives, I haven't tried anything more complicated), so you could easily hide a little one inside the MusicPal case with a small flash drive to extend the storage capacity.

    I like Maz's idea of stripping out the superfluous stuff from the MusicPal firmware and replacing nashville with a mpd client. I just haven't got brave enough to try to re-flash it yet I'll have to try the 'emergency re-flash' procedure to make sure it works first so I can go back to the manufacturers' firmware.

    ReplyDelete