Jun 302008

Emma was our family pet, of almost 18 years. She arrived in the family, as a barely 6-week old kitten in late 1990, and has been part of this family ever since.

We’re not exactly sure when she was born… possibly around August/September. She had a comfortable life, at times playful, much of the time peaceful.

Towards the latter part of her life, she suffered from some inflamation, but apart from this, no other medical issues — she was in good health. In the last few months however, a thiroid problem developed. It turned out this was masking a kidney issue, which only showed up after the thiroid issue had been treated.

Emma passed away in her sleep around 8:45PM. I have collected some photos of her, as a memorial… they may be found here.

Mar 252008

Well, I’ve tinkered today with the headset and this Bluetooth dongle, and got a little further. Still can’t actually connect to anything, but I am seeing devices pop up in Konqueror under the bluetooth:/ kioslave and hcitool scan actually reports some devices.wander ~ # hcitool scan --flush
Scanning ...
20:07:35:xx:xx:xx KF-700
00:1E:E1:xx:xx:xx SGH-A412

I have no idea what the SGH device is … someone’s mobile phone apparently (this dongle has a 100m range). The other device, is my headset. However, hitting the MFB (Mobile Find) button on the headset, does not yield a pin entry request in KDEBluetooth. I’m no closer to actually being able to use this as a means of wireless VoIP.

To reiterate what I have tried:

  • Upgraded to latest vanilla kernel: 2.6.25-rc6
  • Running latest BlueZ tools in portage: bluez-firmware-1.2 bluez-bluefw-1.0 bluez-libs-3.28 bluez-utils-3.28 bluez-hciemu-1.2
  • Using hciconfig to bring the device down, back up, and reset it, enabling various modes (e.g. page scan, inquiry scan, page+inquiry scan)

The following is seen in dmesg when the dongle is plugged in (proceeding text snipped):
[ 2560.963622] usb 5-1: new full speed USB device using ohci_hcd and address 3
[ 2561.133938] usb 5-1: configuration #1 chosen from 1 choice
[ 2561.151391] usb 5-1: New USB device found, idVendor=0a5c, idProduct=2035
[ 2561.151403] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2561.151409] usb 5-1: Product: BCM2035B
[ 2561.151414] usb 5-1: Manufacturer: Broadcom Corp

And hciconfig shows:
wander ~ # hciconfig
hci0: Type: USB
BD Address: 00:00:00:00:00:00 ACL MTU: 377:10 SCO MTU: 64:8
RX bytes:982 acl:0 sco:0 events:28 errors:0
TX bytes:610 acl:0 sco:0 commands:28 errors:0

I’m guessing the address is the problem. And this issue seems to rest with the kernel driver itself, hci-usb. I’ve tried forcing bcm203x to take custody of the device, this doesn’t work at all — the device doesn’t even initialise. So clearly hci-usb is responsible for setting things up — but it isn’t. In sysfs:

wander ~ # cat /sys/bus/bluetooth/devices/hci0/address

Allegedly, the BCM2033 works rather well with Linux, and I see no reason why the BCM2035 shouldn’t, when the code is clearly present. I’d say there’s some edge case that isn’t handled. I’ll ask a little later on the BlueZ mailing lists and see what I can come up with … but I’m posting this here for others’ reference. Later down the track I plan to repeat this exercise on the Lemote boxes (and maybe my O2 as well, if I get a USB card for it) — presently though, I’m doing this on my laptop (which is x86-based).

Again, if anyone has an idea what’s going wrong… I’m all ears. 🙂

Nov 052007

Okay… a quick notice to those who probably saw my political post on Gentoo Universe.

A few months ago, I put in a forced redirect so that the “all posts” feed on my blog redirects to the Public Syndication category, a special category containing posts that I deem appropriate for distribution for other websites. My political post was deliberately not placed in this category.

It seems that redirect broke, and thus my little semi-private post wound up on Gentoo Universe. I’ve pulled it from my site for now, but I’d greatly appreciate if the correct feed URL be used for my site. For those syndicating general posts on my site, the correct URL is below:


To those who saw this post on the Gentoo Universe site, and to my fellow developers, I appologise for this slip-up.  I’ve now marked the post private, so it’ll hopefully disappear from the feed soon.  I realise that Gentoo Universe is not the place for such discussions (definitely a case of pot-kettle here) and that my post did not belong there.  I will put my post back online once the feed URL gets changed and I’ll be making sure it doesn’t feature in the public syndication feed.

Aug 262007

I’ve done some changes to my blog with respect to categories.

