Bug#679750: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Started by littlebat on Jul 6, 2012 · 9 messages from 3 authors · Last reply Jul 19, 2012

open the first message on its own page

Message details and related content
Hi,

Because linux-input@vger.kernel.org is a mail list, I must register to
it for sending bug report. So all the posts about this bug sent to it
before had never reach it. I re-organize the text and report this bug to
linux-input@vger.kernel.org again when post my newly demsg information
under a recompiled 3.4 kernel with added "#DEFINE DEBUG" to the top of
"drivers/input/mouse/alps.c" adviced by seth.forshee@canonical.com. 

I think I am reporting a kernel bug about ALPS touchpad on Lenovo
G360.

This bug was reported at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679750 first.

My lenovo G360 has an ALPS touchpad, shows in Windows 7 Home Editition
OEM in this laptop. Under Debian Squeeze and Ubuntu 12.04 LTS LiveCD in
same laptop, the left and right key, single and double tap, tracking  of
touchpad works well. But, there isn't touchpad tab in gnome mouse
setting dialog, so I can't setup edge scrolling and disable touchpad on
typing. xinput shows it is a "PS/2 Generic Mouse". 

I have tried kernels 2.6.32-45, 3.2.4-1~bpo60+1,
3.4.4-1~experimental.1 under Debian Squeeze and kernel 3.2 under
Ubuntu 12.04 LTS LiveCD on this Lenovo G360 laptop. None of these four
kernels can configure a full functional ALPS touchpad. There are
same syptoms under all of these four kernels: 

1, "synclient -l" shows "Couldn't find synaptics properties. No
synaptics driver loaded? " 
2, "xinput --list" shows it is a "PS/2 Generic Mouse" 
3, "cat /proc/bus/input/devices" shows it is "N: Name="PS/2 Generic
Mouse"" 
4, Can't find any string like "touchpad", "synaptics" in
"/var/log/Xorg.0.log" 
5, There isn't touchpad tab in gnome mouse setting dialog, so I can't
setup edge scrolling and disable touchpad on typing. 

Under the kernel 3.2.4-1~bpo60+1 on Debian Squeeze, I have tried many
ways to fix this problem, but no lucky. The ways I tried such as:

59 more lines

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Fri, Jul 06, 2012 at 11:39:42AM +0800, littlebat wrote:
I found these lines in my dmesg information:
[   19.995850] psmouse serio4: alps: E6 report: 00 00 64
[   20.021288] psmouse serio4: alps: E7 report: 73 03 50
[   20.623609] input: PS/2 Generic Mouse
as /devices/platform/i8042/serio4/input/input9
Thanks, this is the information we need to check whether or not your
touchpad uses any of the known ALPS protocols.

I'm attaching a patch to use as a starting point. Basically we're just
going to try each protocol version until either we find one that works
or run out of options. You should have an external mouse available,
because it's likely that your touchpad will not be usable. I've also
heard that some of the workarounds that people use to get the "disable
touchpad while typing" behavior can cause the touchpad to no longer
function once it starts behaving as a touchpad, so you should look out
for that as well.

