Tuesday, January 6, 2009

LCD panel backlight control vs Sony Vaio AW11Z part 2

Heureka!
Finished. The port of NVClock/SmartDimmer to OpenSolaris is complete. It works nicely on my notebook (and I only crashed it once on the way *g*)
A little reading, browsing source code and learning how to access PCI stuff was... ummm... interesting :-) Thankfully there exists a nice thing called libpciaccess which makes life a lot easier.
NVClock now has a Solaris backend that gives me the ability to control the backlight on my notebook.
For now the source code can be found here
Have a go and try it if you have a notebook with an NVidia graphics card. Please report if you have any issues with the Solaris specific part. Any comments are welcome. But please don't sue me if it blows your box into pieces ;-)
Mind you - smartdimmer and nvclock need to be run as priviledged user to set the registers on the graphics card.

I hope the author of NVClock accepts my patch so OpenSolaris gets supported out of the box.

The really amazing thing is how much battery time the backlight actually sucks. With the 'big' battery runtime went up by 1hour just by dimming from 100% down to 15%. PowerTop reports 40Watts vs 26.5Watts. That is just impressive!

Monday, January 5, 2009

LCD panel backlight control vs Sony Vaio AW11Z part 1

As mentioned in an earlier post, the backlight control on the Vaio doesn't work out of the box with OpenSolaris. A lot of googling and reading revealed that the backlight isn't controlled via ACPI but via the NVidia graphics card. A lot of more googling and reading lead me to a nifty little tool called nvclock / smartdimmer. It features a number of options to tweak some settings. One of the options is the brightness level of the panel backlight. Now there was just one problem. OpenSolaris isn't (yet) supported.
A little more reading and digging around the code...
Heureka!
I now have a first version which can dim the backlight of the panel. Still a lot of things hardcoded (only one graphics card, fixed base mem address). Still... it's the first step.

Battery time on the default battery went up by 35mins by dimming from 100% down to 15%.

Off to part two... and make the beast auto-detect the graphics card, fetch the base mem address etc.

As soon as I'm done with that I'll post it here and on the relevant list.

Tuesday, December 23, 2008

Multimedia keys and Songbird on Opensolaris

As I posted earlier the Multimedia keys on the Vaio work quite nicely with Gnome apps like Rhythmbox. It's just that I prefer songbird. And while moving a server to a new pair of disks a little music is more than welcome. So let's rock and roll.
Only thing the multimedia keys don't work. Bugger. Songbird seems to ignore the gnome keybindings. The MMKeys add-on only seems to work on Linux. I didn't have the nerve to look into it yet. But there seems no easy way to bind keys to actions in Songbird.
A little annoying.

Moving box to S10U6 with ZFS root

So what do you do just before christmas? Well I started updating a T1000 from Solaris 10U4 to U6 with ZFS root. As this box serves a patient administration system in a hospital there is not much room for longer down times. Well except around official holidays.
The T1000 is a nice box to run databases on boot it has one problem - not a real problem more like a hurdle in terms of updating. It came with just a single hard disk when we got it. It has a StorEdge 3510 attached though.
Well sounds quite easy. Setup LiveUpgrade and off you go. In theory yes. Creation of the new boot environment worked nicely. Upgrade went fine too. The damn thing just wouldn't boot off the external disk stack. Bugger.
As there are now double disks in a single bracket available (well for some time now) I ordered a pair of disks to move the installation from one disk to the new pair.
Now the dirty part begins ;-)
As I am too lazy to replicate the installation from scratch (I could do it but it would require more time than I have at hand) I chose the adventurous route ;-)
  • First of all dump the current installation to the external disk stack.
  • Swap the disks.
  • Boot off the net (the T1000 doesn't have a DVD drive and I didn't want to try an USB drive)
  • Slice one of the new disks as desired
  • Restore the dump from the external disks
  • Reboot
  • Be done.
Well not quite.
  • Booting fails as I forgot to run installboot on the new disk, so boot net again
  • Install the boot block on the new drive with installboot
  • Reboot
  • Done
Works nicely. Including all copying (roughly 30GB local data), net booting etc the box was running again in less than 2 hours.

