# HOW-TO: use synaptics driver for better touchpad features



## lonestar (Jan 26, 2016)

Finally, my long quest for proper touchpad support has come to an end. Specifically, my touchpad now supports two-finger scrolling and smoother/faster acceleration when moving the pointer around.

This comes from a lot of time spent experimenting with different options. So in order to possibly save others the same headache, I will post my solution here.

This applies to FreeBSD 10.2-RELEASE, and my laptop is a Thinkpad T530.

There is only one disclaimer: this configuration has resulted in a non-functional trackpoint (both the trackpad pointer and the three buttons beneath it). If I ever decide to get that sorted out, I'll post an update. However, for now the trackpoint was less important to me than the touchpad features.

This method is quite a bit different than all others I've found in various posts, blogs, mailing lists, and how-to's. All have suggested using the mouse driver instead of the Synaptics driver, but my solution is the opposite.

Of course, the perspective of all these steps are from my personal experience. Adjust and experiment as necessary.


Install the following software from ports (not with pkg(8))

x11-drivers/xf86-input-synaptics
x11/libsynaptics
With the pkg(8) versions installed, I was getting errors in Xorg.0.log: 
	
	



```
Unable to query/initialize Synaptics hardware
```

Add to /boot/loader.conf:

```
hw.psm.synaptics_support="1"
```

In /etc/rc.conf, make sure moused(8) is not enabled. The reason is that it will conflict with your xorg.conf file (as will be shown below). However, hald and dbus did not cause any problems. That is key, because depending on your setup, some features may still rely on those services.

Generate an xorg.conf file as described in the handbook:

```
# Xorg -configure
```

Then copy that file to /usr/local/etc/X11/xorg.conf.
`#  cp /root/xorg.conf.new /usr/local/etc/X11/xorg.conf`

You shouldn't have to remove any content from this file. This is my xorg.conf file, excluding the Monitor and Video card sections, with additions noted.

```
Section "ServerLayout"
    Identifier  "X.org Configured"
    Screen  0  "Screen0" 0 0
    InputDevice  "Mouse0" "CorePointer"
    InputDevice  "Keyboard0" "CoreKeyboard"
    InputDevice  "Touchpad0" "CorePointer" << added
    Option  "AutoAddDevices" "false"       << added
EndSection

Section "Files"
   ModulePath  "/usr/local/lib/xorg/modules"
   FontPath  "/usr/local/share/fonts/misc/"
   FontPath  "/usr/local/share/fonts/TTF/"
   FontPath  "/usr/local/share/fonts/OTF/"
   FontPath  "/usr/local/share/fonts/Type1/"
   FontPath  "/usr/local/share/fonts/100dpi/"
   FontPath  "/usr/local/share/fonts/75dpi/"
EndSection

Section "Module"
   Load  "glx"
EndSection

Section "InputDevice"
   Identifier  "Keyboard0"
   Driver  "kbd"
EndSection

Section "InputDevice"
   Identifier  "Mouse0"
   Driver  "mouse"
   Option    "Protocol" "auto"
   Option    "Device" "/dev/sysmouse"
   Option    "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"                  << added
   Identifier  "Touchpad0"             << added
   Driver  "synaptics"                 << added
   Option  "Protocol" "psm"            << added
   Option  "Device" "/dev/psm0"        << added
   Option  "SendCoreEvents" "on"       << added
   Option  "VertTwoFingerScroll" "1"   << added
   Option  "EmulateTwoFingerMinZ" "7"  << added
   Option  "EmulateTwoFingerMinW" "7"  << added
   Option  "VertScrollDelta" "-111"    << added
   Option  "TapButton2" "0"            << added
EndSection                             << added

... the rest is irrelevant monitor and screen configurations
```

* moused(8) will prevent the use of /dev/psm0, causing errors in Xorg.0.log stating that psm0 is busy or already open.

Two things that I found significant...
1. I didn't have to add synaptics to the "Module" section, and
2. I added a line to prevent devd(8) from auto-adding devices in order to avoid overriding my chosen options.

The "Touchpad0" section, beginning at "VertTwoFingerScroll," will differ according to personal preference. All of these values came from reviewing synaptics(4).

About "EmulateTwoFingerMinZ" and "EmulateTwoFingerMinW"... I'm not positive that they're necessary or if they are indeed optimal values. After further experimentation, I've found that these values are necessary for me to get two-finger vertical scrolling. 

And that's it! Hopefully you now have a smooth touchpad experience.


----------



## sag (Jan 30, 2016)

lonestar said:


> There is only one disclaimer: this configuration has resulted in a non-functional trackpoint.


Could you please clarify whether "non-functional" applies to just the trackpoint nib or to both the nib and the trackpoint buttons?


----------



## fnoyanisi (Feb 4, 2016)

lonestar said:


> Install the following software from ports (not with pkg(8))
> 
> x11-drivers/xf86-input-synaptics
> x11/libsynaptics
> ...


Have you created a bug report in bugzilla for this issue?

Unless the software installed from the `ports collection` and is passed non-default compile time options , it should behave exactly the same as the one installed via pkg(8).


----------



## lonestar (Feb 5, 2016)

sag said:


> Could you please clarify whether "non-functional" applies to just the trackpoint nib or to both the nib and the trackpoint buttons?



Yeah, both the nib and the trackpoint buttons are non-functional.

