View Issue Details

IDProjectCategoryView StatusLast Update
0000216elrepo bug tracker--bug-tracker--request-for-enhancement--public2012-01-08 21:43
Reporterrobkampen Assigned Topperry  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0000216: asus-wmi.ko available in kernel-2.6.39 - possible to backport to CentOS 6.2?
DescriptionThe asus-wmi.ko module appears to deal with asus laptop's specific function keys that mange the hardware - in particular:
- turning their wifi hardware on/off <Fn F2>
- turning their keyboard backlight down and up <Fn F3> <Fn F4>
- turning the synaptics pad off and on <Fn F9>
- muting audio <Fn F10>
- Audio down <Fn F11>
- Audio up <Fn F12>
The other function keys appear to function okay or have readily available hacks to allow operation.
Additional InformationI have a new Asus G73S with a clean install of CentOS 6.2 and am prepared to test and run whatever scenario that can assist - will need some pointing in the right direction, but I can set up rpm rebuild if needed.
Thanks for your assistance.
TagsNo tags attached.

Activities

pperry

2011-12-29 18:22

administrator   ~0001429

Acknowledged.

We should be able to backport asus-wmi.ko to EL6. It's slightly complicated by the fact we also need to backport sparse_keymap too on which asus-wmi.ko depends.

I'll try to get some packages available for testing tomorrow and will post back here when available.

robkampen

2011-12-29 18:37

reporter   ~0001430

Just realized I did not specify the OS version - I am using the x86_64, just in case there is any doubt.

pperry

2011-12-30 07:15

administrator   ~0001431

I've built the packages and pushed them to the el6 testing repository:

kmod-asus-wmi-0.0-1.el6.elrepo.x86_64.rpm
kmod-sparse-keymap-0.0-1.el6.elrepo.x86_64.rpm

http://elrepo.org/linux/testing/el6/x86_64/RPMS/

They should appear on the mirrors shortly.

So far I've only built the x86_64 packages, 32-bit packages will follow in due course.

kmod-asus-wmi depends on kmod-sparse-keymap so you will need to install both packages. If you have elrepo set up:

yum --enablerepo=elrepo-testing install kmod-asus-wmi

should pull in kmod-sparse-keymap as a dependency.

kmod-sparse-keymap provides the sparse-keymap module. This module provides the backported sparse_keymap kernel interfaces (symbols) for asus-wmi to use.

If the modules aren't loaded automatically (maybe after a reboot?), Try:

modprobe asus-wmi

which should also load sparse_keymap. Running:

lsmod | grep 'sparse\|asus'

hopefully shows both modules loaded. I was unable to load asus-wmi on my test system as I don't have the physical hardware.

Any feedback appreciated. Please test and report back if they work as expected, or otherwise.

Thanks.

robkampen

2011-12-30 17:59

reporter   ~0001438

Wow - thanks for the prompt response.
The two modules came down and installed without a problem.
The modules can be loaded manually as indicated with
modprobe asus-wmi
they do not survive a reboot
did a depmod and also a mkinitrd but still no auto load - thus I will work on getting a file into /etc/modprobe.d/ once I am certain things are working.

After a manual modprobe the lsmod shows:
[rkampen@robsasus ~]$ sudo lsmod |grep 'sparse\|asus'
asus_wmi 15488 0
sparse_keymap 4376 1 asus_wmi
rfkill 19735 5 asus_wmi,bluetooth,cfg80211
wmi 6287 1 asus_wmi

Now feedback on the actual module.
When loaded, the various function keys do not appear to function any better.
I have re-examined the following
http://forum.notebookreview.com/asus-gaming-notebook-forum/553474-g73-asus-wmi-linux-driver-i-need-your-help-6.html
and find no instructions that help make things work - the /sys/kernel/debug/asus..... do not exist.
What do I do next to provide feedback information?

pperry

2011-12-31 14:06

administrator   ~0001439

That doesn't sound too promising.

I'm tied up with $work for a few days, but in the meantime...

We have an updated kernel (2.6.39.4) available for el6, see here:

http://elrepo.org/tiki/kernel-ml
http://elrepo.org/linux/kernel/el6/x86_64/RPMS/

You could try having a play with that kernel to see if the driver works "in kernel", and if it does maybe get an idea of what you're missing.

These kernels are provided for testing purposes only and are not expected to be of production quality for an Enterprise Linux distribution.

robkampen

2011-12-31 20:55

reporter   ~0001441

