[ASUS X101CH and 1015CX] the hotkey to turn on/off the display is not working

Bug #1000146 reported by AceLan Kao on 2012-05-16
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
AceLan Kao
Precise
Undecided
Unassigned
Quantal
Medium
AceLan Kao

Bug Description

The function key Fn+F7 to turn on/off the display on ASUS X101CH and ASUS 1015CX module is not working.

AceLan Kao (acelankao) wrote :
Changed in linux (Ubuntu):
assignee: nobody → AceLan Kao (acelankao)
AceLan Kao (acelankao) wrote :

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1000146

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
importance: Undecided → Medium
AceLan Kao (acelankao) on 2012-05-17
tags: added: blocks-hwcert-enablement
AceLan Kao (acelankao) on 2012-05-17
Changed in linux (Ubuntu):
status: Incomplete → In Progress
AceLan Kao (acelankao) wrote :

Patch was submitted, but still under evaluation.
This is not a good way to have a long list for this kind of machines,
it would be better if we can detect it through ACPI video_detect.

tags: added: patch
Gary M (garym) wrote :

Bug 853318 looks similar, reported EeePC models are 1015PX, 1005P, 1001HA (which has 1005HA mbd).

AceLan Kao (acelankao) wrote :

Gary,

Yes, it should be the same issue as this one.
I'm very happy that I can collect the info from those h/w.
Please upload the output of the command 'dmidecode' here, thanks.

Gary M (garym) wrote :

As requested, attached decoded DMI for ASUS EeePC 1001HA.

tags: added: oneiric precise
tags: added: kernel-hotkey
AceLan Kao (acelankao) wrote :

Just a quick update, the patch is accepted by the asus-wmi driver maintainer,
but not shown in the platform-drivers-x86 tree yet.

After this patch could be found in the platform-driver-x86 tree, I'll add more other machines into the quirk.

AceLan Kao (acelankao) wrote :

Gary, the patch is accepted by upstream.
So, I added your machine to the list, if you have time please test the new kernel I built.
Thanks.
http://people.canonical.com/~acelan/bugs/lp1000146/

Changed in linux (Ubuntu):
status: In Progress → Incomplete
Gary M (garym) wrote :

@AceLan, thanks. Will you be uploading a 32-bit test kernel? amd64 is not compatible with the 1001HA laptop using an Intel Atom N270 CPU.

AceLan Kao (acelankao) wrote :

Gary, the i386 kernel is uploaded.

Gary M (garym) wrote :

Patched kernel downloaded, installed & booted okay, but Fn-F7 still does nothing.

xxx:~$ uname -a
Linux xxx 3.2.0-29-generic #46 SMP Wed Aug 1 05:44:53 UTC 2012 i686 i686 i386 GNU/Linux

Changed in linux (Ubuntu):
status: Incomplete → In Progress
AceLan Kao (acelankao) wrote :

Gary, could you add one line in the file /etc/modprobe.d/blacklist.conf
   blacklist video
to see if the hotkey works

Gary M (garym) wrote :

@AceLan, after blacklisting video, Fn-F7 still does nothing with your patched kernel, but with the older lowlatency kernel I now get this message in the log: "keyboard: can't emulate rawmode for keycode 244".

AceLan Kao (acelankao) wrote :

Gary, the problem you have is not the same as mine.
And the keycode 244 means KEY_BRIGHTNESS_ZERO
In my patch, I change the key to KEY_DISPLAYTOGGLE

Please redo the command in comment #13 and then see what you have in /sys/class/backlight
Be sure that video module should not be listed by command "lsmod"
You might see an eeepc* entry in the /sys/class/backlight, you can try to echo value to bl_power to see if it works
   sudo sh "echo 1 > bl_power" ; sleep 3 ; sudo sh "echo 0 > bl_power"
It will turn off the sccren and turn it on after 3 seconds.

Gary M (garym) wrote :

keycode 244 was with the older kernel.
I converted your test line to a script, and it did turn the screen black then it switched back to normal ok.

Gary M (garym) wrote :

& btw the video module was listed in the lsmod output (as a dependency of i915) despite being blacklisted.

AceLan Kao (acelankao) wrote :

Gary, so you did the test in the "/sys/class/backlight/acpi_video0/" directory?
If that's the case, that means the acpi driver works for you, you don't need any patch for the kernel.

Did you add any parameter to the kernel command line?
"cat /proc/cmdline" and paste the result.
Just use the kernel you like.

Gary M (garym) wrote :

The test was done as per your instructions, in the /sys/class/backlight/eeepc-wmi directory. This eeepc-wmi subdirectory exists with your patched kernel, but is not there with the older kernel. The test fails in the acpi_video0 and intel_backlight subdirectories, with both kernels.

