You are not logged in.
Pages: 1
Hi, I'm trying to get the 'SW_TABLET_MODE' event to work correctly on my HP Spectre X360.
I think I got most of the peaces of the puzzle, but I need help putting them together.
hp-wmi is suppose to trigger this event, but has some error on startup, here is dmesg:
[ 2.711444] input: HP WMI hotkeys as /devices/virtual/input/input14
[ 2.714634] ACPI Error: Field [D128] at 1152 exceeds Buffer [NULL] size 160 (bits) (20160831/dsopcode-236)
[ 2.714643] ACPI Error: Method parse/execution failed [\HWMC] (Node ffff8da6c60c1730), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
[ 2.714654] ACPI Error: Method parse/execution failed [\_SB.WMID.WMAA] (Node ffff8da6c60c3690), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
[ 2.714715] ACPI Error: Field [D128] at 1152 exceeds Buffer [NULL] size 160 (bits) (20160831/dsopcode-236)
[ 2.714719] ACPI Error: Method parse/execution failed [\HWMC] (Node ffff8da6c60c1730), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
[ 2.714728] ACPI Error: Method parse/execution failed [\_SB.WMID.WMAA] (Node ffff8da6c60c3690), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
I believe that the problem is related to a known problem, where the airplane mode key is spammed because everytime I open the computer to more than 180* and close it again to normal I get another spam of airplane mode keys
I believe the problem is acpi related.
If I cat the event of INT33D6
cat /dev/input/by-path/platform-INT33D6:00-event
I get garbage output `XXXX+X+` when over 180* (tablet state) and when back to normal (laptop state)
I think there is a mixup of INT33D3 and INT33D6, because INT33D3 (or PNP0C60) is suppose to be incharge of laptop mode see here:
https://msdn.microsoft.com/library/wind … e/dn457868
https://patchwork.kernel.org/patch/9306475/
I also decompiled my DSDT, here is the relevant part (I think):
Scope (_SB)
{
Device (VBPA)
{
Name (_HID, "INT33D6" /* Intel Virtual Buttons Device */) // _HID: Hardware ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If ((OSYS >= 0x07DD))
{
Return (0x0F)
}
Else
{
Return (Zero)
}
}
Name (VBST, Zero)
Method (VBDL, 0, NotSerialized)
{
If ((^^PCI0.LPCB.EC0.ECOK == One))
{
If ((^^PCI0.LPCB.EC0.CVTS == Zero))
{
VBST = 0x40
}
Else
{
VBST = Zero
}
}
}
Method (VGBS, 0, NotSerialized)
{
If ((^^PCI0.LPCB.EC0.ECOK == One))
{
If ((^^PCI0.LPCB.EC0.CVTS == Zero))
{
VBST = 0x40
}
Else
{
VBST = Zero
}
}
Return (VBST) /* \_SB_.VBPA.VBST */
}
}
Device (CIND)
{
Name (_HID, "INT33D3" /* Intel GPIO Buttons */) // _HID: Hardware ID
Name (_CID, "PNP0C60" /* Display Sensor Device */) // _CID: Compatible ID
Method (_STA, 0, NotSerialized) // _STA: Status
{
If ((OSYS >= 0x07DD))
{
Return (0x0B)
}
Else
{
Return (Zero)
}
}
}
}
Putting the the computer at tablet state and back at laptop state result in the folllowing messages on dmesg:
[ 4320.122389] intel-vbtn INT33D6:00: unknown event index 0xcc
[ 4320.171779] atkbd serio0: Unknown key pressed (translated set 2, code 0xd8 on isa0060/serio0).
[ 4320.171782] atkbd serio0: Use 'setkeycodes e058 <keycode>' to make it known.
[ 4320.179630] atkbd serio0: Unknown key released (translated set 2, code 0xd8 on isa0060/serio0).
[ 4320.179631] atkbd serio0: Use 'setkeycodes e058 <keycode>' to make it known.
[ 4329.585035] intel-vbtn INT33D6:00: unknown event index 0xcd
I can't read the output of hp-wmi:
ls -la /sys/devices/platform/hp-wmi 9:13PM
total 0
drwxr-xr-x 3 root root 0 פבר 9 19:20 .
drwxr-xr-x 22 root root 0 פבר 9 19:20 ..
-rw-r--r-- 1 root root 4096 פבר 9 21:12 als
-r--r--r-- 1 root root 4096 פבר 9 21:12 display
-r--r--r-- 1 root root 4096 פבר 9 21:12 dock
lrwxrwxrwx 1 root root 0 פבר 9 19:20 driver -> ../../../bus/platform/drivers/hp-wmi
-rw-r--r-- 1 root root 4096 פבר 9 21:12 driver_override
-r--r--r-- 1 root root 4096 פבר 9 21:12 hddtemp
-r--r--r-- 1 root root 4096 פבר 9 21:12 modalias
-rw-r--r-- 1 root root 4096 פבר 9 21:12 postcode
drwxr-xr-x 2 root root 0 פבר 9 21:11 power
lrwxrwxrwx 1 root root 0 פבר 9 19:26 subsystem -> ../../../bus/platform
-r--r--r-- 1 root root 4096 פבר 9 21:12 tablet
-rw-r--r-- 1 root root 4096 פבר 9 21:12 uevent
sudo cat /sys/devices/platform/hp-wmi/tablet 9:12PM
cat: tablet: Invalid argument
After trying to read it I get these messages on dmesg:
[12025.122317] ACPI Error: Field [D128] at 1152 exceeds Buffer [NULL] size 160 (bits) (20160831/dsopcode-236)
[12025.122323] ACPI Error: Method parse/execution failed [\HWMC] (Node ffff8da6c60c1730), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
[12025.122332] ACPI Error: Method parse/execution failed [\_SB.WMID.WMAA] (Node ffff8da6c60c3690), AE_AML_BUFFER_LIMIT (20160831/psparse-543)
xev output is identical when pressing airplane mode key and when switching from laptop to tablet and vise versa:
MappingNotify event, serial 35, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
I hope this would help other user too,
Thanks in advance,
Itay
Last edited by ItayXD (2017-02-09 23:30:49)
Offline
Anyone has any idea?
Offline
I just ran into this issue as well on my x360. Was curious if you found any workarounds?
Offline
Any clue would be welcome...
Offline
It could only be fixed in hp_wmi kernel module, no one here could do this. There are other reports except yours already submitted: https://bugzilla.kernel.org/show_bug.cgi?id=190661 .
You can ping Matthew Garrett https://twitter.com/mjg59 which I think is one of the developers of this module and ask him if it's fixable or not.
If you only want get rid of those errors you can blacklist hp_wmi module in /etc/modprobe.d
Offline
Another way to tackle this would be to fix those DSDT/SSDT tables by yourself. Unfortunately there is no easy wat to do this. Here some guidelines:
https://forums.gentoo.org/viewtopic.php?t=122145
https://www.tonymacx86.com/threads/guid … ts.152573/
https://github.com/RehabMan/Laptop-DSDT-Patch
Try to fix all errors, maybe one of them is causing this issue. I think you could ask on gentoo forums for help.
Offline
Thank you very much QuackDonkey, I did find some new info, that might lead me to the solution.
As we can see in dmesg, all I have to do it set the correct keycode to the scancode
[ 4320.171782] atkbd serio0: Use 'setkeycodes e058 <keycode>' to make it known.
I tried it, and it works, I can get it to type a letter for example whenever I switch to tablet state using:
setkeycodes e058 <keycode>
I also managed to make it permanent using udev I added these line to `/etc/udev/hwdb.d/70-keyboard.hwdb`:
# Keys for HP spectre x360
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP:pnHPSpectrex360Convertible:pvr
KEYBOARD_KEY_d8=k
to get it to type k (for example) when ever switching to tablet mode (based on `[ 4320.171779] atkbd serio0: Unknown key pressed (translated set 2, code 0xd8 on isa0060/serio0).`)
the problem I have now is getting it to work for switching to laptop state.
If I set it using setkeycode:
setkeycodes e057 <keycode>
it works fine and print whatever character, however when I try to set it as I udev rule it seems to be overwritten.
setting:
# Keys for HP spectre x360
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP:pnHPSpectrex360Convertible:pvr
KEYBOARD_KEY_d8=k
KEYBOARD_KEY_d8=z
doesn't print z, instead it trigger airplane mode.
Anyone has any idea when this is coming from or how to over write it?
Last edited by ItayXD (2017-02-26 12:45:01)
Offline
Ok, but what's the point with those keybindings?
If I understand this correctly you want to make your accelerometer work with auto rotate screen. Those keys are virtual and belongs to accelerometer under hp_wmi module which is bugged. You can install https://github.com/hadess/iio-sensor-proxy avalaible in AUR https://aur.archlinux.org/packages/iio- … proxy-git/ and after reboot run "monitor-sensor" and try to rotate screen to see those events.
Offline
there are 2 different sensors, one for accelerometer, used for orientation (which I managed to get working), and the other is for detecting tablet mode and laptop mode, used to disable touchpad and etc which I'm trying to fix
Offline
How do you managed to rotation working?
Offline
I think you have to contact kernel maintainers of hp_wmi or intel-vbtn modules (or both) and ask them to add support for this HP Spectre feature. You can't fix this in userspace.
Last edited by QuackDonkey (2017-03-03 22:51:43)
Offline
Ok, I made it!
#/etc/udev/hwdb.d/90-custom-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
KEYBOARD_KEY_d8=!f23
KEYBOARD_KEY_d7=!f22
Now you have to bind f23 and f22 keys to enable and disable touchpad events. In kde go to: system settings --> shortcuts -> global shortcuts -> KDE daemon
Check "Disable Touchpad", select custom shortcut, then flip your laptop into tablet - it should detect the key as "Touchpad Off".
Next check "Enable Touchpad", select custom shortcut, then return your laptop into laptop - it should detect the key as "Wireless" (This name doesn't matter it works as intended).
Note that I disabled hp_wmi module in modprobe.d (I don't know if it's relevant). It should be similiar in other DE. I hope this help you.
Offline
Pages: 1