Sunday, 30 November 2008

Cross Compiling for MediaMVP

I have a couple of Hauppauge Media MVP media players and I want to turn one into a customised photo view for our son - it will have to be very simple because he will not press buttons, so I want it to just start as soon as it is switched on, and provide a customised "Hello Benjamin" screen as it boots.

The mvpmc project should provide most of what I need, so I just wanted to build a cross compiler and have a play. I downloaded the binary distribution and got it running ok (needed a dhcp and tftp server on my little computer in the atic to do that), and the binary distribution of mvpmc works fine.
I downloaded the source. It says it is supposed to build its own toolchain if you do not have one, but this did not work - it ran for a long time, then complained about bits of the toolchain not being there.

I thought I was too clever for that and I would just do it myself using crosstool. This failed with obscure syntax errors, which was hard to believe.
I eventually read that building cross compilers with recent versions of gcc is troublesome, so I installed an old one instead (gcc.3.4.6 from the Ubuntu repositories). It worked ok and built a PPC-405 cross compiler for me.
Unfortunately my "hello world" program compiled ok but would not run - the MVP responded with "not found" when I executed ./hello_world. I think this is because the MVP is using uClibc, but I had just build a cross compiler with gLibc. "oh dear...".
Next tried the Embedded Linux Development Kit (ELDK). Again "hello world" compiled ok, but got the same "not found" error.

Looks like I will have to find out why the mvp toolchain build failed.

Hunting a very long way back in the build log showed that the first error (that I spotted) was when it tried to download the linux headers to compile against. It looks like the uClibc website has been rearranged and the ones that the MVP needs have been moved to a "old-releases" directory. Downloading the file and putting it in ~/downloads like the mvpmc build script does resulted in the build running apparently ok - still hasn't finished though....

OK, it's finished now, and the new toolchain compiles a "hello world" that runs ok!

Now I just have to strip out the mvpmc code down to a very simple viewer, and it should work.....sounds easy, but it's getting late now...

Cross Compiling for MediaMVP

I have a couple of Hauppauge Media MVP media players and I want to turn one into a customised photo view for our son - it will have to be very simple because he will not press buttons, so I want it to just start as soon as it is switched on, and provide a customised "Hello Benjamin" screen as it boots.

The mvpmc project should provide most of what I need, so I just wanted to build a cross compiler and have a play. I downloaded the binary distribution and got it running ok (needed a dhcp and tftp server on my little computer in the atic to do that), and the binary distribution of mvpmc works fine.
I downloaded the source. It says it is supposed to build its own toolchain if you do not have one, but this did not work - it ran for a long time, then complained about bits of the toolchain not being there.

I thought I was too clever for that and I would just do it myself using crosstool. This failed with obscure syntax errors, which was hard to believe.
I eventually read that building cross compilers with recent versions of gcc is troublesome, so I installed an old one instead (gcc.3.4.6 from the Ubuntu repositories). It worked ok and built a PPC-405 cross compiler for me.
Unfortunately my "hello world" program compiled ok but would not run - the MVP responded with "not found" when I executed ./hello_world. I think this is because the MVP is using uClibc, but I had just build a cross compiler with gLibc. "oh dear...".
Next tried the Embedded Linux Development Kit (ELDK). Again "hello world" compiled ok, but got the same "not found" error.

Looks like I will have to find out why the mvp toolchain build failed.

Hunting a very long way back in the build log showed that the first error (that I spotted) was when it tried to download the linux headers to compile against. It looks like the uClibc website has been rearranged and the ones that the MVP needs have been moved to a "old-releases" directory. Downloading the file and putting it in ~/downloads like the mvpmc build script does resulted in the build running apparently ok - still hasn't finished though....

OK, it's finished now, and the new toolchain compiles a "hello world" that runs ok!

Now I just have to strip out the mvpmc code down to a very simple viewer, and it should work.....sounds easy, but it's getting late now...