I’m quite conscious, that what I say on this blog gets syndicated on a number of websites. So as to protect the owners of those sites from posts that may not be appropriate, I have hacked my WordPress installation to force syndication requests to use the “Public Syndication” category unless they specify an explicit category.

I would greatly appreciate it, if this post winds up on your aggregation site, if you could change the feed URL to http://stuartl.longlandclan.hopto.org/blog/feed/rss2/?cat=10

Aug 172007

Well, right now I’m lying back, listening to the fruits of my labours.

When it comes to time-shifting, there are quite a few solutions that allows a user to time-shift television. MythTV, Tivo, Foxtel IQ… just to name three. However, I’ve looked around, and found very little for radio.

My needs are basic… I have an old stereo FM tuner plugged into the line-in socket of an old laptop. It’s in a spot where it can get good reception. The machine has a 20GB HDD, Apache web server, and enough CPU grunt to push the data. I thought it’d be nice if I could stream my radio around the house, in a manner that allowed me to time shift backwards up to a few hours or so. Therefore… if I wanted to hear a radio programme, but missed the first 15 minutes — no problem, just tell it to start playing from 15 mins ago. Done.

It’d also be nice if it could be in lossless form. I’m on a 100Mbit LAN — I don’t need compression, but some extra CPU cycles could be nice.

Icecast did the basic need of streaming radio quite well… but there were a few problems:

  1. It couldn’t timeshift
  2. I found it would frequently drop the feed mysteriously
  3. It used Vorbis — not so much a problem, but for my needs, lossless was better

So seeing few alternatives, I set about designing my own system. The concept is simple:

  • Create a capture programme, that records audio to a series of 1sec raw blockfiles, stored in a stream directory.
  • Make a CGI application that scoops up a number of these blockfiles, concatenates them, adds an appropriate header and pushes them out to the client
  • Construct a shell script that can clean up old files (to keep the disk from getting full)

After looking around at a suitable capture API, I settled on Portaudio v19. I had done some apps with v18… thus I had some familiarity with it. Doing this allowed my app to be cross-platform, should I decide to develop it further.

It was simply a case of writing a program that would write blockfiles, one for each second, identified by a Unix timestamp. As time ticks forward, it closes one block file and opens the next. My capture app is basically 137 lines of pure C code. Very tight and efficient.

For the CGI app, I again did it in pure C. It picks up its parameters from the PATH_INFO environment variable, allowing nice clean URLs, and parsing is as simple as calling getenv. I ended up writing two versions of this app.

The first version used sox in a child process, to convert the raw audio to a RIFF stream. My problem was that I used popen to execute sox. It worked well, except that disconnecting the player left loads of sox instances running, hogging the CPU. I started looking at writing my own RIFF header library, only to discover how complicated it was.

Looking around, I stumbled across the humble Sun Audio format. Apart from the minor inconvenience of having to pass everything through atonl/atons… everything works fine. I specify a URL like http://blackbox.local/cgi-bin/stream/linein/2 (the laptop, an IBM T20 is called blackbox), which gives me the stream “linein” from 2 seconds ago. I find it’s a bit glitchy any closer than that… but for maybe 6 hours coding, I’m quite happy with the result.

The problem has been clients… Amarok seems to know what to do with the stream. mplayer tries despairately to seek in the stream (why?) then drops out. And don’t even ask what Audacious does — I’m at a loss there. That said, good ol’e sox and wget or curl works fine, and is lightweight — just the interface is a tad annoying.

I’ll probably wind up writing my own client anyway — so I can time-shift somewhat more conveniently (using a slider to set the offset).

Still on the TODO list, is to make the capture app daemonise itself (it runs in the foreground for now), and to write an app that can be run from cron, and will record a radio programme for later listening (e.g. on a portable music player for instance) — perhaps optionally encoding it in a compressed format.

I’m tossing up whether to release the sources or not… if there’s demand for such a project, I’ll look into cleaning things up and releasing it. That said, if anyone knows of something that does similar to the above… I’d be interested to hear about it.

Aug 132007

Well, those who recall my earlier post… I’ve managed to get a VM going.
qemu-mipsel ~ # emerge --info
Portage 2.1.2-r9 (default-linux/mips/2007.0/cobalt/o32, gcc-4.1.1, glibc-2.3.6-r4, 2.6.18-4-qemu mips)
System uname: 2.6.18-4-qemu mips MIPS 4Kc V0.0 FPU V1.0
Gentoo Base System release 1.12.6
Timestamp of tree: Sun, 12 Aug 2007 13:50:01 +0000
dev-lang/python: 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox: 1.2.17
sys-devel/autoconf: 2.61
sys-devel/automake: 1.6.3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool: 1.5.22
CFLAGS="-mips1 -O2 -pipe"