Thanks for the suggestions - I understand the need for $work!!
I have loaded the suggested kernel but it only boots to CLI - X11 fails to load due to not finding the nvidia - I have the elrepo kmod-nvidia installed and thought it would work.
On the CLI when I log in, the various function buttons still do not function - I am going to do some more tests when I get some time.
Any hints on how I get nvidia to work?
TIA

pperry

2011-12-31 22:23

administrator   ~0001444

Unfortunately the elrepo nvidia drivers will not work with the above kernel(s) as they are not RHEL kernels hence not kABI compatible.

To get X working under that kernel the simplest solution is probably to uninstall the elrepo nvidia drivers (backup your /eytc/X11/xorg.conf if you've made changes) and fall back to the default nouveau driver. Which may or may not sound like too much hassle for you :-)

But if the function buttons still do not function under this kernel then they are not going to function with the backported kernel module we built. Would having X make any difference?

robkampen

2012-01-01 03:03

reporter   ~0001446

OK, dropped the nvidia driver and got the GUI working.
Found that the function buttons for mute / audio up and down work fine with the .39 kernel, the <Fn F2> wireless button now seems to turn bluetooth on and wifi off or toggle to bluetooth off and wifi on. The panel icons for wifi, bluetooth, and audio all update as expected.
I did note that lsmod also shows asus_nb_wmi - is this another module that is needed for the wmi to function?

I hope this provides some insight.
In the meantime I am running back on the 6.2 kernel with nvidia as this is where I need to end up.
Further reading on the net shows that Asus is moving towards the wmi interface for function keys and control of H/W - thus this set of modules is definitely the way to go.

If there are any other tests I can do, just let me know.

pperry

2012-01-01 12:50

administrator   ~0001452

Great - now you know what to expect for a "working" system.

Yes, I'm guessing asus_nb_wmi is probably needed. I'll look at backporting that too, but I won't be able to get to it much before the second half of the week. Hopefully that is the missing piece of the puzzle.

If you are able to boot the 2.6.39 kernel again, could you check for all asus/wmi related modules (in case there's anything else we've missed):

lsmod | grep 'asus\|wmi'

and then module dependencies for each module would be useful too, for example:

modinfo asus_wmi | grep depends

for each module of interest from above.

Hopefully that should give us the complete set.

Thanks.

robkampen

2012-01-01 16:09

reporter   ~0001454

Done - it seems the following are required
asus_nb_wmi depends upon asus_wmi
asus_wmi depends upon rfkill; wmi; hwmon; sparse_keymap
none of these four have further dependancies.

Thus it seems we will need to add asus_nb_wmi and hwmon as these are not in the 6.2 kernel set.
the other modules exist - although maybe not in latest required form?

pperry

2012-01-01 16:34

administrator   ~0001456

Thanks - that should be all the information we need.

You got me going there with regards to hwmon!

[root@rhel6b64 ~]# find /lib/modules/ -name hwmon.ko
/lib/modules/2.6.32-131.21.1.el6.x86_64/kernel/drivers/hwmon/hwmon.ko
/lib/modules/2.6.32-71.el6.x86_64/kernel/drivers/hwmon/hwmon.ko
/lib/modules/2.6.32-131.0.15.el6.x86_64/kernel/drivers/hwmon/hwmon.ko

yikes, so where did the hwmon.ko module go in the 6.2 kernel...

# cat /boot/config-2.6.32-71.el6.x86_64 | grep -i hwmon
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set

# cat /boot/config-2.6.32-220.el6.x86_64 | grep -i hwmon
CONFIG_HWMON=y
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set
CONFIG_THERMAL_HWMON=y

So the answer is hwmon is now compiled into the kernel rather than as a loadable module so we don't have to worry about that!

I'll take a look at asus_nb_wmi later in the week which hopefully should be a little more straight forward as we have already met the other deps.

pperry

2012-01-04 16:46

administrator   ~0001467

Last edited: 2012-01-04 16:48

Hi Rob,

I've just built an updated version of kmod-asus-wmi (x86_64 only atm) that now also provides the missing asus-nb-wmi module. The updated package should appear on the mirrors in the next few hours:

http://elrepo.org/linux/testing/el6/x86_64/RPMS/

kmod-asus-wmi-0.0-2.el6.elrepo.x86_64.rpm

You might need to manually load the module:

modprobe asus-nb-wmi

So you should now see asus_nb_wmi, asus_wmi and sparse_keymap modules loaded.

Please let me know if/how it works now.

robkampen

2012-01-05 01:17

reporter   ~0001477

ok, it finally arrived in my repo and installed just fine.
It seems to function just as the .39 kernel i.e.
<Fn F2> toggles the wireless on and off
<Fn F5> reduces LCD screen backlight
<Fn F6> increases thr screen backlight - both of these also have an onscreen icon that responds to the level.
<Fn F7> turns the LCD screen off
<Fn F8> cannot test - it is meant to toggle between internal and external display
<Fn F10> mutes the sound
<Fn F11> dcreases volume - with onscreen icon showing level
<Fn F12> increases volume - with onscreen icon

what still does not function is F3/F4 for keyboard backlight and F9 to toggle the synaptic touchpad on/off.

I will investigate some more - it seems some recent patches to this module may not be in the kernel version you have back-ported.

Finally, let me just say a huge thanks for getting this done - a definite step in the right direction.

pperry

2012-01-05 10:05

administrator   ~0001478

Hi Rob,

That's excellent news, and thank you for the detailed testing and feedback.

The driver we currently have is backported from kernel-2.6.39.4.

I have just done a comparison with the asus-wmi driver in the latest stable kernel (kernel-3.1.7) and quite a few patches have been added since 2.6.39.4, but I don't see anything that relates to either the keyboard backlight or the synaptic touchpad. I have yet to check the very latest 3.2 kernel that has just been released (kernel.org seems to be struggling under the load atm)

My next task will be to try to backport these later patches to get our driver more up to date.

Question - did the F3/F4 for keyboard backlight and F9 to toggle the synaptic touchpad on/off work in the updated elrepo kernel you tried? i.e, are we expecting this to function with a 2.6.39.4 based driver?

Do you have any evidence (maybe from trying a LiveCD of another distro) that these functions work, and if so with what kernel?

pperry

2012-01-05 12:47

administrator   ~0001479

Last edited: 2012-01-05 12:48

Now kernel.org is back up I've found the patches that add keyboard backlight in the 3.1.7 and 3.2 kernels. I'll work on getting the driver updated.

I still don't see anything new for the touchpad. Looking in asus-nb-wmi.c from kernel-2.6.39.4 I see:

{ KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },

which would suggest it should already be supported in 2.6.39.4.

robkampen

2012-01-05 12:59

reporter   ~0001480

The testing of the elrepo 2.6.39.4 kernel did not have the keyboard backlight and did not have the touchpad toggle functional. Thus we currently seem to have the full functionality of the elrepo kernel.

I note that under windoze 7 that as soon as the synaptics driver detected a usb mouse it disabled the touchpad - this is different to the asus hardware turning the device off.

I do not know if the touchpad toggle works under other Linux distro - I'll research this some more.

pperry

2012-01-05 14:48

administrator   ~0001482

Thanks.

From your first comment, I conclude we have successfully backported the driver from kernel-2.6.39.4.

Lets see how an updated driver fairs with the keyboard backlight.

pperry

2012-01-05 16:18

administrator   ~0001483

Hi Rob,

I've just built an updated kmod-asus-wmi-0.0-3.el6.elrepo.x86_64.rpm based on the very latest mainline kernel-3.2.

As usual, it should show up in the el6 testing repo within the next hour or so:

http://elrepo.org/linux/testing/el6/x86_64/RPMS/

Most stuff backports cleanly but there are issues with some backlight API/ABIs I had to hack around although I think these probably relate more to display backlighting than the missing keyboard backlighting function that we are interested in.

Lets see how you get on with this version.

pperry

2012-01-05 16:21

administrator   ~0001484

//quote
I note that under windoze 7 that as soon as the synaptics driver detected a usb mouse it disabled the touchpad - this is different to the asus hardware turning the device off.
//quote

As you say, this is most likely a feature implemented within Windows.

You could probably achieve the same effect with udev rules by writing a rule to detect a usb mouse being plugged in that unloads the touchpad driver, thus disabling it. Just a thought.

robkampen

2012-01-06 14:00

reporter   ~0001488

Loaded the new version just fine - all the items that worked previously still appear to do so.
I still need to load the modules by hand, they do not load with a clean boot, unlike the 2.6.39.4 kernel where they loaded automagically.
i.e. sudo modprobe asus-nb-wmi
No progress on the F3/F4 keyboard backlight buttons and no progress on the F9 touchpad toggle.
So I looked at dmesg and now I get:
<snip>
asus_wmi: ASUS WMI generic driver loaded
asus_wmi: Initialization: 0x1
asus_wmi: BIOS WMI version: 7.6
asus_wmi: SFUN value: 0xa0877
input: Asus WMI hotkeys as /devices/platform/asus-nb-wmi/input/input11
Registered led device: asus::kbd_backlight
asus_wmi: Backlight controlled by ACPI video driver
</snip>
I thus looked at /sys/devices/platform/asus-nb-wmi/ and found lots of interesting device info.
In particular at leds/asus::kbd_backlight I found a brightness and max_brightness file (register?)
A simple cat of these showed 0 and 3 respectively.
Thus as root I did:
echo 1 > /sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness
and the keyboard backlight comes on at lowest brightness.
I also tried values 2 and 3 and they work as expected with maximum brightness at 3.
Thus I can manually get the keyboard backlight to function - a definite step in the right direction.
The function keys F3 and F4 are either not triggering the correct event or the loading of the correct register is not being done.
At this point I'm out of my depth as I do not have a copy of the code (and my C / C++ is very poor)
The machine has a row of three buttons just below the screen and one of these is designated to turn the keyboard lighting on/off. When I press it to off, the keyboard backlight goes off. When I press it to turn them on nothing happens. BTW it is the same under windoze 7 - the on button does not restore the backlight to its previous mode.
I note that a read of the brightness (cat brightness) always returns a 0.
Irrispective of the position of the keyboard lighting button - either on or off - if I do an echo 2 > ./brightness the keyboard backlight will respond.
One final piece of information - when I press the keyboard backlight on/off button the following appears in dmesg:
asus_wmi: Unknown key b7 pressed
thus it seems this key is not yet captured by the device driver code.
Thus, we have made considerable progress - there is just some issue with capturing the keys and getting the correct register loaded with the desired value.
Once again, thanks for all your help with this - at least I can now get the lights on and this makes a huge improvement to operating the machine in poor lighting conditions.

pperry

2012-01-06 14:50

administrator   ~0001491

Hi Rob,

Excellent feedback - thanks again!

I'm also reaching the limits of what I can do from here.

If you want to proceed to take this further then I think you would need to contact the developer of the driver in question. If you look here:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=drivers/platform/x86;h=9f9b6af045d5663f521035213a19b255d2920740;hb=805a6af8dba5dfdd35ec35dc52ec0122400b2610

the files of interest are asus-wmi.c and asus-nb-wmi.c, and looking at the history for both, the developer in question would appear to be Corentin Chary <corentin.chary@gmail.com>

I would suggest you make contact and feed back the information you have regarding what is/isn't working together with any debug information from dmesg etc. It might be the case that with this information and a willing tester in yourself, the developer is able to offer a patch. I could then incorporate any patch into our driver for you to test. If you do then please cite this bug and feel free to copy me in <phil@elrepo.org>.

Finally, my colleague Alan is getting close to releasing kernel-ml-3.1.6 for el6, so may I ask if you'd be willing to test that kernel as I believe the native asus-wmi driver in that kernel is very close to our backported version - I'd just like to double-check that the things that aren't working for you in the backported kmod driver are also not working in the native kernel (IOW I want to check that we haven't broken anything during the backporting process) before we go reporting issues to the upstream developer.

