[ Content | Sidebar ]

Archives for 2009

The Fish

July 11th, 2009

I first became aware of The Fish when I was a small child. At first it terrified me, but now I have come to admire its fishy nature. It is located at the Enterprise Centre in Eastbourne. You should visit it. Here are some photos:

fish_front

And another one showing the fish in full:

fish_side

Also, “modern” art is weird and a bit silly.

Linux on a Samsung Q320: Part 6

July 9th, 2009

I’ve been playing around with powertop trying to reduce power usage. I’m using laptop-mode to spin down the disk when its not needed (it automatically activates when on battery power). I’ve also added these two powertop suggestions to /etc/rc.local

# Reduce the frequency of disk flushes
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
 
# Turn off the SATA link whenever possible
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

I’ve also enabled CPU frequency scaling. If I dim the brightness, the laptop uses around 16W of power under light usage: amarok playing in the background and browsing the tubes. It guesses this will give around 3 hours battery life. Not sure if I can make it better…

Addictive game

July 9th, 2009

I wasted today playing UFO: Alien Invasion. It’s unusually polished for an open source game. The graphics are very nice, especially in the battle mode. The storyline is also quite engrossing and surprisingly well written – I like the non-linearity of it too. Recommended.

Going to stop now and do something useful like add scenery to Train Game.

Garden ponds

July 9th, 2009

Some interest has been expressed in the number of ponds we have in our garden. A comprehensive survey has revealed that there are just four. A fifth having been removed to make room for the garden train. Here they are:

This one is just a hole in the ground. Strange statue lady.

This one is just a hole in the ground. Strange statue lady.

Used to be the wood shed. Also should have a moving submarine but has been inexplicably removed...

Used to be the wood shed. Also should have a moving submarine but has been inexplicably removed...

This is the submarine. It has been temporarily replaced by Captain Cook's Endeavour

This is the submarine. It has been temporarily replaced by Captain Cook's Endeavour

The first pond. This used to be the coal shed.

The first pond. This used to be the coal shed.

And another concealed one.

And another concealed one.

I hope this answers all your pond-related queries.

Linux on a Samsung Q320: Part 5

July 7th, 2009

This morning I have learned a lot about HAL. I have been trying to get the brightness up/down controls on my laptop to work (they need to use a non-standard Nvidia interface).

If you have the same laptop then these are the steps I went through to get it work. Disclaimer: your mileage may vary; no warranty; may be somewhat Arch Linux specific.

First we need to make sure the kernel sends the right key symbols, which it doesn’t by default. Add the following to /etc/rc.local

setkeycodes e008 225 e009 224

Here e008 and e009 are the scancodes, and 225 and 224 are the keysyms we want them translated to.

Next we need to get HAL to recognize the Samsung Q320 and handle it specially. Copy 10-samsung-q320-brightness.fdi to /etc/hal/fdi/information/.

Now restart HAL and this file should be loaded (you can check with /usr/lib/hal/hald-generate-fdi-cache --verbose 2>&1 | grep samsung). This does two things: it sets the access_method for the brightness control to a special value “samsung-q320” rather than the default “generic” – we’ll check for this later; it also removes the key that tells HAL to look for the brightness control under /sys – this doesn’t work. Check this has worked by running lshal | grep samsung-q320.

Now, HAL uses two scripts to handle getting and setting the brightness. These are hal-system-lcd-get-brightness and hal-system-lcd-set-brightness located in /usr/lib/hal/scripts. We’re going to hack them so they use smartdimmer (from the nvclock package). Apply this patch to hal-system-lcd-get-brightness:

--- hal-system-lcd-get-brightness.old   2009-07-07 11:42:25.000000000 +0100
+++ hal-system-lcd-get-brightness       2009-07-07 13:10:17.000000000 +0100
@@ -9,6 +9,10 @@
 
 . hal-functions
 
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "samsung-q320" ]; then
+       exit `smartdimmer -g | awk '/SmartDimmer level: / {print int(($3 - 15) / 5)}'`
+fi
+
 # Check for environment variables
 if [ -z "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" -a -z "$HAL_PROP_LINUX_SYSFS_PATH" ]; then
         echo "org.freedesktop.Hal.Device.UnknownError" >&2

