Jump to content

Cypress PS2 Trackpad kext


Ulysse31
 Share

128 posts in this topic

Recommended Posts

Hi Ulysse31,

Do the 3 & 4 finger gestures in your kext work on synaptics touchpad too?

I don't have a laptop now, but it would be great to see this works on synaptics too when I'm ready to hack one for myself. :)

I found out that there are some useful info in IOHIDFamily (from Apple's open source site) might help your develop this deeper.

IOHIDFamily-503.1.13 is currently the newest version available from OS X 10.9 Source.

 

Hope it helps!

Link to comment
Share on other sites

Hi Ulysse31,

Do the 3 & 4 finger gestures in your kext work on synaptics touchpad too?

I don't have a laptop now, but it would be great to see this works on synaptics too when I'm ready to hack one for myself. :)

I found out that there are some useful info in IOHIDFamily (from Apple's open source site) might help your develop this deeper.

IOHIDFamily-503.1.13 is currently the newest version available from OS X 10.9 Source.

 

Hope it helps!

 

 

my 4 fingers gestures are only composed of the "swipe" one that allows to get the mission control, the current app expose and the dashboard.

the 3 finger i implemented is an option available on the apple's mac air trackpad options, allowing to move a window, select text or elements using 3 fingers, I have implemented it simply because I found it easy to implement ^^

it works by a little hack: it send shortcut keyboard events to "simulate" the gesture. so that is why i was telling before that this "hack" is really limitated to the swipes one.

And yes, those swipes are also present in synaptics touchpad, but that's rehabman's work.

Thanks for the link, gonna search/read a bit on it.

This last 3 days i've be really busy with my work, had not the time to watch over all that. will try on next days.

 

Cheers,

 

--

Ulysse31

 

 

--

  • Like 1
Link to comment
Share on other sites

RehabMan relied a post I made in Tonymac. Seems we'll be able to get more native gestures if we change the PS2 kext to IOHIDFamily base.

On the other hand, it appears to be a huge work...  But I'm neither a coder nor a dev, I'm not sure.

Anyway, marry X'mas and enjoy the vacation! :)

 

 

Will check the IOHIDFamily, but if in fact the work is consequent, don't know if i would have one ready until some several months ... implementing cypress protocol was an "easy" task: not too much time consuming, and was a job really close to what i already code on embedded (arduino communication with chips on I2C and communication on SPI), here the PS2 kext object/instance was already present, just needed to implement the cypress protocol itself. But again, i will get an eye on those sources ^^

 

 

Thanks, (Don't have vacations but thanks anyway ^^' ), And Yes, Merry Xmas to all !

Link to comment
Share on other sites

Hi again,

 

Well like I said before, i haven't got vacations ^^ so I have now a possible v0.6, but with less features than expected, here is what is added :

 

- better 4 fingers swipe: in fact, i found the actual 4 fingers swipe a bit unstable, it was coming from the fact that when using 4 fingers and you leave the pad, you almost never leave it 4 fingers at the same time, which create a one finger tap ... so now it's corrected on this version.

- implemented 5 fingers lock screen : since cypress allows to detect up to 5 fingers, added the possibility to lock the screen by making a long 5 fingers frame => just put 5 fingers on the pad during a second/almost a second and it lock the screen, i personally find it useful since i don't like to let my machine alone without been locked, and generally locking the screen on osx can be a PITA if you don't know the shortcut keys ...

 

So, I would need some testers available today (don't know if they are a lot ^^), just send me a message and I will PM you a link to a beta debug kext (why debug: because if you have troubles, you can send me the logs) ...

On mine it works great but with the differences between firmwares versions I prefer firstly to call for some testers to be sure before release.

 

Thanks to all,

 

--

Ulysse31

Link to comment
Share on other sites

version 0.6 debug. here you go sir...

I'm still using the debugger, seems stable and has yet to crash from basic 2-4 gestures. 5 fingers gave me a select effect. hope the log helps

Thanks for your help,

 

But it seems that cypress_dump.txt is empty (zero bytes here), 2 possible things :

- bad zip

- bad dump command ( sudo cat /var/log/system.log | grep -i cypress > ~/cypress_dump.txt )

 

Thanks again for your help and quick reactivity ^^

 

Cheers,

Link to comment
Share on other sites

 

Thanks for your help,

 

But it seems that cypress_dump.txt is empty (zero bytes here), 2 possible things :

- bad zip

- bad dump command ( sudo cat /var/log/system.log | grep -i cypress > ~/cypress_dump.txt )

 

Thanks again for your help and quick reactivity ^^

 

Cheers,

 

Thanks,

 

I sent you a new "patched" debug kext to test ^^ in PM, keep me in touch :P

 

Cheers,

 

--

Ulysse31

Link to comment
Share on other sites

Thanks,

 

I sent you a new "patched" debug kext to test ^^ in PM, keep me in touch :P

 

Cheers,

 

--

Ulysse31

 

I don't know how you do it, but it works. All this time I was thinking that Cypress was just plain awful...but its all software!!! 

 

No crash from testing and screen locks just as you said it would. 

 

I will say this though, I am not sure if the CPU is sleeping or the screen is just off. The cpu  fan is shut off but the power button light is not flashing like it would when the cpu sleeps. But either way, 5 fingers does the trick and it comes in handy. Great job sir..

  • Like 1
Link to comment
Share on other sites

I don't know how you do it, but it works. All this time I was thinking that Cypress was just plain awful...but its all software!!! 

 

No crash from testing and screen locks just as you said it would. 

 

I will say this though, I am not sure if the CPU is sleeping or the screen is just off. The cpu  fan is shut off but the power button light is not flashing like it would when the cpu sleeps. But either way, 5 fingers does the trick and it comes in handy. Great job sir..

 

Hi,

 

Thanks for your test report.

Great to know it works ^^, on mine it works too now ^^'.

So far here is why 4 and 5 fingers does not work directly out of the box :

For some (unknown) reason, on firmware version 34 and later, the trackpad sends an invalid packet header following the cypress specs itself for 4 fingers touch, and on 5 fingers, it sends an "almost" valid header ^^.

I say almost because it seems valid, but as one bit set that following the spec implies to have 1 other bit set elsewhere ... and it does not ... and if i know that the firmware version is superior or equal to 34, than i can i patch the header to match what it should look alike : a 5 finger header . to resume, same patch for the 4 fingers detection.

I was wondering, why does cypress has released new firmwares with less features ?? generally, when you update firmware is to get more features and stability ...

I may have some ideas, in why the cypress touchpad is v34 and later have less features than v11 or other lower firmware : it might came from a marketing/commercial willing. Here is my little guessing story:

 

A computer manufacturer says to Cypress:

- hey, i might be interested in implementing your trackpads on my computers, but i think they are too expensive for me, and i don't need up to 5 fingers detection. 3 fingers is largely enough

then the Cypress marketing/sales turns to its hardware dev team and says :

- We need to lighten this product, reduce cost only to 3 fingers detection.

- "but we can't hardwarely, those chips are made to track 5 fingers, it would need to make a new chip, which implies dev work time and putting to trash all 5 fingers trackpad chips already in stock !" says the engineer.

- Don't care, find the chipper way !

 

And yes, in that type of cases, the engineer might lower features by modding software/firmware, and lower features only to sell a product. they don't gain in production cost, but either they don't loose.

They could resolve the negotiation just by directly lowering the price, leaving the features for a lower price, but for the marketing/sales dep, it is not understandable to sell the same for a lower price, they prefer selling a software lowered product, even if the production cost of the product still the same.

 

 

This little story might imply 3 interesting possibilities in the near future, or maybe a already the case since don't have tested my 5 finger detection on v35 and v36 yet :

 

- Possibility 1 : a new trackpad (like v42) version may come out, when they would have emptied all the 5 fingers chip they had in stock, but with a new low cost chip with hardwarely lowered finger detection, and in that case, 5 fingers won't work even with my little trick.

- Possibility 2 : 5 fingers chip production gets lowered by itself, the selling is so intense/wide, that production becomes a large scale so that production cost is reduced, and they keep the same chip. (no hardware feature shrink)

- Possibility 3 : cost between a 5 fingers chip and a 3 fingers chip is really close, and don't worth to build a new chip production, and the limitation stays softwarely lowered.

 

So, now i can close this little parenthesis on my personal guessing attempt in "WTF do you reduce features in newer products ??!!".

 

For the 5 fingers "gestures" i implemented, I'm gonna explain a bit what it is exactly :

 

- 5 simultaneous fingers appears on the trackpad, and leave about a second later => this triggers the screen lock feature : it launches the OSX shortcut keys for screen locking (Control+Shift+Eject)

- 5 simultaneous fingers appears on the trackpad, and still present after 3 seconds => this triggers the sleep computer feature : it launches the OSX sleep shortcut keys (Command+Option(Alt)+Eject)

 

I firstly thought that the sleep features wasn't working on my computer but after @youngwake reported me that it works on his computer,  checked again on mine and yes it works, it just take some time to go to sleep, but that might come from my DSDT ...

 

@youngwake: Gonna build a new pre-release, will sent it to you in order to test it, but first gonna clean a bit the code. thanks again.

 

 

Cheers,

 

 

--

Ulysse31

Link to comment
Share on other sites

sorry been slow last 2 days here is my dump

 

http://www.mediafire.com/download/61jfx8au6nw41ld/cypress_dumpv6.txt.zip

 

not seeing anything on five fingers it just does some weird random stuff.

 

edit: further attempt at 5 fingers left the trackpad non responsive

Hi,

 

From what i check on the logs, this dump is using an old v0.6 debug kext, since then, i patched the code to handle "buggy"/"cheap" firmwares v34 and later (cf my last post), those firmwares, in fact does not handle 5 fingers normally.

since this last patch other user reported it working.

Have you tested the v0.6 pre-release i sent you in PM ?

 

Thanks,

 

--

Ulysse31

Link to comment
Share on other sites

Slight issue I think....

 

Sometimes depending on my finger location it will lock my laptop when I log back in the sound no longer works on my machine :-|

 

The sound does not work anymore ? have you still have troubles with putting your machine to sleep ? it might be some misdetect 5 fingers that produces a 5 fingers sleep ...

If I remember good you have an xps 13, will also try to reproduce it on my computer and try to track down that mis-detection.

If you find an way to reproduce this problem (move combination on trackpad or other). Please tell.

I am working on a prefPane for the kext, that will allow to customize taps/timers but also enable/disable features.

 

Thanks again for your report.

 

Cheers,

 

EDIT: OK, I think i found something, i was able to reproduce a 4 finger swipe with only two fingers : by clicking on the corner bottom left edge (mecanical click) + and then putting a second finger in move arround the bottom center of the pad. and got 2 valid packets from the trackpad telling 4 fingers ... but only 2 packets, and got 4 finger gestures (no locks, and no sound troubles).

I suppose that in your problem, that might be a similar action that creates a similar bug but with 5 fingers instead of 4.

That allows me to think several points :

- The cypress firmware is not that correct even in v11 ( :P )

- This is patchable : generally the 4 and 5 fingers gestures are until now taken in account only if they have a minimum of packets of 2 ... this can be raised to 3 or 4, and it would "patch"/avoid this bogus behaviour of the firmware.

- v34 and later might not be affected (since i already patch header packets to get 4 and 5 fingers). but it still a supposition.

I think that in fact, it might have some bug issue here, but the sound lost, i don't have it and my be a sleep/DSDT issue (since lock shortcut used put screen to sleep and sleep shortcut lock then sleeps computer).

 

--

Ulysse31

Link to comment
Share on other sites

Yes but could be related to issue with my motherboard, dell are coming on Thursday to replace it, I can't even turn it on at the moment.

 

When I did put it to sleep, extended sleep ie 8+ hours it wouldn't wake up.

 

When the laptop is up and running again I shall test it but from memory,

 

It was when I was holding left click and using the trackpad (could be another finger touched while highlighting for example)

Link to comment
Share on other sites

Ok, I think I found the "end" of this :

 

In fact it seems that there is a little bug on firmware (at least v11 aka in XPS 13 and 12 i think), if you click mecanically then select with a second finger, no bug, the touchpad "streams" the coordinates of the moving fingers.

BUT, IF you stop moving the finger you are using to select/move cursor and then tap quickly (something several taps to append), the trackpad firmware as a Hic-up : it stop sending the packet is writing to write a new one with a tap, which means that it sends an incomplete packet that create a de-sync on protocol, the de-sync can be detected directly since the first packet is not a header byte.

BUT, IF the first packet is valid as a header byte (compliant to the cypress doc) it only detects the de-sync on the few next packets, but some packet have already been taken in account which creates some "buggy" behaviour.

 

I know, selecting with mecanical click and then tapping with the moving fingers with keeping mecanical click is not a often case ... can almost be call quite rare ... but it still a minor issue.

 

I might enhance packet filtering, but the cypress protocol as not a fixed header packet type but dynamic/variable packet header type : in order to validate a header byte, for each specific bits set on the header byte it implies that I check that other bit might be or not be set ... which in short means that there is no way to be 100% sure that a byte is not a header byte with there protocol ...

 

Does someone with a XPS 15z (or other that would have a v34 fw or later) could test that ? selecting with mecanical clic and then tap with the moving finger (keeping mecanical click) and tell me if it gives strange behaviour ?

 

Thanks,

 

 

--

Ulysse31

Link to comment
Share on other sites

So I finally got around to try it out.

 

It's definitely usable now. The only thing I REALLY want from it, is for it to be smoother. Right now it's still kind of jerky, and that makes it hard to click small things.

 

Great job, though.

 

Edit: I recommend everyone to disable horizontal scrolling. It makes scrolling much smoother.

Link to comment
Share on other sites

  • 3 weeks later...

Hi all,

I have update my first post since I have released v0.7 with a lot of changes :

 

Values from the trackpad in multifingers gestures are now filtered/smoothed allowing better moves.

Added dragging via pressure average calculation and triple tap drag lock.

You can now set all advanced parameters of the kext via the VoodooPS2Trackpad/Info.plist, here is a list of the parameters and their quick definition :

 

CypressTwoFingerRightClick  : enable/disable two fingers right click
CypressThreeFingerDrag : enable/disable three fingers drag
CypressFourFingerHorizSwipeGesture : enable/disable 4 fingers left right swipe
CypressFourFingerVertSwipeGesture : enable/disable 4 fingers up down swipe
CypressFiveFingerScreenLock : enable/disable 5 fingers screenlocking
CypressFiveFingerSleep : enable/disable 5 fingers sleep
Cypress1FingerMaxTapTime : defines the maximum frame time to be considered as a tap (for 1 finger type frames)
Cypress2FingerMaxTapTime : defines the maximum frame time to be considered as a tap (for 2 fingers type frames)
Cypress3FingerMaxTapTime : defines the maximum frame time to be considered as a tap (for 3 fingers type frames)
Cypress4FingerMaxTapTime : defines the maximum frame time to be considered as a tap (for 4 fingers type frames)
Cypress5FingerMaxTapTime : defines the maximum frame time to be considered as a tap (for 5 fingers type frames)
CypressDragPressureAverage : average pressure above this value will be considered as a drag (default 85)
Cypress5FingerScreenLockTimer : minimum time to wait (in ms) with 5 fingers to launch a screen lock
Cypress5FingerSleepTimer : computer goes to sleep if 5 fingers still present after this minimum time (in ms)
CypressPressureFiltering : set the noise value of the pressure filtering (default 20) setting to 0 disable kalman filtering for pressure
Cypress2FingerFiltering : set the noise value of the 2 fingers scroll filtering (default 1) setting to 0 disable kalman filtering for 2 fingers scrolling
Cypress3FingerFiltering : set the noise value of the 3 fingers drag filtering (default 50) setting to 0 disable kalman filtering for 3 fingers drag
Cypress4FingerFiltering : set the noise value of the 4 fingers swipes filtering (default 20) setting to 0 disable kalman filtering for 4 fingers swipes

 

In order to test quickly different values, you can now download and use the cypress prefpane i made for v0.7, from there you can check enabling/disabling/customizing values in real time, once you have configured everything has you wish, you can then go on the last tab of the prefpane to see the different values you need to set on which parameters in the VoodooPS2Trackpad/Info.plist file. Once set on the Info.plist, settings will be definitively at boot.

Basic Trackpad settings are still to configure on the Apple's Trackpad System Preferences, the prefpane is only for the advanced features and values.

 

Hoping that you'll like this release.

Again, like the other release versions, if someone have questions or needs some clarifications, don't hesitate to contact me on this thread or by PM.

 

Cheers all,

 

--

Ulysse31

Link to comment
Share on other sites

 Share

×
×
  • Create New...