burakkucat

2012-01-06 16:07

administrator   ~0001492

Last edited: 2012-01-06 16:08

@Rob, re: note 1488, first two sentences.

[quote]
Loaded the new version just fine - all the items that worked previously still appear to do so.
I still need to load the modules by hand, they do not load with a clean boot, unlike the 2.6.39.4 kernel where they loaded automagically.
[/quote]

That is easily fixed. Create a file, /etc/sysconfig/modules/asus.modules, owner/group == root/root, mode 0755, with contents --

[code]
#!/bin/sh

MODULES="list the modules you require to be loaded here"

for i in $MODULES ; do
        modprobe $i >/dev/null 2>&1
done
[/code]

Problem fixed. :)

burakkucat

2012-01-06 16:23

administrator   ~0001494

@Rob, Please try the kernel-ml package, *for testing purposes only* (not publicly released), that is now available to you from --

http://elrepo.org/people/ajb/devel/kernel-ml/el6/x86_64/RPMS/

robkampen

2012-01-08 14:07

reporter   ~0001500

ok, I will try the new kernel, it will need me to remove the nvidia/kmod package just like last time, thus it will take me a little while to clear my desktop.
Will let you know.

pperry

2012-01-08 14:43

administrator   ~0001501

Thanks Rob - I appreciate it's not trivial.

