First Torchbox Cruise of the Season

This gallery contains 16 photos.

My first cruise of the 2012, the first Torchbox cruise of 2012 and the first outing for the new decking. Also check out Louise’s flickr set.

More Galleries | Leave a comment

How to Make Boat Decking

This gallery contains 13 photos.

How to make boat decking in 11 easy but detailed steps. 1 – Find a load of scrap timber. Put in on the roof and pace up and down a bit. It is crucial that you stay away from the … Continue reading

More Galleries | Leave a comment

Crazy high CPU usage on Snow Leopard and a surprising culprit

After coming back from a team-building trip, I started to notice things were going a bit slow on my work laptop. I took it with me for casual emailing and working on the train, but spent about 4 days not really using it and certainly not ‘working’ on it. It came out once to display the lyrics to a song about Pithivier, and once to check emails, but that was about it.

On my return to work everything ran a little bit slower than I remember. I’m building a web app, so I have a vertical stack of Postgres, Python and Chrome running at the same time. To top it off I had a brief excursion into someone else’s code which I didn’t know as intimately as my own. For a while I put it down to “I’ve been away and forgotten what it’s like to use”. Soon came “Python is a slow language”. Not long after that, “and so is JavaScript”. No late-binding language was safe.

I put up with this for about a week. Things were usable, just sluggish. It gave me a bit of nostalgia, taking me back to Windows days when things would just slow down after a couple of years. I noticed that Firefox was the main culprit. I’ve used Firefox for 6 or 7 years, and it has had, on occasion, some terrible performance. This wasn’t such a surprise. I tend to favour Chrome anyway, so I just got on with it.

But this evening it came to a point when I had a handful of tabs open, Firefox was converging on 200% CPU and I thought “this is my machine not yours” and took a closer look.

The first thing I noticed was that the of the CPU cycles used by Firefox, the Firefox code itself wasn’t actually guilty.

Notice all that red? That’s System CPU usage. And that green skimming on top? That’s User CPU. It’s been over a year since I’ve been able to take an interest in this kind of thing, but if I’m correct, the red is system calls, called as a result of userland code, executed in protected kernel space. The green is user code in userland space.

I’m not sure why I didn’t notice this before. This is more serious then: it’s not buggy Firefox code, but something’s going wrong with the system. Perhaps it’s a kext gone bezerk, or hardware damage resulting in repeated attempts to perform low-level tasks. Perhaps it’s a bug in mach, heaven forfend. I have been on the brink of wiping and re-installing my mac, and this nudged me a bit closer.

I’m a fairly vanilla user. I don’t have tonnes of services running, or kexts and drivers installed. Launchd is pretty much as God intended. I don’t have any extra daemons running, at elevated privileges or otherwise.

I had noticed other processes use high CPU. TextMate was one culprit, and I’m sure Chrome did this too from time to time. Python was affected, but the closest I got to finding the problem was identifying a stack-maintenance function in CPython, which isn’t such a surprise. Firefox was the most noteworthy recidivist, and it was doing it right now.

So I decided to run Shark on the Firefox process. The results were as follows:

 

Aha! So it is kernel code responsible. I know from my copy of Mac OS Internals: A Systems Approach (it’s an excellent book), as well as it being fairly obvious from the name, that vm_fault is a page fault.

Whilst this was running I was searching the web for random high CPU usage. I came across this discussion which blamed BTServer. I just happened to notice that Bluetooth was enabled. We’d tried to use it to get the Pithivier words transferred to my laptop on the team-building trip. Bluetooth was the first port of call. I’d last done this in 2004, before wifi came as standard, and it was straightforward then (it didn’t work this time, we used wifi).

I disabled Bluetooth. Behold:

CPU suddenly dropped to what I’d expect. Just like that. I have frankly no idea whatsoever why this happened.

I can’t see a connection between the Bluetooth kext (I imagine it’s a kext) and page faults. I don’t see why it would happen for one codebase / process any more than any other. I can’t see why it wouldn’t happen in the Bluetooth daemon not a completely unrelated process. I can only guess that it somehow shifted some function pointers around, or registered on some interrupts, or something. Perhaps the user_trap somehow installed by the Bluetooth server, and had some expensive code in it? Perhaps an IOKit driver was installed in the wrong bit of the device tree.

But I don’t really care, problem solved. Except it does leave me casually wondering if the design of Firefox leads to more page faults than Chrome. And apologising to Javascript and Python and all its late-binding friends, as the problem was almost certainly written in C or C++.

tl;dr if your CPU runs excessively high on Mac OS X Snow Leopard, check to see if you’ve got Bluetooth enabled.

If you do, disable it. It’s 2012.

Posted in Computers, Work | 3 Comments

Mucking about in the Umeå snow

When visiting Umefolk recently we came across a snow castle in the city centre. It would have been impossible not to have a go…

 

Posted in Arts, Life | Leave a comment

The end of Umefolk 2012

Play the MP3 and imagine this. I recorded it walking through the musicians.

The end of Umefolk 2012

A weekend festival, with a 25 year heritage and massive following, is drawing to a close. Hundreds and hundreds of people must have passed through its doors. Headliners such as Garmana and Hoven Droven have drawn in crowds, impromptu sessions have brought out nyckelharpa players, and a large variety of players from all over north-east Europe have entertained and captivated. The event is winding up, and on the dance floor Anton and about 30 young people are playing for the final dance…