The assessment? Well, firstly, it’s slow, very slow. I realise the BogoMIPS is a somewhat dubious benchmark… but:

system type : Qemu
processor : 0
cpu model : MIPS 4Kc V0.0 FPU V1.0
BogoMIPS : 246.27

versus… my Qube2 (250MHz):
system type : Cobalt Qube2
processor : 0
cpu model : Nevada V10.0 FPU V10.0
BogoMIPS : 248.83

one of the Lemote Fulong miniPCs (660MHz):
system type : lemote-fulong
processor : 0
cpu model : ICT Loongson-2 V0.2 FPU V0.1
BogoMIPS : 444.41

or my IP28 (195MHz):
system type : SGI Indigo2
processor : 0
cpu model : R10000 V2.5 FPU V0.0
BogoMIPS : 193.53

Is it usable?  Well, if that benchmark is anything to go by, it isn’t that much slower than my Qube2.  But the CPU that QEMU emulates, doesn’t implement any cacheops… so in that respect, it’s even slower than the Qube2 (which at least has some primary cache) .  I’ll know as I install more stuff, but my first impresions are that it’ll be too slow for most tasks running Gentoo, unless your host PC is a beast (mine isn’t).  Unless you’re doing development, you’d be better off just running everything on the host PC bypassing the emulation layer.

I might consider putting together a kernel that will allow installation of Gentoo/MIPS, since it’ll be a good way for me to test the userland components of any netboot images I produce.  I’m yet to try a kernel build, at the moment I’m using Debian’s kernel.

It is doubtful that this machine will ever be officially supported, but I’ll consider it if there’s sufficient demand. 😉

Aug 112007

I’m in the process of installing Debian/MIPS on QEMU. Why might you ask? Well… the situation only came up just recently.

It seems there is some interest in running Gentoo on the QEMU virtual machine. The catch: QEMU emulates a MIPS Malta board with a 4Kc processor — which implements the MIPS32 ISA (a superset of MIPS2).

Until recently, this was impossible, as we did not produce stages for anything less than MIPS3 on big-endian MIPS, or MIPS4 on little-endian. MIPS32 is officially defined as the 32-bit subset of MIPS64, thus implements all the 32-bit instructions present in MIPS64, MIPS4, MIPS3 and completely implements MIPS1 and MIPS2.  It doesn’t however, implement any of the 64-bit instructions in these ISAs, which is where users come unstuck.  I produced some MIPS1 stages for little-endian MIPS, so in theory, the port is possible.

There’s also the question of performance — the guide I’m following suggests I can expect the performance of an R4400 200MHz Indy when ran on a 3GHz AMD64 host. Unfortunately for me, my host is a 1.4GHz Pentium 4. So I’m expecting things to be quite slow.

If things test okay, I might look into how one compiles a kernel for QEMU, and see if it’s worthwhile, since QEMU is much easier to get hold of then most supported MIPS platforms. It’s not known if mips-sources will be suitable, theoretically it should be, but this has never been tested. Support will be quite minimal, since most second hand SGI machines I suspect will outperform QEMU many times over. At the moment, my VM is “installing core packages” (yes, debian-installer is quite stingy on information), after which, I should be able to set up Gentoo on a second virtual HDD.

Support will likely take the form of a minimalist HDD image and kernel that can be booted on the VM.

May 112007

Hi All…

Here at uni (Room S825, S-Block, QUT Gardens Point) someone started a drawing of some penguins getting alarmed at a Windows Vista logo on one of the whiteboards. Over time, this little cartoon has evolved, and thus I figured I better get a shot of it before it disappears. It symbolises the battles between various operating systems — mainly the OS zealots. Of course, things aren’t really quite like this, there is quite a bit of co-operation between the various platforms, with a few notable exceptions.
Anyway… here it is… enjoy. 🙂 As always, click the image for an enlarged version.

War of the operating systems

Apr 142007

Hi All… I just received this email… Some may have seen it before, and I could’ve just forwarded it to people, but rather than forwarding an email that’s already been forwarded at least 6 times, complete with the email addresses of everyone involved, I figured I’d post it up here.

A co-worker got a pen stuck inside our printer. He started to try and remove the pen, but I told him we don’t have time for that now, just put a note on the printer telling folks not to use it and then report it to the Help Desk. So he grabbed a piece of paper and scrawled on it. I left before he finished the note.

About 20 minutes later, one of my techs comes in laughing and says he was just in the lobby, saw a piece of paper on a printer and went to investigate. Attached is what he found. Sometimes things don’t always come out the way you want them to…

