tHog

DIARY 2009

(2008)

DECEMBER

OCTOBER

SEPTEMBER

AUGUST

JULY

JUNE

MAY

APRIL

MARCH

FEBRUARY

JANUARY

2009

Fri, Jul 31

<00:37 EEST> The recent hacks from Monday are now finished with great success. In fact, I completed the SPDIF cabling on Monday afternoon. Now there is an adapter cable from the CD/DVD drive to the back panel of Hoo, with an RCA jack that in turn is connected to the amplifier. It was nice to hear the basic plan work, as I had not paid much attention to shielding, which I thought would be unnecessary for such short runs. The actual adapter circuitry is mounted on the inside of the back panel, with the TTL level cabling from the drive being a simple twisted pair.

Following an uninvited incident, there was more hardware hacking to do later on Monday. Gaga had powered off spontaneously, and I suspected an overly sensitive overheating detection in a Linux kernel module, that is still waiting to be fixed. I think that had actually happened to me before, but the machine also has a history of other random freezes, which are probably unrelated. However, this time after a few hours of cooling, it would still not power up, so I started to disassemble the system.

Curiously enough, the machine booted up when the power supply case was open, and shut down as I firmly pressed it close. It seemed like a mechanical problem, and I soon found the Achilles heel at one end of a certain heat sink. However, at this point I was going insane from the Finnish summer heat, which was not helped by the work with big iron in a clumsy position. I decided to postpone the whole thing for another day, as I would not really need the machine running. Looking at weather reports, it seemed like I would have to wait for at least a week. It also felt like a nice place to stop, as I had located the problem and it would be easy to continue. Finally, I removed the power supply entirely from the case, and started googling for the pinouts. This was both for the possible need to replace it with a PC equivalent, and for testing the power-on without a computer.

On Thursday I felt incredibly bored for a while, so I decided to give the PSU a go. With the rest of the heavy machine away, the process seemed much less daunting, even with the hot weather. The actual problem was found surprisingly quickly: a couple of the heatsink-mounted components had broken solder joints. An easy thing to fix, keeping in mind the mechanically preferred position of the heat sink, which was slightly different from the original soldering orientation.

It was actually a little weird, since I would expect that applying that pressure would keep the solder itself intact, while ripping the copper foil off the circuit board. That would maintain the electrical connection for a while, but might also introduce more severe problems, i.e. short circuits. So this was a very fortunate kind of glitch, as it was possible to fix into an intact state, even better than original in fact. It was also fortunate to have it happen on a PSU, where the dimensions are large enough even for a beginner in soldering, and there are no multiple layers in the PCB. But the mode of failure suggests there was something wrong in the original solder. Perhaps a case of extreme cold, like Napoleon's buttons?-)

Anyway, soldering the fractured joints did the trick. I guess the following hacks with this machine will involve software, in case the overzealous overheating limit hits me again.

Mon, Jul 27

<00:53 EEST> Searching for parts for another CDROM-SPDIF adapter (the simplest one here), I came across the analog circuit I used to implement Ortoperspekta for the first time. It has not been used much, since after that summer I moved to Jyväskylä, and the extra speakers had to stay where they belonged, with my parents. This part of my audio experiments has now gone a full circle, and it is time to recycle the components. Midnight is not the best time for soldering, though, so it will have to wait for a while.

I have actually stopped for a while to wonder how amazing it is to have time and resources for these creative and constructive endeavours. This is the kind of thing I feel like I was built to do. I also feel the need for the long days and nights of just pondering upon the world itself, the wonderfulness and futility of life, the arts and the sciences. I guess there is no profession in wondering about things, but one that comes pretty close in my experience is teaching science. Which is where I am, once again, going to return.

Sun, Jul 26

<16:42 EEST> While my present-day activities continue to involve computing and electronics, I feel like writing a little about my trip to Outokumpu early last week. The eponymous strange hump was covered in the remains of a mining industry, which evoked a strong sense of the ancient. This was compounded by the signs of old technology, and the underground mysticism of mining. I was strongly reminded of my summer in CERN, and the smell of its underground tunnels.

The old mines managed to leave an impression, probably due to the scarcity of prominent, marketed features. It was an honest collection of what was left from the once active industry. In fact, the past attempts to make it into a more family-friendly tourist attraction in the form of a theme park had failed.

Another positive feature was the way the old industrial buildings had been put to new use, for example by the arts and media students. Unfortunately, this also meant that not everything was open to public, but generally the extent of openness was surprising. You would pay the admission fee at one place, and nobody would check your tickets while going in and out of the various buildings in an open area next to the town centre. I cannot imagine this working in a bigger city, even in Finland.

