LocustWorld update

I’m still waiting to get hold of some wifi cards that actually work with LocustWorld, so at the moment I’m stuck with two old laptops with crappy pcmcia cards in them. It works, but I really need more nodes to mess about with.

For now I am working on getting LocustWorld installed onto a Linksys WRT54G. So far I’ve managed to get the routing system working (AODV), and now need to concentrate on getting the auto configuration working! To track all this, and to allow other people to help, I’ve set up a wiki on LancasterMesh website. If you want to help with this, feel free to create an account. I’m also going to set up a CVS repository or something for any code I create, but that’ll probably be much further down the line!

LugRadio

I know its very very geeky, but I’ve just started listening to LugRadio. This is a podcast radio show created by a group of LUG members from Wolverhampton. It is extremely funny, a bit blue in places, and talks about the latest happenings in the Linux and open source world in general. If you are into Linux or open source in any way, it is well worth a listen!

Darren.

Locust World

I’m currently looking at the Locust World system which is a combined wireless mesh node and access point, all rolled into a single 32Mb package that can be run off a compact flash card. It uses standard PC components and the base system is totally free! Could be quite good for both Lancaster Mesh and CastleWireless.

Unfortunately, the documentation seems a little old, and apart from new news articles about the latest implementations, there doesn’t seem to be much activity. It doesn’t help either that I can’t seem to join the mailing list for some reason. Hopefully I’ll be able to get on the list and get some form of support, and possibly contribute back in to the project. It does have a commercial version of the software with all sorts of bonuses, but I think I’ll wait till I’ve got the basic package working before I fork out on that! 🙂

From my messing around with it so far tho’, I have discovered just how bad the native support in linux is for wifi cards, also how often card manufacturers decide to change what chipset they use on their cards! Having said that tho’, I’ve found one card on Dabs that seems to be quite well supported and is only a tenner! (Quicklinx code: 3X0MWS). So, if anyone out there has a wifi card (11Mb, or 54Mb) that they know has a prism or orinoco chipset and want to give it a good home, let me know!

IPv6

Well, in my eternal geek quest, I’ve once again set up IPv6 on my network. This time however, I discovered BT Exact, which made the whole process so simple, its a wonder more people aren’t IPv6 enabled (at least in the UK). It took all of 10 minutes to install the required software (radvd), edit the script that BT exact automatically send to fit in with my network, and start the interface. They even allow you to set up your own IPv6 enabled DNS servers with reverse lookups.

Now just to wait and see if Eclipse offer any IPv6 functionality! Update: They don’t!

Darren.

MythTV and a Sony PSP

I’m not really much of a gamer, but after having a go on someone’s PSP, I had to get myself one. They are a wonder of modern technology. A small package that crams just about everything you could want to play games, and more besides. It is sold as a games machine, but it makes a pretty good all round portable multimedia system, playing movies, MP3s and holding your holiday snaps on there too!

Most of the functionality is easy to get to work with linux. Basically it is seen as a mass storage device and files can be copied to and from it with the usb cable. The one area that is problematic under linux is movies. Sony have decided to only support an MP4 media format, and even then it has some strange headers so that only certain MP4 files will play. There’s plenty of information out on the net for converting these files, but it can be hidden in various different sources. I’ve written this article to draw together all those sources into one place. I’ve tried to credit the original supply of the information wherever possible.

First step is to get a working copy of ffmpeg that supports the PSP format. This isn’t as easy as it sounds. I ran into problems with the version of compiler I was using. Most up to date distributions ship with gcc4, which will not let you compile the ffmpeg that you need. On Mandrake and Debian, they also ship a version of gcc3, but unfortunately this has a bug in it which means that you will get halfway through the compile and it will crash. In the end I downloaded the source for the latest version of gcc3 (3.4.5) and compiled that. On Mandrake you change the symlink in /etc/alternatives/gcc to the version you want to use, in Debian the symlink is in /usr/bin/gcc

Feel free to try with the version of compiler you have, but if you have any problems then just get the latest version of gcc3. It may be worth trying seeing as it takes a rather long time to compile gcc!