robkampen

2012-01-08 16:22

reporter   ~0001502

OK, loaded the 3.1.6 ml kernel and it boots just fine and appears to function.
Testing of the function keys - it appears to operate the same as the CentOS 6.2 kernel with the asus-nb-wmi and asus-wmi modules installed.

Let me be specific.

<Fn-F1> - sleep button - puts the machine to sleep, and it appears to recover okay, except it looses some of the function key functions after restore - thus the drivers do not seem to survive in a functional mode after awaking from the sleep.

<Fn-F2> - wireless toggle - this seems to work okay, the machine's wifi light is on after boot and the toggle functions as expected. After sleep and awaken the wifi light is off, but a toggle of the button gets the light in sync.

<Fn-F3> and <Fn-F4> - keyboard backlight down and up - these buttons do still not function. an lsmod shows the drivers are loaded, and an echo {0|1|2|3} to
/sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness does work and allows control of the keyboard back-light. Seems to work just like the back-ported drivers we have set up for the CentOS 6.2 kernel.

<Fn-F5> and <fn-F6> - display brightness down and up - these work as expected, however after suspend and awaken they failed to function - the onscreen icon came up but the screen backlight did not change and then the machine hung - needed hard reboot.

<Fn-F7> - blank display - seems to work fine

<Fn-F8> - control of internal display and external - cannot test, sorry.