<20:12 EEST> Continuing on the the tweaks around my 5.0 audio setup, I've now run out of 3.5 mm to 2xRCA cables. I happened to have a total of three, and there are 6 analog channels from the sound card. The problem is playing CDs with a discrete player, since the one I'd been using is a portable one with only 3.5 mm outputs (a proper line-out in addition to the headphone socket, btw). Then again, I now have a fancy amplifier with digital inputs, a couple of ancient CDROM drives from the 'multimedia' era of mid-1990s, and finally, a SPDIF adapter to bind them :)

While most CD/DVD/BD drives continue to have digital audio outputs, the nice thing about these old drives is the play/forward/stop buttons. That's about all of the user interface, so there is nothing like shuffle or repeat available, not to mention any kind of display. But they are still usable with just a power supply, and I happen to have a 5/12 V brick for externally connected drives. Both of the old 8x drives I've tested are different from the one in February 2007 test, in that the volume pot does not change the digital output level. Which might mean that there is no useless DAD conversion.

There are several reasons why a dedicated CD player is nice, for example when DJing. But even for home listening, there are some drawbacks with software players like Audacious. These days, they tend to do CDDA extraction, i.e. on-the-fly ripping, instead of relying on the drive's own audio outputs. The reason may be that not all drives have these outputs. Some older players had a choice between the two kinds of playing, but these days the designers seem to make it 'easier' by omitting such a technical option altogether. Unfortunately, CDDA extraction is not perfect, particularly when doing something else with the computer. It is generally also noisier.

However, there are still dedicated non-CDDA software players available, for example mcdp. Using these with the SPDIF output should be the killer combination of sound quality and user interface. Of course, the CD drive would be reserved for audio discs, which might interfere with other activities. So it's nice to have the option of a discrete CDROM player as well. But right now, the combination of mcdp with SPDIF seems to work so well that I feel like hacking up a more permanent connection. Should also work for DTS discs, since the amplifier can do the decoding :)

Thu, Jul 23

<15:33 EEST> This may be a bit of magic, perhaps Liquid Luck, from last night's viewing of Harry Potter and the Half-Blood Prince. Something easy, simple and amazing. My long-standing dream/plan of seamlessly combining 2-channel stereo, Ortoperspekta, Dolby Surround and Dolby Digital in the same set of electronics is finally fulfilled. It only took a few minutes of reading, and writing a few lines in a configuration file. It also helped that I am using the separate analog 5.1 outputs of my computer, which until now has felt like a compromise in quality and elegance.

In fact, I recall thinking about implementing Ortoperspekta as an ALSA plugin before, but I did not have the requisite set of speakers back then. Now that I do have 5.0, a quick googling led me to a related discussion. Actually, I was looking for something like MPlayer's surround filter for Audacious, since it seemed to handle 6-channel output really badly by itself. It was basically copying front channels to others, which is definitely not what I wanted.

Incidentally, the above discussion is also wrong about the details of surround and stereo, but at least I could learn the basics of ALSA routing. Thus here are my .asoundrc entries for Dolby Surround and Ortoperspekta, for use with any ALSA application.

Of course, the choices available with my multichannel setup are sometimes a little overwhelming. While I can set a nice default for Audacious, MPlayer needs to be run with extra options to get an optimal output with some soundtracks. For example, AAC has a wrong channel ordering, and sometimes a movie has multiple soundtracks with different numbers of channels. Most of these problems are not solved by a digital output and hardware decoding, which is one more reason for me to stick with this rats' nest of cables.

Wed, Jul 22

<00:05 EEST> My 5.0 sound setup is now up and running, using the backup plan of separate analog outputs. Not quite 5.1 as I don't have a subwoofer around, but the centre channel in particular is a welcome addition, as per some of my earlier musings. One nice effect is that I can keep the overall volume lower and still hear the dialogue, as it is mixed to the centre, with music and other noises mainly occupy the remaining channels.

Even this trivial setup was not without some ALSA tweaks. In the past few days I have experimented with the various model options of the snd_hda_intel kernel module without much digital success, and I had settled for the default automatic configuration. However, after setting up the amplifier and the five speakers, I could not hear anything besides the two front channels. Actually, I already suspected there was something to fix up, since alsamixer presented the full 7.1 capabilities of the chip, with additional side channels. But to my slight surprise, the centre and surround channels were also silent. Using model=3stack-6ch-dig did the trick; there are plenty more to try in Documentation/sound/alsa/HD-Audio-Models.txt in the Linux kernel sources.

