Thursday 27 June 2013

Fractal Design Define R4 and Corsair H110

I am currently building my own computer by getting the components off Amazon, Aria and Scan whenever their prices are down, and I opted for the Fractal Design Define R4.
Ok, it looks cool. Realy cool (see the pictures below).

A while after, one of the coolers I had in my list (Corsair H110) dropped in price; I ordered it and quite excitedly started fitting it onto my case (even though I don't have a mother board yet, but new toys...).

The case specifications described it as being able to allow 140mm radiators on the top of the case; while the fan holes are there, there was a bit problem: the holes didn't match up with the cooler:

As you can see, the screw holes on the cooler have a wider space between them than the case. Foiled.
There was not enough room to mount the radiator at the front, and on the bottom of the case, the space was occupied by my PSU (Corsair AX 760).

Meh, had to send it back - it was either that or the case (which I fell in love with). Ordered the H90 instead; lets see how that one fits!








Wednesday 16 January 2013

Chrome sound and pulse audio

A while ago I suddenly stopped having sound in Google Chrome. The symptoms were a hung YouTube and Google Music (the progress bar would be stuck at 0 and not progress). I booted Chrome through the command line, but no helpful messages as to diagnose the absence of sound. The rest of the system was unaffected.

I suspected it was the Flash plugin. But, wait, I am using HTML5 YouTube and Google Music...

I traced back to see what I had changed on my system to cause such problem; it had been a while since I used this sort of web applications, so didn't really know how far back I had to look.

Of the packages I had recently updated, I only found the Kernel to be a reasonable suspect. Alas, my kernel configuration has been the same for quite a while.

After a bit of googling and fiddling with Portage, I realised that Chrome uses PulseAudio whereas the rest of my system uses GStreamer (either directly or through Phonon). Could this be a bad config?
As I delved into /etc/pulse/ I noticed a strange thing... I had not one, but two audio devices; the first being my Intel HD Audio and the second an AMD Radeon audio device. Weird. Could PulseAudio be routing the audio through this card instead?

I searched Portage for pavucontrol (PulseAudio Control) but it would pull in loads of GTK dependencies; surely there must be a command-line solution?
I looked on the config files for PulseAudio, and with the help of Google, I found http://ptspts.blogspot.co.uk/2009/03/how-to-select-alsa-sound-card-and-have.html and after I tried this, the videos on YouTube were suddenly playing about twice as fast as they should. Well, at least they were playing!

What if instead of selecting an audio sink for PulseAudio, I could route it through ALSA? After all, that's what GStreamer is doing, and it's working fine. That solution turned out to be very easy and quick, as described at http://forum.pinguyos.com/Thread-How-to-Pulseaudio-and-Alsa.

On my system, all I had to do was comment out the udev module on /etc/pulse/default.pa

#load-module module-udev-detect
and enable the ALSA module
load-module module-alsa-sink

And sound's back!

Friday 4 January 2013

High memory java death

I recently further upgraded my system's memory to 12GBs.


I turned the computer on and everything worked just fine.
I popped open Thunderbird and Chrome and everything was right with the world. Until suddenly, Thunderbird just dies when I opened the Chat tab. I found that rather odd, but the bug was reproducible. I couldn't really be bothered with debugging it, had more important things to do, but then Chrome started randomly dying. I ran it through the command line, and the error was "Bus error" and chrome://crashes/ didn't show anything. Obviously, I immediately blamed the new memory stick: it must be faulty!

I also noticed that my ebuild of NetBeans and LibreOffice were failing as well, although other ebuilds were unaffected. The ebuilds failed with


Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Which sounds odd. I mean, 12 GBs of RAM and Java says no memory? Well, I did disable the kernel's over-allocation, but surely it would have made no difference.
I Googled about this and found out that the VM will allocate a quarter of a system's ram for the heap. Well, a quarter of my system's ram is 3GBs, which in a 32bit system would surely make the address space of the process rather tight, which would explain why the kernel simply refused it. Oh wait, according to that page I found, the VM clamps this allocation to 1GB. That's odd. I wonder if they took into account that a 32 bit system can have more than 4GBs and used a large variable to store the system's total memory (ie, if they used a 32 bit integer and queried the number of bytes available in my ram, it would surely have overflown).

I switched to other VMs; I was using Sun's, and tried Oracle's and IcedTea, but all failed with the same error.

Alas the solution was simple:

export _JAVA_OPTIONS="-Xmx640m"

And emerge built NetBeans and LibreOffice with no problems. For some strange reason, if I increase the value (from 640) the Java death returns. No idea why.
Oh yeah, you still need an export to get emerge going with forced Java options

export I_WANT_GLOBAL_JAVA_OPTIONS=true