pajukanta.fi/ blogs/ Destruction Preventer

Destruction Preventer

Against All Odds Since 2008.

RSS Atom
Making time-lapse videos with MEncoder

As I mentioned in my other blog, I was one of the organizers of an anime & role-playing game convention called Tracon IV. As I had no time to move around taking photograps during the event, I put my camera to good use and shot a time-lapse video from the InfoDesk. The video is available in 480p, 720p and 1080p (Matroska/H.264/Ogg Vorbis), and you can even watch it on YouTube.

Here's a little more technical follow-up on how I made the video. Or, more appropriately, how I played an epicly frustrating round of open source and finally won...

Shooting the photographs

I shot the photographs during the event day using my Canon EOS 450D DSLR camera connected to my laptop with a USB cable. The laptop ran the Canon EOS Utility software that was programmed to take one picture every 30 seconds – this would amount to 1200 pictures in ten hours. I was a little short on hard disk space on my laptop, so I used the smallest supported resolution. 2259x1504 was, after all, way enough for a crisp 1080p high definition picture. Needless to say I didn't bother to shoot RAW.

I wasn't exactly sure how long the two batteries would last, so I decided to use one battery at a time and have the recharger charge the other at the same time. One battery seemed last, well, forever, but due to unrelated troubles I had to reboot my laptop at roughly 2 PM and decided to swap the battery just to be sure, at which point roughly 580 shots had been taken. This caused a little glitch in the naming of the picture files as I had to start over with Canon EOS Utility – not really anything five lines of Python couldn't solve.

At the end of the day (literally), I had 1119 JPEG files that took a little over 1.3 gigabytes of space.

Encoding the video

I then went on to google a little about time lapse photography and soon discovere there were two command line utilities that would do the job – ffmpeg and MEncoder. I evaluated them both and soon discarded ffmpeg as it promptly segfaulted every time I tried to feed JPEG files to it. A fair amount of time was then spent googling for the parameters for MEncoder to do the job.

I found out the software scaler in my build of MEncoder couldn't take input wider than 2048 pixels, so I had to scale and crop the images beforehand with ImageMagick. The command line options -resize and -crop came in handy (for details, see convert(1)).

for i in IMG_*.JPG; do convert -resize 1920 -crop 1920x1080+0+200 $i 1080p_$i; done

For the video I decided on the H.264 format and the x264 encoder. This required a fair amount of command line parameters to MEncoder, most of which I was able to copy-paste from the MEncoder documentation, though. I also found out the libavformat multiplexer of MEncoder was horribly broken being unable to handle B-frames. Thus I had to save the result in a raw video stream for now, and use other tools to encapsulate it in a suitable container (and bundle it with the sound track) later on. The final two-pass command line for the 1080p version was something along the lines of

mencoder 'mf://1080p_*.JPG' -ovf rawvideo -ovc x264 -x264encopts pass=1:bitrate=20000:subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b -passlogfile 1080p.log -o traconiv_infocam_h264_1080p.264
mencoder 'mf://1080p_*.JPG' -ovf rawvideo -ovc x264 -x264encopts pass=2:bitrate=20000:subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b -passlogfile 1080p.log -o traconiv_infocam_h264_1080p.264

Note that I selected an arbitrarily high bit rate – 20 megabits per second – as the video was going to be fairly short (55 seconds with the title and credit screens) and contained an unusually high amount of variance between frames. I also tried a more typical bit rate of 8 megabits per second, but this yielded an unacceptably blocky outcome. The bit rates for the 720p and 480p versions were 10 megabits and 4 megabits per second respectively.

Title and credit screens

I then proceeded to make the title and credit screens in OpenOffice.org. In the process of doing so, I discovered my new favourite font – Lucida Sans. I like it. A lot. To make "slides" in the 16:9 aspect ratio, I selected a page size of 32 cm by 18 cm. This was close enough to A4 to allow me to use typical point font sizes.

As I tried to export my title and credit screens as PNG, I found out there was no way to set the size of the resulting image. Instead, some arbitrary size was selected by OpenOffice.org that was quite big – but still not anywhere near 1080p. Finally I resorted to the cheap trick of taking a screenshot of the slides on my WUXGA (1920x1200) display and cropping it into the 1080p size (1920x1080). It turned out nice and crisp.

I then converted the title and credit screens to quality 100 JPEG and tried to add them to the encoder command line. As I wanted the title and credit screens to both last roughly five seconds, I made 127 symlinks to the title screen – ditto for the credit screen. The title screen pictures were named "1080pAAAxxxx.JPG" and the credit screen pictures "1080pZZZxxxx.JPG" so I figured they could be picked up in correct (alphabetic) order by the multi-file input expression.

This, in turn, crashed MEncoder with SIGABRT every time at the end of the encoding process. I spent almost two hours trying to find out what was wrong and managed to figure it had something to do with the title and credit screens being in another colorspace than the cropped JPEGs from my camera. Finally, after a frustrating while of shotgun debugging, I got MEncoder to make it through the encoding process by spelling out the input files as

'mf://1080p_AAA_*.JPG' 'mf://1080p_IMG_*.JPG' 'mf://1080p_ZZZ_*.JPG'

instead of

'mf://1080p_*.JPG'

Intuitive, isn't it?

The sound track

