Bug 99351 (synaptics)

Summary: Add support for event layer synaptics driver
Product: [Retired] Red Hat Raw Hide Reporter: Paul Nasrat <nobody+pnasrat>
Component: XFree86Assignee: Mike A. Harris <mharris>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: aleksey, anthony, behdad, bugzilla, cra, dkelson, gkarabin, michael.redinger, mitr, pbender, sp, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://w1.894.telia.com/~u89404340/touchpad/
Whiteboard:
Fixed In Version: 4.3.0-58 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-18 06:34:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Basic skeletal spec changes
none
Imakefile for synaptics driver
none
Patch for sdk includes
none
Modified tpconfig kernel patch for 2.4 series kernels
none
Working incremental patch
none
Working patch for XFree86 none

Description Paul Nasrat 2003-07-17 22:58:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20030131

Description of problem:
Many laptops have a touchpad driver which uses the Synaptics driver.  With the
2.6.0 psmouse/evdev combination standard XFree86 drivers will not work with the
touchpad.  Using the trackpad does not produce mouse activity.

modprobe.conf fragment

install psmouse /sbin/modprobe --ignore-install psmouse && { /sbin/modprobe
evdev; /bin/true; }




Version-Release number of selected component (if applicable):
kernel-2.6.0 and XFree86-4.3.0

How reproducible:
Always

Steps to Reproduce:
1. Boot into 2.6 and modprobe psmouse (there may be timing issues otherwise)
2. Start X
3. Move finger along trackpad

Actual Results:  Nothing happens

Expected Results:  Movement controls cursor

Additional info:

May vary depending on how synaptics driver presents to bios but v. common

Comment 1 Paul Nasrat 2003-07-17 23:02:45 UTC
Created attachment 92992 [details]
Basic skeletal spec changes

Initiial spec changes - I had this working against 9, but rawhide doesn't build
fully with errors, compile and binary ok.  

RPM build errors:
    File listed twice: /usr/X11R6/lib/modules/dri/tls
    File listed twice: /usr/X11R6/lib/modules/dri/tls/gamma_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/i810_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/i830_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/mga_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/r128_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/r200_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/radeon_dri.so
    File listed twice: /usr/X11R6/lib/modules/dri/tls/tdfx_dri.so
    Bad exit status from /var/tmp/rpm-tmp.38788 (%doc)

Comment 2 Paul Nasrat 2003-07-17 23:04:42 UTC
Created attachment 92994 [details]
Imakefile for synaptics driver

This is the file with the spec which I can get working drivers

Comment 3 Mike A. Harris 2003-07-17 23:50:37 UTC
Yes, I've investigated this before, and it will probably get into the
distro at some point.  The problem is that it is GPL licensed, not MIT
licensed like the rest of XFree86.

Having a bunch of stuff in the XFree86 rpm permanently that will never
get into upstream XFree86 makes the rpm a huge unmaintainable mess, so
I've avoided it as much as possible in the past, having learned what
a pain it is to have extras just folded into the rpm.

Also, XFree86.org gets annoyed when they receive bug reports for drivers
and whatnot that do NOT come with XFree86 stock, but which some distro
adds into their XFree86 packages.

I'd like to add the driver, but I'd like to do so in a separate package.
Unfortunately the driver requires XFree86 source code in order to compile.

I've enabled the XFree86-sdk package, and plan on investigating if I can
get the driver to build against that or not.  If so, we might be able
to do this ok.  If not, I'll see if I can devise another way.


Comment 4 Paul Nasrat 2003-07-18 03:19:34 UTC
That's great I'm really only trying to raise this as a rawhide/2.6 thing as the
new kernel input layer for touchpads just doesn't work in the same way.  I
didn't even consider looking at licenses as I was trying to get it working.

Hmm, you could possibly provide it as a driver from the same src.rpm, but the
pain is distributing.  Gah!  The issue for me (and others) is 2.6 doesn't work
with synaptics without this driver/gpm in CVS.  It's one of the FAQ's I've seen
so I tried to make it work (but compiling X is such a pain). However I'm
guessing this needs to go in for a full 2.6 distro. The new input layer is the
real killer which means this is needed ...
 

Comment 5 Mike A. Harris 2003-07-18 07:59:29 UTC
Yes, a few people have indicated this, and I'd like to come up with a solution
that includes the driver with no drawbacks if possible.

I tried to build the sdk and it fails, which sucks.  That's something I'll have
to explore after OLS+holidays though.

