Acer Aspire 5920G Fn keys not working correctly

Bug #281951 reported by Alkis Georgopoulos
8
Affects Status Importance Assigned to Milestone
hal-info (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: hotkey-setup

Worked fine in hardy, doesn't work in Intrepid beta full updated (2008-12-10).

I boot to recovery mode, just console, so no X involved.
I press Fn+right arrow (= brightness up) and the character "?" is echoed. The brightness does increase, but three times, like I had pressed the key 3 times.
If I do this under X, it's exactly the same, only I see the echoed character as "±".
Fn+left arrow (= brightness down) decreases the brightness 3 times without echoing any character.

Back to plain console, if I switch the keyboard to Greek (=shift+alt), everything works OK!!!
No echoed characters, brightness increasing/decreasing 1 time, normally.
Then when I switch back to English, sometimes it remains fixed, other times it's happening again.

Switching keyboard languages in X doesn't make any difference.

There are other keys misbehaving (like, when I'm back to English in console, backspace may be echoing a diamond character instead of deleting the previous char), but I'd better keep it focused on the brightness keys.

> sudo dmidecode -s system-manufacturer
Acer, inc.
> sudo dmidecode -s system-product-name
Aspire 5920G
> sudo dmidecode -s system-version
Not Applicable

> showkey
# A *single* Fn+Left arrow pressing/releasing:
keycode 224 press
keycode 224 release
keycode 224 press
keycode 224 release
keycode 224 press
keycode 224 release
# A *single* Fn+Right arrow pressing/releasing:
keycode 118 press
keycode 118 release
keycode 225 press
keycode 225 release
keycode 225 press
keycode 225 release

> showkey -s
# A *single* Fn+Left arrow pressing/releasing:
0xe0 0x4c 0xe0 0xcc
0xe0 0x4c 0xe0 0xcc 0xe0 0x4c 0xe0 0xcc
# A ***single*** Fn+Right arrow pressing/releasing:
0xe0 0x4e 0xe0 0xce
0xe0 0x54 0xe0 0xd4 0xe0 0x54 0xe0 0xd4

I probably don't need to include this, because I'm mainly talking about the console, but anyway,
> setxkbmap -print
xkb_keymap {
 xkb_keycodes { include "evdev+aliases(qwerty)" };
 xkb_types { include "complete" };
 xkb_compat { include "complete+ledscroll(group_lock)" };
 xkb_symbols { include "pc+us+gr(extended):2+inet(evdev)+group(alt_shift_toggle)+level3(ralt_switch)" };
 xkb_geometry { include "pc(pc105)" };
};

Kind regards,
Alkis Georgopoulos

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

Confirming the bug remains in final release of II 8.10. I see exactly this behaviour with my 5920G.

Charlie

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

I've created a file named /usr/share/hotkey-setup/acer-aspire-5900.hk (contents below) and added the following lines to /etc/init.d/hotkey-setup so that it gets loaded:
     Aspire\ 59*)
     . /usr/share/hotkey-setup/acer-aspire-5900.hk
     ;;

Result:
1. While booting (e.g. in recovery console) hotkey-setup is not loaded yet, so keys don't work correctly.
2. Later in the boot process, hotkey-setup is called (I've put some debug "echo" instructions to verify this).
3. When gdm is loaded, some other setkeycodes are executed (I don't know who does that, maybe X?) which override hotkey-setup, and keys again don't work properly.
4. When the gnome session is loaded, yet other keycodes, different than those of gdm are loaded (maybe by gnome?) which override all the previous.

So I think that modifying hotkey-setup is not the correct way to solve this problem. Could someone please give us some suggestions on what else to look for?

Should /lib/modules/2.6.27-7-server/kernel/ubuntu/misc/acerhk.ko be loaded? (it's not)
Should I also modify /usr/share/X11/xkb/keycodes/evdev ?

If I manually run "/etc/init.d/hotkey-setup restart" anytime, either on console or on X, keys work fine.

The file /usr/share/hotkey-setup/acer-aspire-5900.hk I've made:

# Tested on Acer Asprire 5920G by http://users.sch.gr/alkisg/
# Output of /usr/share/bug/hotkey-setup:
# manufacturer="Acer, inc."
# name="Aspire 5920G "
# version="Not Applicable"

setkeycodes e00a $KEY_MEDIA # TV
setkeycodes e059 $KEY_BLUETOOTH
setkeycodes e06c $KEY_MAIL
setkeycodes e032 $KEY_WWW
setkeycodes e055 $KEY_WLAN
setkeycodes e025 $KEY_HELP # Fn+F1, Acer shortcut keys help
setkeycodes e026 $KEY_CONFIG # Fn+F2, Acer eSettings for Acer Empowering Technology
setkeycodes e027 $KEY_SETUP # Fn+F3, Acer ePowerManagement for Acer Empowering Technology
setkeycodes e05f $KEY_SLEEP # Fn+F4
setkeycodes e029 $KEY_SWITCHVIDEOMODE # Fn+F5
#setkeycodes $KEY_DISPLAY_OFF # Fn+F6, Backlight off key (hardware, no scan code)
#setkeycodes e071 $KEY_ # Fn+F7, Touchpad on/off (hardware, information only)
setkeycodes e020 $KEY_MUTE # Fn+F8
setkeycodes e074 $KEY_HP # Blue "e" key, Acer Empowering Technology
setkeycodes e012 $KEY_SPORT # Kid icon, Acer Arcade
setkeycodes e022 $KEY_PLAYPAUSE # Fn+Home
setkeycodes e024 $KEY_STOPCD # Fn+PgUp
setkeycodes e010 $KEY_PREVIOUSSONG # Fn+PgDn
setkeycodes e019 $KEY_NEXTSONG # Fn+End
setkeycodes e06f $KEY_BRIGHTNESSDOWN # Fn+<-
setkeycodes e04e $KEY_BRIGHTNESSUP # Fn+->
setkeycodes e033 $KEY_EURO # '€' is hard to do out-of-the-box
setkeycodes e034 $KEY_DOLLAR # '$' is hard to do out-of-the-box
setkeycodes e02e $KEY_VOLUMEDOWN # Turning the volume control right
setkeycodes e030 $KEY_VOLUMEUP # Turning the volume control left

Revision history for this message
Percy Leonhardt (p3y) wrote : Re: [Bug 281951] Re: Acer Aspire 5920G Fn keys not working correctly

Am Mittwoch, den 12.11.2008, 18:10 +0000 schrieb Alkis Georgopoulos:
> So I think that modifying hotkey-setup is not the correct way to solve
> this problem. Could someone please give us some suggestions on what else
> to look for?

Hi,

I found somewhere (don't ask me where, I think it was somewhere in the
release notes or similar) that hotkey-setup is no longer used. It said
that instead HAL is used to map the keycodes and I found the following
file as an appropriate replacement:

/usr/share/hal/fdi/information/10freedesktop/30-keymap-acer.fdi

I made a modification to get rid of the bug that turning off bluetooth
is interpreted as increasing brightness on my 5920G.

I also have the problem described in this bug but have no idea what to
change in the above mentioned file to get this fixed. My personal
assumption was that this bug is caused by a acpi/kernel bug.

Bye, Percy

PS: If you want to get your media keys working, please take a look at
this thread: http://ubuntuforums.org/showthread.php?t=911184&page=4

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Percy, thanks a lot!!!

I just replaced all entries in 30-keymap-acer.fdi with the scancodes from my previous post.
This solved *all* problems in X/gnome/etc, except for the brightness increasing/decreasing two times instead of one, which is an acpi script bug, I had found it in Hardy, I'll find it again.

But in *plain* console (e.g. in recovery console) the brightness key still echoes the "?" ("±") character, I want to try to modify /etc/console-setup/boottime.kmap.gz to see if this can be fixed as well.

So I think this bug should be moved to hal-info,
and hotkey-setup should be completely removed from Ubuntu, it's loading without having any effect anywhere.

Thanks again,
Alkis Georgopoulos

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

hotkey-setup is loaded in Ubuntu, but it doesn't have any effect. I think it should be completely removed. Changing the appropriate files of hal-info fixed the problem under X, but on in plain console.

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

Did anyone make any progress or find a workaround for this?

Cheers
Charlie

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

FokkerCharlie, yeah, I did as Percy suggested and all keys works fine under X.

I'm attaching my /usr/share/hal/fdi/information/10freedesktop/30-keymap-acer.fdi
There should be some more <match key> in there to check specifically for Aspire 5920G, but I didn't have time to look into it.

Remaining issues:
1. Fix the keys under plain console,
2. Make the brightness buttons increase/decrease the brightness only once instead of twice.
3. Use loadkeys to make euro/dollar keys to echo euro/dollar characters.

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

Cool, that .fdi worked well for me. If you find a fix for the € and $ keys, I'd love to know, and the brightness glitch is still vexing me!

Thanks for your work on this.

Charlie

Revision history for this message
Percy Leonhardt (p3y) wrote :

> If you find a fix for the € and $ keys, I'd love to know

By the way, I am using

<append key="input.keymap.data" type="strlist">e033:pageup</append> <!--
Euro symbol -->
<append key="input.keymap.data" type="strlist">e034:pagedown</append>
<!-- Dollar symbol -->

to map both keys to page up and down. I find it rather useful to have
them near the cursor keys and don't use € and $ often.

 Percy

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Here's a fix for the € and $ keys:
echo 'keycode 186 = dollar dollar dollar dollar dollar' | xmodmap -
echo 'keycode 185 = EuroSign EuroSign EuroSign EuroSign EuroSign' | xmodmap -

185 and 186 are the keys "scrollup" and "scrolldown" in which I've mapped the Euro and Dollar keys in my previously attached 30-keymap-acer.fdi.
Put the above commands in a startup script.

So, here it goes:
€$€$€$€$€$€$€$€$€$€$
;-)

I'll post again if I find out how to fix the brightness double increasing / descreasing.

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

Hi Alkis

Thanks for this. Unfortunately, it didn't work for me. I'm not very good with xmodmap and things. I am using your 30-keymap-acer.fdi file, that fixed the hotkeys. Attempting to follow your instructions, I made /etc/rcS.d/S90eurodollar.sh, with the following contents:

#! /bin/sh
echo 'keycode 186 = dollar dollar dollar dollar dollar' | xmodmap -
echo 'keycode 185 = EuroSign EuroSign EuroSign EuroSign EuroSign' | xmodmap -

As per your instructions. Owner=root, 'Allow executing file as a program' checked.

Can you tell me what I've missed? The $ and € keys don't seem to return anything at all, not even in xev.

Thanks for your continued help.

Charlie

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Hi Charie,

I didn't put the script to /etc/rcS.d, I just put it to a session script (menu system > preferences > sessions - if that's what it's called, I got Greek menus and I'm not sure).

Anyway, you may also just run them inside a gnome-terminal while you're logged on, they don't need sudo or restarting X or anything.

OK, let's get to debugging your case.
$ sudo dumpkeycodes | grep e033
It should show
e033 177

$ sudo setkeycodes e073 0
Then press the euro key and look at dmesg
It should say "unknown key e073"

$ sudo setkeycodes e073 177
OK, we put it back to producing "scrollup"

$ xmodmap -pke | grep 185
It should show
keycode 185 = EuroSign EuroSign EuroSign EuroSign EuroSign

If it does show this, and by pressing the euro key at this point you don't see it, I don't know what's wrong.

If it doesn't show this, try
$ echo 'keycode 185 = EuroSign EuroSign EuroSign EuroSign EuroSign' | xmodmap -
and then press the Euro key again.
If you see the Euro sign, it's just a matter of putting the script to a correct place.
If you don't, again, I don't know what's wrong.

I wonder what transformes the 177 kernel key to 185 in xmodmap, though... :)
I hope someone someday will remove (make obsolete) at least 15 of the 20 different daemons that mess up with scancodes/keycodes/actions!!!

Good luck! :)

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