A few other libraries are needed to get this working, but I found the default ones in Mandrake 2006 to work fine, YYMV. The libraries needed are the libfaad, libfaac, libogg and libvorbis. Don’t forget to get the -devel packages for these (-dev under debian).

Once you are ready to compile, I found the best instructions on the linux PS2 site, in a post by “cronocloud“. Here is the basic gist of the post.

Get a snapshot of the ffmpeg CVS from the 10th March at: http://www.nurs.or.jp/~calcium/3gpp/sources/ffmpeg-050310-0.30.tar.gz, along with a patch from: http://www.nurs.or.jp/~calcium/3gpp/sources/ffmpeg_patched_diff_031.tar.gz.

Uncompress the ffmpeg and patch tarballs into the same directory. Next move the file libavformat/movenc.c from the patch into the ffmpeg/libavformat directory, overwriting the existing one. Then, open the file in an editor and find the section (near the top) that looks like:

#ifdef WIN32_PSP 
 #include "wchar.h" 
 #include "locale.h" 
 #include "windows.h" 
 #endif

Replace this with:

#ifdef WIN32_PSP 
#include "wchar.h" 
#include "locale.h" 
//#include "windows.h" 
 
#define CP_ACP 0 
#define MB_PRECOMPOSED 0 
size_t MultiByteToWideChar(int a, int b, char *src, size_t c, wchar_t *dest, size_t n) { return mbstowcs(dest, src, n) + 1; } 
#define _timezone 0 
#endif

Edit the file ffmpeg/libavformat/Makefile and remove the line:

OBJS+=avisynth.o

Edit the file ffmpeg/libavformat/allformats.c and remove the line:

avs_init(); // [MobileHackerz]

Lastly, edit the file ffmpeg/ffmpeg.c and remove the lines:

setvbuf(stdout, (char *)NULL, _IONBF, 0); // [MobileHackerz] 
setvbuf(stderr, (char *)NULL, _IONBF, 0); // [MobileHackerz] 
_setmode(_fileno(stdout), _O_BINARY); // [MobileHackerz]

Once all this is done, run a configure and make in the main ffmpeg directory. This should go away and compile ffmpeg (hopefully). The configure line to use is:

./configure --enable-gpl --enable-faac --enable-faad --enable-vorbis --enable-ogg

By now, you should hopefully have a ffmpeg binary that will convert just about any movie format into one that can be played on your PSP. Unfortunately, ffmpeg is not the simplest of programs to use, and needs 101 command line options to be specified. I’m not exactly an expert when it comes to video formats, so a lot of these options I specify below come from the “monkey see, monkey do” school of thought! The following is an example of how to convert a NUV video (the kind used in MythTV) to a PSP MP4 format.

./ffmpeg -y -i /home/mythtv/Recordings/1010_20051213180000_20051213183000.nuv -title "The Simpsons - Brothers Little Helper" -bitexact -f psp -s 320x240 -r 29.97 -b 768 -acodec aac -ac 2 -ar 24000 -ab 32 -map 0:0 -map 0:2 ~/M4V00070.MP4

This will take the file and encode it to an output file ~/M4V00070.MP4. The filename must be in this format for the PSP to pick it up. (M4V followed by 5 numbers, ending with .MP4 – All characters must be in upper case). Some options are straight forward (-title!) some others can be tweaked. The frame rate (-r) should be either 29.97 or 14.985. I’ve not been able to get any other rates working. The bitrate (-b) should be either 384 or 768, depending on what type of quality you want. -f specifies the output format is psp (duh!), -acodec is the audio codec to use (aac) and the -map options at the end are so that the audio works with NUV videos (probably not needed for other movies).

The last step I did was to take a script that I found on the MythTV website and extend it a little. Thanks to james at mauibay for the initial script. Extensions on mine include, automatic tracking of movie number, to always create unique movies, and creation of a thumbnail. Also it will produce a log file so you can check on why things went wrong. This script can then be added as a user job in MythTV so that it can be fired off on any recording, or automatically on all.

