Archive for February, 2010

Napoleon Dynamplifier

I changed the motherboard of my PC a few weeks ago and one problem I have is that the audio line out signal is not amplified. I have this connected to a pair of massive 4 Ohm HiFi speakers which I found in one of the flats I rented. The speakers are not amplified, which is quite annoying as at maximum volume they are still very quiet. The previous board had a software controlled switch to flip the line out to speaker out. The speakers come with speaker wire leads, which I just twisted to the exposed wires from an old broken pair of headphones (a proper there, I fixed it job). Every so often I would crawl under the desk to re-twist them when I accidentally kick them free.

So making a small amp would fix two problems in one go. I was looking around the office for a nice box and here is one I found.

Sorry Pedro, but this amp is more important than your election. I was planning on stabbing a hole though the metal, but Dave insisted that stabbing things is not allowed due to health and safety rules. Instead he drilled the holes I needed.

The circuit is an amp from a a small computer speaker set I had. It is based on two KA2209 chips. I could have made my own, but this one was perfect.  These can take quite a bit of punishment. They work from 3V to 15V and use very little power. At 5 volts the board was drawing 30mA. At one point I wired the power and ground the wrong way and the ICs pulled 3 amps, getting incredibly hot in the process. After I corrected the power I was quite surprised to find no damage was done.

The holes were relatively easy to expand by rotating a pair of pointed  tipped pliers inside.

For power I used a USB cable I had from a broken PS/2 to USB converter. USB should give you 100mA without asking, and here we are well within this limit. Most hubs will give the maximum 500mA without any negotiation.

I could only find an eight port spring clip speaker wire connector block. Maybe I will expand it to an 4 speaker system later.

The metal case is not ideal as you have to insulate it from the board, here done with a piece of paper. I forgot to ask Dave to drill a hole for the audio cable, and I fancied using my stabbing approach without telling him. The method I used was taking a drawing pin and, using my thumb, pushing it through the metal sheet. It actually worked. It is a weird feeling being able to push one metal though another. That’s what it must be like to be a Terminator. You can then expand the hole with a cross head screwdriver.

A bit of foam to wedge the board in place and stop it from moving (it was coincidence that it was such a close fit).

The USB cable is a little short but that can be fixed with a USB extension lead (plenty around).  I’m now gonna use it for whatever I wanna use it for! GOSH!

Updating your BIOS without Windows or a USB stick

On some of the new lab machines I made, I noticed the CPU clock did not drop when idle. This is usually due to a motherboard not having support for a new CPU, and can be fixed by doing a BIOS update. The really old way of doing this using a floppy disk. This really is not an option, but writing a CD or a USB stick can be as much hassle. Here is a dead easy set of steps to update your BIOS on a Fedora system. The following should be done as root.

yum install syslinux
cp /usr/share/syslinux/memdisk /boot/
wget -O /boot/floppy.img.gz http://www.fdos.org/bootdisks/autogen/FDSTD.288.gz
gunzip /boot/floppy.img.gz

Now edit /etc/grub.conf and add the following lines at the bottom

title Floppy Image
    root (hd0,0)            # Or whatever the other entries use
    kernel /boot/memdisk
    initrd /boot/floppy.img

Of cause the floppy image does not yet contain the flash program or data. To get these you will need to look up your motherboard at the manufacturers website and click on support. Then find the latest BIOS data file. These will be either in a ZIP or an archive EXE. If it is an EXE then usualy you can extract their content without having to resort to Windows. Try using unzip, unrar (available from RPMFusion) and 7za (available in the p7zip package). Gigabyte for example use both rar and 7zip based executables. Once you have extracted it, you should have a flash file (the file extensions on these are completely random) and a flashing program (something like FLASHSPI.EXE or AWDFLASH.EXE). To copy these to the floppy image execute the following:

mkdir /mnt/floppyimage
mount -o loop /boot/floppy.img /mnt/floppyimage
cp {your flash and executable files} /mnt/floppyimage/
umount /mnt/floppyimage/

What you have now is a FreeDOS floppy disk image which can be booted by selecting it in the grub boot menu. Remember the grub menu is now hidden, so keep any key pressed during the boot reach it. Once it has booted (you can press F5 to bypass executing autoexec.bat) simply run the program as instructed by the motherboar website:

flashprog.exe flashfile.123

