Keyboard backlight does not work in Samsung Series 9 NP900X4C

Bug #1203592 reported by mmalmeida
164
This bug affects 31 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

In Ubuntu 13.04, the keyboard backlight does not work in Samsung Series 9 NP900X4C.

Adding the FN key mappings as described in https://help.ubuntu.com/community/SamsungSeries9 does show information in the notification area when pressing the keyboard backlight's + and - buttons, but:

1) The notification always identifies the backlight as "full max"
2) It has no effect on the backlight - it's always off

When I first installed Ubuntu on this machine (12.10), even though the fn keys never worked I did have intermitent backlight functionality - the light sensor would sometimes work and I'd see light in the keyboard.

I dual boot in Windows 8 and backlighting works there, so this is not a hardware issue.

More discussion can be found here: http://askubuntu.com/questions/233312/how-to-make-keyboard-backlight-fn-buttons-work-in-samsung-series-9

Tags: samsung udev
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udev (Ubuntu):
status: New → Confirmed
Revision history for this message
karlingen (karlo-m) wrote :

I'm too having this problem.

Revision history for this message
Alix Axel (alix-axel) wrote :

Same problem here (New Series 9 - 900X4C).

tags: added: samsung
tags: added: udev
removed: samsung
tags: added: samsung
Revision history for this message
Alix Axel (alix-axel) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Can you please follow /usr/share/doc/udev/README.keymap.txt to check with the "keymap" tool if the key generates the correct key code? if not, please give me the scan code, so that we can fix it in the keymaps.

Thanks!