#!/bin/bash

FILE=$1
TITLE=$2

FFMPEGBIN=/home/mythtv/bin/ffmpeg
OUTDIR=/home/mythtv/PSP
declare -i FILENUM=`cat $OUTDIR/.filenumber`

OUTFILE="M4V`cat $OUTDIR/.filenumber`.MP4"
OUTTHM="M4V`cat $OUTDIR/.filenumber`.THM"

echo "Encoding" > $OUTDIR/.$OUTFILE.log
echo "Input file:  $FILE" >> $OUTDIR/.$OUTFILE.log
echo "Output file: $OUTFILE" >> $OUTDIR/.$OUTFILE.log
echo "Title:       $TITLE" >> $OUTDIR/.$OUTFILE.log

let FILENUM=$FILENUM+1
printf "%05d" $FILENUM > $OUTDIR/.filenumber


$FFMPEGBIN -y -i $FILE -title "$TITLE" -bitexact -f psp -s 320x240 -r 29.97 -b 768 -acodec aac -ac 2 -ar 24000 -ab 32 -map 0:0 -map 0:2 $OUTDIR/$OUTFILE >> $OUTDIR/.$OUTFILE.log

$FFMPEGBIN -y -i $FILE -title "$TITLE" -s 160x90 -padtop 16 -padbottom 14 -r 1 -t 1 -ss 3:00.00 -an -f singlejpeg $OUTDIR/$OUTTHM >> $OUTDIR/.$OUTFILE.log

When setting the MythTV job, don’t forget to put quotes round the title setting!

Hopefully this is easy to follow and has all the information in one place. If you need any more help or know of anything missing from my explanation, feel free to drop me a line.

Web pages moved!

Well, I’ve been playing a lot of online games recently (Day of Defeat mainly) and discovered a slight problem. Previously these web pages, including all the 100’s of pictures, were hosted on my web server in my cellar. Unfortunately this meant that whenever someone was looking at my pictures I got really bad lag and got killed!

I’ve now moved my web pages and pictures to a remote server that I look after, run by my hosting sideline, TinyNetworks. Hopefully everything should have moved across OK. If you spot any problems, let me know! Not that this will improve my gameing any. I’ll still get killed just as often, but at least now I’ve not got an excuse! Also, viewing the pictures may well be a bit faster now!

No ‘net for 24 hours!

Well, not exactly true, I could get on from work, but my home connection was down for an extended period!

But I survived!

Eventually the problem was tracked down to a BT fault, as usual. This has only been my second major outage since getting ADSL (over 3 years now) so its not really bad going.

Normal services will now be resumed!

Lancaster Mesh

Well, I’ve just been looking through the logs for one of my little pet projects, Lancaster Mesh, and noticed that there has been a little bit of traffic to it including some downloads of the software. Will wonders never cease!?

I’ve also heard rumours of people picking up the mesh wireless network (cunningly called lancastermesh) from all sorts of places around Lancaster. Now this means that either people are messing with it and not letting me know (nowt wrong with that.. they’re welcome to!) or other people are trying to do a mesh in Lancaster. In either case, if you pick up a wireless network called lancastermesh, email me and let me know when and where you picked it up from.

On a totally unrelated note, cheers to Olly for getting my map of Lancaster, er I mean Ankh-Morpork signed by Terry Pratchett!

Weblog Vulnerablities – Important

Hi,

Sorry to butt in, but I’ve just had to upgrade the software for this weblog to fix a major security vulnerability. This affects quite a few bits of blog software including PostNuke, WordPress, Drupal, Serendipity, phpAdsNew, phpWiki and phpMyFAQ. If you are running any of these, please upgrade!

Press Release

Thanks,

Darren.

The Wedding!

Thankfully, not my wedding. Today (well, yesterday, Saturday) Matthew Lee and Patricia McGrath tied the knot at the Registry office in Lancaster. Here is a link to some pictures from the (long, exhausting, fun) day.

The Wedding Photos

Congratulations to Matty and Trish!

Darren.