Argh! Another problem! Over the last couple of days I’ve being trying to figure out why the brightness fn-keys on my laptop don’t seem to work: they either set the brightness to maximum-bright or maximum-dim. (Although they inexplicably sometimes work.) At first I thought it was a problem with my earlier HAL hackery, but this isn’t the case as the HAL brightness scripts work fine when not using the fn-keys.
After a while I discovered the problem was that some of the fn-keys weren’t sending key release events (easy to see in xev
or with lshal -m
). Turns out this is a problem with lots of laptop keyboards: look at the thousands of lines of hacks in drivers/input/keyboard/atkbd.c
in the Linux kernel source. The good news is that this is easy to fix: the Q320 uses exactly the same scancodes as an earlier Samsung laptop. The bad news is that you have to compile your own kernel. Ho hum.
Apply this patch to a 2.6.30 kernel and rebuild. Voila! And the problem is gone!
--- drivers/input/keyboard/atkbd.c.old 2009-07-13 00:34:14.000000000 +0100 +++ drivers/input/keyboard/atkbd.c 2009-07-13 00:35:19.000000000 +0100 @@ -1550,6 +1550,15 @@ .driver_data = atkbd_samsung_forced_release_keys, }, { + .ident = "Samsung Q320/P320", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), + DMI_MATCH(DMI_PRODUCT_NAME, "Q320/P320"), + }, + .callback = atkbd_setup_forced_release, + .driver_data = atkbd_samsung_forced_release_keys, + }, + { .ident = "Samsung SQ45S70S", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
I found the DMI_PRODUCT_NAME
using dmidecode
if you were wondering.
Will test it for a few days and if nothing is borked maybe I shall try to get it merged into the kernel. It would certainly be annoying to have to compile my own kernel for every release.
Hi Nick!
Thanks for the great work but unfortunately I’m not able to use your patch and recompile the kernel. (I have read a lot of HowTo but my “results” are miserable to say the least).
Would you be so kind to post a “guide” a little bit more elementary for clumsy people like me who own the Samsung Q320, please?
PS
I read you’re relocating and so on and so forth and therefore quite busy but (please) I’m in such dire straits as I had to go back to microsof… blah.. so sad! :)
Sorry for being so outspoken (nasty) and good luck for your new job and life by the way!!
Cheers
Matt
September 14, 2009 @ 2:08 pm
Hi Matt,
It’s difficult to give more in-depth instructions because building a kernel is very distro-specific. It basically boils down to following your distro’s instructions to acquire the source code, cd-ing to the source directory, and running:
patch -p0 < samsung-q320-atkbd.patch And then following the distro's instructions to actually build and install the kernel. Unfortunately, this patch will probably only work with the exact kernel version I wrote it for (2.6.30). If you don't already feel comfortable building a custom kernel, I wouldn't advise trying to build one with this patch. However, having fn-key support is not absolutely vital: you can still change the brightness manually with the "nvclock" command (on Debian/Ubuntu this is in a package called "nvclock"). So, for example, to set the brightness to 50% you can exectute: nvclock -S 50 In fact, even with this fn-key patch, the brightness keys still will not work correctly because HAL cannot set the brightness on nvidia graphics cards (you have to hack it to use nvclock, see my earlier post). This is all a bit irritating, and it would be nicer if everything worked out of the box: unfortunately Nvidia/Samsung don't seem to want to stick to standards... Hope some of this helps!
September 18, 2009 @ 10:25 pm
Hi,
Did you have a problem with your DVD drive?
I’m using Chakra linux (liveCD based on Arch). I put a CD in it but nothing happened.
mount doesn’t show any /mnt/cdrom or something else, and Fn+inser doesn’t eject the cd!
November 14, 2009 @ 11:18 am
I haven’t had this problem. A couple of things you could try:
1) Check under /media rather than /mnt as this is where most modern Linux distros mount their CDs
2) Check the output of `dmesg’ and see if the kernel detects the CD.
Otherwise, I’m not sure what to suggest – I haven’t had any problems with the CD drive yet.
November 14, 2009 @ 6:03 pm
Thx for your answer,
In fact, cd drive was not in fstab. So now, cd can be mounted in /media/cd. The last problem is that KDE4.3.3 doesn’t mounted it automatically. But it’s better.
Did you manage to eject a cd with Fn+Inser?
November 14, 2009 @ 6:23 pm
> Did you manage to eject a cd with Fn+Inser?
Yes, this works for me in Debian (testing) and in Arch Linux when I was
using it briefly.
Does using the “eject” command work?
November 14, 2009 @ 9:27 pm