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?

22 comments:

Anonymous said...

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.

maz said...

The current features are:

- MP3 recording / ripping
- Samba Server (as addon)
- Customized menues (/home/palmod.cfg)
- Command line parameters, to control display, knobs and audio.

It runs parallel to nashville.
I posted a tutorial in german on http://www.mydssd.de/musicpal/doku.php

The included README is in english but a little bit shortened.

Anonymous said...

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)

Graham Jones said...

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.

maz said...

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.

maz said...

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.

Graham Jones said...

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.

maz said...

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
#################################

maz said...

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

Anonymous said...

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 ;)

Anonymous said...

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 ;)

maz said...

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

Anonymous said...

My god, that was quick!

Can't wait to try it...

Anonymous said...

After spending several hours getting samba on my laptop working, sigh.

It worked, however the module is too big to put anywhere other than tmp, which then gets deleted after I shut down the music pal.

I wonder maz, could the size of the module be reduced by stripping, as discussed here:

http://www.linux-mips.org/archives/linux-mips/2002-04/msg00031.html

maz said...

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.

Anonymous said...

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

maz said...

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.

Graham Jones said...

Someone else has been busy writing software for the MusicPal - see http://forum.freecompromo.com/viewtopic.php?t=11077

maz said...

That's cool.

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

MpPong is really funny :-)

stuaxo said...

@giles your blog seems to be down...

@maz via google cache of giles blog -
"maybe the USB-Host can manage other devices."

If this can be achieved then were definitely on to something, put a hub inside like they did with the EEEPC
http://beta.ivancover.com/wiki/index.php/Eee_PC_Internal_Upgrades

From the internal hub put some storage inside and still have an external USB socket.

From there have all the software on the extra storage (apart from the alarm clock part I guess).

[stuartaxon.com]

Anonymous said...

Yeah it keeps going down because I have a measily 100MB a month bandwidth quota, I get my web hosting for free, but prehaps I need to upgrade to the unlimited bandwidth option.

Anyway, there is a mirror of my site hosted at http://korma.home.dyndns.org/wordpress

Graham Jones said...

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.