I won't be able to respond further until next Monday, but it's pretty
simple to modify the driver to try different protocol versions so I'll
give you some instructions. The patch adds the following line. I've
identified the two fields you'll need to change.

    { { 0x73, 0x03, 0x50 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 },
                              ^         ^
                              |         |
                    command_mode_resp   |
                                  proto_version

Not surprisingly, to try different protocol versions you just need to
change the proto_version field. Try ALPS_PROTO_V4 first, if that doesn't
work try ALPS_PROTO_V3, etc., until you've tried them all or found one
that works.

The first time you run the patch though you need to be on the lookout
for a message in dmesg that says "Unknown command mode response"
followed by two hex digits. If you see this then you need to change
command_mode_resp to match the response printed in the message. Be sure
to leave the 0x characters in place; only replace the 8a characters.
Then try the same protocol version again.

The basic test procedure after booting with a test version of the driver
is:

 1. Check dmesg for any errors from the alps driver. If you see anything

15 more lines

Message details and related content
On Fri, 6 Jul 2012 00:11:41 -0500
Seth Forshee [off-list ref] wrote:
On Fri, Jul 06, 2012 at 11:39:42AM +0800, littlebat wrote:
quoted
I found these lines in my dmesg information:
[   19.995850] psmouse serio4: alps: E6 report: 00 00 64
[   20.021288] psmouse serio4: alps: E7 report: 73 03 50
[   20.623609] input: PS/2 Generic Mouse
as /devices/platform/i8042/serio4/input/input9
Thanks, this is the information we need to check whether or not your
touchpad uses any of the known ALPS protocols.

I'm attaching a patch to use as a starting point. Basically we're just
going to try each protocol version until either we find one that works
or run out of options. You should have an external mouse available,
because it's likely that your touchpad will not be usable. I've also
heard that some of the workarounds that people use to get the "disable
touchpad while typing" behavior can cause the touchpad to no longer
function once it starts behaving as a touchpad, so you should look out
for that as well.

I won't be able to respond further until next Monday, but it's pretty
simple to modify the driver to try different protocol versions so I'll
give you some instructions. The patch adds the following line. I've
identified the two fields you'll need to change.

    { { 0x73, 0x03, 0x50 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 },
                              ^         ^
                              |         |
                    command_mode_resp   |
                                  proto_version

Not surprisingly, to try different protocol versions you just need to
change the proto_version field. Try ALPS_PROTO_V4 first, if that
doesn't work try ALPS_PROTO_V3, etc., until you've tried them all or
found one that works.

The first time you run the patch though you need to be on the lookout
for a message in dmesg that says "Unknown command mode response"
followed by two hex digits. If you see this then you need to change
command_mode_resp to match the response printed in the message. Be
sure to leave the 0x characters in place; only replace the 8a

19 more quoted lines

Thanks.

I have changed "proto_version" from V4 to V1, and changed
"command_mode_resp" to 0x73(followed by unknown response while entering
command mode: 73 01 0d) or 0x8a, 0x00, etc.. But, none of them works.

Briefly, "proto_version" V4 with "command_mode_resp" 0x00, 0x01, 0x73,
0x0d and V3 with 0x0d, 0x73, show the almost same symptoms:
1, dmesg output:
[   19.105550] psmouse serio4: alps: E6 report: 00 00 64
[   19.130028] psmouse serio4: alps: E7 report: 73 03 50
[   19.149304] psmouse serio4: alps: unknown response while entering
command mode: 73 01 0d 
[   19.149311] psmouse serio4: alps: touchpad failed to enter command
mode
2, xinput --list shows it is a "PS/2 Generic Mouse"
3, No "touchpad" found in "Xorg.0.log" except "PS/2 Generic Mouse"
4, No touchpad tab in gnome mouse setting dialog.
Detail information see attachments, here is V4 with 0x73:
V4-73-dmesg.txt, V4-73-inputdevices.txt, V4-73-xinputlist.txt,
V4-73-Xorg.0.log

And, V2 or V1 with 0x8a or 0x00, show the almost same symptoms below:
1, dmesg output:
[   19.935069] psmouse serio4: alps: E6 report: 00 00 64
[   19.960457] psmouse serio4: alps: E7 report: 73 03 50
[   20.000732] psmouse serio4: alps: Status: 10 00 0a
[   20.026497] input: PS/2 Mouse
as /devices/platform/i8042/serio4/input/input9 
[   20.042797] input: AlpsPS/2 ALPS GlidePoint
as /devices/platform/i8042/serio4/input/input10
2, xinput --list shows there are "AlpsPS/2 ALPS GlidePoint" and "PS/2
Mouse"
3, Xorg.0.log shows:
[    30.225] (--) AlpsPS/2 ALPS GlidePoint: touchpad found
...
But,
[    30.245] (EE) Query no Synaptics: 6003C8
[    30.245] (--) AlpsPS/2 ALPS GlidePoint: no supported touchpad found

26 more lines

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Sat, Jul 07, 2012 at 01:35:19PM +0800, littlebat wrote:
Briefly, "proto_version" V4 with "command_mode_resp" 0x00, 0x01, 0x73,
0x0d and V3 with 0x0d, 0x73, show the almost same symptoms:
1, dmesg output:
[   19.105550] psmouse serio4: alps: E6 report: 00 00 64
[   19.130028] psmouse serio4: alps: E7 report: 73 03 50
[   19.149304] psmouse serio4: alps: unknown response while entering
command mode: 73 01 0d 
mode
Okay, I don't suspect the v3/v4 protocol support is likely to work then.
And, V2 or V1 with 0x8a or 0x00, show the almost same symptoms below:
1, dmesg output:
[   19.935069] psmouse serio4: alps: E6 report: 00 00 64
[   19.960457] psmouse serio4: alps: E7 report: 73 03 50
[   20.000732] psmouse serio4: alps: Status: 10 00 0a
...
4, There is touchpad tab in gnome mouse setting dialog, but the
functions of "edge scrolling" and "disable touchpad when typing" still
can't work even if I can setup them in touchpad tab in gnome mouse
setting dialog.
The alps driver will detect and handle raw PS/2 mouse data, so what it
sounds like to me is that the alps driver manages to attach to your
device but doesn't get it sending absolute data packets. As a result the
driver is only passing relative motion data instead of absolute position
data, which means the touchpad is usable but still can't support any
touchpad features like edge scrolling.

So it sounds like we don't know how to talk to your touchpad, and
there's no trivial way to add support for it to the driver. There's
not really anything more I can do to help since I don't have access to
the hardware.

Seth

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Mon, 9 Jul 2012 09:45:08 -0500
Seth Forshee [off-list ref] wrote:
So it sounds like we don't know how to talk to your touchpad, and
there's no trivial way to add support for it to the driver. There's
not really anything more I can do to help since I don't have access to
the hardware.
Thanks.

Three things:
1, Can you provide a simple tutorial (or web page address) of how to
reverse-engineer a Linux ALPS driver if possible? I have very basic
programming knowledge(shell script, read basic C code except hardware
driver). Maybe, I can provide more detail hardware information about
this ALPS touchpad in this way?

2, Is there a tool, it can show the message when I operate on touchpad
edge scrolling? So, according to the output, it is able to get a dirty
solution about edge scrolling function of Lenovo G360 touchpad.
The funciton of "disable touchpad when typing" has a solution using
python script I have mentioned in the previous posts.

3, If you are interest in this and have time and it is helpful, I can
provide a root password for this laptop to you and run ssh service for
you all the time. Then you can operate this laptop via ssh connection
in this way. You can do anything on this machine even format the
disk :-)

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Tue, Jul 10, 2012 at 12:16:27PM +0800, littlebat wrote:
1, Can you provide a simple tutorial (or web page address) of how to
reverse-engineer a Linux ALPS driver if possible? I have very basic
programming knowledge(shell script, read basic C code except hardware
driver). Maybe, I can provide more detail hardware information about
this ALPS touchpad in this way?
I did a write-up a while back about how I did it.

http://swapspace.forshee.me/2011/11/touchpad-protocol-reverse-engineering.html
2, Is there a tool, it can show the message when I operate on touchpad
edge scrolling? So, according to the output, it is able to get a dirty
solution about edge scrolling function of Lenovo G360 touchpad.
The funciton of "disable touchpad when typing" has a solution using
python script I have mentioned in the previous posts.
I'm sorry, I can't quite tell what you're asking. If you're asking for a
way to enable edge scrolling without having a functioning touchpad
driver, I don't know of any. I doubt it's even possible to detect that
you're near the edge of the touchpad with only relative motion events.
3, If you are interest in this and have time and it is helpful, I can
provide a root password for this laptop to you and run ssh service for
you all the time. Then you can operate this laptop via ssh connection
in this way. You can do anything on this machine even format the
disk :-)
I'm afraid it's just not practical to do this remotely. Being able to
physically interact with the touchpad is pretty crucial.