OK, that's all sorted with the new .fdi file EXCEPT for a glitch remaining in the brightness control. A quick thought on it, could you let me know if you are seeing the same thing, and if there are any more clues?

When I adjust brightness, the screen looks like it goes to minimum (if trying to decrease the brightness) or maximum (if trying to increase) momentarily before reverting back to what appears to be the commanded level.

Output from my lappy:

~$ cat /proc/acpi/video/VGA/LCD/brightness
levels: 80 50 10 20 30 40 50 60 70 80 90 100
current: 90

Which all looks perfectly reasonable. Any more thoughts?

Charlie

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

It looks a bit like that a request for an invalid brightness level is getting into the process somewhere, and that's corrected afterwards.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Στις 02-12-2008, ημέρα Τρι, και ώρα 21:07 +0000, ο/η FokkerCharlie έγραψε:
A quick thought on it, could you let me know if you are seeing the
> same thing, and if there are any more clues?
>
> When I adjust brightness, the screen looks like it goes to minimum (if
> trying to decrease the brightness) or maximum (if trying to increase)
> momentarily before reverting back to what appears to be the commanded
> level.

Charlie no, I'm not seeing the same thing.

When I try to increase the brightness, I see it increasing two times, exactly like I pressed "Fn+Right arrow" two times.
I don't see it going to maximum brightness temporarily.