I'm sure it's because of moused(8) being disabled, since those buttons all work fine when moused(8) is running. In fact if you prefer the trackpad over the touchpad, you should definitely not use this method.

I wouldn't be surprised if there's some way to make both of them work.


----------



## sag (Feb 6, 2016)

lonestar said:


> Yeah, both the nib and the trackpoint buttons are non-functional.


Based on posts in earlier threads in these forums, I was able to edit xorg.conf to achieve the same result about a year ago.



lonestar said:


> I'm sure it's because of moused(8) being disabled, since those buttons all work fine when moused(8) is running. In fact if you prefer the trackpad over the touchpad, you should definitely not use this method.


This applied to me because I just couldn't do without the trackpoint middle-click button for opening new links in tabs when browsing the web.



lonestar said:


> I wouldn't be surprised if there's some way to make both of them work.


I got both to work by switching to OpenBSD. 
No xorg.conf needed whatsoever.


----------



## lonestar (Feb 9, 2016)

sag said:


> I got both to work by switching to OpenBSD.
> No xorg.conf needed whatsoever.



OpenBSD is like a girl who's pretty hot, and is fun to hang out with, but she just demands too much of you. It's an all-or-nothing thing.... no more nights out with the boys, you can't even look at another girl. 

Because when you use OpenBSD, it's back to MBR for you; say goodbye to all of your GPT installs.


----------



## free-and-bsd (Apr 22, 2016)

lonestar said:


> ...
> Because when you use OpenBSD, it's back to MBR for you; say goodbye to all of your GPT installs.


 And that to say nothing of ZFS!

However, on the positive side of it, in the terms of the OS readiness for use upon the regular installation finish OpenBSD was a pleasant surprise for me. I mean, after all those talks about it being "too special" etc.etc., it was unexpectedly simple to use. 

Good Intel HD driver, too. A ready to use FVWM desktop with a good customized config. I sensed "good quality" approach in it, which I cannot but respect and appreciate.


----------



## fizk (Jun 15, 2016)

I'm trying to get this working on FreeBSD 11-CURRENT, which I have to use for wireless support, but this setup didn't work for me.

I was able to get the touch pad on my Samsung Series 9 to work in OpenBSD as well, using the `synclient` application. Running `synclient` on FreeBSD gives an error:


```
Couldn't find synaptics properties. No synaptics driver loaded?
```

 which might mean synaptics isn't loading at all?

Also, 
	
	



```
Option  "AutoAddDevices" "false"
```
 caused the touchpad to stop working completely.

uname:

```
FreeBSD laptop 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r300097: Wed May 18 01:54:55 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## free-and-bsd (Jun 15, 2016)

fizk said:


> I'm trying to get this working on FreeBSD 11-CURRENT, which I have to use for wireless support, but this setup didn't work for me.[/CODE]


The one described here is not a recommended approach, as the author says honestly.
I have CURRENT on my laptop and the mouse works all right. At that I have moused enabled in /etc/rc.conf. The only thing I seem to have is use:

```
hw.psm.synaptics_support="1"
```
 in my boot configuration (grub.cfg or loader.conf -- whichever you use) 

And NO xorg.conf file at all. If you have noticed, you don't use that file now, instead you put separated files (for some really special cases!) into /usr/local/etc/X11/xorg.conf.d directory. These only contain sections pertaining to that special hardware you need to address.

And BTW, OpenBSD really IS very good at all this.


----------



## lonestar (Jun 19, 2016)

fizk said:


> I'm trying to get this working on FreeBSD 11-CURRENT, which I have to use for wireless support, but this setup didn't work for me.
> 
> I was able to get the touch pad on my Samsung Series 9 to work in OpenBSD as well, using the `synclient` application. Running `synclient` on FreeBSD gives an error:
> 
> ...



My guess, based on previous experience with similar errors, is that you have not disabled moused. Make sure the line:

```
moused_enable="YES"
```
is either changed to

```
moused_enable="NO"
```
or it is commented out altogether, either way will achieve the same result.

And it's worth repeating, the pkg version of xf86-input-synaptics did not work for me, I had to use the port. It only takes a few seconds to build and install that port though, and I didn't have to change any default options. It's weird I know, but it worked.


----------



## lonestar (Jun 19, 2016)

free-and-bsd said:


> The one described here is not a recommended approach, as the author says honestly.



That's true, if you require trackpoint functionality. The trackpoint must use moused apparently, so disabling it will also disable trackpoint inputs of any kind - scrolling, buttons, and tapping. 



> And BTW, OpenBSD really IS very good at all this.



Yes, OpenBSD has this knocked out, and power management (suspend/resume) is just dead on perfect out-of-the-box. I just really like FreeBSD more for day to day usage, I wish they would take these types of things seriously or at least stop introducing regressions as was done in 10.1.


----------



## free-and-bsd (Jun 25, 2016)

lonestar yes, I have trackpoint and its associated buttons which I like very much.

BTW, the portion added to xorg.conf in your HOWTO above can just be saved in a separate /usr/local/etc/X11/xorg.conf.d/*conf file just containing the needed config section (your InputDevice section). I think that's the way it's being done these days. Very handy, too, because you DON'T have to "configure" something that just works without your interference (devd).


----------



## newcomerFree (Jul 3, 2017)

lonestar said:


> OK , this is what I have :
> 
> /usr/local/etc/X11/xorg.conf
> 
> ...


----------



## scottro (Jul 3, 2017)

One runs the command when in a console rather than when X is running.


----------

