Re: touchpad on powerbook5,6
Le jeudi 23 juin 2005 à 00:18 +0200, Frank Arnold a écrit :
> > Too bad this cannot work with the absolute approach I use...
> > I did however improve a bit the driver using a better smoothing function
> > (inspired from your code)...
> Did again some experiments:
> 1. Put Johannes/my userspace stuff into your driver skeleton and
> switched from relative to absolute values.
Ok, I worked a bit on this too and I decided to give a try to the
accumulator way. The result is a mix between Johannes', yours and my
algorithms, and the code got somewhat simpler.
The updated version is at:
It seems to work quite well, I've added some smoothing inside and I
suspect it will react better to the warming trackpad because of the
accumulator. Once it gets a bit more testing I'll make this the default.
> 2. Got the accumulator working. One remaining problem: dev->data
> delivers incomplete packages too. But accumulation needs full datasets -
> at least the first package, wich is everytime incomplete or crap. I
> don't know exactly how to fix this and used dev->urb->transfer_buffer
> and dev->urb->actual_length to figure this out and getting the data.
transfer_buffer is the same as data. You only need to look at
actual_length and skip the packet if it is not ATP_DATASIZE.
> 3. Instead of using the raw accumulator I use now an additional signal
> shaped copy for calculations. In this copy all changes of the
> accumulator are delayed a bit (think of an equalizer, wich holds the
> peak for some time). This way we get a smoother overall signal without
> having to hold previous values.
I decided to hold the previous 5 values and use them to smooth the
movement (I took the code from synaptics)
> 4. Calculation of positions is done in a different way then before. Used
> a little bit statistics (mean calculation) and your istart/iend code
> (wich was meant for finger detection). Short description:
> * get the first and last sensor with signal above min threshold
> * multiply pressure with position for each sensor between them and
> cumulate the results
> * divide the result by the sum of all pressure signals
> * here we go with our calculated position
> Side effect: People with big fingers are able to use this driver and
> it's possible to use the flat finger instead of the finger tip.
I took this calculation, it works better indeed.
> 5. Send the maximum reported pressure instead of a static value to input
> (ABS_PRESSURE). Then the driver is far less sensitive when used without
Hmm, I wonder how this is possible, since the kernel mouse driver
doesn't care at all about ABS_PRESSURE... It's only the synaptics X
driver who uses the ABS_PRESSURE.
> 6. Changed YFACT to 43 (from native screen resolution 1280x854 I come to
> 64x43). If we use touchpad dimensions here it's 40 at least.
Took this as well. I'm not sure it's the screen or the touchpad
dimensions which matters but the scale is almost the same.
Stelian Pop <email@example.com>