Next I set out to find a suitable sound track for the video. I remembered a band called Mandrake Root had a song called Build'o'Burn, the interlude of which was suitably hectic for a time-lapse video. Fortunately Magnatune.com, the non-evil record label that Mandrake Root is signed to, provides their content under the Creative Commons Attribution-NonCommercial-ShareAlike 1.0 license – therefore I was able to use the song legally, as long as I used the same license for the combined work. Please support Magnatune.com and Mandrake Root by buying their album ;)

In Audacity, I cropped a 50-second-long clip from the end of the interlude, added some silence in the end and made a fade-in in the beginning. The sound track was timed so that the loud final note of the soundtrack would coincide with the appearing of the credit screen, which turned out quite nice. Finally I exported the sound track as Ogg Vorbis.

Putting it all together

I chose Matroska as the container format because it seems to be favoured by the, ahem, underground media distribution channels, and thus has wide and well-tested player support. Using mkvmerge from the mkvtoolnix package I bundled the raw H.264 video stream and the Ogg Vorbis sound track together:

mkvmerge -o traconiv_infocam_h264_1080p.mkv --title "Tracon IV InfoCam" -A traconiv_infocam_h264_1080p.264 traconiv_infocam.ogg

There! A nicely wrapped up video file I could distribute, with soundtrack and all.

Conclusion

I found working with MEncoder exceedingly tedious and ffmpeg refused to co-operate at all. I was quite happy with the end result, but next time I need to do something like this, I'll consider getting a real video editing program. VirtualDub might or might not be up to the task.

Posted Tue Feb 10 01:15:00 2009
The State of Audio in Ubuntu Intrepid

OK, so due to M-Audio finally releasing the Vista x64 beta drivers, I was finally able to install my M-Audio Audiophile Delta 2496 sound card in my desktop computer (see my previous blog post). I had been happily using this card in my old desktop computer – a four-year-old 32-bit system with Gentoo Linux. There the card worked fine with the ALSA ice1712 driver. I had no reason to expect it wouldn't work with my new desktop computer and 64-bit Kubuntu Intrepid, too. However, I ran into unforeseen trouble.

Upon installing the sound card I disabled the onboard Intel HD Audio chip from the BIOS. This left my box with two audio devices: the HDMI output on my Radeon 4870 video card, and the M-Audio 2496. Would you imagine that Ubuntu managed to pick the HDMI output as the default sound device?

Solving this was a matter of simply blacklisting the snd-hda-intel module at /etc/modprobe.d/blacklist. This and using envy24control (from the alsa-gui-tools package) to unmute the somewhat complex hardware mixer enabled me to actually get sound out of the card.

envy24control reported, however, that sound was being played at the 48 kHz sample rate, which was clearly wrong. All the music I play is ripped from CDs and thus sampled at 44.1 kHz – the signal was getting resampled in software on the fly. Now I don't claim to be able to hear the difference, but such resampling is still HORRIBLY WRONG, especially when using a digital output and the equipment receiving the signal (in this case, Behringer MS-40 speakers) being able to handle the native sample rate (in fact, they can handle everything up to 192 kHz, 24 bit).

The culprit was found to be dmix, the ALSA software mixer that is enabled by default in Kubuntu (GNOME-Ubuntu seems to use Pulse Audio). I wonder why on earth they've chosen 48 kHz as the default sample rate! As far as I know, 48 kHz is totally useless in a consumer setup and has been, since the death of the DAT tape, largely replaced by other formats in professional recording.

I was able to work around this by disabling dmix using the following .asoundrc configuration file, as suggested by several sources:

pcm.!default {
  type plug
  slave.pcm hw
}

This enabled me to play stuff from the command line using ogg123 at the correct sample rate (44.1 kHz). The next thing I tried was listening to music with Amarok 2 RC 1; much to my dismay I noticed the sample rate, as reported by envy24control, was back to 48 kHz again. In the comments of some Amarok story at dot.kde.org someone wrote this off as the XINE Phonon backend being at fault – dunno, I lost the link already. Not that Amarok 2 RC 1 were able to handle single-file FLAC album images with embedded CUE sheets anyway, so I guess I'll be sticking to WINE and foobar2000 for the time being.

Another annoying problem remains, though: Every application that uses ALSA invariably hangs for roughly ten seconds when opening the audio device. I noticed this problem also when I was using the onboard Intel HD Audio controller before installing the M-Audio card, so it's hardly ice1712's fault. This is especially annoying when I'm trying to view web sites that use Flash, as the embedded Flash player seems to be closing and opening the audio device on every page load.

I hate to sound like a fanboy, but in Gentoo the card just worked – no fiddling with sample rates, no mystical ten-second hangs. Sure, at every boot I would have to tell Gentoo which sound card to use using their excellent alsaconfig tool and some braindead applications would still fail to work with the card due to making stupid assumptions about the mixer (every ALSA mixer has Master and PCM controls, right? Right?). But with Ubuntu I've had to delve much deeper in the vast monstrosity that is ALSA's configuration system.

And I just want to listen to music. Guess how hard this would be if I actually wanted to make music with Ubuntu?!?

Update: Sound does not work in WINE. So much for using foobar2000.

Posted Fri Nov 28 17:17:00 2008
They Did It!

A few weeks ago someone called RayT started posting on the M-Audio user forum regarding the progress (or the perceived lack thereof) of the Vista x64 drivers for the M-Audio Delta series of sound cards. Considering he had the cool-sounding title of "M-Audio Project Manager", a little spark of hope lit up: the cake might not be a lie after all.