Happy flashing!

Will’s TV box

Will and Sophie got married last April and the gift list they had was, lets say “disagreeable” (a £30 gravy boat is silly). Luckily Sooty and I had a policy of giving gifts on the first anniversary (should they last that long). I wanted for years to make Will a TV/server box, so this seemed like the perfect opportunity.

Ebuyer had the MSI Media Live bare-bone systems for £120 which is reasonable for a sleek case. Andrew bought one of these a couple months earlier, when I pointed them out, and he had no problems. There were also positive reports about these by MythTV users.

The Athlon X2 issue

Here there was a bit of pain. I ordered an AMD Athlon 5000+ to go into it (it was on the supported CPU list). I plugged it in, and no response. So I take the whole machine to Andrew’s house, try the 5000 in his machine and again nothing, while his 4400 works in mine. Grrrr I think, borked CPU. Got an RMA, CPU was picked up, a replacement arrives a week later. Exactly the same problem. Then I start reading into this more.

Apparently there are two CPUs which have the exact same name (AMD Athlon 5000+ AM2). The newer version is in fact a low end Phenom based CPU which has two cores disabled. This is the only Phenom based chip which goes under the name Athlon X2, so had I picked any other chip in that range, I would have been fine. Most new boards will support Phenoms, but this one does not (even witha BIOS update). So I ordered a 5400 and kept the 5000 to upgrade my own machine (a painfully slow Athlon 1700). On the positive side, that part can be overclocked rather well and one of the cores can be unlocked with a good motherboard.

The machine

The actual box is fine, nothing amazing, but just works. The other parts were: a 1.5TB Samsung F2 disk (I didn’t test the speed but the F3 we have in the office is incredible), 2GB of RAM, a Hauppauge dual DVB-T receiver and the KeySonic wireless keyboard/touch-pad. The keyboard was so good, Andrew decided to buy one for himself to replace the Apple bluetooth keyboard and mouse he was using until that point. Its nice to see the Linux bluetooth support is very smooth. The other day Will took over an hour to bind his new Apple mouse with his Mac laptop. In the mean time I managed to sense the device from the other end of the room and bind with it within seconds.

As an always on machine, it is important to look at the power consumption. The rule of thumb is 1Watt is £1 per year (more like a $1 at the moment). This makes it easy to calculate how much you will save should you go for a lower power part. The TPD (Thermal Design Point) is roughly double to triple the average power consumption. The second thing to look for is the clock scaling. The 5000 I took for my machine scales from 2.2GHz, down to 800MHz (where it spends most of it’s time). This is a very good range compared to my Core2, at work, which scales from 3GHz to 2GHz. The added advantage of having a low power system, is the fans will rarely spin up to their higher speed. Andrew’s machine, which is practically identical, pulls 63W when idle.

The on board video card has a HDMI output, which is connected to the digital audio on the sound card. This is quite common nowadays in on-board cards, but I have also seen ATI cards which have a digital only sound chip on the card for HDMI audio. One shame is that MythTV doesn’t play well with pulseaudio and likes to grab the digital ALSA output. Apparently this is annoying when you want to pause TV and play a YouTube video. I recommend ignoring the digital output as that connects to the television and thatwill probably have awful speakers. Instead use the 7.1 analogue audio system already in the machine and attach it to some reasonable speakers.

Fedora and MythTV

Fedora was happily running on the machine detecting all the devices (although the DVB card requires some extra firmware which is well documented). MythTV has improved in the setup area greatly and installing the Rpmfusion MythTV packages did practically all the work for me. The first TV box I made for myself took about three days to get properly going. The remote was fairly easy too as the new remote control configuration tool works reasonably well and saves you having to search for the appropriate set-up file. One down side of the remote is the ugly windows logo on the middle button. This is easy to change using a torx head screwdriver and a plastic spudger. Andrew has a Fedora logo one, and Will’s one has a Tux.

For a machine that is only used to record and watch TV, 1GB is usually enough, but since the machine will be on all the time it can also be used as a server. On mine I run MySQL, DHCPd, DNS, MLDonkey, Apache, Ping proxy, DNS proxy, Squid (with passive redirection) and a VNC desktop I can log into. Will additionally has a DAAP server and VMware Widnows session just to run something called SoulSeek.  These can chew though another GB.