Changed in udev (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Richard Andreu (randreu) wrote :

It seems that key codes are fine. This is what I get from 'keymap':

scan code: 0x97 key code: kbdillumdown
scan code: 0x96 key code: kbdillumup

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks, so the keymaps are fine. Moving to gnome-settings-daemon, it's the power plugin's responsibility to control backlight.

affects: udev (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
status: Incomplete → New
Revision history for this message
mmalmeida (mmalmeida) wrote :

Same result here:

fn+light down = scan code: 0x97 key code: kbdillumdown
fn +light uo = scan code: 0x96 key code: kbdillumup

Revision history for this message
mmalmeida (mmalmeida) wrote :

Any news regarding this, or any help needed?

There is also a discussion regarding this at http://askubuntu.com/questions/233312/how-to-make-keyboard-backlight-fn-buttons-work-in-samsung-series-9

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Haw Loeung (hloeung)
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Medium
Revision history for this message
netfox (netfox-co) wrote :

Hi,

I tried showkey --scancodes but there isn't any scancodes associated with fn+f9 and fn+f10.

Regards

Revision history for this message
mmalmeida (mmalmeida) wrote :

From the discussion in https://bugs.launchpad.net/ubuntu/+source/linux/+bug/971061/comments/130 a few worhtwile considerations:

- It is said that this is caused by "UEFI bug though, since Samsung's special hardware features are disabled in UEFI mode."
- It therefore only affects Samsung models running in UEFI mode (which is required for dual booting)

I'm trying to track down the UEFI problem. Any relevant information on the status of that is appreciated!

Revision history for this message
Marc Segond (gnumarco) wrote :

Same problem here. From what I could read it is indeed that the special hardware stuff are turned off my default in the kernel when it detects that the system is running in UEFI mode.
This has been done because of a bug in the UEFI firmware from Samsung that could brick the whole laptop.
Though, now there have been firmware updates and the bug is corrected, so I don't see why it is not possible to enable again these special features...
Anyone has a clue?

Revision history for this message
Aisthesis (aisthesis) wrote :

I was just screwing around with this and found out something interesting.

In /etc/modprobe.d/samsung-backlight.conf you'll likely see;

blacklist samsung-laptop
options samsung-backlight use_sabi=0 levels=8 force=1

Remove the blacklist and keyboard backlight controls will work and org.freedesktop.UPower.KbdBacklight exists allowing you to control the keyboard brightness.

But the screen backlight stops working...

Add the blacklist back, screen brightness works again, keyboard brightness does not, and org.freedesktop.UPower.KbdBacklight does not exist.

I don't really have any more time to play around but thought I would share.

Revision history for this message
Sérgio Faria (sergio91pt) wrote :

To complement what aisthesis said, now, in Ubuntu 14.04, the kb backlight works.
It gets "triggered" only via the luminosity sensor, not the fn keys.

I don't recommend removing that blacklist, as its known to brick the laptop in UEFI mode (atleast in old BIOS versions).

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

If you are using UEFI, do not remove the blacklist on samsung-laptop!

You are probably safe from the bricking bug with a recent kernel, but there are other UEFI problems with samsung-laptop that have never been resolved, like machine check exceptions.

I did find a way of setting the keyboard backlight without the samsung-laptop module, but I am still working on it.

The ACPI DSDT defines a variable KBLL (keyboard back-light level?) in the SNVS (system non-volatile storage). This is where the the backlight level can be stored, but it is highly non-trivial to set. I wrote a program for my own machine, but it has hard-coded memory addresses which probably make it very unwise to run on other systems.

A slightly safer way, which requires a reboot to work, is to set the keyboard backlight level in the UEFI variables.

On my system:

# cd /sys/firmware/efi/efivars
# ls *KeyboardBacklight*
SecKeyboardBacklightLevel-2f440835-38c4-44b6-b7e4-4f321c8b4189
# xxd -p SecKeyboardBacklightLevel-2f440835-38c4-44b6-b7e4-4f321c8b4189
0700000001
# echo 0700000005 | xxd -p -r > SecKeyboardBacklightLevel-2f440835-38c4-44b6-b7e4-4f321c8b4189
# reboot

You can change that last byte from 00 through 06 or so. Don't change the first or other bytes. At some stage during the next boot, it will be read into the KBLL value mentioned above.

I use '01' pretty well permanently. Now that recent kernels detect the ambient light properly, it comes on automatically when I need it.

Revision history for this message
m.hesselink (m-hesselink) wrote :

I can confirm the solution of Kieran Clancy works on my samsung np900x4c with ubuntu 14.04 LTS

Revision history for this message
Francisco Reverbel (reverbel) wrote :

Keyboard backlight does not work in my Samsung NP900X4B as well. I am running Ubuntu 14.04 LTS with UEFI disabled.

The strange thing is that I had it working on my first installation of Ubuntu on this notebook. I was running Ubuntu 12.04 at that time. Later on, when I upgraded Ubuntu to 13.04, keyboard backlight ceased to work.

It appears that Kieran Clancy's solution is specific to UEFI mode. Would it be possible to do something similar with UEFI disabled?

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

If you have UEFI disabled, the keyboard backlight control should work automatically through the samsung-laptop kernel module.

Revision history for this message
herbaman (fat-b) wrote :

I also confirm that Kieran Clancy's solution works on Samsung NP900X4C, Ubuntu 14.04.
Thanks a lot man, this really was annoying me.

Revision history for this message
stblack (stblack-linux) wrote :

I'd like to try Kieran Clancy's solution, but I don't know if it0ll be working also on NP770Z5C notebook (I set UEFI and CMS OS BIOS Option)
How could I help ?
Thanks.

Revision history for this message
Renato Severiano (renatose) wrote :

I'm on a NP700Z5C using LMDE/Debian testing. Keyboard backlight works in auto mode, and its Fn+F9, Fn+F10 keys do nothing. It would fine for me if it were possible to at least turn it off or auto. For example: when watching a film in a dark room it is not possible to turn off those lights off. Also having the wifi key working would be very good.

I there anyway I can help?

Revision history for this message
Eric Polin (eric-polin) wrote :

No luck here w/ Kieran Clancy's solution on a 940X.
Well, there was no *eyboard* file in the directory anyway...

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :

Same here with a 900X3G, Kieran Clancy's solution doesn't work because there is no *KeyboardBacklight* file.

Revision history for this message
mmalmeida (mmalmeida) wrote :

I don't know if this has been mentioned before, but bug https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1283589 -
[Samsung NP530U3C-A01] LID close, AC, and battery status events not produced anymore - seems to have some influence over this.

While the FN buttons do not work for keyboard backlight, the automatic sensor seems to be working. However, because of the issue described in the other bug, once the "event buffer" is full, the keyboard backlight sensor will not work anymore.

This means that while solving the other bug doesn't produce working FN keys, it at least makes the keyboard backlight work again.

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

For those without KeyboardBacklight UEFI variables, can you attach a list of the UEFI variables you do have, as well as attach a dump of your DSDT:

sudo cat /sys/firmware/acpi/tables/DSDT > DSDT.aml

If you are not using UEFI (e.g. you have no /sys/firmware/efi directory) then none of this will help you. Most likely you just need to fix your key bindings.

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :
Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :
Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

Simon,

It looks like your UEFI variable has a different name:

KBDBacklitLvl-8be4df61-93ca-11d2-aa0d-00e098032b8c

Please do xxd on this and see if it looks similar to my SecKeyboardBacklightLevel variable.

Thanks for your DSDT. It looks like your machine doesn't have a KBLL variable... the closest thing I could find was a KBCL variable, but I have no idea if it does the same thing.

I have uploaded a program to probe the memory at this region, designed for your DSDT, at:

https://github.com/kieranclancy/probe-dsdt-regions/tree/900x3g

(Note to others, do NOT run this program, it is just for Simon's DSDT and could break your system. If you want a version of this program for your machine's DSDT, please ask me.)

If you have time, can you please:

1. Compile this program from the 900x3g branch
2. Reboot to get a relatively clean variable state
3. Save the output of 'sudo ./probe'
4. Dump the KBDBacklitLvl UEFI variable with xxd and save this too.
5. Modify the KBDBacklitLvl variable slightly (e.g. from 00 00 00 07 to 00 00 00 06)
6. Reboot to reload variables
7. Save the output of 'sudo ./probe' to a new file

This will tell me whether your KBCL variable is the important one, or if the variable has another name.

At some point I would like to handle these KBLL/KBCL variables in the kernel, and this information from your machine can help me to write a safe kernel module to do this.

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :

Kieran,

thanks for the help.
./probe alwyas returns just
probe: Bad field: OSYS, 16 (0 bits)

The KBDBacklitLvl* variable seems to be right:
xxd -p KBDBacklitLvl-8be4df61-93ca-11d2-aa0d-00e098032b8c
0700000001
Writing 0700000005 makes the keyboard backlight bright on next reboot.

Btw: The FN-Key for keyboard brightness shows the statusbar on the desktop, it just doesn't change.

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

Simon,

Sorry about that - there was a syntax problem in regions.c

I've just updated it so it should work properly now, if you are happy to test it again.

The keyboard shortcut is currently set up to connect to the samsung laptop kernel driver, but since the module is disabled on UEFI, the shortcuts don't do anything. That's why I want to write a UEFI-safe module for this.

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :

Kieran,
now it works, before there was 0700000001, I wrote 0700000005 for the second probe (did the reboot i n between as well).

BR, Simon

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

Thanks Simon,

Looks like the KBCL variable is indeed the right one. Strange that it changed from 01 to 04 rather than 01 to 05 though... If you have time for a few more tests, I would love to know what values it takes when the UEFI variable is modified from 00 through 07.

Currently we have:

UEFI KBCL
  00
  01 01
  02
  03
  04
  05 04
  06
  07

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :

Here you are, the 04 was correct, I verified once again.
UEFI KBCL
  00 00
  01 01
  02 02
  03 03
  04 04
  05 04
  06 04
  07 04

Revision history for this message
Kieran Clancy (clancy-kieran+launchpad) wrote :

Great work, thanks Simon.

I presume that there is no noticeable difference in brightness between 04 and 07 then?

Revision history for this message
Simon N. (simon-ubuntu-sngs) wrote :

Thanks for looking into this!
You're right, I don't see a difference between 04 and 07.

Revision history for this message
stblack (stblack-linux) wrote :

So do your think a fix that could be possible ? Is it available a kind of package that fix keyboard backlit ?
Is it's useful I can post my DSDT and efivars like Simon, my KBDBacklitLvl is :

xxd -p /sys/firmware/efi/efivars/KBDBacklitLvl-8be4df61-93ca-11d2-aa0d-00e098032b8c
0700000004

I have a NP770Z5C.

Revision history for this message
Francisco Reverbel (reverbel) wrote :

I have Ubuntu 14.04 on two Samsung notebooks: a Series 9, model NP900X4B-A02US ,and an ATIV Book 9 2014 Edition, model NP940X5J-K02US.

In the NP940X5J, Ubuntu is running with UEFI enabled. I confirm that Kieran Clancy's solution works on that notebook.

In the NP900X4B, Ubuntu is running with UEFI disabled, but the keyboard backlight function keys do not work due to a key binding issue. In order to make them work, I had to run the following commands (which I placed in a init script):

sudo setkeycodes e017 229
sudo setkeycodes e016 230

The key binding problem appears to be a bug. It happens with plain Ubuntu 14.04, even when booted from an USB stick with the dowloaded distro.

Revision history for this message
en23 (en3ster) wrote :

SImon N.
How do I write the hex value with xdd?

Revision history for this message
mmmatjaz (mmmatjaz) wrote :

Kieran's solution doesn't work for me on Xubuntu 15.10 (900X3E). I can edit the values with
xxd -p /sys/firmware/efi/efivars/KBDBacklitLvl-8be4df61-93ca-11d2-aa0d-00e098032b8c

but they have no effect. Any ideas what else to try?

Revision history for this message
mmmatjaz (mmmatjaz) wrote :

... on my old 14.04 installation the backlit was always on, using CMS and EFI off. I switched to EFI because of a CMS-related issue causing kernel panics

Revision history for this message
mmmatjaz (mmmatjaz) wrote :

OK never mind, works after the second reboot. I'd like to have a solution that doesnt require reboot tho

Revision history for this message
Queeq (i-queeq) wrote :

Kieran's solution doesn't work for Samsung NP940X3L. I tried to set it for the following value:
xxd -p /sys/firmware/efi/efivars/KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
0700000005

Backlight goes on briefly during early boot stages but then shuts off.

Revision history for this message
Queeq (i-queeq) wrote :

Sorry, forgot to mention that I'm on Linux Mint 17.3 (Ubuntu 14.04-based), kernel 4.5 generic, firmware 1.155.

Revision history for this message
badis (badoubadidou) wrote :

i have the solution contact me in my facebook https://www.facebook.com/badiis1916

Revision history for this message
ThOR27 (thor27-gmail) wrote :

Hi,

Thanks for the tips here, I managed to get keyboard backlight working on Kubuntu 17.04 with my NP900X3J - Samsung Style S50 (the key to change it still doesnt works, and requires a reboot). I have to adapt what Kieran said, what I did was:

# cd /sys/firmware/efi/efivars
# xxd -p KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
0700000004
# lsattr KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
----i-------------- KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
# chattr -i KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
# lsattr KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
------------------- KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
# echo 0700000004 | xxd -p -r > KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
# xxd -p KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
0700000004
# chattr +i KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
# xxd -p KBDBacklitLvl-5af56f53-985c-47d5-920c-f1c531d06852
0700000004
# sudo reboot

And it started to work with ambient light sensor. thanks!

Revision history for this message
o (overtorment) wrote :

Thank you Kieran Clancy, thank you ThOR27. Model Samsung SNP900X5T-X01US. Can confirm that keyboard backlight now works with ambient light sensor. Elementary OS Juno (Built on Ubuntu 18.04 LTS)

Revision history for this message
o (overtorment) wrote :

Got an issue tho. Either after suspend (or really long work session, not sure), efivars get reset to zero, and I have to repeat whole procedure again (including reboot)

Revision history for this message
Queeq (i-queeq) wrote : Re: [Bug 1203592] Re: Keyboard backlight does not work in Samsung Series 9 NP900X4C

For years I've been using a dirty Python script that listens on DBus for
keyboard backlight events and then keeps pushing the last heard value
through DBus every several seconds. Works fine most of the time, but
something turns off the backlight after a day or two of uptime (varies).
Mere turn back on makes it work again. I can share it if anyone is
interested.

вт, 25 дек. 2018 г. в 14:44, o <email address hidden>:

> Got an issue tho. Either after suspend (or really long work session, not
> sure), efivars get reset to zero, and I have to repeat whole procedure
> again (including reboot)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1203592
>
> Title:
> Keyboard backlight does not work in Samsung Series 9 NP900X4C
>
> Status in gnome-settings-daemon package in Ubuntu:
> Confirmed
>
> Bug description:
> In Ubuntu 13.04, the keyboard backlight does not work in Samsung
> Series 9 NP900X4C.
>
> Adding the FN key mappings as described in
> https://help.ubuntu.com/community/SamsungSeries9 does show information
> in the notification area when pressing the keyboard backlight's + and
> - buttons, but:
>
> 1) The notification always identifies the backlight as "full max"
> 2) It has no effect on the backlight - it's always off
>
> When I first installed Ubuntu on this machine (12.10), even though the
> fn keys never worked I did have intermitent backlight functionality -
> the light sensor would sometimes work and I'd see light in the
> keyboard.
>
> I dual boot in Windows 8 and backlighting works there, so this is not
> a hardware issue.
>
> More discussion can be found here:
> http://askubuntu.com/questions/233312/how-to-make-keyboard-backlight-
> fn-buttons-work-in-samsung-series-9
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1203592/+subscriptions
>

Revision history for this message
Drew R. (drew-rosoff) wrote :

Queeq, yes I'd be interested in that Python script.

Revision history for this message
Queeq (i-queeq) wrote :

Here it is.

Revision history for this message
Eduardo Casteluci (eduardo-casteluci) wrote :

Confirmed that Kieran Clancy's solution (supplemented by ThOR27) works on Samsung NP9005XT notebook. Thank you.

Revision history for this message
Eduardo Casteluci (eduardo-casteluci) wrote :

Recently, I noticed that, from time to time, efivars values are automatically restored to default thus making necessary to redo all the steps in the aforementioned solution. Does anyone know if it is possible to change this behavior? Thank you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.