There are no additional kernel parameters specified, here is the current boot line:

XXX@XXX:~$ cat /proc/cmdline
BOOT_IMAGE=/@/boot/vmlinuz-3.2.0-29-generic root=UUID=XXX ro rootflags=subvol=@

The video module is no longer blacklisted.

AceLan Kao (acelankao) wrote :

Gary, then, everything looks good.
The quirk for your machine is matched, so that you have /sys/class/backlight/eeepc-wmi directory.
And the functions provided by eeepc-wmi are working, so that you can turn on/off your screen by bl_blank.

I need more info to know the problem you have.
1. Does it report any keyevents if using "sudo showkey" and press the display toggle key
2. Which message in the dmesg "Disabling ACPI video driver" or "Backlight controlled by ACPI video driver"
3. Do you have "/sys/class/backlight/acpi_video0/" in your system when using the patched kernel I gave you.
Thanks.

AceLan Kao (acelankao) wrote :

Please use the kernel I gave you to do the test.

Gary M (garym) wrote :

@AceLan, Test results from comment 21 using your patched kernel:

1. sudo showkey
keycode 431 press
keycode 431 release

2. Which message?
Neither. I'm attaching the output of dmesg|grep ACPI .

3. acpi_video0
Yes, acpi_video0 is still present with your patched kernel (see comment 20).

AceLan Kao (acelankao) wrote :

Gary, thanks very much.
The asus-wmi driver maintainer did some modification on my patch
and we didn't imagine that will lead to the problem you have.

I totally know the situation and will try to figure out a feasible solution for it.

The problem is that in your system, there are eeepc-wmi and acpi_video0 directories in the /sys/class/backlight
and while pressing the hotkey, the gnome-settings-daemon will try to turn on/off the screen through /sys/class/backlight.
And in the gnome-settings-daemon, the one it chose to operate is acpi_video0 which is not working.

AceLan Kao (acelankao) wrote :

Gary, there is one more test need your help.

Could you use the patched kernel and add one file in the /etc/modprobe.d
%cat /etc/modprobe.d/asus-wmi.conf
install video modprobe asus-wmi; modprobe --ignore-install video;

And then reboot and try to see if the hotkey works.
Many thanks.

AceLan Kao (acelankao) wrote :

BTW, could you also list the directories in /sys/class/backlight after adding that files and reboot?
Thanks.

Gary M (garym) wrote :

@AceLan, there was no apparent change after adding the file and rebooting :

XXX@XXX:~$ uname -a
Linux studioB-1001HA 3.2.0-29-generic #46 SMP Wed Aug 1 05:44:53 UTC 2012 i686 i686 i386 GNU/Linux
XXX@XXX:~$ cat /proc/cmdline
BOOT_IMAGE=/@/boot/vmlinuz-3.2.0-29-generic root=UUID=XXX ro rootflags=subvol=@
XXX@XXX:~$ cat /etc/modprobe.d/asus-wmi.conf
install video modprobe asus-wmi; modprobe --ignore-install video;

XXX@XXX:~$ ls -l /sys/class/backlight/
total 0
lrwxrwxrwx 1 root root 0 Aug 8 15:44 acpi_video0 -> ../../devices/pci0000:00/0000:00:02.0/backlight/acpi_video0
lrwxrwxrwx 1 root root 0 Aug 8 15:46 eeepc-wmi -> ../../devices/platform/eeepc-wmi/backlight/eeepc-wmi
lrwxrwxrwx 1 root root 0 Aug 8 15:46 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight
XXX@XXX:~$ sudo showkey
...
keycode 431 press
keycode 431 release

XXX@XXX:~$

AceLan Kao (acelankao) wrote :

The contain of the file should be as below. :p
%cat /etc/modprobe.d/asus-wmi.conf
install video modprobe eeepc-wmi; modprobe --ignore-install video;

It will load eeepc-wmi before video, and it will prevent video to create acpi_video0 directory.

Gary M (garym) wrote :

Yes, that change prevents acpi_video0 from being created. But Fn-F7 still fails.

AceLan Kao (acelankao) wrote :

Gary, too bad, that looks like another bug in gnome-settings-daemon.
We already make sure that we can turn on/off the display through bl_blank in /sys/class/backlight/eeepc-wmi
So, everything in kernel are all set.
I just check the gnome-settings-daemon code and fount in plugins/media-keys/gsd-media-keys-manager.c +2126

        case KEYBOARD_BRIGHTNESS_UP_KEY:
        case KEYBOARD_BRIGHTNESS_DOWN_KEY:
        case KEYBOARD_BRIGHTNESS_TOGGLE_KEY:
                do_keyboard_brightness_action (manager, type);
                break;