So far it has been 4 weeks since they started using the machine. No major complaints yet apart from the DVD menu system being a bit poor (I recommend you don’t play DVDs and just rip them to the hard disk). The statistics of my machine are a testament to how useful it is (Number of shows: 1436,  Number of episodes: 11218).

A couple cute Linux games

I spent Christmas writing lectures and I thought I deserved a little break. As a reward I had a brief look though some commercial games available on Linux. I am not all that keen to support closed source development, but the game side of the open source world is sadly relatively weak, and I am pro supporting publishers who develop with Linux in mind. Traditionally, closed source games were a pain to install and would break after updating the kernel or libc (as I found recently when trying to play some). This seems no longer the case. I have gone though maybe 20 demos and all worked out the box on Fedora 12. Here are the two that really stood out.

Machinarium

This is a game by Amanita Design who have been making some fantastic things with flash for years now. One of the best things I have seen from them is a very short game they made for The Polyphonic Spree (who are amazing in their own right) where it became a different way to experience their album.

Machinarium is a much longer and fuller game with vast amounts of detail. You play as a cute little robot who has been discarded in a pile of junk.

The scenery of every screen is fantastically detailed with layered moving foregrounds and animated background characters.

The body of the game is a puzzle adventure. These are often frustrating as you spend hours of your time trying to rub every object against every other object to make anything happen. The puzzles here are, on the whole, rather logical. You rarely have more than four items in your inventory and the game has a fantastic hint system. There are two types of hints, the hint icon simply repeats the obvious stuff you should have noticed. The second hint system gives you a cheat sheet for that screen, only if you pass a level of a mini game. The mini-game is a last resort thing but the cheat sheet is a hand drawn scribble notes explaining the solution in an incredibly cute way. When the robot gets a bit bored he starts day dreaming, giving a short entertaining animation.

Having said that, there were some weird dead ends I ended up getting into. At one point, I needed an oil drum which was offered in a shop. The shop owner asked for moeny, so I spent ages wondering around looking for sources of cash. The actual solution (SPOILER ALERT: of throwing a swarm of flies into his eyes and stealing the drum) was somewhat bizarre.

For $20 (£12.40 in the UK) you get about 4 hours of game-play. If you like this game, you should also try Samorost (Free) and Samorost 2 ($5).

Aquaria

This is not the first time I played Aquaria. It was an addiction of mine a couple years ago, before I removed my Windows installation. This is one of the most engrossing games I have ever played. On the face of it, you basically swim around and solve the mystery Aquiaria. The game is part puzzle mystery, part atmospheric escapism and part arcade shoot-em-up and one of my favourite games of all time.

The swimming comes very naturally and it is a pleasurable experience just to have a bit of a swim though the environment. As the game progresses, you attain more powers, which open up more of the vast map to explore. Unfortunately this was ruined somewhat by one of the final powers, the power to get a boyfriend. I liked Niaja (the main character in the game), she is strong, determined and has kick ass moves. Yet then she falls in love with the most pathetic guy who follows her around, occasionally throwing a fire bolt at some harmless fish and uselessly getting stuck flapping around on every piece of rock you go past. Then he manages to get himself captured and I could never get past the final boss to free him. This is possibly because I suspected the final scene would be them swimming hand in hand towards the sunset while I was screaming at the monitor “NOOOOOOO! You can do so much better! He is not the only fishman in the sea!” (well actually he is, but that’s not the point).

So, as I mentioned earlier, the game can be very hard at points. This can frustrate you if you can’t get past some stage. The second issue is the enormity of the map. The game is sandboxish, which allows you a bit of freedom to the order in which you attain your powers. On the other hand, you can spend quite a while swimming around looking for areas you have not explored.

It is a shame that many people will snub this game for it’s girly overtones. Cookery and collecting recipes features heavily which I found a bit bizarre at first become compelling after a while as you collect ingredients to attain special temporary attributes. I was completely trapped by this game for weeks and enjoyed it immensely.

Aquaria still has not been released for Linux, but the beta has. The free beta version is of the full game with no restrictions (although the site says this is only until mid February 2010), and I have not seen any bugs yet. There is a solid month worth of game-play here and even when the game becomes final, it is easily worth the £13.54 that the Windows and MacOS versions are selling for. I should also mention that the game does use a lot of open source elements. There is a heavy use of ogg/png and the lua scripting language.