August 2007

Thanks :-)

Hi All… figured I’d thank you for the support, and better explain my emotional ramblings (as I lie here trying to wind down and sleep, battling a 15″ CRT that wants to emulate a disco light).

A little about my personal life. I certainly realise I’ve had it a lot easier than some, but I’ve had some rough moments.

This includes witnessing a marriage breakup of my parents back in the early 90’s. (Being the ham in the sandwitch is no fun at all.) Bullying both verbally and physically over my years at school, not just from individuals, but from entire classes. Even some sexual abuse (from a female student, more on that later).

So it’s little wonder that I am sometimes a bit on the fragile side. Am I looking at blaming others for my problems? Well no. I’ve moved on for the most part.

This includes the one case of sexual abuse. Without going into details, it was back in 1992, and involved a year 7 female student at my primary school. I’m not planning on hunting her down though. If I do happen to come into contact, I only wish to know two things:

  • Has she committed the same act on others?
  • (most important) Has she gotten help for her psychological condition?

What I’ve heard… this kind of abuse starts when the abuser themselves, is abused in some manner. I’m willing to forgive (not forget) the act if the guilty party is willing to, or has, undergone some rehabilitation & councelling on the matter.

As for the bullying… the worst of it occurred in 1995. I don’t exaggerate when I say I had a good 20 or so students from the year 6 class ganging up on me. I don’t recall every incident, but I do recall getting surrounded and screamed at.

It didn’t help that I didn’t get along at all with my teacher at the time. The problem solved itself however… the main ring leader wound up switching to BBC and the group kinda collapsed. The teacher also wound up switching schools if I recall, not sure of the exact reasons.

So yeah, I carry a bit of baggage around with me. I don’t let it stop me with what I’m doing now… and it has very little to do with my outburst a few days ago — which was brought on by more recent issues.

Right now… I’ve been trying to wrap my head around some telecommunications topics for an exam I have on Tuesday. (I’m repeating the subject from last year — so I really want to pass this time.)

Progress has been slow however, since I haven’t completely grasped all the concepts. My apathy/laziness and a sub-optimal teaching method (for me, not everyone learns the same way) are likely to blame there.

Needless to say, I’ll be looking forward to the upcomming Christmas/New Year break. I’ll like it even better if I can put these engineering skills of mine to some constructive use.


Well… now that I’ve redirected most of the major viewers to a safer feed, I can now drop a few bombshells and let off some steam without making Linux distributions look bad.

The last 12 months have been a bit of a roller coaster ride for me. Specifically, it has been events at university, and the stress brought on by these events that have lead to me getting burned out. No longer have I any interest in persuing a career in IT or electrical engineering, or continuing with life in general.

Early last year, I was looking forward to finishing my degree, and ideally working with some embedded systems, as that was what I seemed to enjoy. The idea of getting useful software onto an embedded computer (with limited memory, storage and CPU power), then stuffing that computer inside some package appealed to me.

In a way, it kinda still does… but not to the same extent. See, my big problem is that I’m not able to play the social game, and have no desire to. While some are not happy unless they’re chattering away with the big boys in the posh end of town — I’m more comfortable sitting back in a quiet space working on whatever projects interest me at that moment in time.

I do have quite a few technical abilities, and some social qualities that are considered highly valuable by many employers — however, what they get is a package deal, and it’s some of my personal traits that could make it a deal breaker at the interview. Put simply, interviews do not suit me or people like me. Which is a shame, since it’s people like this, that gave us many of the advances we have today including AC power generation and modern computers.

My situation at the moment is this. Make no mistake right now, I am in a suicidal state mentally. I however, don’t want to put undue stress on those that I’m working with within the university… thus I won’t be enacting on any plans until next year. If things don’t go well this year, I may well be a corpse around March next year.

Essentially, my problem revolves around the fact that I see no worthwhile future at this moment in time. If I can’t gain employment, then I’ve got no means to support myself — I’ll wind up on the streets. I’d rather jump now whilst I have some dignity, then wait until I sink to the bottom of society.

I’m in talks with various medical people at the moment… so far this has largely been a waste of time and money. I’ve been following the advice given, but so far haven’t had any real resolution to the issues that I face. My biggest problem, is that not being a socialite, more or less means that my skills are not in an easily accessible form. Thus, people conclude that I have nothing to offer them.

They see me as an ordinary person who should understand the unwritten rules of social behaviour. I mention that I have AS, the usual retort is, “You look fine to me…” Yes, I do look fine. I have good vision (slightly myopic, but acceptable), good hearing, etc. I have both arms and legs fully intact and operational. I have no mobility problems and my mental abilities are fine. But this does not mean that I react the same way as everybody else. It’s this total lack of understanding for people like myself that has me on the brink of suicide.

