Jump to content

Refined ALPS TouchPad driver


Dr. Hurt

Recommended Posts

  • Moderators

Yup, here's some of the result when touching the touchpad although no movement. 

 

8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte0 data (6a) from PS/2 controller
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte0 data (40) from PS/2 controller
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=0, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=-129, y=-2131768962, z=-128, fingers=0, buttons=176
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte0 data (00) from PS/2 controller
8/30/15 11:34:44.000 AM kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte0 data (48) from PS/2 controller
Link to comment
Share on other sites

Those coordinates are definitely incorrect. I'm starting to think that the V7 code in the Linux driver is incomplete.

 

I have a couple of patches from people who worked on the driver which seem to complete the missing pieces.

 

I'm currently having some real life issues so I probably won't be able to provide an update soon. Maybe in a week, hopefully sooner.

Link to comment
Share on other sites

V7alpha6:

 

- Added V7 interrupt handler.

- Saves multitouch data to modelData for future use. (probably needs improvement)

- Updated/ported lots of stuff from Linux 4.1

 

Again, this is the debug version. Use only with V7 hw.

=================

 

In other news: Release 3 is progressing, RC coming soon.

- Zero compile warnings now after the clean up :D

- Improved 2-finger detection

- Slowed down trackstick speed by 2x

- Improved single finger scroll acceleration

- Separated Rushmore profile, ported updates from Linux 4.1

- Updated interrupt handling

- Cleaned up logging

V7alpha6.zip

Link to comment
Share on other sites

  • Moderators

Getting this in console

9/3/15 4:28:16.080 PM com.apple.kextcache[4604]: kxld[org.rehabman.voodoo.driver.PS2Trackpad]: ApplePS2ALPSGlidePoint::alps_is_valid_package_v7(unsigned char*, int)

9/3/15 4:29:39.039 PM com.apple.kextcache[4693]: kxld[org.rehabman.voodoo.driver.PS2Trackpad]: ApplePS2ALPSGlidePoint::alps_is_valid_package_v7(unsigned char*, int)
9/3/15 4:41:27.920 PM com.apple.kextcache[453]: kxld[org.rehabman.voodoo.driver.PS2Trackpad]: ApplePS2ALPSGlidePoint::alps_is_valid_package_v7(unsigned char*, int)
 
Keyboard/touchpad/trackstick not working.
Link to comment
Share on other sites

ALPS V7 is just way too different in the way it works compared to V1-V5. Developing a driver for it without the hardware is a bit challenging.

 

If this build doesn't at least show some promise, I'll publish all the ported V7 code to my github for future devs with the hardware to takeover.

I have done all the hard work. All it needs is just the finishing touches. 

 

alpha7:

- integrated the packet validity check into the interrupt handler (as opposed to a separate function).

V7alpha7.zip

Link to comment
Share on other sites

R3RC1: This is for ALPS V1-V5 only

 

Changes:

- Zero compile warnings now after the clean up
- Improved 2-finger detection
- Slowed down trackstick speed by 2x (as suggested by you).
- Improved single finger scroll acceleration
- Separated Rushmore profile, ported updates from Linux 4.1 (hope it doesn't backfire).
- Updated interrupt handling (more strict filtering should make things smoother).
- Cleaned up logging

 

Watch for pointer smoothness, 2-finger scroll/click, pointer jump with trackstick. 

 

 

 

R3RC1.zip

Link to comment
Share on other sites

  • Moderators

V7alph7 output

Sep  4 11:06:35 localhost kernel[0]: VoodooPS2 ALPS TouchPad Driver loaded...Sep  4 11:06:35 localhost kernel[0]: ApplePS2ALPSGlidePoint::probe entered...
Sep  4 11:06:35 localhost kernel[0]: Found an ALPS V7 TouchPad...
Sep  4 11:06:35 localhost kernel[0]: ApplePS2ALPSGlidePoint::probe leaving.
Sep  4 11:06:35 localhost kernel[0]: Found an ALPS V7 TouchPad...
Sep  4 11:06:35 localhost kernel[0]: Entering command mode: ALPS: { 0x88, 0xba, 0x2a }
Sep  4 11:06:35 localhost kernel[0]: ApplePS2ALPSGlidePoint read reg result: { 0xc2, 0xd9, 0x00 }
Sep  4 11:06:35 localhost kernel[0]: ApplePS2ALPSGlidePoint read reg result: { 0xc2, 0xc4, 0x00 }
Sep  4 11:06:35 localhost kernel[0]: ALPS TouchPad Initialization Complete.
Sep  4 11:06:42 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=832, y=1160, z=-111, fingers=0, buttons=128
Sep  4 11:06:43 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=864, y=1112, z=-111, fingers=0, buttons=176
Sep  4 11:06:47 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1408, y=1248, z=-127, fingers=0, buttons=128
Sep  4 11:06:47 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1920, y=1248, z=-127, fingers=0, buttons=128
Sep  4 11:06:47 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=2880, y=1136, z=-111, fingers=0, buttons=144
Sep  4 11:06:48 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1376, y=1088, z=-127, fingers=0, buttons=144
Sep  4 11:06:48 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte1 data (80) from PS/2 controller
Sep  4 11:06:48 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=795, y=1464, z=-111, fingers=0, buttons=176
Sep  4 11:06:56 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=320, y=1456, z=-127, fingers=0, buttons=160
Sep  4 11:06:56 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1952, y=1464, z=-111, fingers=0, buttons=160
Sep  4 11:07:49 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint: Unexpected byte1 data (80) from PS/2 controller
Sep  4 11:07:49 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=2016, y=1464, z=-111, fingers=0, buttons=176
Sep  4 11:07:49 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1952, y=1408, z=-111, fingers=0, buttons=176
Sep  4 11:07:49 Yoshis-MacAir kernel[0]: ApplePS2ALPSGlidePoint::dispatchEventsWithInfo: x=1952, y=1456, z=-127, fingers=0, buttons=176
Console shows it does sense movement when I touch the touchpad, but it doesn't respond.
Both trackstick and touchpad don't work, keyboard works fine though.
 
Thanks Dr. Hurt for you effort, I can't imagine how hard it is to code something without actual hardware to test. I'll try give the R3RC1 a try.
Link to comment
Share on other sites

I'm gonna assume the pointer is not moving because the driver is reporting a negative z (pressure) value.

 

V7 does not report pressure values in its packets so the driver is going crazy and reporting -ve values.

OS X needs a z value above 30 to start translating coordinates into movements. I'll find a way to report fake pressure when movement is detected.

 

BTW, does your touchpad even have buttons? 

----------------------

 

In other news, Linux 4.2 has been released and has some nice fixes for bitmap processing (multi-finger). Will add those to the next R3RC.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...