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

Webcam in Linux on Sony VGN-BX61MN

For anyone interested in using linux on this laptop, the following should be of help. The camera is labeled as Motion Eye but lsusb reports the device as:

05ca:1839 Ricoh Co., Ltd Visual Communication Camera VGP-VCC6 [R5U870]

After alot of messing around and installing defunct kernel modules, that seem to work, but actually include the wrong firmware versions. I found that the work being done by Alex Hixon on a generic R5U87x driver to be the most up to date. Previously the project rolled its own kernel module to support the camera, However the current version works by providing userspace tools to upload firmware to the device so that the standard uvcvideo driver in the kernel can communicate with the camera.

Unfortunately there wasn’t much around in the way of a howto to explain how to use the code. So I had to figure out the following for myself.

First of all install mercurial and some other project dependencies

sudo apt-get install mercurial libglib2.0-dev libusb-dev

Now you can download the source

hg clone http://bitbucket.org/ahixon/r5u87x/

Change into the source directory and issue the following three commands.

cd r5u87x
make
make rules
sudo make install

If your user isn’t part of the video group you will probably have to modify /etc/group and make yourself a member of that group otherwise you might experience Permission Denied errors.

After you have rebooted you can test using mplayer

mplayer tv:// -tv driver=v4l2

Also make sure you can record because uploading the wrong firmware will in some cases allow you to see output but not record it.

mencoder tv:// -tv driver=v4l2:device=/dev/video0 -nosound -ovc lavc -o test.avi

If you want to clean things up afterwards you can run the following commands
sudo apt-get --purge remove mercurial libglib2.0-dev libusb-dev
sudo apt-get --purge autoremove
rm -r r5u87x

You may find the above steps also work for the following devices:

05ca:1830 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1832 Ricoh Co., Ltd Visual Communication Camera VGP-VCC3 [R5U870]
05ca:1833 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1834 Ricoh Co., Ltd Visual Communication Camera VGP-VCC2 [R5U870]
05ca:1835 Ricoh Co., Ltd Visual Communication Camera VGP-VCC5 [R5U870]
05ca:1836 Ricoh Co., Ltd Visual Communication Camera VGP-VCC4 [R5U870]
05ca:1837 Ricoh Co., Ltd Visual Communication Camera VGP-VCC4 [R5U870]
05ca:1839 Ricoh Co., Ltd Visual Communication Camera VGP-VCC6 [R5U870]
05ca:183a Ricoh Co., Ltd Visual Communication Camera VGP-VCC7 [R5U870]
05ca:183b Ricoh Co., Ltd Visual Communication Camera VGP-VCC8 [R5U870]
05ca:183e Ricoh Co., Ltd Visual Communication Camera VGP-VCC9 [R5U870]

Creating Tiny Windows executables with TCC

I recently compiled a small executable program writtern in C with the Visual Studio C++ Express. The output was a 56K executable, which ok is pretty small, but actually in terms of programs its really large.

So I looked into compiling my program with the TinyCC compiler.

First I downloaded the compiler, however it quickly came apparent that the libraries and includes that come with the compiler were just a minimal set. What I needed was the includes from MinGW. Its only necceccery to download the Windows 32 API package.

My program needed to be linked with winsock2 so first i needed to run

tiny_impdef c:windowssystem32ws2_32.dll

This will generate a ws2_32.def file. I was then able to simply compile the program with.


tcc program.c ws2_32.def

The output of which is an executable of 1K. I asume because the compiler itself is small, and the compiler compiles itself that it would produce rather small executables. I have yet to test compiling the same program using mingw and GCC -Os.

Rock Concert

Joey and I went to see Nickleback live at Sheffield Arena. We went with Chris, Trish, and Alex.

Set List

  • Animals
  • Woke Up This Morning
  • Photograph
  • Because of You
  • Far Away
  • Saturday Night’s Alight (For Fighting)
  • (Elton John cover)
  • If Everyone Cared
  • Savin’ Me
  • Someday
  • Side of a Bullet
  • How You Remind Me
  • Too Bad

Encore:

  • Rockstar