What's next?
Create a new boot environment on the second disk. As we are still running S10U4 it has to be UFS again. Right now it is still populating the new BE with data from the first disk. (Yes, we are running live at this point.) Luckily the new disks (SATA vs SAS) are much faster, so this is running faster than expected.
Next thing will be the update to S10U6 followed be reboot into the new BE running S10U6. That gives us ZFS root. Once this is done and working I'll delete the first BE and create a new boot environment on a ZFS root pool. And one last reboot will bring us to where we want to be. Mirror root pool with much easier upgrade procedures next time (and just a single reboot needed).

Update
The upgrade to S10U6 took a bit over 2 hours. No problems here. Try to boot the new BE.
With the shutdown running I knew there was something missing.
Exactly.
The luactivate. Things like this happen when you drive home (90min commute) to finish this from home. Oh well!
Anyway, activated and booted the new BE.
Zpool created (remember it has to be a slice in order to be bootable! - Yes I did read the man page on that point ;-))
So now we are copying the S10U6 UFS BE to the final destination on a zpool.

Update 2
Everything made it to the new BE on the zpool. It boots. This was work for today then.

Merry Christmas everyone!

Wednesday, December 17, 2008

More support fun

Update on the Vaio Support story. 2 days after logging two further calls (both regarding LCD panel brightness) an answer two both of them.
1. How to dim the panel with no OS loaded?
-> We do not support that.

2. Why isn't the panel brightness persistent across reboots (even with vista)?
-> Have you tried the latest update for your graphics card?

When trying to answer via the support web site it hit me twice now that I was typing for too long and got logged out. Of course back in the browser didn't work and I had to type again...

Sony function keys and OpenSolaris

The sound vol up/down/mute buttons on the Vaio nearly worked out of the box, all I had to do was to map them in the Gnome Keyboard Shortcuts preferences.
Running
# dtrace -n '::KeyboardConvertScan:entry {printf("%x", arg1)}'
I found the keycodes for some other keys (Play/Pause, Stop, Next, Prev).
Funny that the Keyboard Shortcuts preferences dialog didn't see the keycodes when I tried to map them directly. So I had a look at acerkb from frkit which I had been using for ages on my Acer Ferrari. Seems like I was lucky that acerkb mapped the keycodes for the sound control already and it therefore just worked. So I replaced the keycodes from the Ferrari with the ones from the Vaio. And voila I was able to map them to the according functions in Gnome.

I wonder how I can find out which keycode sequences the keys generate that I couldn't catch with above dtrace command. There are 4 more Sony keys (S1, S2, AV mode, Eject) that I couldn't grab. Also the keys for LCD brightness, suspend and internal/external display didn't generate a key code. So there is more research needed.

How much support to expect

So after playing around with the Vaio and logging a service call about the numlock issue I found that no matter what I did the notebook would only charge the battery to 80%. Since I had ordered a high capacity battery as well I put that one into the notebook to find the exact same behaviour. Charged to 80% and off. Both Vista an Opensolaris reported the notebook was running on mains, battery connected, charged to 80% neither charging or discharging.
Time for another service call.
By now it was day 4 (in words four) after I logged the call about numlock.
And finally some kind soul from Sony's Vaio support answered to the numlock question. Indeed there is no such option in the BIOS (that much I knew already). There also is no way to turn off numlock at bootup using any other tool (Vaio Control Center may be). No BIOS update available. So here I am stuck with a turned on numlock on every boot and it takes Sony's support 4 days to find that out. Great work!

"Only" two days after logging the call on the battery question Vaio Support reacted and asked me a lot of questions. Yes this is the original power supply and batteries that Sony shipped. Yes my power outlet works just fine (why would the notebook run on mains otherwise?). Yes the power supply gets warm after being plugged in for a while. I tried both batteries as well. The guy then suggested a nice list of things to try (I was waiting for "dance around naked" until the end...) No real solution suggested though as I already had all cables removed and reinserted etc.
Funny I had a look around in the "Vaio Control Center" that comes installed with Vista. There is an option to extend battery life by only charging the battery to 80%. This was of course enabled. Switched off I have fully charged batteries.
And of course tech support didn't come up with the thing to check. But it has been only two days on this call.
Let's see how my other calls go. 2 more open for 2 days now.