Continue reading

Posted in Arts, Life | Leave a comment

Umea and Umefolk

This gallery contains 71 photos.

I spent the last week at Umefolk, a folk music festival in Umeå in the north of Sweden. We met Anton Teljebäck, who runs the festival, at a small festival in the UK and he invited us. Umefolk is well … Continue reading

More Galleries | Leave a comment

Crazy idea: Hold music cadence machine

I’ve just been on a call with a client. They have Strauss or somesuch a hold music. Orchestral waltzes. The person on the other end picked up exactly at the end of a phrase. It was perfect.

My idea:

On-hold music programmed with meta-information that stores the exact timecodes of cadences and the end of phrases. When the person who is being waited on picks up the phone, the system keeps playing the music until the next point.

This would only result in a second or two extra hold time, but would result in the person appearing to pick up at the ‘perfect’ time, every time!

Posted in Crazy Ideas, Work | 3 Comments

Agency, empathy and the 0736 service to Manchester Piccadilly

I am sorry to announce that the 0736 service to Manchester Piccadilly is delayed by approximately 40 minutes due to engineering works. I am extremely sorry for the severe disruption to the service.

Luckily I wasn’t trying to get to Manchester Piccadilly, but from the reaction on the platform someone was. This well-spoken automatic pre-recorded announcement was clear, and told us everything we immediately needed to know. It was spoken courteously in perfect Recieved Pronunciation. It is the same voice that is used to announce all the official goings-on at Platform 2 of Oxford Station, and at stations across the country. I quite enjoy hearing the voice if I’m honest.

But when there is a 40 minute delay, it doesn’t quite seem right. I’ve been on the receiving end of delayed train notices, and I’ve borne the automatic announcement a grudge. I feel that it should be a human on the end of the PA system making a personal apology to all those involved. The people who conceived the system went some way toward trying to emulate this. Words like ‘extremely sorry’, human-like repetition and even a slight plaintive tone to the voice all add to the effect, in theory. But ultimately, the speaker was not addressing directly to this group of people, she was speaking of some imagined late service that may or may not have been going to occur in the future.

I think to myself “I don’t want a pre-recorded voice, I want a human!”. The question is agency: the right and ability of the announcer to actually account for what they are saying. Not only in terms of being in control of the situation, but also to feel the gravity in what they are saying and sympathise with the audience.

But if I did get my way, what kind of human would I get? Probably a harassed station staffer who is desperately trying to deal with suddenly-upset passengers. His apology would be mumbled and stressed, possibly not immediately understandable. The mellifluous tones of announcer lady would be replaced by scruff regional Oxford man suddenly dropped in it by engineers in another part of the country. He would be in no better situation to do anything about the situation in any case. The only difference would be that we knew that someone real knew and was being hassled about it. A severed head on a plate but not very constructive.

The wish to have a human making the announcement is, of course, nonsense. It is far better to have the pre-recorded message, voiced in clear and relaxed tones. It gets the job done, does not escalate emotions any higher than they need to be and, ultimately is no better or worse placed to pass on information provided via an automatic system by some engineers up north somewhere.

But it’s something to think about on the 0804.

Posted in Life | 1 Comment

Tracks that use Gradual onset of Distortion to Great Effect

I love Spotify. I refuse to participate in the ‘social networking’ aspect of things. Indeed I find the idea of assuming I want everyone knowing what I listen to, and the assumption that I want to see what other people are listening to mildly offensive. That’s ok, I don’t mind being offended.

That said, here is a list of songs (not a playlist) which use the gradual onset of distortion to great effect. Distortion has been used since the dawn of time to make guitars fuzzier, vocals warmer, snares more brutal.

These tracks don’t just stick some fuzz on an instrument. I’ve chosen tracks that use the gradual saturation of an amplifier to slowly overdrive and distort, and change the character of the sound. This has the effect of introducing a part with a given timbre and then gradually changing the timbre of the sound bit by bit. The result is an extra side to the musical journey throughout the track.

Lithuania by Jaga Jazzist

The rhodes piano, which has provided a rhythmical bed throughout the piece (and a clever trick at the start) slowly distorts in the last 30 seconds of the track to something truly grimy. This transforms it from ‘mainstay’ of the track into something a bit more rebellious. Jaga Jazzist are my favourite contemporary group, I think.

Impossible – Shuttle remix

The main part in this track is rhythmical almost-tuned shouting. The voices initially have a well-defined punch with very slight distortion but quickly descend into a very squelchy sound. There’s also some other kind of degradation, possibly reduction of bit-depth. The effect is a spreading, straining and then dissipating into something more nebulous. Glorious.

La Nocturne

A number of parts become increasingly distorted. This is more of a subtle timbre-change than the others.

Boom Bip – The Birdcatcher’s Return

The drums become increasingly grimy and distorted towards the end. More of a ‘fuzz sound’, but a nice end to the track.

Sorry if you don’t have Spotify.

Posted in Music | Leave a comment

WordPress on Apache being Reverse Proxied by Nginx in an Endless Loop

I have a couple of WordPress installations running on Apache (on a non-80) port, and I’m reverse proxying them through nginx. Somewhere along the line WordPress is getting its knickers in a twist about the port not being the same as it expects. This results in WordPress going into an infinite redirect loop.

To solve this, I put this in the nginx virtual server config:

proxy_set_header Host $host;

Fixed.

Posted in Computers | Leave a comment