And no, pills aren’t the answer here … not unless you want to try and medicate 6.1 billion people who have the lack-of-understanding disease. Indeed, it’s not just AS, it’s other conditions too: being of a particular ethnicity, various forms of disabilities (mental, physical and social/communicative), demographics… you name it.

It’s something that really gets up my nose about society today. The bigger we get, the less we care. If this is how the world is going, then count me out — this is not a world in which I wish to participate.

Change of feed URL

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

My present TODO list

Well… if you looked at the number of commits I’ve done lately, you’d be forgiven for thinking I’ve been resting on my laurels for the past month. In some ways, this is true… but I’ll soon be doing a bumper crop of updates.

KDE 3.5.7 Keywording

I’ve been using this release of KDE for a good few months now. I’ve given it a run on my Octane, everything seems to work alright there… and I’ve been using it on a daily basis on both Loongson machines — and thus can be fairly confident it won’t break anything.

Avahi to earn ~mips badge

Again, I’ve been using this package on MIPS for a very long time, since mid-last year. Everything seems to work. Along with this, will be dbus-1.0 and nss-mdns.

Re-keywording of Gnome

This hasn’t been discussed yet, and as such no decision has been made, but I have been working towards getting Gnome installed on my O2. Some packages failed tests, some failed to compile completely … but nonetheless, there’s now the beginnings of a useful Gnome desktop. (Well, as useful as Gnome is likely to be… I’m a long-time KDE user myself, having switched to it during my SuSE 5.3 days. Prior to this, I used FVWM.) I’d like feedback from present MIPS users, about whether there’s any demand for this desktop.

Other packages presently in testing

I’ve started looking into other packages for ~mips candidates. Namely, I’m concentrating my efforts on packages that turn an otherwise useless MIPS box into a useful workstation. That is, desktop type applications such as KOffice, mplayer, xine, Amarok, Gimp, Inkscape … etc. Some of these, I’ve been using for a while… others I’m only just starting to build now. (e.g. I’m building Amarok, since I prefer it to Audacious, and in my experience, it handles Sun Audio better than mplayer or Audacious presently does)

On this matter, I’d love feedback on what people actually use their MIPS boxes for, and how Gentoo/MIPS can be better tailored for their needs. If you’re using Gentoo/MIPS for something productive, either as a hobby project or for something more serious, I’d also be interested to hear about it… since this will help in planning what needs to happen with respect to this port.

Lemote Loongson Support

Still, no word from trustees… but I figure any legal hurdles are well and truly gone now. I’m starting to look into how to produce media for these systems.

The biggest hurdle thus far, has been µClibc — or namely, it’s dynamic library loader ( The Lemote systems use a page size of 16KB — this was the default when I first started using the boxes, and as far as I can tell, they do not like using 4KB page sizes, the kernel dies a rather horrible death. Unfortunately, µCLibc, in it’s infinite wisdom, assumes a page size of 4KB. Thus when it tries to dynamically load libraries, one gets hit by a “can’t map <>” message.

So where does this leave me? By the sounds of things, the netboot images will probably wind up being either a hybrid statically-linked µClibc busybox with dynamically-linked glibc filesystem tools, or will be a completely dynamically linked glibc affair, depending on which winds up being smaller.

Thankfully I can kinda get away with using more space — I don’t have the size restrictions on the platforms I support. CoLo on Cobalt will load kernels of almost any size, as will PMON2000 on Loongson, but still, I cringe at the idea.

Apart from netboot images… there are a few other steps to be done here:

  • Keywording of the ATI Radeon driver — this can probably happen straight away. It won’t break the SGI boxes, since they don’t use the Radeon driver, and I know it works out-of-the-box on Loongson.
  • Patch — There’s some patches needed to the core components of for it to work on Loongson. These need to be tested on SGI systems to ensure they don’t break things. It’s quite likely they’ll wind up in CVS in the next few months, but it’d be worthwhile locating and fixing any bugs that occur ahead of time.
  • Inclusion of patches into mips-sources — At the moment, I’m waiting around for a 2.6.21 or 2.6.22 ebuild to show up so I can try out the patchset I have here, the holdups being IP28 and IP30 support. Once I can get the Lemote patchset into a form that cleanly applies to mips-sources, we’ll then look at formally including them in the ebuild.
  • Handbook updates — to be done once formal approval has been granted and the other steps are complete.

So, lots of work to do… and all of this whilst getting into my studies (e.g. there’s one piece of Allen Bradley ladder-logic code that’s just screaming for me to pick through it for a uni subject) and looking for industrial experience. Hopefully university studies won’t burn me out like they have for the last 12 months.

As always… you know where to find me if you wish to get in touch.

Time-shifting radio

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.

Gentoo/MIPS on QEMU: Update

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. 😉

Gentoo/MIPS on QEMU

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.