Archive for the ‘University’ Category

Ubuntu on an HP Compaq dx2300 Microtower

Thursday, March 19th, 2009

My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux – Ubuntu 8.10 in this case. It’s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from install. The graphics card is Intel, so I’m not going to be doing any serious gameplaying (this is a work computer, anyway) but it runs Compiz pretty well. Being a desktop, suspend and hibernate aren’t terribly important, but as it happens they work fine.

The only problem – and this is the main point of this post – was with the soundcard (an Intel HDA). The box has three audio outputs: headphone plugs front and back, and a tinny built-in speaker. Under Ubuntu all three outputs were switched on all the time, and it wasn’t possible to adjust them separately. The purpose of headphones in a shared lab environment is entirely defeated if the built-in speaker is always on! I tried fiddling with all of the multitude of ALSA settings, but nothing worked. It couldn’t have been a hardware problem, because it did the right thing under Windows.

So, the problem was narrowed down to the audio driver, snd-hda-intel to be specific. Some googling established that changing the model parameter to the module might have some effect on the output selection behaviour. Further searching established that the possible values are listed in Documentation/sound/alsa/HD-Audio-Models.txt in the kernel source.

To find out what the possible values are, you have to know which codec your card uses. This you can do by running

cat /proc/asound/card0/codec#0 | grep Codec

For the dx2300 the result was Realtek ALC888. Indeed, under the list of models for the ALC888, there is one called “3stack-hp” for “HP machines with 3stack”. Guessing that this was the correct one, I added to /etc/modprobe.d/alsa-base the line

options snd-hda-intel model=3stack-hp

and rebooted. Hey presto, suddenly the internal speaker switches off when headphones are plugged in.

tl;dr summary: If you have a dx2300 and you’re having problems with the audio under Linux, then add the line options snd-hda-intel model=3stack-hp to the file /etc/modprobe.d/alsa-base (at least in Ubuntu; your distro might put module options in a different file).

Not quite how one expects to find out…

Wednesday, January 14th, 2009

This afternoon I discovered that I’ve officially been accepted to the MSc programme in Maths at UCT. But how did I discover this? I received an automated email from ICTS (UCT’s IT administration) that said “Dear Post-Honors Student, A new email address has been created for you in the Name.Surname format…” So I figured, “OK, they’ve given me a new email address, I guess that means I’ve been accepted.” And indeed, when I checked Peoplesoft (the student admin system) there was a green tick in the Admissions section that hadn’t been there before.

Now, it doesn’t really bother me to find out this way, since in my case the official acceptance is just a technicality. But in general it seems like the best way to inform prospective students that they’ve been accepted is not through an automated notice about an email alias creation. Of course a proper signed letter is in the post as I write, but, y’know, it might be nice to send an email saying “Congratulations, you’re in” before sending one saying “Here’s your email account”.

Oh yes, and they could try to spell “Honours” properly, too.

HSDPA modem and custom routing

Tuesday, January 13th, 2009

So, for my Christmas present to myself I got a Huawei E220 HSDPA modem – it’s one of the Vodafone-branded ones, but I reflashed it with the generic firmware. Anyway, it’s an awesome thing to have for a geek like me – I can be connected to the Internet at broadband speeds almost anywhere in the city. It’s particularly useful when i’m on campus, so I can avoid the dog-slow UCT internet connection.

Problem is, I’d like to stay connected to the UCT network as well so that I don’t use up my precious* data bundle for UCT services, and this requires a bit of custom routing magic. So I have a script:

#!/bin/sh
GATEWAY=137.158.32.97
route add -net 137.158.0.0/16 gw $GATEWAY
route add -net 192.48.253.0/24 gw $GATEWAY
route del default
route add default ppp0

137.158.0.0/16 and 192.48.253.0/24 are the UCT netblocks, and 137.158.32.97 is the router on the subnet that I’m mostly using at the moment. ppp0 is, of course, the name of the interface associated with the HSDPA connection.

The problems with this script currently are that I have to edit it to change the gateway for each subnet that I’m on, that I have to run it manually each time I connect, and that it doesn’t restore the original routing when I disconnect. The first and third problems should be reasonably easy to solve, but the second will probably require that I dig into the mysterious world of NetworkManager. (Cue dramatic music.)

*It’s ourssss, my preciousss… they wants to take it from us, the nasssty Vodacom…

Graduation redux

Thursday, December 11th, 2008

On Monday I was admitted by the University of Cape Town to the degree of Bachelor of Science (Honours) in Mathematics of Computer Science, in the first class. While I am, of course, very pleased to have graduated (and incredibly pleased that the Year From Hell is over), the whole “graduation experience” wasn’t nearly as exciting as last time, I guess because this time I knew what to expect.

Anyone who has mentioned graduation to me will have heard my description of it as “three hours of boredom punctuated by a moment of excitement”. (I didn’t make that up; it’s a paraphrase of the quote about war: “long periods of boredom punctuated by moments of sheer terror”.) I guess I attend it anyway because it serves as a useful psychological “marker” that the degree is over. If I didn’t go, I think I’d have a huge sense of anticlimax.

(The fact that I go may also have something to do with my parents being on staff and thus able to sit on the stage and put the hood over my head; also something to do with my grandmother’s demand for photographs.)

Graduation

Thursday, December 6th, 2007

This is my annual look-at-me post.

On this coming Wednesday (the 12th) I will graduate from UCT with a BSc in Computer Science and Mathematics. I will receive the degree with distinctions in Computer Science and Mathematics, and with a distinction in the degree overall; I will also be on the Dean’s Merit List. My final marks for this year are:

CSC3002F Computer Science IIIA 91%
CSC3003S Computer Science IIIB 94%
MAM3000W Mathematics III 90%
MAM3004Z Mathematics 304 81%

It actually feels quite weird, to have finally reached this point. For the last three years, I’ve worked away at my courses, but I’ve never really had a feeling that I was actually approaching an endpoint. Now, suddenly, it hits me: I have finished my undergraduate studies. Wow. It’s actually quite a big deal.

Of course, I’m returning to UCT for Honours next year, so it’s not as if what I do with my day is actually going to significantly change (although I will have a much heavier workload). But still. Wow. In a week’s time I’ll be able to style myself Mr. Adrian Frith, B.Sc. (Cape Town). (Although it would be rather pretentious to do that outside of a formal academic setting.)

Results

Saturday, December 2nd, 2006

So, I’m going to start this blog with a rather pleasant post: I’ve finally got my results for this year, and they are (if I say so myself) rather good.

These are they:

Course Code Description Mark
CSC2001F Computer Science 2A 88%
CSC2002S Computer Science 2B 89%
CSC2003S Computer Games & Simulation 75%
MAM2000W Mathematics 2 87%
MAM2047H Applied Mathematics 2047 86%
Weighted Average 85.3%

Furthermore, I got on the Dean’s Merit List (which means, essentially, that I have the normal number of course credits, passed all my courses this year, am repeating nothing, and got over 70% average). And I got an FSA (don’t know what it stands for), the largest possible academic merit scholarship, for next year.