Aparently you can disable something in the kernel config and get these things
to work without this new driver.  I don't recall the config item however
bero mentioned it to me a few days ago.  Perhaps someone who is aware of what
needs to be disabled can make note of that here for now.

It'll likely be in a 2.6 based distro for sure somehow or another.  I'd like
to do it for our next release too though.  Just depends what issues arise.
Thanks.

Comment 6 Paul Nasrat 2003-07-18 10:19:44 UTC
The hack is psmouse_noext=1 IIRC, again this seems to work or not depending on
the actual touch pad.  

Plus there is some weird key repeating which only seems to happen if it gets
modprobe'd on boot, if I manually modprobe (with auto evdev probe in
/etc/modprobe.conf) it works fine - however this is getting beyond the scope of
the bug :_

Comment 7 Paul Nasrat 2003-07-23 17:15:42 UTC
I've built the XFree86-sdk and got it working for an additional driver (foo),
however it won't work for input drivers - they really need the full source tree.
 I'll send some patches for the README and the via driver was bombing out
(whitespace issue) so the sdk works generically, but for out of tree input
drivers you may need an XFree86-source sub package - which sucks but the sdk
doesn't have the necessary headers.

Comment 8 Paul Nasrat 2003-08-06 14:23:13 UTC
I have tested using an XFree86-source package (similar generation to
kernel-source - but after prep stage so it's a clean tree), and tested it with
building vnc using lndir to simulate the tree ontop of the local vnc changes. 
This works well and would be of benefit both to synaptics and vnc and other out
of tree drivers.  Although you need to build with FAST=1 as make depend is
broken on the patched tree.

I don't have my spec file patch for XFree86 to hand but essentially I added a
%define build_source 1; created $RPM_BUILD_ROOT/usr/src/%{name}-%{version}, tar
. and extract in the output dir, added a sub package in conditionals, added a
files directive in conditionals.

Could this be considered an RFE for XFree86-source please! 

Then I'll look at the synaptics package, saving space in src.rpm is good, and
there is a rawide package that would benefit.

Comment 9 Paul Nasrat 2003-08-26 08:55:16 UTC
Saw this on irc which is a lighter weight source package (for synaptics, vnc, etc)

https://bugzilla.fedora.us/show_bug.cgi?id=647

I have a standalon synaptics spec which I could submit to Fedora maybe.

Comment 10 Mike A. Harris 2003-08-26 13:20:00 UTC
The RPM files linked to in the fedora bug report are not accessible to download
so I can't examine them at all.

Comment 11 Mike A. Harris 2003-08-26 13:25:45 UTC
The proper fix for this BTW, is to fix the SDK.  That means the via driver
needs to have SDK stuff added to the Imakefile, and the input driver
tree and it's deps need to be added to the SDK by editing their respective
Imakefile's also.

That is the minimal needed to get things working on x86.  However then the
SDK needs to be made to work on ia64, AMD64, ppc as well, and and while the
other architectures we support don't ship an X server (ppc64, s390, s390x),
the SDK changes must not break those architectures.

How much work this involves I'm not sure, but it is a lot of work to devote
to adding one or 2 drivers this close to the end of a development cycle.

Some of the SDK has been fixed in XFree86 CVS also.  I need to investigate
that.

A separate source package might work, but if it's 30Mb or something huge
like that, IMHO that is unacceptable to add 30Mb to the distro of code
that is already there just for one or two drivers.  That just fills CD
space unnecessarily.  But since the VNC package aparently soaks in the
source anyway, it might be better to do it with a separate source package
anyway.

Very ugly no matter how you slice it.  I'd rather people who are interested
in this problem try to solve the real problem and help fix the broken SDK.
All you need to do is examine Imakefiles of existing drivers, and enable
the with_sdk macro in the spec file.  Then troubleshoot problems and hopefully
fix them.  ;o)






Comment 12 Mike A. Harris 2003-09-01 08:07:49 UTC
*** Bug 103498 has been marked as a duplicate of this bug. ***

Comment 13 Paul Nasrat 2003-09-03 16:12:19 UTC
A very skeletal src.rpm for the via driver built using the sdk is available for
you to prod at - I know the name/version isn't perfect but the meat is in the
Imakefile patch and in the imake command used:

http://pauln.truemesh.com/rpms/xfree86-via-driver-4.3.0-1.src.rpm

vga also works fine too.  


