Problem with touchpad

abi abi at abinet.ru
Fri Sep 2 18:30:06 UTC 2016


It sees psm device, however it can't attach to it. Here is log without 
xorg hint

[  4698.445] (II) Using input driver 'synaptics' for 'PS/2 Mouse'
[  4698.445] (**) PS/2 Mouse: always reports core events
[  4698.446] (**) Option "Device" "/dev/psm0"
[  4698.446] (EE) synaptics: PS/2 Mouse: Synaptics driver unable to 
detect protocol
[  4698.446] (EE) PreInit returned 11 for "PS/2 Mouse"

Yes, I reinstalled all 2 (synaptics driver was new - I never used it, so 
it's freshly compiled).

Here is list of protocols. Man suggests to use psm under BSD.

ftp://www.x.org/pub/X11R7.5/doc/man/man4/synaptics.4.html

*Option "Protocol" "*/string/*"*
    Specifies which kernel driver will be used by this driver. This is
    the list of supported drivers and their default use scenarios.
    auto-dev 	automatic, default (recommend)
    event 	Linux 2.6 kernel events
    psaux 	raw device access (Linux 2.4)
    psm 	FreeBSD psm driver




On 02/09/2016 21:03, Anthony Jenkins wrote:
> Weird!  Itt's supposed to see the /dev/psm0 device, see the
> hw.psm.synaptics.margin_topsysctl and pick the 'synaptics' driver for
> that device.  The "psm" protocol shouldn't work for the Synaptics device
> (I don't believe), and I don't think you should need an Xorg.conf file.
> Not sure what's up with the x11-drivers/xf86-input-synaptics losing sync
> all the time.  I can add more logging to config/devd.c.  I've been
> running this code for years on 2 laptops.  Did you reinstall all 3
> ports?  I'll pick through your logfile to see if I spot anything.
>
> Anthony
>
> On 09/02/2016 01:06 PM, abi wrote:
>> Patch can be applied to current revision of port tree.
>>
>> Here are changes
>>
>> I recompiled xorg-server and mouse drivers and noticed that nothing is
>> attached to touchpad. xorg now looking for synaptics driver. Is it
>> expected? We have support for synaptics in kernel and recently it was
>> unproved to support 2 fingers touch.
>>
>> I installed synaptics driver. Without hint, it failed to attach with
>> error that it can't detect protocol. This is common one, if you need
>> exact error, I can repeat test.
>>
>> So, I put
>>
>> Section "InputClass"
>>      Identifier "Mouse"
>>      MatchDevicePath "/dev/psm0"
>>      Option "Protocol" "psm"
>> EndSection
>>
>> psm is protocol driver can't detect. I think, in FreeBSD this is the
>> only option. Maybe hardcode it into driver?
>>
>> As with kernel's touchpad driver, synaptics driver worked until reboot
>> and I must say, this driver is even worse - mouse is not moving at all
>> and just emits random key presses. Xorg log is a little bit more
>> interesting. It's big, so I posting it as gist.
>>
>> https://gist.github.com/abishai/14b32a93001201c51bb984802b0fff92
>>
>> 1. kbd tried to attach to USB mouse. I suppose it failed due to rights
>> issue. /dev/ukbd0 is root:wheel, while I'm only operator. Should I
>> test what will happen if it actually attaches? But I don't think this
>> is the right thing  to attach.
>>
>> 2. Every touch of synaptic driver emits synaptics touchpad found block
>> in xorg log.
>>
>> 3. (EE) Synaptics driver lost sync... got gigantic packet! is when I
>> actively use touchpad. So, I doubt this is the root of the problem.
>> Delicate touching :P keeps this error from spawning.
>>
>>
>>
>> On 02/09/2016 17:11, Anthony Jenkins wrote:
>>> The problem is the mouse(4) Xorg driver doesn't work (well) with the
>>> Synaptics-flavored psm(4) device.  My xorg-server port should attach the
>>> synaptics(4) Xorg driver.
>>>
>>> If you can, try grabbing my version of the following ports:
>>>
>>>          x11-servers/xorg-server -
>>> https://github.com/ScoobiFreeBSD/freebsd-ports/tree/xorg-synaptics/x11-servers/xorg-server
>>>
>>>          x11-drivers/xf86-input-synaptics -
>>> https://github.com/ScoobiFreeBSD/freebsd-ports/tree/xorg-synaptics/x11-drivers/xf86-input-synaptics
>>>
>>>          x11-drivers/xf86-input-mouse -
>>> https://github.com/ScoobiFreeBSD/freebsd-ports/tree/xorg-synaptics/x11-drivers/xf86-input-mouse
>>>
>>>
>>> The 2 drivers just change the autodetection of FreeBSD's
>>> Synaptics-flavored psm(4).
>>>
>>> Patch version:
>>> https://github.com/ScoobiFreeBSD/freebsd-ports/commit/4e1b8522e770b54264f393b4fd8ce5b3acebcabe.patch
>>>
>>>
>>> (I'm not sure if any of the x11 ports changed since I did these patches,
>>> so they might not apply cleanly)
>>>
>>> Anthony
>>>
>>> On 09/02/2016 03:00 AM, abi wrote:
>>>> No need to sorry, I'm very thankful you're answering at all! :)
>>>>
>>>> I removed moused config from /etc/rc.conf and from xorg configuration,
>>>> so I have only hw.psm.synaptics_support=1 in /boot/loader/conf
>>>>
>>>> Here is how xorg initializing pointing devices
>>>>
>>>> [    27.114] (II) LoadModule: "mouse"
>>>> [    27.114] (II) Loading
>>>> /usr/local/lib/xorg/modules/input/mouse_drv.so
>>>> [    27.115] (II) Module mouse: vendor="X.Org Foundation"
>>>> [    27.115]     compiled for 1.17.4, module version = 1.9.1
>>>> [    27.115]     Module class: X.Org XInput Driver
>>>> [    27.115]     ABI class: X.Org XInput driver, version 21.0
>>>> [    27.115] (II) Using input driver 'mouse' for 'sysmouse'
>>>> [    27.115] (**) sysmouse: always reports core events
>>>> [    27.115] (**) Option "Device" "/dev/sysmouse"
>>>> [    27.115] (==) sysmouse: Protocol: "Auto"
>>>> [    27.115] (**) sysmouse: always reports core events
>>>> [    27.115] (==) sysmouse: Emulate3Buttons, Emulate3Timeout: 50
>>>> [    27.115] (**) sysmouse: ZAxisMapping: buttons 4 and 5
>>>> [    27.115] (**) sysmouse: Buttons: 5
>>>> [    27.115] (**) Option "config_info" "devd:sysmouse"
>>>> [    27.115] (II) XINPUT: Adding extended input device "sysmouse"
>>>> (type: MOUSE, id 7)
>>>> [    27.115] (**) sysmouse: (accel) keeping acceleration scheme 1
>>>> [    27.115] (**) sysmouse: (accel) acceleration profile 0
>>>> [    27.115] (**) sysmouse: (accel) acceleration factor: 2.000
>>>> [    27.115] (**) sysmouse: (accel) acceleration threshold: 4
>>>> [    27.116] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
>>>> [    27.116] (II) sysmouse: SetupAuto: protocol is SysMouse
>>>> [    27.116] (II) config/devd: device /dev/ums0 already opened
>>>> [    27.205] (II) config/devd: adding input device Mouse (/dev/psm0)
>>>> [    27.205] (II) Using input driver 'mouse' for 'Mouse'
>>>> [    27.205] (**) Mouse: always reports core events
>>>> [    27.205] (**) Option "Device" "/dev/psm0"
>>>> [    27.205] (==) Mouse: Protocol: "Auto"
>>>> [    27.205] (**) Mouse: always reports core events
>>>> [    27.288] (==) Mouse: Emulate3Buttons, Emulate3Timeout: 50
>>>> [    27.288] (**) Mouse: ZAxisMapping: buttons 4 and 5
>>>> [    27.288] (**) Mouse: Buttons: 5
>>>> [    27.288] (**) Option "config_info" "devd:psm0"
>>>> [    27.288] (II) XINPUT: Adding extended input device "Mouse" (type:
>>>> MOUSE, id 8)
>>>> [    27.288] (**) Mouse: (accel) keeping acceleration scheme 1
>>>> [    27.288] (**) Mouse: (accel) acceleration profile 0
>>>> [    27.288] (**) Mouse: (accel) acceleration factor: 2.000
>>>> [    27.288] (**) Mouse: (accel) acceleration threshold: 4
>>>> [    27.361] (II) Mouse: SetupAuto: hw.iftype is 3, hw.model is 13
>>>> [    27.361] (II) Mouse: SetupAuto: protocol is PS/2
>>>> [    27.906] (II) Mouse: ps2EnableDataReporting: succeeded
>>>>
>>>> I also rebuild kernel with options PSM_DEBUG=1, so here is some
>>>> extended info from dmesg. Nothing criminal as well
>>>>
>>>> Sep  2 09:42:22 sphinx kernel: atkbdc0: <Keyboard controller (i8042)>
>>>> port 0x60,0x64 irq 1 on acpi0
>>>> Sep  2 09:42:22 sphinx kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
>>>> Sep  2 09:42:22 sphinx kernel: kbd0 at atkbd0
>>>> Sep  2 09:42:22 sphinx kernel: atkbd0: [GIANT-LOCKED]
>>>> Sep  2 09:42:22 sphinx kernel: psm0: current command byte:0065
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 02 64
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 00 64
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 03 64
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 03 64
>>>> Sep  2 09:42:22 sphinx kernel: psm: data 08 00 00
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 02 47 18
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 01 e2 a1
>>>> Sep  2 09:42:22 sphinx kernel: psm: status f0 02 23
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 80 3f
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 84 03 00
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 12 e8 00
>>>> Sep  2 09:42:22 sphinx kernel: psm: status b1 f1 93
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 27 fe 22
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 2c de 40
>>>> Sep  2 09:42:22 sphinx kernel: psm: status 00 02 64
>>>> Sep  2 09:42:22 sphinx kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0
>>>> Sep  2 09:42:22 sphinx kernel: psm0: [GIANT-LOCKED]
>>>> Sep  2 09:42:22 sphinx kernel: psm0: model Synaptics Touchpad, device
>>>> ID 3-00, 4 buttons
>>>> Sep  2 09:42:22 sphinx kernel: psm0: config:00004000, flags:00000008,
>>>> packet size:6
>>>> Sep  2 09:42:22 sphinx kernel: psm0: syncmask:c0, syncbits:00
>>>>
>>>> abishai at sphinx:~ % xinput
>>>> ⎡ Virtual core pointer                        id=2    [master pointer
>>>> (3)]
>>>> ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave
>>>> pointer  (2)]
>>>> ⎜   ↳ sysmouse                                    id=7    [slave
>>>> pointer  (2)]
>>>> ⎜   ↳ Mouse                                       id=8    [slave
>>>> pointer  (2)]
>>>> ⎣ Virtual core keyboard                       id=3    [master keyboard
>>>> (2)]
>>>>       ↳ Virtual core XTEST keyboard                 id=5    [slave
>>>> keyboard (3)]
>>>>       ↳ kbdmux                                      id=6    [slave
>>>> keyboard (3)]
>>>>
>>>> I still have the original issue: taps and button click are working 1
>>>> time from 10, buttons can easily hang in pressed state.
>>>> Also, I noticed that when touchpad in this broken state, pointer moves
>>>> slower than normal.
>>>>
>>>> The only way to fix the problem is to run
>>>> xinput disable Mouse
>>>> xinput enable Mouse
>>>>
>>>> On the second command system hangs until it gets some input from
>>>> touchpad (clicking or touching). And nothing in the logs!
>>>> I see only this one when I disable/enable it
>>>> Sep  2 09:52:37 sphinx kernel: psm: status 00 03 64
>>>> Sep  2 09:52:37 sphinx kernel: psm: status 2c de 40
>>>> Sep  2 09:52:37 sphinx kernel: psm: status 20 01 14
>>>>
>>>> This freeze worries me: system is completely disabled until it get
>>>> touchpad input and no component is unhappy enough to write something
>>>> in the logs.
>>>>
>>>> On 01/09/2016 21:14, Anthony Jenkins wrote:
>>>>> Sorry for late reply, and for top-posting (trying to stay consistent).
>>>>>
>>>>> Pointing devices on FreeBSD are typically handled by a number of
>>>>> drivers, including:
>>>>>
>>>>>      * ums(4) - A USB HID device which is a mouse class
>>>>>      * psm(4) - A serial mouse/touchpad attached to PS/2 keyboard port
>>>>>
>>>>> moused(8) can detect these devices and create composite pseudodevice
>>>>> /dev/sysmouse which aggregates the events from the devices it manages.
>>>>> The problem with psm(4) touchpad devices and moused(8) is that psm(4)
>>>>> can be in "Synaptics" mode which makes it incompatible with moused(8).
>>>>> So if you boot with the hw.psm.synaptics_support="1" tunable and
>>>>> moused(8) enabled, (unless this has changed recently) you get weird
>>>>> behavior from the touchpad and none of the gestures work.
>>>>>
>>>>> The devd(8) interface to x11-servers/xorg-server waits for devd(8) to
>>>>> notify the X server that a device has attached/detached.  The
>>>>> notification includes a simple path under /dev (e.g. /dev/ums0,
>>>>> /dev/psm0 or /dev/sysmouse).  The multi-mode behavior of psm(4) makes
>>>>> the current implementation of the devd interface awkward, because each
>>>>> device path maps to a single driver (e.g. "/dev/ums*" -> "mouse",
>>>>> "/dev/psm*" -> "mouse", "/dev/sysmouse" -> "mouse",
>>>>> "/dev/vboxguest" ->
>>>>> "vboxmouse", etc.)
>>>>>
>>>>> My implementation maps each new device notification to a function to
>>>>> determine which driver should be attached to each device node.  For
>>>>> example, the function for "/dev/psm" checks for the presence of a
>>>>> sysctl
>>>>> that indicates what mode psm(4) is in.
>>>>>
>>>>> Even with the current implementation of xorg-server's devd stuff, all
>>>>> this should "just work" when using moused(8) and USB mice.  It's
>>>>> multimode devices like psm(4) which confuse the current
>>>>> implementation.
>>>>>
>>>>> Anthony
>>>>>
>>>>> On 08/30/2016 02:43 AM, abi wrote:
>>>>>> How can it be - all devices attached to one devd node? What if I want
>>>>>> different drivers? synaptics for touchpad and generic mouse for USB ?
>>>>>> Not in this particular case, but generally speaking.
>>>>>>
>>>>>> On 29/08/2016 19:19, Arto Pekkanen wrote:
>>>>>>> I never used the psm device directly with X.org, because
>>>>>>> /dev/sysmouse (which operated by moused) is the the standard,
>>>>>>> multiplexed interface for mice and touchpads. Every touchpand and
>>>>>>> mice attached will be handled by moused.
>>>>>>>
>>>>>>> Take out all moused -related stuff from your rc.conf, remove ALL
>>>>>>> your
>>>>>>> X.org input device configuration. Then try again. Ie. don't touch
>>>>>>> the
>>>>>>> vanilla settings.
>>>>>>>
>>>>>>> USB mice work out of the box without any configuration. Devd will
>>>>>>> notify X.org, which then configures the mice etc.
>>>>>>>
>>>>>>> abi kirjoitti 29.08.2016 16:34:
>>>>>>>> I'm not sure what is attached to /dev/sysmouse
>>>>>>>>
>>>>>>>> I suspect USB one, but I disabled sysmouse in xorg configuration
>>>>>>>> for
>>>>>>>> sure
>>>>>>>>
>>>>>>>> Section "InputClass"
>>>>>>>>        Identifier "VanishBastardo"
>>>>>>>>        MatchDevicePath "/dev/sysmouse"
>>>>>>>>        Option "Ignore" "true"
>>>>>>>> EndSection
>>>>>>>>
>>>>>>>> and
>>>>>>>>
>>>>>>>> moused_enable="NO"
>>>>>>>> moused_nondefault_enable="NO"
>>>>>>>>
>>>>>>>> [    17.061] (II) config/devd: adding input device (null)
>>>>>>>> (/dev/sysmouse)
>>>>>>>> [    17.061] (**) sysmouse: Ignoring device from InputClass
>>>>>>>> "VanishBastardo"
>>>>>>>>
>>>>>>>> So, if both devices clashing for 1 node, no driver attached to it
>>>>>>>> anyway. Also, I tried CURRENT - it has the same problem.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 29/08/2016 15:16, Arto Pekkanen wrote:
>>>>>>>>> With a PS2 touchpad you could also try this:
>>>>>>>>> https://www.freebsd.org/doc/faq/x.html#idp64092272
>>>>>>>>>
>>>>>>>>> abi kirjoitti 27.08.2016 03:51:
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I have strange issue with Dell XPS 13 (Skylake) touchpad. It
>>>>>>>>>> works
>>>>>>>>>> until xorg restart. After restart, buttons become
>>>>>>>>>> unresponsive, the
>>>>>>>>>> most common is if button remains pressed somehow.
>>>>>>>>>>
>>>>>>>>>> I found simple workaround - toggle touchpad with xinput.
>>>>>>>>>> However, on
>>>>>>>>>> xinput enable system hangs - screen is not updated and it ignores
>>>>>>>>>> keyboard input until I use touchpad. After that, system and
>>>>>>>>>> touchpad
>>>>>>>>>> becomes operational. Until restart.
>>>>>>>>>>
>>>>>>>>>> Synaptics driver has the same problem.
>>>>>>>>>> Touchpad in generic ps/2 mode (without
>>>>>>>>>> hw.psm.synaptics_support=1)
>>>>>>>>>> works.
>>>>>>>>>>
>>>>>>>>>> I made a search and found this commit
>>>>>>>>>> http://svnweb.freebsd.org/base?view=revision&revision=281440 in
>>>>>>>>>> CURRENT release notes. However it's pretty old and should be
>>>>>>>>>> included
>>>>>>>>>> in 11.
>>>>>>>>>>
>>>>>>>>>> FreeBSD 11.0-RC1
>>>>>>>>>> Xorg log
>>>>>>>>>> https://gist.github.com/abishai/844c3221d9388a5a6f8c65bd13ad2d88
>>>>>>>>>> USB receiver is generic wireless mouse
>>>>>>>>>> Mouse is touchpad
>>>>>>>>>> No idea what is sysmouse. I have moused_enable="NO" and
>>>>>>>>>> moused_nondefault_enable="NO" in /etc/rc.conf
>>>>>>>>>>
>>>>>>>>>> I appreciate any help or suggestions :)
>>>>>>>>>> _______________________________________________
>>>>>>>>>> freebsd-x11 at freebsd.org mailing list
>>>>>>>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-x11
>>>>>>>>>> To unsubscribe, send any mail to
>>>>>>>>>> "freebsd-x11-unsubscribe at freebsd.org"
>>>>>> _______________________________________________
>>>>>> freebsd-x11 at freebsd.org mailing list
>>>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-x11
>>>>>> To unsubscribe, send any mail to
>>>>>> "freebsd-x11-unsubscribe at freebsd.org"



More information about the freebsd-x11 mailing list