Seth

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
Hi Seth,

On Tue, Jul 10, 2012 at 6:57 AM, Seth Forshee
[off-list ref] wrote:
On Tue, Jul 10, 2012 at 12:16:27PM +0800, littlebat wrote:
quoted
3, If you are interest in this and have time and it is helpful, I can
provide a root password for this laptop to you and run ssh service for
you all the time. Then you can operate this laptop via ssh connection
in this way. You can do anything on this machine even format the
disk :-)
I'm afraid it's just not practical to do this remotely. Being able to
physically interact with the touchpad is pretty crucial.
How long do you think you will need to reverse engineer the protocol
if you would have the hardware?
Depending on how long you think you might need, and how much it would
cost me to ship my laptop to you (where are you located?), would it
help if I simply ship my laptop to you?

I can't do that right now, but might be able to do that in a few months.

Regards,

Rik

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Mon, 9 Jul 2012 23:57:14 -0500
Seth Forshee [off-list ref] wrote:
I did a write-up a while back about how I did it.
http://swapspace.forshee.me/2011/11/touchpad-protocol-reverse-engineering.html
Hi,
I have done some testing on my Lenovo G360 Laptop according to the
instruction above, but it seems can't work as the instruction says.
Here is my steps:

1, Install Ubuntu 11.10 for i386 on laptop.
2, sudo apt-get update
3, sudo apt-get build-dep virtualbox
4, sudo apt-get source virtualbox (download
virtualbox_4.1.2-dfsg-1ubuntu1 source into home folder) 
5, Applied the virtualbox patch "vbox-psmouse-serio-passthrough.patch"
downloaded from instruction page 
6, sudo apt-get -b source virtualbox (this will compile patched source
and generate several deb virtualbox packages into home folder) 
7, sudo dpkg -i virtualbox_4.1.2-dfsg-1ubuntu1_i386.deb
virtualbox-dbg_4.1.2-dfsg-1ubuntu1_i386.deb
virtualbox-dkms_4.1.2-dfsg-1ubuntu1_all.deb
virtualbox-fuse_4.1.2-dfsg-1ubuntu1_i386.deb
virtualbox-qt_4.1.2-dfsg-1ubuntu1_i386.deb (install generated
virtualbox packages) 
8, Installed Windows 7 (or Windows xp SP2, has the
almost same testing result) into VirtualBox virtual machine. 
9, Installed Touchpad driver in Windows 7 in VirtualBox virtual machine.
But, the touchpad still act as a normal ps/2 mouse in Windows in
virtual machine, it misses edge scrolling function although has
installed windows touchpad driver successfully. 
10, Do the test:
y@y-PC:~$ sudo ./psmouse-reverse/mouse-to-serio.sh 1 
y@y-PC:~$ sudo chmod 666 /dev/serio_raw0 
y@y-PC:~$ ls -la /dev/serio*
crw-rw-rw- 1 root root 10, 55 2012-07-14 07:40 /dev/serio_raw0 
y@y-PC:~ $ export PSMOUSE_SERIO_DEV_PATH="/dev/serio_raw0" 
y@y-PC:~$ export
PSMOUSE_SERIO_LOG_PATH="/home/y/psmouse-reverse/reverse.log" 
y@y-PC:~$ virtualbox --startvm w7 ("w7" is my VirtualBox virtual
machine Windows 7 guest OS name)

In the Windows 7 guest OS, the touchpad "Lenovo pointing device"
disappeared from the hardwares list. And, the log file in Ubuntu 11.10

82 more lines

Re: Lenovo G360: ALPS Touchpad Recognized as "PS/2 Generic Mouse"(with newly dmesg information)

Message details and related content
On Sun, Jul 15, 2012 at 10:15:57AM +0800, littlebat wrote:
In the Windows 7 guest OS, the touchpad "Lenovo pointing device"
disappeared from the hardwares list. And, the log file in Ubuntu 11.10
has the content below: 
y@y-PC:~$ cat ./psmouse-reverse/reverse.log 
S ff
R fe
S ff
R fe
S ff
R fe
S ed
R fe
From the outset this doesn't look right. When reset is sent (0xff) the
touchpad should respond with and acknowledge (0xfa) and a couple more
bytes. Something obviously isn't working right, but I'm not sure what.

The only suggestion I have is to start debugging and try to see what's
going wrong. Is the data from the guest OS getting to the hardware okay,
and vice versa? Are you sure you've got the correct device?

Seth
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help