Friday, 28 November 2008

autoconf / automake / aclocal

I am trying to build Music Player Daemon for the FreeCom MusicPal. I have written an output plugin that I think will drive the hardware, but now I am having trouble compiling this into the MPD source code. I have never really understood the GNU configure scripts (./configure and all that), so I have probably messed something up.
I have added new bits to configure.ac, Makefile.in etc. But now what do I do?

As far as I can tell from the simplest tutorial I can find suggests that I should just be able to edit configure.ac and Makefile.am then run autoconf, but it complains that the files are designed for automake version 1.6, and I have 1.10. The error suggests running aclocal, but this just leads to more errors....

autoconf / automake / aclocal

I am trying to build Music Player Daemon for the FreeCom MusicPal. I have written an output plugin that I think will drive the hardware, but now I am having trouble compiling this into the MPD source code. I have never really understood the GNU configure scripts (./configure and all that), so I have probably messed something up.
I have added new bits to configure.ac, Makefile.in etc. But now what do I do?

As far as I can tell from the simplest tutorial I can find suggests that I should just be able to edit configure.ac and Makefile.am then run autoconf, but it complains that the files are designed for automake version 1.6, and I have 1.10. The error suggests running aclocal, but this just leads to more errors....

Sunday, 23 November 2008

Progress with MusicPal Sound Programming

After a couple of hours of using strace to try to understand what Nashville was doing, and looking at the "base_audio" directory in the MusicPal kernel source directory, I have finally got it to make a noise.

Basically you have to use /dev/audio and send some ioctl's to initialise the hardware, and set up the graphic equaliser. You can then write raw data to /dev/audio just like you would with OSS. In fact, I used the OSS sinegen.c example program as the basis and just altered the ioctls. http://www.musicpal.webhop.net/audiotest.c is my sample program (it needs audio.h from the MusicPal kernel source code to compile) - it makes a continuous tone come out of the MusicPal speaker, which is progress! There are some comments in the code to show what it is doing (as far as I can work out anyway!).

Progress with MusicPal Sound Programming

After a couple of hours of using strace to try to understand what Nashville was doing, and looking at the "base_audio" directory in the MusicPal kernel source directory, I have finally got it to make a noise.

Basically you have to use /dev/audio and send some ioctl's to initialise the hardware, and set up the graphic equaliser. You can then write raw data to /dev/audio just like you would with OSS. In fact, I used the OSS sinegen.c example program as the basis and just altered the ioctls. http://www.musicpal.webhop.net/audiotest.c is my sample program (it needs audio.h from the MusicPal kernel source code to compile) - it makes a continuous tone come out of the MusicPal speaker, which is progress! There are some comments in the code to show what it is doing (as far as I can work out anyway!).

MusicPal Debug Tools

I am trying to get sound playback working in my own code on the MusicPal. I have been advised to use a utility called 'strace' which allows you to monitor what system calls an application is executing - this should allow me to see how nashville initialises and uses the sound system on the MusicPal (http://forum.freecompromo.com/viewtopic.php?p=22633#22633).

I downloaded the source code for strace from sourceforge. It uses the standard gnu ./compile system to configure and compile it.
I got it to compile for the MusicPal using:
source ~/alinux/setvars; CFLAGS=-I~/alinux/linux/include ./configure --host=arm-linux
make

It compiled ok, and won't run on my PC, which is a good indication that it has cross compiled.
The problem is that I can not transfer it to the MusicPal because the executable is about 290kB, and there is only 176kB free on the MusicPal /home directory.

Oh Dear....I think the MusicPal has quite a lot of RAM - I'll see if I can make a RAM disk - either that or I have to get NFS working on the MusicPal so I can mount a decent sized directory, or even more drastic, pull the MusicPal appart and put a USB socket in it to use a USB disk - easier in the long run, but this is supposed to be a present for my wife, so I'd better not.

Silly me - there is already a ram disk mounted as /tmp....