I had fixed this in Hardy, but I don't remember what I did. Something with the acpi scripts...

P.S. I'm attaching a (slightly) improved version of 30-keymap-acer.fdi.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

I've fixed the brightness bug by removing the video module.

I.e. I inserted the following line in /etc/modprobe.d/blacklist and rebooted my laptop:
  blacklist video

This is a trial-and-error workaround, I don't know if it's a good thing to remove this module or not, I just know that it fixes the bug in my laptop.

P.s. you may use the following one-liner:
  while cat /sys/class/backlight/acer-wmi/actual_brightness; do sleep 0.1; done
to see the brightness value, while pressing the brightness keys:
a) Increasing two by two, before removing the module,
b) Increasing one by one, after removing the module

So now I think absolutely everything is working OK with Acer Aspire 5920G, I don't think I have any problem at all.

Charlie, can you send me the forum topic link? I can't find it... :)

Revision history for this message
Percy Leonhardt (p3y) wrote :

> I've fixed the brightness bug by removing the video module.

There seems to be an official fix for the brightness problem:

https://bugs.launchpad.net/bugs/257827

Revision history for this message
FokkerCharlie (charlie-andrews) wrote :

Hello!

Here is the url for the ubuntu thread:

http://ubuntuforums.org/showthread.php?t=997860

I have just added the blacklist video fix, which I still need even after today's hal updates.

The OSD for brightness here is not quite right- it doesn't always agree with the actual brightness of the screen, particularly after quick multiple presses or holding the keys down. Anyway, that's a very minor point.

Please let me know if there's anything to add/remove/modify.

Charlie

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.