SPDIF output is still not working, though. One problem which I had hoped to be digitally corrected is the slight mains hum in all speakers, but it turns out it is independent of the inputs. I suspected the analog 5.1 inputs, since I am using three quite different pairs of coaxial, with different lengths, so there are obvious candidates for ground loops.

Nevertheless, I still have hope for a digital audio output from this motherboard. The model option has corrected one important aspect of the sound system, so the driver does play a significant part. Unfortunately, it may be that there is no SPDIF hardware here after all. The specs are inconsistent and it may be impossible to be sure without some desoldering, which I am not too keen on doing. But at least for now, I have genuine surround sound :)

Tue, Jul 21

<00:04 EEST> The surround amplifier, that I have previously used with my laptop via Toslink, is finally here at my Jyväskylä apartment. Unfortunately, after a few days of configuring, I am still not getting optical audio out of this motherboard. This may or may not be a Linux driver bug.

In fact, I am not even sure if there is optical audio hardware onboard. ALSA detects three devices on the Intel HDA card: ALC888 Analog, ALC888 Digital, and ATI HDMI. So it seems that there are two options for digital output, but I am not seeing the Toslink light up in any of the 3.5 mm sockets, and I have no HDMI monitors. Thus my current 'easy' options are:

So, for now I will probably go with the analog 5.1, and maybe in the meantime the Linux drivers will magically improve. But first I need to find a proper space for the amplifier...

Sat, Jul 4

<23:47 EEST> Spectator sports is one of those things I have never really understood, even though many people seem to be into it. I guess it is a logical continuation of the fact that I am not much into any sports, particularly those involving teams and competition. Nevertheless, I do appreciate some physico-mental exercise to the point that I hardly live a day without any. I think sports is something you do, not something you just watch.

However, I do recognize the wide variety of other people's interest in sports. Whatever subject you are into, it is likely to seek inspiration and instruction by following the masters of your trade. So, thus far I understand the spectator part of whatever you're into otherwise. But the idea of beer-bellied slobs watching other people exercise is a little weird.

In my dirty Friday-night mind, this immediately evokes the picture of watching porn. The analogy may well be true, not necessarily as a source of direct arousal, but as a vicarious experience of the actual event. Connecting with the team and its extension, the fan base. Now this gets into the murky waters of social psychology, of which I have little experience, theoretical or empirical. This is probably the root of my lack of understanding in the first place, and I believe many a geek/nerd will agree.

Not that being a geek isn't an issue of social group identity. This morning I woke up with the startling realization that my interest in distributed computing projects is like spectator sports. My online routines include checking some statistics on the projects in which I participate. In fact, my choice of projects is partly based on the availability of statistics. Not just how I am performing myself, but also compared to others. My focus on low power consumption, and making good use of older hardware, makes the competition angle quite moot, though. But I imagine I feel something similar to what goes on in the mind of a sports fan — or any kind of social group supporter. I am doing a small part in a greater effort.

Of course, as a scientist I like to think that scientific efforts are somehow more important than the question of which team wins. (In case you are wondering how keeping a computer on all night can be a good thing, in this time of global warming, see Climateprediction.net.) I guess I am, nevertheless, driven by ancient social instincts. (I was about to continue on how nice it is that these instincts can be harnessed for a 'greater good', but I guess any sports fan would say the same ;)

Wed, Jul 1

<11:53 EEST> There is a wonderful Finnish saying "perse edellä puuhun" which roughly means, to climb a tree ass-first. It pretty much captures my experiences in the past half-year, and now I am glad to say that period of my life is over. Yesterday I returned head-first to Jyväskylä, and I already feel incredibly relaxed and physically better. This apartment in Viitaniemi that I found last September in a rush has turned out very nice, nothing short of a home.

Today's technical issue deals with sparse files. I ran into these when moving a 4-GB directory from one computer to another, via a tarball on a removable drive, and the target directory grew up to 9 GB. After pondering for a while, I realized it must be due to sparse files, since the application in question deals with them a lot. Tar needs an extra option to handle them intelligently, and of course I did not think of that at the time.

Yesterday, the time came to move the directory back, with its updated contents. The computers are on the same LAN, so I decided to use rsync, but the directory size (as reported by du) increased even more. Recalling the tar issue, I found the -S option in rsync, and I managed to shrink the directory quite a bit, compared to the source. This was even better than I expected: not only did rsync copy sparse files as such, it also found out if non-sparsely stored files could be written into sparse copies. So it can even be used locally to shrink a directory with these potentiall sparse files. A very nice feature in a tool I have already found immensely useful. Yay for rsync!


Risto A. Paju