And in do_keyboard_brightness_action(), it will call
        g_dbus_proxy_call (manager->priv->power_keyboard_proxy,
                           type == KEYBOARD_BRIGHTNESS_UP_KEY ? "StepUp" : "StepDown",
                           NULL,
                           G_DBUS_CALL_FLAGS_NONE,
                           -1,
                           NULL,
                           update_keyboard_cb,
                           manager);

You can easily find that, the brightness toggle type is gone. So that gnome-settings-daemon will do nothing while receiving the keyevent 431(which is KEY_DISPLAYTOGGLE).
I'll file a bug on bugzilla and link back to this bug tomorrow.

Thanks for your help.

AceLan Kao (acelankao) wrote :

After digging this issue more, I found that it's not only gnome-settings-daemon's
(nor xfce-power-manager's) problem, but X key mapping's problem.
There is no display toggle key defined in X, so X can receive the key 0x1af
which is defined in kernel
#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */

That means all the applications based on X can get that keyevent.
I'm actually a kernel engineer, so I need to find other guys to get involve this issue.
And as far as I can see, this is not the easy one and take time to drive.

AceLan Kao (acelankao) wrote :

This issue might not be able to be solved in the near future, so I build a dkms package for you temporarily.

AceLan Kao (acelankao) wrote :

This issue in the kernel part could be fix by the following 2 commits, and they are in linux 3.6
I'll submit the ubuntu SRU later, but we still need the g-s-d patch in comment #32 to be merged.

commit 689db7843d503fae0eb46cb849e4caab35588170
Author: Corentin Chary <email address hidden>
Date: Mon Aug 20 23:01:50 2012 +0200

    drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEO

    Signed-off-by: Corentin Chary <email address hidden>
    Signed-off-by: Matthew Garrett <email address hidden>

commit 272c77d55672ef92eda9d5e24a5a7ac62df9c431
Author: AceLan Kao <email address hidden>
Date: Wed Jun 13 09:32:06 2012 +0200

    asus-wmi: control backlight power through WMI, not ACPI

    BugLink: https://bugs.launchpad.net/bugs/1000146

    Some h/w that can adjust screen brightness through ACPI functions, but
    can't turn on/off the backlight power correctly. So, we list those h/w in
    quirks and try to turn on/off the backlight power through WMI.
    Signed-off-by: AceLan Kao <email address hidden>
    Signed-off-by: Corentin Chary <email address hidden>
    Signed-off-by: Matthew Garrett <email address hidden>

The attachment "0001-asus-wmi-control-backlight-power-through-WMI-not-ACP.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

AceLan Kao (acelankao) on 2013-04-01
Changed in linux (Ubuntu Quantal):
status: In Progress → Triaged
AceLan Kao (acelankao) on 2013-04-01
Changed in linux (Ubuntu):
status: In Progress → Triaged
Launchpad Janitor (janitor) wrote :

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

Changed in linux (Ubuntu Precise):
status: New → Confirmed
Changed in linux-lowlatency (Ubuntu Precise):
status: New → Confirmed
Changed in linux-lowlatency (Ubuntu Quantal):
status: New → Confirmed
Changed in linux-lowlatency (Ubuntu):
status: New → Confirmed

AceLan Kao, given the kernel fixes are now merged into Trusty, would it be best to close the linux (Ubuntu) tasks, and open an xorg (Ubuntu) task for the remaining issue of generating an x even for toggling the display as noted in https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1000146/comments/31 ?

no longer affects: linux-lowlatency (Ubuntu)
no longer affects: linux-lowlatency (Ubuntu Precise)
no longer affects: linux-lowlatency (Ubuntu Quantal)
AceLan Kao (acelankao) wrote :

The kernel patch is in 3.6 kernel, so it's already in raring kernel.
And I also see the patch for gnome-setting-daemons is in GNOME_SETTINGS_DAEMON_3_5_92~1
So, I think we can close this issue now.
Please feel free to re-open it, if this is still a issue.

Changed in linux (Ubuntu):
status: Triaged → Fix Released
Changed in linux (Ubuntu Precise):
status: Confirmed → Won't Fix
Changed in linux (Ubuntu Quantal):
status: Triaged → Won't Fix
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu laptop testing tracker.

A list of all reports related to this bug can be found here:
http://laptop.qa.ubuntu.com/qatracker/reports/bugs/1000146

tags: added: laptop-testing
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers