All posts by Darren Poulson

Asterisk and a Linksys SPA-941

Linksys have done it again, produced an excellent product with a build quality to rival Cisco’s main offerings. I’ve just become the proud owner of a shiney new Linksys SPA-941 VoIP hardphone.

Getting it out of the box, it looks like its come from the same heritage as many of the Cisco VoIP phones, which isn’t surprising seeing as Cisco aquired Linksys about 3 years ago. It has a solid feel to it and the buttons respond nicely, unlike by Grandstream BT-100 which feels rather (very) cheap in comparison.

The next model up, the SPA-942 comes with a backlit display and an extra ethernet port, but neither of these were a major problem for me.

Getting the phone working with Asterisk was a total doddle. I already had a sip account set up in Asterisk, so I simply plugged the phone in to the network and power. The phone got a DHCP address (which you need to lookup what IP address it gets given) and I went to the web administration page with a browser. All that had to be done was set up the username, server address and password, then apply the changes. The phone rebooted and was online with Asterisk ready to make and receive calls.

I’ll write up the configuration at a later date. I’m going to see if I can write up some instructions for doing an autoconfiguration process for rolling them out at a commercial site.

Other Links:

 

Kubuntu Linux on an Apple G4 iBook

I’ve been using my iBook for nearly a year and a half now with Mac OS X. Whilst the hardware is fantastic, I’m not that impressed with OS X. Hardware support is of course spot on, but usability wise it leaves a lot to be desired. I know a lot of people swear by it, but I still prefer the more classic window systems such as KDE. I even find Windows easier to use!. To this end, I was contemplating buying a new laptop to put linux on as a replacement to the iBook. That was until I happened to notice that there were open source drivers for the Airport Extreme wireless cards that the iBook uses. This is a bit of a god send seeing as most laptops that I have been looking at have either poor battery life compared to the iBook, or are a bit out of my price range.

This entry is my documentation for installing Kubuntu on an iBook, which has given my trusty ol’ iBook a whole new lease of life. I chose Kubuntu as I have recently been a bit of a Debian convert, and I have been using KDE for a long long time and it has now become my desktop distribution of choice (with Debian on the servers of course!)

The first step is to download the Kubuntu 6.06 PowerPC CD image and burn it. This can be found on www.kubuntu.org.

Next, install the standard Kubuntu onto the iBook. To boot up from CD, press the ‘c’ key as the iBook turns on and you hear the gong. Installation is rather straight forward and just the same as installing Kubuntu on just about any hardware. You will need to have the iBook plugged into a network cable during the installation seeing as drivers for the wireless card need to be downloaded seperately.

Once Kubuntu is installeed, all that needs to be done is getting the wireless working. Only two commands are really needed to do this. One to download a package, and one to install it!

wget http://ubuntu.cafuego.net/pool/dapper-cafuego/bcm43xx/bcm43xx-firmware_1.2-0ubuntu1_all.deb
sudo dpkg -i bcm43xx-firmware_1.2-0ubuntu1_all.deb

Hopefully, that should be it. For more information on the wireless drivers, check out the Ubuntu Wiki page for bcm43xx. Reboot to make sure that everything is ok and then you can use all the standard tools to connect to wireless networks. Personally I use KNetworkManager which seems to work fine. I’ve been using my iBook and Kubuntu for a few days now and not come across any major problems. Bluetooth works well, the sound card gets detected automatically, and the function keys work to control volume and brightness.

The only slight niggles I’ve found are that it takes about twice as long to come out of hibernation as it did with Mac OS X (still, quicker than most systems I’ve seen, so not much of a niggle) and I can’t seem to get the wireless to come up automatically after going into hibernation, tho’ I’ll probably be able to overcome that soon. The other niggle is on the hardware… Where’s the right hand mouse button! 🙂 F11 and F12 are set up as middle/right mouse buttons by default under Kubuntu.

there’s still a few things that I haven’t tested on it such as graphics performance and some of the addons, but they aren’t important for what I need it for.

All in all, this has got to be the best laptop system that I’ve owned, and installing Linux onto my iBook has given it a whole new lease of life!

Fast Broadband!

Eclipse Broadband are now offering some fantastic adsl offers. Get up to 8Mb (or as fast as your line can take) for as little as 15 quid a month. This is due to BT’s new wholesale ADSL Max packages. I’m just in the process of getting my connection regraded with Eclipse, so hopefully I’ll be able to give a bit of an idea how good the new products are. In the meantime, if you want to migrate to eclipse for free, and get a months connection free, click on the banner below. When asked for a referer code, feel free to enter mine (DPOULSON).

High Quality Internet Services

Breast Cancer

The Breast Cancer Site

Doesn’t really need any explanation, go to this site and click on the “Fund Free Mammograms” link in the middle of the page to give money for free! Only takes a couple of seconds, and could make a difference!

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!