Comment 14 Paul Nasrat 2003-09-08 12:13:11 UTC
I've got synaptics driver working with XFree86-sdk.  It only required two
additional includes to be added to the sdk and a simple Imakefile.  I've tested
on  2.6.0-0.test4 with a touchpad and it works.

Patches to follow along with src.rpm

Comment 15 Paul Nasrat 2003-09-08 13:13:54 UTC
Created attachment 94296 [details]
Patch for sdk includes

This is an updated patch for sdk includes it adds two includes in addition to
the ones from bugid https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=103824
as I don't have XFree86 4.3.0-29

Comment 16 Paul Nasrat 2003-09-08 13:28:38 UTC
I've put a synaptics src.rpm on my website, I haven't put strict versions on the
requires for XFree86 and the sdk as these aren't available yet.

I'm probably going to submit it to fedora when there is a public version of
XFree86 with the necessary sdk include patches in - hence the fedora style spec.

http://pauln.truemesh.com/rpms/

Comment 17 Mike A. Harris 2003-09-09 15:37:44 UTC
Your latest patch is integrated into 4.3.0-29.1 and later.

Comment 18 Mike A. Harris 2003-09-09 16:33:51 UTC
Just for everyone who might stumble upon this bug report / RFE, the synaptics
driver is now being considered for inclusion in Cambridge pending it building
ok against the SDK, not having 2.6.x compile time deps, and the results actually
working.

Comment 19 Mike A. Harris 2003-09-09 22:25:21 UTC
*** Bug 77842 has been marked as a duplicate of this bug. ***

Comment 20 Mike A. Harris 2003-09-10 22:12:34 UTC
*** Bug 84792 has been marked as a duplicate of this bug. ***

Comment 21 Paul Nasrat 2003-09-11 07:56:06 UTC
I've tested the synaptics driver using as follows on my laptop:

Section "InputDevice"
        Identifier  "MouseS"
        Driver      "synaptics"
        Option      "Device" "/dev/psaux"
        Option      "Protocol" "auto-dev"
        Option  "LeftEdge"      "1900"
        Option  "RightEdge"     "5400"
        Option  "TopEdge"       "3900"
        Option  "BottomEdge"    "1800"
        Option  "FingerLow"     "25"
        Option  "FingerHigh"    "30"
        Option  "MaxTapTime"    "180"
        Option  "MaxTapMove"    "220"
        Option  "VertScrollDelta" "100"
        Option  "MinSpeed"      "0.02"
        Option  "MaxSpeed"      "0.18"
        Option  "AccelFactor" "0.0010"
        Option      "Emulate3Buttons" "no"
EndSection


2.6.0-0.test4 - works with synaptics only - MouseS auto-dev sets Synaptics
Device to /dev/input/event0

2.6.0-0.test4 with psmouse_noext=1 kernel arg.  X won't start (though I expected
this) if I add a second InputDevice using the mouse driver it works

2.4.21-20.1.2024.2.1.nptl - works with synaptics only.

I'll wait for 4.3.0-29.1 or greater to be available then rebuild on 2.4 only
severn box (with updates) and retest.

Comment 22 Péter, Soós 2003-09-15 08:42:57 UTC
This synaptics driver do not works for me if gpm is active on 2.4 series
kernels. You may apply the modified kernel patch of tpconfig to coexist both X
driver and gpm using synaptics mode on kernels 2.4.

Comment 23 Péter, Soós 2003-09-15 08:45:38 UTC
Created attachment 94489 [details]
Modified tpconfig kernel patch for 2.4 series kernels

Modified tpconfig kernel patch for 2.4 series kernels to work X ang gpm
together in synaptics mode.

Comment 24 Paul Nasrat 2003-09-15 09:09:29 UTC
Thanks for pointing that out, I didn't spot that despite it being clear on the
web page.  As I'm running 2.6 mostly I don't have gpm running (I haven't looked
at the synaptics patches for it yet...)

I'm guessing this means this is unlikely to get in to Cambridge.  I'll test a
kernel rebuilt with that patch in with gpm running.

Comment 25 Paul Nasrat 2003-09-16 05:38:59 UTC
In case anyone is following this

New rawhide XFree86 reverts patch to build this, I've just downloaded the
src.rpm and I'll look for why the following occurs:

- Disabled SDK-add-missing-includes-for-vnc patch as it causes the X server
  build to fail, reverted to previous patch for synaptics.

Apologies.

Comment 26 Paul Nasrat 2003-09-16 12:57:54 UTC
Created attachment 94520 [details]
Working incremental patch