This checks the special key we set earlier, and if it is set we query setdimmer for the current brightness and munge it into a number between 0 and 17 (there are 18 brightness levels on this backlight). A similar patch for hal-system-lcd-set-brightness:

--- hal-system-lcd-set-brightness.old   2009-07-07 11:28:32.000000000 +0100
+++ hal-system-lcd-set-brightness       2009-07-07 16:48:16.000000000 +0100
@@ -30,5 +30,10 @@
 
 export value
 
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "samsung-q320" ]; then
+       smartdimmer -s `expr $value \* 5 + 15`
+       exit
+fi
+
 hal_check_priv org.freedesktop.hal.power-management.lcd-panel
 hal_exec_backend

Now you should be able to test this using any HAL-enabled brightness setter (e.g. GNOME Power Manager).

I had a strange problem with the GPM in Arch: it refused to change the brightness away from 50%. I got the GPM source from ABS to try and debug it, but when I built it from source it worked fine. Hmm.

Linux on a Samsung Q320: Part 4

July 7th, 2009

VGA and HDMI out are now working nicely. I couldn’t get xrandr to work (I suspect I could with more fiddling though). Instead I’m using Nvidia’s TwinView which supports multiple monitor configurations nicely. I’ve tested it on an external TFT monitor and a widescreen TV (via HDMI) and both worked fine.

Turns out that some parts of the xorg.conf I posted earlier were redundant. You can use HAL to detect the screens, monitors, etc. All you actually need is a section to force the use of the Nvidia driver like this:

Section "Device"
   Identifier     "Device0"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
   BoardName      "GeForce G 105M"
   Option         "TwinView"      "1"
EndSection
 
Section "Module"
   Load         "glx"
   Disable      "dri"
   Disable      "dri2"
EndSection

The TwinView option is required to enable Nvidia’s multi-monitor stuff.

The webcam and bluetooth also seem to be working.

I’ve managed to reproduce the bug where xcowsay gets sliced across screens!

Linux on a Samsung Q320: Part 3

July 6th, 2009

Progress is good. I have wireless working (using the ath3k driver). GNOME’s network manager (nm-applet) works fine in fluxbox.

Suspend/resume works too, but it’s not automatic on lid-closing. Need to fiddle with the ACPI event handlers I think. EDIT: works fine with gnome-power-manager.

The normal ACPI brightness controls for the backlight do not work. You have to use nvclock instead (e.g. nvclock -S -10 to dim 10%).

This is my working xorg.conf file for the Nvidia G105M in the laptop. It’s fairly straightforward apart from the two “Disable” lines at the bottom – you need these or xorg will try to load those modules by default (conflict with the Nvidia stuff). Note that this assumes you’re using HAL to configure the input devices…

Section "ServerLayout"
   Identifier     "Layout0"
   Screen      0  "Screen0" 0 0
EndSection
 
Section "Files"
   FontPath "/usr/share/fonts/local/"
EndSection
 
Section "Device"
   Identifier     "Device0"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
   BoardName      "GeForce G105M"
EndSection
 
Section "Screen"
   Identifier     "Screen0"
   Device         "Device0"
EndSection
 
Section "Module"
   Load		"glx"
   Disable      "dri"
   Disable      "dri2"
EndSection

I’ll post an updated one when/if I get VGA/HDMI output working.

Linux on a Samsung Q320: Part 2

July 6th, 2009

Argh! The Debian installer worked perfectly, but the installed system was fail: no network drivers for wired or wireless, no X, … After several hours of frustration I gave up and installed Arch Linux. It’s not bad! The installer is a little more primitive than Debian’s, and it dumps you into a terminal without X. Managed to get X working with the proprietry Nvidia drivers and the xf86-input-synaptics package for the touchpad.

Will report back when I’ve tested more things.

Linux on a Samsung Q320: Part 1

July 6th, 2009

A laptop: I has one! It’s a Samsung Q320. Here it is after taking it out the box:

Samsung Q320

The lid is nice and shiny but I suspect it is going to be a fingerprint magnet. After booting it up it is running Microsoft Windows Vista Premium Edition TM (C) FTW. Here’s a picture:

Samsung Q320

The screen is glossy, as you can see from my reflection. No dead pixels or other defects that I can see. All looks good!

Going to upgrade to Debian now. Will report back…