<Fn-F9> - touchpad toggle - still does not function

<Fn-F10> - audio mute - seems to work as expected, complete with onscreen display.

<Fn-F11> and <Fn-F12> - audio down and up - seems to work as expected complete with on screen display.

Pressing the lights off/on button below the screen give the following message in dmesg.
keyboard: can't emulate rawmode for keycode 240
keyboard: can't emulate rawmode for keycode 240
asus_wmi: Unknown key b7 pressed

Hope this helps. Any other questions or tests - just let me know.

pperry

2012-01-08 21:41

administrator   ~0001504

[quote]
OK, loaded the 3.1.6 ml kernel and it boots just fine and appears to function.
Testing of the function keys - it appears to operate the same as the CentOS 6.2 kernel with the asus-nb-wmi and asus-wmi modules installed.
[/quote]

Brilliant - thanks Rob.

To me, that would confirm we have done as much as we can do in terms of backporting the latest upstream asus wmi drivers to RHEL6. The job is now up to the upstream developers to hopefully add support for those function keys which are still missing, at which point we can backport any new patches into our drivers.

I'll mark this bug as resolved, but I'll leave it open so we can continue to track any further developments here as needed.

Many thanks Rob for providing such detailed and precise testing and feedback - it's been invaluable!

Issue History

Date Modified Username Field Change
2011-12-29 18:14 robkampen New Issue
2011-12-29 18:14 robkampen Status new => assigned
2011-12-29 18:14 robkampen Assigned To => stindall
2011-12-29 18:16 pperry Assigned To stindall => pperry
2011-12-29 18:22 pperry Note Added: 0001429
2011-12-29 18:37 robkampen Note Added: 0001430
2011-12-30 07:15 pperry Note Added: 0001431
2011-12-30 17:59 robkampen Note Added: 0001438
2011-12-31 14:06 pperry Note Added: 0001439
2011-12-31 20:55 robkampen Note Added: 0001441
2011-12-31 22:23 pperry Note Added: 0001444
2012-01-01 03:03 robkampen Note Added: 0001446
2012-01-01 12:50 pperry Note Added: 0001452
2012-01-01 16:09 robkampen Note Added: 0001454
2012-01-01 16:34 pperry Note Added: 0001456
2012-01-04 16:46 pperry Note Added: 0001467
2012-01-04 16:46 pperry Note Edited: 0001467
2012-01-04 16:48 pperry Note Edited: 0001467
2012-01-05 01:17 robkampen Note Added: 0001477
2012-01-05 10:05 pperry Note Added: 0001478
2012-01-05 12:47 pperry Note Added: 0001479
2012-01-05 12:48 pperry Note Edited: 0001479
2012-01-05 12:59 robkampen Note Added: 0001480
2012-01-05 14:48 pperry Note Added: 0001482
2012-01-05 16:18 pperry Note Added: 0001483
2012-01-05 16:21 pperry Note Added: 0001484
2012-01-06 14:00 robkampen Note Added: 0001488
2012-01-06 14:50 pperry Note Added: 0001491
2012-01-06 16:07 burakkucat Note Added: 0001492
2012-01-06 16:08 burakkucat Note Edited: 0001492
2012-01-06 16:23 burakkucat Note Added: 0001494
2012-01-08 14:07 robkampen Note Added: 0001500
2012-01-08 14:43 pperry Note Added: 0001501
2012-01-08 16:22 robkampen Note Added: 0001502
2012-01-08 21:41 pperry Note Added: 0001504
2012-01-08 21:43 pperry Status assigned => resolved
2012-01-08 21:43 pperry Resolution open => fixed