Pen is Stuck

Hrmm, yes… I’ve heard of people putting their tackle in mighty unusual places, but I wouldn’t rate an office printer as being one of them I’d want to try. Thanks to “Jo” who originally sent the email, and to the chain of people who eventually forwarded it to me (Tim being the last on the chain). Being a bit sore and sorry after a buster on the bus (entirely my fault), I needed the chuckle. 🙂

Apr 112007

(Update 20080211: During an upgrade of my blogging software, I accidentally lost the photos of the shower… I’ve since taken new ones, of the portable shower, and the new in-house installation. Click any photo for a larger image.)

Those of you in this part of the world, will probably know about the massive water shortages brought on by the drought. Particularly in Brisbane, where the problem is that dire, that we’re moving to level-5 water restrictions, which means luxuries like washing cars and watering lawns are largely things of the past.

Residents have been asked to keep their showers to 4 minutes or less — but is there a better solution? Well, when camping, we often have to face working with a limited supply of water. Often we have two supplies, drinking water that we bring with us, and washing water that we collect from the campsite. Lugging buckets of water around is no fun, thus it pays for us to be efficient in our water usage.

Camping showers often are overglorified bags with shower nozzles attached to the bottom. Usually there are two types, one is usually is made of black plastic, and is designed to absorb heat from the sun. The other is a bag you just fill with heated water. They need to be suspended overhead, often quite high to be useful. They’re heavy when fully loaded, making hoisting them a challenge, and don’t offer that much pressure. You can also get showers that are powered from a 12v supply, which overcome this issue, but then one must have a car or small SLA battery nearby. None of these are all that useful when not camping either.

Kym Schluter, however, came up with a rather novel idea. Hardware stores sell pressurised weed sprayers which can carry several litres of water. By attaching a suitable hose and nozzle to these, you can build a camp shower which is portable, doesn’t need to be hoisted up high, and provides decent water pressure without electricity. He’s been using this shower for a number of years now, and over time, a number of us have made replicas of it. None of the camping stores seem to be selling these showers — but thankfully, your local hardware store will carry most, if not, all the components you’ll need to build one of your own.

Portable showerThe shower consists of three main parts, the pump pack itself, the hose and the nozzle. The lot connects together using standard hose fittings, allowing you to theoretically use any off-the-shelf trigger hose nozzle. The unit pictured on the left is a 6L pressure pack.Bottle end of shower hose fitting A short length of clear 12.5mm tubing connects the bottle to a hose fitting. On the bottle side, plumbing tape is wrapped over the screw thread to seal the gaps. The hose was fitted by heating the end up (place it in hot water for a few secs) then pushing it over the end of the thread. It was then clamped to keep it from slipping off. You’ll find the other end of the tube will neatly fit inside the hose fitting, making a secure fit.

Portable shower hoseTo make the hose, we used some 10mm clear tubing, with a screw-in adaptor fitting on one end, and a standard hose fitting on the other. The thread on the screw-in fitting is wrapped up with plumbing tape and clamped much like the pressure pack, and the other end will generally fit quite securely.

The whole assembly is completed with a standard off-the-shelf trigger nozzle. You can use almost any fitting here, bearing in mind that soaker nozzles tend to loose pressure quickly (<2 seconds). Ideally you’re looking for something with a fine spray. The nozzle pictured here has several settings, the ones that are useful are “centre” (uses a small 2cm ring in the centre of the nozzle), “jet” (produces a 2mm jet of water), “flat” (produces a 5mm×1mm rectangular jet) and “mist”. Your mileage will vary.

I haven’t produced any diagrams of the system, since it’s a pretty simple concept, but I figured I’d pass this idea on. We’re thinking of building one for one of my uncles: my cousin and his girlfriend both see nothing wrong with half-hour showers. This system, you can take as long as you like… you still won’t use any more than 6L water. I’ve found using this unit, I’m able to get everything done with water to spare. Couple this with one of the solar showers mentioned earlier, and you’ve got a green way to keep clean. 🙂

Installing an in-house trigger shower

In-house Shower installation Since posting the above entry… we’ve actually installed a similar shower arrangement in our house. Using typical washing machine adaptor fittings that you can obtain from any hardware store, you can achieve much the same thing. Fittings used for in-house installationYou don’t have the 6L limit, which is both a positive, and negative, and you don’t have to pump it. The photos here show the installation (left), and a close-up of the fittings in use (right). To use this on a mains supply, you’ll need a water hammer arrester, like the one pictured in the photo — otherwise the water hammer generated when releasing the trigger will push the hose off the end of the fitting.