Comment 100 for bug 296610

Revision history for this message
Dave (foceni) wrote :

Bad news. The driver behaves correctly - it does exactly what HW says. Problem is HW says is "wrong". Look at my dumps:

1) Pad Left Push:
alps.c: [0] cf 11001111
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: [3] 59 01011001
alps.c: [4] 7f 01111111
alps.c: [5] 0 00000000
alps.c: ----------
alps.c: report pad pkt 1

2) Pad Left Release:
alps.c: [0] cf 11001111
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: [3] 58 01011000
alps.c: [4] 7f 01111111
alps.c: [5] 0 00000000
alps.c: ----------
alps.c: report pad pkt 0

3) Stick Left Push:
alps.c: [0] 9 00001001
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: ----------
alps.c: report ps2 pkt 1

4) Stick Left Release:
alps.c: [0] 8 00001000
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: ----------
alps.c: report ps2 pkt 0

5) Pad Left Push:
alps.c: [0] cf 11001111
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: [3] 59 01011001
alps.c: [4] 7f 01111111
alps.c: [5] 0 00000000
alps.c: ----------
alps.c: report pad pkt 1

6) Stick Left Push:
alps.c: [0] 9 00001001
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: ----------
alps.c: report ps2 pkt 1

7) Stick Left Release (!!! reports pushed !!!)
alps.c: [0] 9 00001001
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: ----------
alps.c: report ps2 pkt 1

8) Pad Left Release:
alps.c: [0] cf 11001111
alps.c: [1] 0 00000000
alps.c: [2] 0 00000000
alps.c: [3] 58 01011000
alps.c: [4] 7f 01111111
alps.c: [5] 0 00000000
alps.c: ----------
alps.c: report pad pkt 0

Number 7) is "wrong". It should say PS2 "release", but it's a PS2 "push" packet. Basically, it says "Left button on your *screen* is still pushed". Windows see only one pointer and a set of buttons - like X. This ALPS is designed accordingly, but also to save money surely. It provides only ONE set of *button states*.

Number 8) is a normal PAD "release" packet. No extra info about the Stick.

The only solution, unfortunately, is to update BOTH devices with all PS2/PAD button events. Yes, we merge two mouses into one with 2 pointers, but it will work. This ALPS just doesn't provide two independent mouse HWs. Only two pointers and one set of buttons. Bastards!!

This HW is also the reason why I can't resize with Stick while holding Pad button. Pad button is registered, but Stick movements contain Pad button states (!!!) as if they were Stick's. So X thinks "he pushed Stick button now" and it takes preference. I have just learned this from packet dumps.

It's true. Our ALPS has just one set of buttons. The fix should be easy now. Just be careful to apply this feature only to this model. You might miss one button, but I bet your ALPS also has only one set of button states like ours. Not many people use this model on Linux - it was unnoticed like crazy jumping or the whole 9p change.

PS: With my packet dumping, I think we can find the 9p flag easily if it's there. I believe it's there, it wouldn't work on Windows too if it was just 1MRL. This is almost certain. It's a basic protocol requirement.

Have to go to sleep.....