And lo! The Vista x64 public beta driver for the M-Audio Audiophile Delta series is finally, FINALLY, available!

Without wasting any time I blew off the dust on my Delta 2496 and plugged it in one of my desktop's two free PCI slots (both of which happen to be alarmingly close to the video card), downloaded the driver and installed it. So far, so good – there's sound on both analog and digital outputs and no crashes yet, even though there's been warnings of a BSOD bug in the driver.

I've a two-fold message for M-Audio: "yay, thanks" for finally shipping the driver (albeit beta), and "shame on you" for TAKING YOUR SWEET LITTLE TIME IN DOING SO...

Posted Thu Nov 27 20:53:00 2008
Network Damager in Intrepid Ibex
 15:21   Nakkel : WPA Enterprise - To boldly go where no wlan has gone before.

No, WPA Enterprise still does not work with Network Damager. Sigh...

Posted Thu Nov 6 16:25:00 2008
Intrepid Ibex on my desktop and laptop

After toying around a while with my first dual-boot installation on my new desktop computer, I set up a motherboard RAID1 setup to protect my precious photographs – all 60 GiB of them – and reinstalled Windows Vista, this time in 64-bit mode. These so-called FakeRAID systems have not been supported in previous versions of Ubuntu, though, so for a while I was stuck with a single-boot Windows system. Support for FakeRAID has been added in the newest version, Ubuntu 8.10 "Intrepid Ibex", that was finally released last Thursday – 30th October. I had been eagerly waiting for this release, for it meant I could finally set up dual-boot again.

Before messing around with the desktop, though, I installed Intrepid on my laptop (Thinkpad X60s). As the laptop lacks an optical drive, I used the netboot image trick again – a routine I've grown to rely on: just extract the "linux" and "initrd.gz" files from the netboot archive into the /boot partition of an existing Linux installation and boot them with an existing GRUB. The installation was painless and I haven't noticed any problems with the system yet.

After a successful installation on the laptop, I turned my attention to the desktop. To my great, pleasant surprise, also the installation on the desktop went very smoothly. Using the Alternate installation CD the FakeRAID setup was correctly autodetected and I was able to easily set up LVM on top of the FakeRAID – a setup known to have caused problems with earlier distributions due to LVM autodetecting its volumes too early. The only hitch I had during the installation was that Windows Vista was not automatically added to the GRUB menu. Definitively a non-problem for me, as I come from a Gentoo background where you're required to write the GRUB configuration yourself, but a Linux newbie would have been totally lost.

In addition to the FakeRAID setup working out of the box, there are some other notable improvements in this version of Ubuntu, such as my video settings being correctly autodetected on the Radeon 4870 and Network Damager not completely freaking me out during the first three minutes of usage. The new Network Damager shall have its ultimate trial tomorrow as I'm going to try it on my laptop in a (gasp!) WPA Enterprise network – something the earlier iterations have been utterly unusable with. This time I was also able to install the proprietary fglrx driver from the Restricted Drivers Manager without having to resort to command-line hackery and extra-repositorial driver packages.

S/PDIF output still doesn't work on my on-board audio controller, and M-Audio still hasn't released Vista x64 drivers for the Audiophile Delta 2496, so I'm still stuck without a viable digital sound solution that would work in both operating systems. My brand new Hewlett-Packard LaserJet P1005 laser printer (the cheapest one there is) was immediately detected but could not print anything, the printer configuration utility complaining "No %%Pages: comment in header!" upon printing attempts – whatever that means. I wrote about this in the Ubuntu Finland forums (in Finnish only, sorry).

As I usually do when a new Ubuntu is released, I'm going to try GNOME for a few days again. Usually I revert back to KDE pretty quickly to avoid permanent loss of sanity. Nothing worth mentioning here so far, really – Evolution still sucks, I can now turn off menu access keys in gnome-terminal and Rhytmbox doesn't support FLAC album images (that is, big FLAC files with many songs and an index within them). Might actually file a bug report or two, if I get really bored.

Posted Thu Nov 6 02:15:00 2008
Watch out for the E90 300.34.84 firmware update!

So I read from the web site of a Finnish IT magazine that a new firmware for the E90, 300.34.84, is out. They promised performance improvements and some minor new features (such as Flash Video support). I had had no problems with past Nokia firmware updates, so I backed up my E90 using the Nokia Content Copier application from the Nokia PC Suite, installed the firmware update using Nokia Software Updater, and restored the backup again using NCC, as I had done three times before.

I was shocked to find out that even though Nokia Content Copier insisted on having successfully restored my backup, this time my calendar, address book and messages had not been restored. I tried restoring the backup a second time, again to no avail. That's over 600 calendar entries and 100 to-do entries from the past 1.5 years and three months into the future, around 200 names in the address book and countless SMS messages. Only slightly exaggerating, that's my LIFE there in the backup file I'm now unable to restore. Luckily I synchronized everything to Ovi.com on Tuesday; now, before trying to restore anything from there, I need to find out if synchronizing with an empty phone actually Does the Right Thing™ or wipes everything out from Ovi.com as well...

Your mileage might vary, but for the time being my advice would be to steer clear of the 300.34.84 firmware update until the transferrability of backups over the firmware upgrade is confirmed should you have anything worth retaining in your calendar, address book or message history.

