From owner-freebsd-x11@freebsd.org Sun Mar 5 18:06:35 2017 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBF1CFA8C5 for ; Sun, 5 Mar 2017 18:06:35 +0000 (UTC) (envelope-from jan.kokemueller@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 541EA11CA; Sun, 5 Mar 2017 18:06:35 +0000 (UTC) (envelope-from jan.kokemueller@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id n11so48620041wma.0; Sun, 05 Mar 2017 10:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:subject:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Wc5o60pi2ak3TxhAtoiwrUO6XlbwoDlIwjyJXvg8mSA=; b=tcg53//pF1OMMrIj0b/uWSMqGlH+n0JSq185eao/IMcgx0p7/KLw2nxccj9azsQJXf dAzEkNTsOJjc1z8vI/3YRk7wL1YhmbU8JerBpyE0w9ZgRwTSbkrOYcFOUq6d3VGiIsYs Dxubt+8buLa0knQMQPHtPVlFWXTuYP3CWocVPCJnzvJktuWAfL0JpYNMl9yX0A8QqaSB XZcfjm7zuy2SX+4/vVFUBafLVNNOkYjEntBsD7dbRJh5jfUSGIevb2jDilptAlFLGU/F udQYJ0jObrslYstj9bBp95MiA2RnUYX7HzzpKezSzstvX/TP6phYZgkktftqobTlNZdu XL1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:subject:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Wc5o60pi2ak3TxhAtoiwrUO6XlbwoDlIwjyJXvg8mSA=; b=HgNZcE7v1Gomu8v5G+TQdVwcdcVT9LOPdCmVGKNZACoEg86YZ//0bhcmHH/2hEjmdk jMkYASUcjQVA8UlsIeQxj80XwRVHzh/72Zjyn8Xy+mQ9rxq0MNIrRca6lE4qHEXn07ho O/vX20SRtjzSTAy0stwg0unt6aFeO5G6iy5QVQpDmoB9/IQ5SIRidL+TZ+LZX1OOyafE knM3sjSYVJw9D6xeMGx2k7lp+MGmgir4bAhrO1S5sfC18G/BWPcZtgFFNAUFHvK5ygxi 7EmIvD9welTA2o6yenRP/PaFoaXTSLZGMyg/Emnh2FOgLsAQQn6bk2Fc8EXdOeLE0+Mf 7AJw== X-Gm-Message-State: AMke39l7mWSX1EdRBTOaQreZavPoNAD3BpRBfNdxpZhGrFokrelAyRHf1YGioH5Ox/jX7A== X-Received: by 10.28.109.70 with SMTP id i67mr10590185wmc.48.1488737193526; Sun, 05 Mar 2017 10:06:33 -0800 (PST) Received: from ?IPv6:2001:470:1f15:b1f:d422:adb4:ce55:add1? ([2001:470:1f15:b1f:d422:adb4:ce55:add1]) by smtp.googlemail.com with ESMTPSA id d75sm11664496wmd.25.2017.03.05.10.06.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Mar 2017 10:06:32 -0800 (PST) To: freebsd-x11@freebsd.org References: Subject: Re: X input: devd, dbus, hald, evdev... ??? From: =?UTF-8?Q?Jan_Kokem=c3=bcller?= Message-ID: Date: Sun, 5 Mar 2017 19:06:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 18:06:35 -0000 Hi Jon, > I notice that the handbook > (https://www.freebsd.org/doc/handbook/x-config.html) doesn't mention > dbus or hald, so are they not needed any more? Is everything meant to be > handled automatically through devd? Should I remove the hald_enable line > from /etc/rc.conf? dbus_enable? Yes, HAL has been deprecated by its upstream for quite some time now. Xorg on FreeBSD does not depend on HAL any more. On most Linux based systems HAL has been replaced by udev which is similar to devd on FreeBSD. Xorg can do device detection statically (xorg.conf.d etc.), but the "modern" way is dynamically via libudev (on Linux) or a devd backend (default on FreeBSD): https://svnweb.freebsd.org/ports/head/x11-servers/xorg-server/files/patch-config_devd.c?revision=433863&view=markup > How does evdev/webcamd fit into the picture? I see that devd is starting > an instances webcamd for my touchpad and touchscreen, but when I install > xf86-input-evdev, it does funny things to my keyboard input. evdev is Linux' input event interface. Every input device such as keyboards or mice have one or more nodes under /dev/input/. Its ioctl based API looks a bit funny (http://lxr.free-electrons.com/source/include/uapi/linux/input.h), but it's actually pretty flexible. It supports things as absolute touch coordinates, multiple finger tracking, horizontal scrolling and more (all those features are unsupported by the mouse(4)/sysmouse(4) protocol). More recently, libinput has shown up. It is an input driver library that can be used stand alone, in Wayland or in Xorg via xf86-input-libinput. libinput does its own device detection with libudev and can attach to multiple evdev nodes at once. This is useful for features where you need input from multiple devices at the same time, for example palm detection (mouse+keyboard) or automatic disabling of the touchpad when the lid is closed. One instance of xf86-input-evdev can only attach to one /dev/input/event* device at a time I think. libinput also contains a touchpad driver that takes the raw multitouch events from evdev and transforms them into relative mouse movement. So xf86-input-libinput is also usable as a replacement for xf86-input-synaptics. The specialized input device drivers such as xf86-input-mouse or xf86-input-keyboard are not really in use any more on systems that support evdev. xf86-input-evdev or xf86-input-libinput are used instead. When using xf86-input-evdev/-libinput as the keyboard driver, the keycodes are slightly changed in comparison to the old xf86-input-keyboard driver. I'm not sure exactly why this is, but I need to configure my X keymap with the '-rules evdev' parameter like this (I'm using xf86-input-libinput for my keyboard, though): setxkbmap -rules evdev -layout us Maybe X use evdev rules per default on your machine, but you actually need some other rules? Maybe playing around with some other rules in /usr/local/share/X11/xkb/rules helps? > Should X be able to detect input devices under /dev/input automatically, > or do I need to explicitly configure them? I think that I need an > explicit driver config for my drm-next setup, so does that mean that I > also need to create explicit ServerLayout, Screen, Keyboard, Mouse, > etc., files in /usr/local/etc/X11/xorg.conf.d? Xorg is supposed to automatically pick up the /dev/input/ devices (see /usr/local/share/X11/xorg.conf.d/10-evdev.conf if you have xf86-input-evdev installed), but it all depends on the device detection backend. If a device is not picked up by the backend, it won't even reach those "MatchDevicePath" rules. The udev backend on Linux sees all those /dev/input/ devices, but the devd backend currently ignores them. I believe there are some patches for the devd backend floating around, though. Hardcoding an input device in a Xorg configuration and not relying on the "MatchDevicePath" rules should work though. I don't think you need a "complete" Xorg config with ServerLayout, Screen etc. in order to get input devices to work. Small "InputClass" sections in /usr/local/etc/X11/xorg.conf.d should be enough. > In sum... how is this all meant to fit together? FreeBSD still uses the 'old' input model, where each device type has its own node under /dev and its own xf86-input-* driver. Support for evdev style /dev/input/ nodes is not yet "plug'n'play" as they are unsupported by the devd backend. There is an in progress bug report about that here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 There are more evdev related input efforts ongoing: - The FreeBSD kernel actually supports creating evdev nodes for many input devices. Support is not activated in GENERIC per default, though. - There are libudev implementations for FreeBSD that are based on devd under the hood. While the devd backend for Xorg works fine, many other tools and libraries such as libinput and mesa are relying on the libudev API for device detection. It would be nice not having to develop devd backends for every such user. There is libudev-devd for example (https://github.com/wulf7/libudev-devd). There is also a port (devel/libudev-devd). I believe there is a Xorg port in the FreeBSDDesktop github repository that uses libudev-devd instead of the devd backend. - I wrote a userspace implementation of evdev (https://github.com/jiixyj/evdevfbsd) that 'translates' /dev/{atkbd,psm,sysmouse,uhid} devices to /dev/input/ nodes with cuse(3). - There is also a port of libinput to FreeBSD (https://github.com/jiixyj/libinput, ports tree: x11/libinput and x11-drivers/xf86-input-libinput). libinput needs evdev devices, though. They have to be created from the FreeBSD kernel evdev support or from userspace (webcamd, evdevfbsd). As far as I know, libinput+evdevfbsd is currently the only way to get smooth vertical and horizontal touchpad and trackpoint scrolling in Xorg on FreeBSD. -Jan