XFree86 builds with this ontop of other one, or you can editdif
s/exevent.h/exevents.h/

Comment 27 Paul Nasrat 2003-09-16 13:01:26 UTC
Note when I say "other patch" I refer to Patch# 9133 (for vnc includes).  This
can  replace 9134 or I could combine them if you prefer.

Comment 28 Paul Nasrat 2003-09-21 11:27:02 UTC
I've just done some initial testing on 2.4 (2.4.21-20.1.2024.2.1.nptl) with gpm
using the patches available from:

http://www.geocities.com/dt_or/gpm/gpm.html

I built on severn+rhn updates from the src.rpm (I changed the release to
Release: 38.dt.7) provided at that site.

Mouse worked both in console and in X.  Work needed for /etc/sysconfig/mouse and
/etc/sysconfig/gpm setup for 2.6 for correct gpm arguments but I think this is
better if fixed in gpm rather than with the tpconfig patch.  Although the
patchset contains quite a bit of refactoring so it might take a bit to get this
upstream, but still feasible for Cambridge++ I'd hope

Comment 29 Paul Nasrat 2003-11-29 11:29:18 UTC
The synaptics driver no longer requires a full XFree86 source tree to
build.  I am currently repackaging and testing build requires.

Please drop patch 9133 and 9134 as they are no longer required.



Comment 30 Mike A. Harris 2003-11-30 09:20:11 UTC
No, those patches fix bugs in the XFree86 SDK, which doesn't provide
all of the stuff needed for the SDK to be useful otherwise.  The SDK
has various other problems which still need to be fixed also.

It is not acceptable to me for people to grab random header files or
other parts of an XFree86 build and stuff them into individual driver
builds, as those headers might change at any time, thus breaking the
given driver.

I want this to be fixed properly, not just worked around.

Comment 31 Paul Nasrat 2003-12-02 07:52:54 UTC
I've pushed a patch against HEAD to xfree86-devel list to try and get
some discussion on this matter.

If it gets in I will push an Imakefile that will work both with the
SDK and with an expanded tree.

I agree the inclusion of externally modifyable headers in a src tree
is probably not a good idea.


Comment 32 Dax Kelson 2004-01-03 06:41:08 UTC
Happy new year. Here's hoping to a resolution to get the synaptic XF86
driver included with Fedora++.

My FC1 laptop is running the 2.6 kernel full-time now.

The synaptic driver is substantially more featureful/useful/productive
versus the stock XF86 mouse driver.

Comment 33 Paul Nasrat 2004-01-25 10:11:31 UTC
I think that we should document use of psmouse.proto=imps for test1
users, and I'm working on cleaning up the synaptics stuff and
repushing upstream to XFree86 and synaptics driver maintainer.

I've resynced synaptics and rewritten the majority of the Imakefile -
I need to rediff against XFree86 head and bugzilla.  I will try and
get this done this asap.

Comment 34 Paul Nasrat 2004-01-26 11:29:48 UTC
XFree86 upstream bug http://bugs.xfree86.org/show_bug.cgi?id=1121

Comment 35 Paul Nasrat 2004-01-27 04:57:30 UTC
My patch has been commited upstream for this

http://bugs.xfree86.org/show_bug.cgi?id=1121

Mike can you drop the patches 9133 and 9134 from the current XFree86
srpm I'll rediff against the srpm if necessary and upload a patch.

Comment 36 Mike A. Harris 2004-02-03 10:54:44 UTC
well?  waiting for clean patch that applies to fedora devel rpm
and is tested to compile properly....

Comment 37 Paul Nasrat 2004-02-04 11:08:03 UTC
Created attachment 97462 [details]
Working patch for XFree86 

src.rpm and binary rpm of XFree86 to prove compile here

http://pauln.truemesh.com/rpms/synaptics/

broken-out for ease of inspection.  The attach patch applies after
XFree86-4.3.0-xf-4_3-branch-2003-11-03.patch which also touches one of the
Imakefiles.

I dropped 9133 and 9134 and added

Patch9133: XFree86-4.3.0-SDK-add-missing-includes-for-synaptics.patch

Comment 38 Paul Nasrat 2004-02-05 14:18:57 UTC
synaptics rpms which have built against xfree86-sdk above (only
upgraded that) no at

http://pauln.truemesh.com/rpms/synaptics/

Tested with touchpad as core pointer (device /dev/input/mice protocol
auto-dev) and /dev/input/mice as AlwaysCore.  usb and nipple work
(nipple is seperate event device).