Update 2008-10-11: Using the Change Device wizard at Ovi.com, I was able to re-add my E90 to the service. Then, using the in-phone Synchronization tool, I was able to retrieve my calendar and address book as of Tuesday. Now I just need to figure out everything I've changed in the calendar since Tuesday again...

Posted Fri Oct 10 23:16:00 2008
A Customized DAS Keyboard Layout

My Customized DAS Keyboard Layout

DAS is an alternative keyboard layout designed by Cristian Seres. Unlike the de facto standard QWERTY layout that is designed to maximize the distance between the typewriter hammers for the letters that are most used when writing English (a worthy goal nowadays, isn't it), DAS is designed with typing speed and comfort in mind. It is especially optimized for writing in Finnish, but it also performs noticeably better for English than QWERTY.

I've been using a custom variant of DAS as my primary keboard layout for around 1.5 years. I haven't done any comparative typing speed tests to determine if I'm actually typing faster using DAS than using QWERTY, but using DAS feels subjectively much more comfortable. My DAS variant differs in a few ways from the vanilla DAS by Cristian Seres:

If you're interested in using my DAS variant, Windows KLC source and installer files and Xmodmaps for Linux x86/AMD64 and Solaris SPARC are available.

Update 2008-11-05: Antti_Alien correctly noted that my Xmodmap files assume a Finnish QWERTY layout to be loaded beforehand. This is the way I think most Finnish users have their Linux systems configured, and "setxkbmap fi && xmodmap Xmodmap-DAS-uname -s" should probably do the trick for the rest. If this does not work for you, Antti kindly provided his own version of the Linux Xmodmap.

Posted Sat Aug 30 23:26:00 2008
Christmas!

Oops. I had intended to finish this post weeks ago, but kept forgetting it.

So my new hardware finally arrived a few weeks ago. It didn't arrive in time for my return from Norway – in the end it was the Intel Core 2 Quad Q9300 Tray processor and the Corsair HX520W power supply that were holding the order back. When they got the power supply, I decided not to wait any longer and changed the processor to a Boxed Set that comes with a stock cooler for about a 20 € increase in price. The stock cooler, of course, is useless to me; anyone wanna exchange it for e.g. some amount of a certain non-alcoholic beverage?

Anticipating that the hardware would arrive on Wednesday, I already took my old desktop computer apart on Tuesday and rebuilt it in an older, smaller case to function as a file server. There it is now, happily churning away in the corner of the living room.

When Verkkokauppa.com dropped me a SMS informing my hardware had arrived, I left work early and set out to drive my father's car to Verkkokauppa.com in Pirkkala... and got stuck in an epic traffic jam. It took me nearly an hour to drive from Lakiala to Pirkkala, and that's only twenty kilometers or so. >_<

The assembly process

After I got home with the hardware, it took me nearly two and a half hours to get the computer from boxes to BIOS setup. The assembly process was surprisingly laborious due to two things: the Noctua NH-C12P CPU cooler took longer to install than the usual variety of CPU coolers, and routing all the cables around inside the case also took its own time.

Unfortunately I need to back up a little on what I said about modular power supplies. They're great if you're building a barebones system with only the motherboard and a few hard drives demanding power, such as our server, but in a typical enthusiast system such as mine, you'll probably end up installing almost all of the modular cables. As the modular cables are not coupled from their root as the case is with non-modular power supplies, they end up causing a worse mess inside the case. Due to power cables I had to install the hard disks in the lower compartment: the power cables of the graphics card block the upper compartment that could hold two hard disks.

I was also surprised about the Asus P5Q-E motherboard requiring an EATX12V extra power cable – I thought only server motherboards needed those. Of course the HX520W had one, though, but had it been five centimeters shorter, it wouldn't have been long enough to reach the EATX12V power connector next to the CPU socket. I only found about the EATX12V requirement through spotting the empty connector and wondering why it's there in the first place – the fact that EATX12V is required was well hidden on the page 2-36 (about mid-way) of the P5Q-E manual.

After all this hassle, the computer actually booted on the first time I tried. Victory!

Installing the Other Operating System

I was disappointed to find out that the Windows® Vista® Home Premium retail box didn't contain 64-bit installation media. Instead there was a slip of paper telling me I need to order them separately for a "nominal fee" of 9,90 €. Only the ridiculously expensive Ultimate edition comes with both 32-bit and 64-bit installation media in the box. I should have known this – I must have read about it before.

Grinding my teeth, I ordered the 64-bit media (which they sent out yesterday). I didn't want to wait for them though, so I installed the 32-bit edition. I'll probably wipe it clean and install a 64-bit system once the 64-bit media arrives. The Vista® installation process was quite straightforward. It did offer the choice of manually partitioning the disks, which I gladly accepted – this way I didn't need to shrink the NTFS partitions when installing Linux.

I made 300 GB NTFS partitions on both disks and installed Vista® on one of them. The Windows® software RAID system is quite lacking: only JBOD and RAID0 are supported in non-server-edition systems, and the system disk can't be a software RAID array. I also haven't yet found any conclusive sources to determine whether it's possible to use the Intel ICH10R Matrix Storage hybrid RAID controller under Linux. That's why I currently don't have the Windows® installation on a RAID array. This is something I need to investigate further, as my photos will reside on the Windows® partition – I'd like to have them secured against hard disk failures. I also need to put up some way to do off-site backups in Windows@. Knowing myself, manual backups are not an option.

After the usual hassle of driver installation, I fired up the 3DMark Vantage benchmark application. The trial run gave me P8347 3DMarks, which seems typical for this class of computers. To my dismay, the two demos I tried to run – LifeForce by ASD, the winner of the Demo compo at ASSEMBLY Summer 2007, and Panic Room by Fairlight, the winner of the 64k Intro compo at ASSEMBLY Summer 2008 – didn't work. Probably they're optimized for NVIDIA, or there's some problem with the ATI driver (Catalyst 8.6). Unreal Tournament 3, the Source based games of Orange Box and Call of Duty 4 work fine, though.

I also installed the CyberLink PowerDVD 7 BD Edition DVD player software that came with the Lite-ON Blu-Ray drive. As I first tried to watch Arn – The Knight Templar from Blu-ray, CyberLink wanted to download and install an 90-megabyte upgrade. Only after installing this update would the movie play. No problems with HDCP & co. though – both the ATI Radeon 4870 video card and the BenQ FP241W TFT display support HDCP through DVI.

There's one more problem: sometimes, if I leave Vista at the login screen for a few minutes after a boot and then try to log in, it gives me a Blue Screen of Death and reboots. It seems this can be avoided by power cycling the keyboard if the NumLock LED doesn't light upon entering Windows. I hope this is just some random bug that doesn't occur anywhere else...

So far I've been somewhat impressed with Vista. After all, it hasn't managed to completely drive me nuts yet. Reaching this threshold didn't take long with the two Windows XP systems I've set up during the last few years.

Installing Kubuntu 8.04 Hardy Heron

Windows® is for three things: playing games, using Adobe Photoshop Lightroom 2 and watching Blu-Ray movies. The "usual stuff" I prefer to do with GNU/Linux. I considered Gentoo for a while, but as I wanted to get the system running before leaving for Ropecon last Friday and didn't fancy learning to build an LVM and software RAID enabled initrd manually, I decided to take the easy way and go with Kubuntu. The Debian installer supports LVM and software RAID out of the box, and Kubuntu also offers prebuilt KDE 4.1 packages.

The installation process itself was very painless. Even though I had a relatively complex LVM-on-RAID partition setup in mind, it was quite easy to implement using Debian's partition manager. On both disks I created first a 200 GB unused partition for future expansion, then a 256 MB RAID1 boot partition and finally a 235 GB (the rest) RAID1 physical volume. Within the LVM I created two logical volumes, root and /home, both initially 10 GB in size. As the educated reader knows, LVM will allow me to resize these volumes at will, even on the fly.

As you would expect with a brand new video card model, the out-of-the-box video performance was abysmal. The Radeon 4870 was not detected correctly and the VESA driver was used, resulting in a maximum resolution of 1600x1200 (on a 1920x1200 display) and horrible banding in gradients (even though it claimed to be operating in 32-bit true colour). Worse yet, the video card did not show up in the Proprietary Driver Manager, so I had to install the fglrx driver manually.

The xorg-driver-fglrx package was apparently too old, as it provided no help either. Luckily the ATI driver installer builds .deb packages, so I didn't have to operate around the package manager. Running the installer, installing the .deb packages and running aticonfig --initial helped and now I have X.org running at full 1920x1200 without the banding effect.

fglrx solved most of my graphics problems, but also introduced a new one: X.org now totally hangs every time I try to log out or othewise close the X Window System. I need to try the open source radeon and radeonhd drivers too, but for the time being I have a somewhat working setup using fglrx.

It never ceases to wonder me how buggy software sometimes gets released. The default "community supported" installation of KDE 4.0 was broken beyond measure: Konsole kept crashing and neither Konqueror nor Dolphin ever managed to start up. I wasted no time getting the KDE 4.1 packages installed and was delighted to find out that KDE 4.1 actually seems usable.

Sound problems

Unfortunately it would seem that the IEC958 (S/PDIF) digital audio codec on the Asus P5Q-E sound card is not yet supported by the hda-intel ALSA driver. This means I don't get digital sound output in Linux using the integrated audio controller.

In my old desktop computer I had an M-Audio Audiophile Delta 2496 sound card that worked well under Linux using the ice1712 driver. I bought it about a year ago – despite the model being eight years old, it remains in stock as the best-selling PCI sound card at Thomann.de. As I was expecting I'd be using the onboard audio controller of the P5Q-E, I didn't install the Delta 2496 in the new computer.

Now that I've found out the P5Q-E digital output doesn't work under Linux, I might install the Delta 2496. There's a catch, though; the Delta 2496 seems to be unsupported under Vista. I don't know if there's any easy solution to this problem that doesn't involve either reverting back to analog audio or juggling the S/PDIF cable back and forth between the integrated and discrete audio controllers.

What now?

The computer project has been fairly successful so far. Performance is at an expected level, I haven't noticed any stability problems other than the occasional login screen BSOD and the system is really quiet except when the GPU fan kicks in at full force, which never seems to happen in normal use (including games). I'll run the system at stock speeds for a few weeks and possibly try conservative overclocking after that. The onboard RAID and the audio problem still warrant some additional research.

Posted Sat Aug 30 22:05:00 2008
Powered by Electricity

Before you ask, yes, I got the new hardware and no, the blog post about it is not ready. I do have some pictures of it online.

In other news, I got my hands on an Etech PM300 Energy Meter and played with it a little. It's a handy device you plug between a wall outlet and the device whose energy consumption you want to measure, and it tells you the mains voltage, current and power consumption.

Here's some quick, unscientific results:

I have no idea about the accuracy of the device. The meter reports the wattage with zero decimal places.

The measurements that surprised me were the "computer power off 11 W" and "display in standby 0 W" ones. I would have expected the computer to draw significantly less when powered off – on the other hand, I'd have expected the display to draw at least a little when in standby.

From the tree-hugging point of view, the most concrete way for me to preserve energy would be to switch off the computer from the PSU power switch when I'm not using it. That's too bad – the power switch is located behind the computer, requiring me to crawl under the table to operate it. Guess if that's going to happen...

Posted Sun Aug 17 23:59:00 2008
New hardware!

My current desktop computer has undergone a series of upgrades – more and even more memory (now 2 GiB), a faster GPU (currently an NVIDIA GeForce 4200Ti with a passive aftermarket Zalman cooler), another hard disk (a 320 GB Western Digital SE, 160 GB of which in software RAID1 with the old Maxtor DiamondMax) and a better case (Antec Performance One P180). However, the motherboard (Asus A7V8X-X) and the CPU (AMD Athlon XP 2500+ 1.86 GHz) have stayed the same since I got them in January 2004. In a sense my current desktop computer is therefore four and a half years old – that's ancient considering the fast pace at which the PC hardware is evolving nowadays.

It has survived the teeth of time quite well: only recently it has started to "feel slow" in certain everyday tasks I use my desktop computer for, such as web surfing (damn those Flash-heavy web sites) and reading RSS feeds (merging 30000 articles into the All Feeds list in Akregator takes a few dozen seconds). Of course it has been next to useless for gaming for a few years now: Neverwinter Nights and Unreal Tournament 2004 are the newest retail games I've been playing on it. Not that it would have been my top priority so far, having kept the box Gentoo Linux -only and always on for server needs.

Being quite content with the current hardware I've been postponing building a new computer way beyond the three-year upgrade cycle I had originally planned. Last autumn, when I agreed to work in Norway for this summer, I finally decided I would upgrade the computer upon returning from Norway. That time is coming closer and closer: my time here in Norway has been flying like an arrow, and eleven days from new in less than a week (!) I will be returning to Finland just in time for the seventeeth annual Assembly computer festival.

So I've finally ordered the new hardware hoping that it'll be waiting for me when I return. Not without careful consideration, though – it's amazing how many tough choices you face when building a computer (or, to a lesser extent, purchasing a ready-built one). In this blog post, written during an utterly boring rainy Sunday afternoon, I'll try to give some insight about my hardware choices and give useful links to reviews and other information about the parts. So read on for an account on my journey into the depths of hardware nerdship! Some of the links will be in Finnish or Norwegian, but hey, at least everyone can look at the pics... ooh, shiny!

Computers should always be built or purchased with the intended usage in mind. In addition to the Usual Stuff I do with my computer – IRC, web surfing, programming, schoolwork etc. – there were some new use cases I wanted to enable with the new computer: playing new PC games, developing digital images (this means Adobe Lightroom) and watching high-definition video from both Blu-ray and the Internets. With the server project now up and running and these use cases in mind, I decided I wouldn't be running my new computer 24/7 like the old one. After five years of running nothing but Linux on my desktop, I'd be building a dual-boot system with emphasis on performance and low noise.

CPU

The CPU was actually the toughest choice, and probably the one I had the least good reasons for. The first big question about the CPU was whether or not to even build a computer at this time: later this year Intel will launch Nehalem, a new processor family that will feature a completely new microarchitecture. However, Nehalem will require ridiculously expensive DDR3 memory and I'm not actually expecting the CPUs and LGA1336 motherboards to be cheap at launch either, and I've been postponing this upgrade for long enough already.

Having decided that I wouldn't wait for Nehalem but instead get the hardware right now, it was quite clear that I'd go for Intel Core 2 – it would seem that AMD has naught to offer in the 150-200 € price point I was aiming at. In the end the choice was between two processors: the dual-core Intel Core 2 Duo E8400 (9.0 * 333 MHz = 3.0 GHz) retailing for around 150 €, or the quad-core Intel Core 2 Quad Q9300 (7.5 * 333 MHz = 2.5 GHz) retailing for around 220 €. Of course there's also the Intel Core 2 Duo E8500 (9.5 * 333 MHz = 3.16 GHz) for roughly 190 €, but 40 € sounds a little steep for a mere 5 % increase in clock speed.

Had I been simply building a gaming rig, I would have definitively chosen the E8400 that offers single thread performance superior to the Q9300. It wasn't that simple, though – what I want is solid performance in both games and other applications, a workstation I'd be able to use for at least three years. Something a friend of mine said also made think about this from a professional point of view: how do I expect to be able to learn scalable parallel programming with only two cores at my disposal? Multicore systems are where the industry focus is, so for future proofing I finally settled for the quad-core Q9300.

From the forums I read the E8400 was overclockable using air cooling even up to 4.0 GHz. The Q9300 on the other hand was reported to be running fine at up to 3.6 GHz using air cooling. Having never overclocked my boxen before, I'm not interested in extreme overclocking, but I expect to be pushing my Q9300 to around 3.0-3.2 GHz – having the multiplier capped at 7.5, this means 400 to 425 MHz in FSB clock. This will have some implications on the motherboard and memory, which I'll address in their respective sections.

Motherboard

It seems there's two big players manufacturing chipsets for Intel processors: Intel itself and NVIDIA. I must admit I didn't really research the NVIDIA offerings at all. Intel, on the other hand, has four chipsets relevant to the sort of PCs I'm building: P35, X38, P45 and X48. I was thinking the most I'd be willing to spend on the motherboard would be around 160 €, which kinda rules X48 out.

Intel P35 has been the de facto chipset for Intel processors for a while now. Despite its age it still seems adequate for most setups. You'd likely only pick X38 or the brand new X48 if you were planning to run a CrossFire setup of multiple ATI Radeon cards – other than that, there seems to be few reasons to pick the X38, let alone the X48. The biggest improvement in P45, an evolutionary update of P35, is probably the PCIe 2.0 support, which has little use with the current generation of graphics cards. However, some P45 motherboards also support quad-pumped FSB rates up to 1600 MHz – considering I'm aiming to run my Q9300 at 7.5 * 400 MHz = 3.0 GHz, 1600 MHz rated FSB is definitively a plus.

Asus has a pretty solid P45 lineup, namely the P5Q family of motherboards. Initially I was considering P5Q Pro, but a little Googling revealed that its Attansic Gigabit Ethernet chip isn't supported in the mainline Linux kernel yet. The atl1e driver is currently headed for net-next and might make it into 2.6.28, but not wanting to be bothered with running an off-tree network driver for the first few months, I chose the next model up from P5Q Pro – the P5Q-E – for an about 20 € increase in price. CPU3D.com found the P5Q-E "a mainstream motherboard - - hard to beat".

Update 2008-10-11: The atl1e driver made it into 2.6.27.

Memory

The first question about memory is whether to go for DDR2 or the ridiculously expensive DDR3. This is a choice that's fairly easy to make: DDR3 setups seem to have negligible to small performance advantages over DDR2 ones. Were I planning to build a temporary system and go for Nehalem once they were available, DDR3 would be the logical choice, but as I don't have any such plans, it's DDR2 for me.

Within DDR2 the memory speed doesn't seem to be a big deal either. Taking into account the expected 400 MHz FSB I opted for a pair of Corsair 800 MHz 2 GiB DDR2 modules with 4-4-4-12 timings, allowing me to run them in a dual channel configuration on their "native" 800 MHz DDR rate with a 1:1 multiplier.

GPU

My old desktop computer has seen three generations of NVIDIA cards: an old GeForce 2 MX, a passively cooled GeForce FX 5200 (actually a rebranded GeForce 2) that had heat problems and a second-hand GeForce 4200Ti whose broken HSF I replaced with a passive Zalman heatpipe cooler. Until mid-June I didn't see my long lineage of NVIDIA cards coming to an end: after all, NVIDIA has (proprietary) Linux drivers that work. I'd probably just buy a 9800 GTX and be perfectly happy with it. Or so I thought.

I was wrong in many ways. For starters, AMD released their HD 4800 series that turned the whole GPU world upside down. Since the ill-fated HD 3800 series they had been struggling to maintain their relevance in the GPU market with NVIDIA offering more bang for the buck in all price categories other than the lowest ones. With the release of the 4800 series this changed dramatically: the 4850 surpasses 9800 GTX and GTX+ in performance and comes close to the more expensive GTX 260, and 4870 wipes the floor with all NVIDIA single-chip solutions except their flagship GTX 280. Detailed reviews can be found at Tom's Hardware and Muropaketti.

On the Linux driver front the situation also seems to have reversed. Suddenly there's lots of complaints from masses of NVIDIA users of awful 2D performance. On the other hand AMD seems to be getting their Linux driver act together and two different open source projects are offering open drivers also for the 4800 series. Suddenly for me the only reason to consider NVIDIA over ATI/AMD was their CUDA parallel computing toolkit that is more established than its AMD counterpart, the AMD Stream SDK.

ATI/AMD wins. I'm getting the 4870.

It seems that all manufacturers simply glue their own stickers on the AMD Radeon HD 4870 512 MiB GDDR5 reference design, so the selling points are mostly price, availability and warranty (some offer 12 and some 36 months). I chose the Sapphire variant.

Persistent storage

Nothing ground-breaking here. I played with the thought of getting an SSD or a RAID1 of Western Digital VelociRaptors, but in the end the economical viewpoint won. Choosing a hard disk brand boiled down to Samsung versus Western Digital – two of my Seagate disks broke last autumn, so it'll be a while until I buy anything from them. Silent PC Review was impressed with the silence and performance of the new Samsung SpinPoint F1 750 GB and 1 TB drives. The 750 GB model is actually quite affordable, albeit a little slower than its bigger brother. I'm building a RAID1 from a pair of them.

Optical drive

I'll be reusing an old LG IDE DVD+RW burner from my old computer. However, I thought it'd be about time to hop on the High Definition bandwagon, so I decided to get a Blu-ray reader. Pioneer BDC-202BK would have been an affordable BD-ROM reader and DVD+RW burner that would have allowed me to ditch the old IDE drive, but it's only available in bulk packaging that doesn't include the software required to play Blu-ray movies. I was shocked to find out that PowerDVD 8 Ultra, the only version of PowerDVD 8 that plays Blu-ray movies, costs USD 99.95! Therefore I ended up ordering a Lite-ON drive that comes with a Blu-ray enabled version of PowerDVD 7 (I checked this from a forum).

Power supply

For our server we spent a lot of time searching for a power supply that would implement the ATX12V and EPS12V standards required by Xeon motherboards. We ended up ordering a Corsair HX620W. For a consumer PC support for these standards is not required, but HX620W charmed me with a certain feature: the modular wires. Never have I seen a computer with such uncrowded interiors than our server! Well, of course this had something to do with not having discrete graphics, but still the lack of extra wires protruding from the power supply was very convincing.

It's a shame that modular wiring still seems to be a feature only found in the top-of-the-line multi-jingawatt PSUs with their own nuclear power plants included. Setups very similar to the one I'm building seem to draw a mere 300 watts under heavy load, so even HX620W's little brother, the HX520W, will be overkill for me. That's the one I'm purchasing, though, as the Seasonic M12II-430 – the only modular PSU smaller than the HX520W I've found – isn't any cheaper than the HX520W. And the GPU marketing materials do recommend a half-kilowatt PSU.

Dunno why. Probably just to be sure. After all, you never know when some idi^Wmoro^Westeemed customer will call in, complaining "I've got ten hard disks and a Radeon 4870 in my Skulltrail dual-processor setup and my trusty old 450 W Nexus can't provide enough juice! Your marketing materials said 400 watts would be enough so I'm suing you to hell!"...

Case and cooling

I'm also reusing the Antec Performance One P180 from my old computer and evicting the old computer into a cheap Codegen case to serve as a file server. Were I buying a new case, I'd probably still get another P180 or its new revision, the P182 Gunmetal Black. I've been thoroughly impressed with the quality of this case during the three years I've had it and will continue to recommend it to anyone asking for a good case.

The quality of the case does not extend to the fans provided with it, though. The P180 came with three 120 mm Antec fans, each of which has at some point started to make a horrible noise, at which point I've removed them. Probably their bearings have given up. Currently my old computer is cooled by a single orange Nexus Real Silent D12SL-12 case fan, and I hope this will be enough for the new computer, too. If it isn't, well, I'll just keep adding Real Silents – the case can sport five of them!

Unlike the Antec fans, though, the Real Silents don't have speed switches. The Real Silent isn't really silent (a terrible pun, I know) when you're running it at 12 volts, which is unfortunately the only voltage it'll run on out of the box. Having read all sorts of ugly warnings about the 7 volt trick (ie. connecting a fan between the 12 V and 5 V lines instead of the 12 V and GND lines), I'm convinced that's not something I'll want to do – I'll get a 7 volt adapter for each of the case fans. One with a resistor or a diode, that is – they actually sell adapters that just implement the aforementioned 7 volt trick.

As I intend to overclock the CPU a little, I'll also need a good CPU heat sink. If you look at SPCR's list of their recommended HSFs, you'll notice a big warning about cooling the components around the processor slot when running either a fully passive CPU cooling solution or one whose fan blows parallel to the motherboard. Taking that warning seriously, I decided to get a top-down cooler. The best top-down cooler according to SPCR is the Noctua NH-C12P that comes with a ridiculously overpowered NF-P12 fan. The NH-C12P is expensive – around 80 € – but only around 20 € more so than eg. comparable Zalman top-down coolers (which haven't even made it to SPCR's list).

There is one thing I can't praise Noctua enough for: their motherboard compatibility list for NH-C12P. Zalman & co. should really follow their example.

Summing it up

Here's the parts I finally decided on:

 Kpl  ID   Tuoteseloste                                  Hinta  Vapaana
=======================================================================
   1 12737 Lite-On DVD-/BD-ROM -asema, musta. 4x BD    109.90e    -2kpl
   1 20076 Asus P5Q-E ATX-emolevy Socket 775-proses    139.90e    -5kpl
   1 21190 Corsair HX520W HX-sarjan 520w ATX-virtal    102.90e    -2kpl
   1 23441 Corsair XMS2 DHX TwinX 4GB (2X2GB) PC2-6     96.90e    -3kpl
   2 26681 Samsung Spinpoint F1 750GB SATA 3.0 Gb/s    173.80e    -9kpl
   1 27359 Noctua NH-C12P Heatpipe prosessorituulet     82.90e     0kpl
   1 32545 Intel Core 2 Quad Q9300 2.5GHz, tray. In    219.90e   -12kpl
   1 33779 Sapphire Radeon HD4870 512MB - näytönohj    248.90e     0kpl
=======================================================================
Yhteishinta:                                          1175.10e

Adding the Other Operating System (;WHISTEL), a Blu-ray movie (Arn – Tempelriddaren; supporting Nordic film-makers!) for testing the BD-ROM drive and some cables, the final price for the whole order climbed to a little over 1400 euros. I ordered the parts from Verkkokauppa.com.

I did consider splitting my order up to several webshops, or even ordering some of the parts from Germany. The savings this would have brought wouldn't have been much more than around 10 %, though, which is what I'll gladly pay for being able to do the possible warranty dealings at Tampere instead of having to send my parts all over the Europe.

So now I'm waiting to return to Finland and hoping Verkkokauppa.com will have delivered the parts by then. I'll write another post (with pictures!) once I get to building the computer.

Posted Fri Jul 25 02:36:00 2008

More...