MacBook Pro 13 mid 2012 touchpad fine tuning

Machiaveli

Member

Reaction score: 23
Messages: 57

Hello folks,

After installing FreeBSD-12.1-RELEASE on a MacBook Pro 13 mid-2012 (MacBookPro9,2 model in Apple's terminology) as the only OS, I've made it working pretty well, thanks to people that make this happens (end of this post to know what's working or not)!
Actually I'm struggling to fine tune the touchpad to make it work as in Mac OS X.

Reading numerous threads on this forum and afaik there's more than one way to configure the touchpad so I'm still confuse as to what I should use to achieve this tuning:
  1. atp(4) (which is what I'm using because it's the driver who gives results close to what I was used to on Mac OS X, except for scrolling)
  2. wsp(4) (which gives the best scrolling with two fingers but couldn't tune it as much as I wanted to)
  3. xorg.conf(5) (a custom InputDevice section on /usr/local/etc/X11/xorg.conf.d/touchpad.conf used in conjunction with atp(4))
  4. synaptics(4) (haven't tried this driver yet)

Configuration of atp(4) through sysctl:
Code:
# sysctl hw.usb.atp
hw.usb.atp.stroke_maturity_threshold: 4
hw.usb.atp.slide_min_movement: 1
hw.usb.atp.tap_minimum: 2
hw.usb.atp.small_movement: 40
hw.usb.atp.scale_factor: 20
hw.usb.atp.double_tap_threshold: 200000
hw.usb.atp.touch_timeout: 125000
hw.usb.atp.debug: 1

Configuration of wsp(4) through sysctl:
Code:
# sysctl hw.usb.wsp
hw.usb.wsp.enable_single_tap_clicks: 1
hw.usb.wsp.scr_hor_threshold: 20
hw.usb.wsp.pressure_tap_threshold: 120
hw.usb.wsp.pressure_untouch_threshold: 10
hw.usb.wsp.pressure_touch_threshold: 50
hw.usb.wsp.z_factor: 5
hw.usb.wsp.scale_factor: 12
hw.usb.wsp.debug: 1

Configuration with /usr/local/etc/X11/xorg.conf.d/touchpad.conf:
Code:
# cat /usr/local/etc/X11/xorg.conf.d/touchpad.conf
Section "InputDevice"
   Identifier  "Mouse0"
   Driver  "mutouch"
   Option    "Protocol" "auto"
   Option    "Device" "/dev/atp0"

   Option  "LeftEdge"  "100"
   Option  "RightEdge"  "1120"
   Option  "TopEdge"  "50"
   Option  "BottomEdge"  "310"
   Option  "FingerLow"  "25"
   Option  "FingerHigh"  "30"
   Option  "MaxTapTime"  "180"
   Option  "MaxTapMove"  "220"
   Option  "MaxDoubleTapTime"  "180"
   Option  "VertScrollDelta"  "20"
   Option  "HorizScrollDelta"  "50"
   Option  "MinSpeed"  "0.79"
   Option  "MaxSpeed"  "0.88"
   Option  "AccelFactor"  "0.0015"
   Option  "SHMConfig"  "on"
EndSection

The good things (what's working):
  • x11/xorg (all is automatically detected \o/ )
  • backlight and keyboard brightness with /boot/kernel/asmc.ko and sysutils/asmctl (mapped to the corresponding keys in x11-wm/xfce4-wm
  • suspend/resume (works out of the box)
  • ambient light sensors
The "bad" things (what isn't working):
  • Wifi interface (it's a Broadcom BCM4331. It might be supported, thanks to Landon Fuller's great work on bwn(4) and bhnd(4) drivers)
Edit: adding dmesg.
 

Attachments

  • dmesg.boot.txt
    12.6 KB · Views: 63
OP
Machiaveli

Machiaveli

Member

Reaction score: 23
Messages: 57

Well after a lot of fiddling, libinput doesn't work at all with the touchpad, no matter what options are used, even the supported one. Might be a bug in how the touchpad is handled by atp(4) or wsp(4) (unloading those and use only libinput lead to no clicks in Xorg).

wsp(4) driver prevents any selection and drag gestures to be made and click detection is fuzzy (with standard sysctl or not through hw.usb.wsp tree). atp(4) provides in this model the most viable option even if scrolling isn't smooth and a real pain to used.

synaptics(4) isn't even recognized by Xorg despite all what's needed is installed.
A mouse is fortunately well supported without any custom settings 👍
 
OP
Machiaveli

Machiaveli

Member

Reaction score: 23
Messages: 57

For future reference in case someone else is using this laptop, here are settings making scrolling less painful and fuzzy with the atp driver.

In /etc/sysctl.conf put the following sysctl's MIB:
Code:
hw.usb.atp.stroke_maturity_threshold: 4
hw.usb.atp.slide_min_movement: 1
hw.usb.atp.tap_minimum: 2
hw.usb.atp.small_movement: 30
hw.usb.atp.scale_factor: 18
hw.usb.atp.double_tap_threshold: 200000
hw.usb.atp.touch_timeout: 125000
 
Top