Comment 39 Mike A. Harris 2004-02-18 06:25:50 UTC
*** Bug 114804 has been marked as a duplicate of this bug. ***

Comment 40 Mike A. Harris 2004-02-18 06:34:21 UTC
This bug does not block bug 116091 in any way.  Removing blocker
status.

Aleksey:  if you wish to track synaptics related bugs, feel free
to open a "synaptics related tracker bug" and mark various synaptics
related bugs as blockers on that one, however please do not pick
an arbitrary bug and then mark other bugs as blockers because
they have something in common and you'd like to track them.  That
is improper use of bugzilla, and it makes the one "master" bug
uncloseable until all of the blockers are closed - which is not
what is wanted.

I've put Paul's patch into 4.3.0-58, and it builds just fine
locally.  Should be in rawhide this week sometime if beehive
ever actually allows us to build anything...

Thanks Paul for the patch, and your efforts.


Comment 41 Aleksey Nogin 2004-02-18 06:46:46 UTC
> If you wish to track synaptics related bugs, feel free
> to open a "synaptics related tracker bug" and mark various synaptics
> related bugs as blockers on that one, however please do not pick
> an arbitrary bug and then mark other bugs as blockers because
> they have something in common and you'd like to track them.

- Fully supporting synaptics touchpads in X is IMHO a prerequisite for
fully supporting them in system-config-mouse.
- I did not "pick an arbitrary bug" _ was the one who filed bug 116091
in the first place
- I did not turn bug 116091 into "synaptics related tracker bug" - out
of all the synaptics bugs I only picked those that I thought were
relevant (e.g. those that would need to be fixed in order for s-c-m to
be able to do the right thing).

Anyway, now that this bug is fixed (thanks _a lot_!!!), this is
irrelevant. Thanks again to all who made it possible!

Comment 42 Mike A. Harris 2004-02-18 06:54:59 UTC
>- Fully supporting synaptics touchpads in X is IMHO a prerequisite for
>fully supporting them in system-config-mouse.

I still have not decided wether or not I'm going to even include
the synaptics driver yet.  However our SDK package can now
allow the driver to build outside of XFree86 and hopefully
without a bunch of hacks.

I do not have any synaptics hardware at all to test with, and
so if it gets included at all, it will be as-is.  I have extreme
reservations about adding a driver like this which I do not
have any hardware for.  I also have no time to review the
driver or see if the upstream maintainer is active still.

In time I will look into these issues, however for now at least
it's easier to build the driver I hope.

Comment 43 Aleksey Nogin 2004-02-18 07:31:20 UTC
> I still have not decided wether or not I'm going to even include
> the synaptics driver yet.  However our SDK package can now
> allow the driver to build outside of XFree86 and hopefully
> without a bunch of hacks.

??? Are you saying that 4.3.0-58 will only fix bug 114804 (include the
SDK changes), but not this one (e.g. include the actual driver)???

First, the most recent synaptics driver (0.12.4, dated Feb 10)
_already_ builds on 4.3.0-57 without any problems or hacks - see
http://nogin.org/tmp/ if interested.

Second, if the driver itself is not yet included, should a new RFE be
filed or this one (which asked for it in the first place) be reopened?

Finally, the upstream maintainer is indeed very active -
http://w1.894.telia.com/~u89404340/touchpad/files/ suggests a new
release is happening every month or so (with the most recent one dated
February 10th).




Comment 44 Paul Nasrat 2004-02-18 07:44:58 UTC
The driver is GPL and can not go into XFree86 itself.

Please read the history of comments for more context, earlier
synaptics drivers needed an entire XFree86 source tree to build which
was not acceptable. I got it to build with the SDK, pushed patches. 
Later versions ship XFree86 headers in the tar.bz2, and the most
recent Makefile detects the fixed sdk and uses that, prior to that I
was using an Imakefile to generate my Makefiles.  I'm going to rebuild
my rpm when XFree86 -57 comes out of rawhide.

External drivers should be using the SDK and not shipping there own
headers, it didn't work it does now and upstream. I'm going to
continue to work to ensure that this is the case for as many drivers
as possible.

I am working with people to figure out best way for inclusion, whether
Core or Extras, etc.  I will probably push to extras as soon as -58
comes out and I've rebuilt, then it can be merged into core if
necessary.  I will post updates to necessary lists.

I have mailed the maintainer to see if there is announce list so I can
better track upstream.