The Linux Wacom Project
SourceForge.net Logo

Linux Wacom Project HOWTO

5.6 - Hotplugging the device






Wacom X server driver, wacom_drv.so, has enabled the hotplugging feature since version 0.8.5.

If you are seriously considering hotplugging a Wacom device on a Linux system, an Xorg server version 1.6 or later is highly recommended. With some luck, you may make it work on a server newer than 1.4.

This may lead you think that hotplugging is a pure Xorg feature. No, it is not. It requires HAL (Hardware Abstraction Layer) daemon (for Xorg servers 1.8 and older?) or the udev-hotplug subsystem (for Xorg servers 1.9 and later) being installed.

To hotplug a Wacom device, you need to install an extra script, wacom.fdi, on your system. On most distros, the file should have been pre-installed for you:

On Xorg servers older than 1.7


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- this is probably a bit imprecise -->
<deviceinfo version="0.2">
  <device>
    <match key="info.category" contains="input">
      <match key="info.product" contains_outof="Wacom">
	<merge key="input.x11_driver" type="string">wacom</merge>
	<merge key="input.x11_options.Type" type="string">stylus</merge>
	<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
	<append key="wacom.types" type="strlist">eraser</append>
	<append key="wacom.types" type="strlist">cursor</append>
	<append key="wacom.types" type="strlist">pad</append>
	<append key="wacom.types" type="strlist">touch</append>
      </match>
    </match>
    <match key="info.capabilities" contains="serial">
      <match key="@info.parent:pnp.id" contains_outof="WACf;FUJ02e5;FUJ02e7;FUJ02e9">
	<append key="info.capabilities" type="strlist">input</append>
	<merge key="input.x11_driver" type="string">wacom</merge>
	<merge key="input.x11_options.Type" type="string">stylus</merge>
	<merge key="input.x11_options.ForceDevice" type="string">ISDV4</merge>
	<merge key="input.device" type="copy_property">serial.device</merge>
	<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
	<append key="wacom.types" type="strlist">eraser</append>
        <match key="@info.parent:pnp.id" contains_outof="WACf008;WACf009;WACf00A;WACf00B;WACf00C;WACf00D;WACf00E;WACf010;FUJ02e7;FUJ02
e9">
	  <!-- Serial tablets with touch capabilities -->
	  <append key="wacom.types" type="strlist">touch</append>
	</match>
      </match>
    </match>
  </device>
  <!-- Match the Wacom Bluetooth A5 pen tablet -->
  <device>
    <match key="info.capabilities" contains="input.mouse">
      <match key="info.product" contains="WACOM">
        <match key="info.product" contains="Tablet">
          <merge key="input.x11_driver" type="string">wacom</merge>
          <merge key="input.x11_options.Type" type="string">stylus</merge>
	  <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
	  <append key="wacom.types" type="strlist">eraser</append>
	  <append key="wacom.types" type="strlist">cursor</append>
	  <append key="wacom.types" type="strlist">pad</append>
        </match>
      </match>
    </match>
  </device>
</deviceinfo>

On Xorg servers 1.7 and later


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- this is probably a bit imprecise -->
<deviceinfo version="0.2">
  <device>
    <match key="info.category" contains="input">
      <match key="info.product" contains_outof="Wacom;WACOM">
	<merge key="input.x11_driver" type="string">wacom</merge>
      </match>
    </match>
    <match key="info.capabilities" contains="serial">
      <match key="@info.parent:pnp.id" contains_outof="WACf;FUJ02e5;FUJ02e7">
	<append key="info.capabilities" type="strlist">input</append>
	<merge key="input.x11_driver" type="string">wacom</merge>
	<merge key="input.x11_options.ForceDevice" type="string">ISDV4</merge>
	<merge key="input.device" type="copy_property">serial.device</merge>
      </match>
    </match>
  </device>
</deviceinfo>

Note: If a Wacom device is defined in /etc/X11/xorg.conf, the same Wacom device that is also defined in the wacom.fdi will be ignored.

If you are running an Xorg server older than 1.4 or even an XFree86 server, you can try the following workaround to bring the device live without restarting your X server or the whole system:

Switch virtual terminal from your current disply to another one then back. The following method works on most distros:

pressing "Ctrl Alt F1", all three keys, the same time, then "Ctrl Alt F7".

Edgar Fehlinger and Lars Michelsen have provided a solution on RHEL 5.3. We are very grateful that they have gave us the permission to share it here:


First we had to add the following lines to the Xorg.conf ServerLayout section:

 Option "AutoAddDevices" "on"
 Option "AutoEnableDevices" "on"
 Option "AllowEmptyInput" "on"

After restarting the X server the following procedure brought the display back again:

 - Turn off display
 - Turn on display
 - Switch virtual terminal to 1 and back (CTRL+ALT+1 and then CTRL+ALT+2
 while the virtual terminal 2 has the X server running)

After switching the terminals, the display can be used as usual.

Having this working we added the virtual terminal switch to udev 
/etc/udev/rules.d/60-wacom.rules to perform it automatically everytime the display 
is switched on:

 --------------------------------------------------------------------------------
 # First set type
 BUS=="usb", KERNEL=="event*", SYSFS{bInterfaceNumber}=="00", ENV{WACOM_TYPE}="stylus"
 BUS=="usb", KERNEL=="event*", SYSFS{bInterfaceNumber}=="01", ENV{WACOM_TYPE}="touch"
 # Then fire the vt switch
 BUS=="usb", KERNEL=="event*", SYSFS{idVendor}=="056a",
 ENV{WACOM_TYPE}!="touch", RUN+="/usr/bin/wacom-display-recalibrate"
 --------------------------------------------------------------------------------

And this is the /usr/bin/wacom-display-recalibrate script which only runs the vt 
toggle when the currently active vt is the number 2.

 --------------------------------------------------------------------------------
 #!/bin/bash
 # +------------------------------------------------------------------+
 # | wacom-display-recalibrate                                        |
 # |             Copyright (c) 2010 - Mathias Kettner GmbH            |
 # |                                                                  |
 # | Author: Lars Michelsen <lm@mathias-kettner.de>                   |
 # +------------------------------------------------------------------+
 #
 # Sylo is free software;  you can redistribute it  and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation in version 2. Sylo is distributed
 # in the hope that it will be useful,  but WITHOUT ANY WARRANTY; with-
 # out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
 # PARTICULAR PURPOSE. See the  GNU General Public License for more de-
 # ails.  You should have  received  a copy of the  GNU  General Public
 # License along with GNU Make; see the file  COPYING.  If  not,  write
 # to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
 # Boston, MA 02110-1301 USA.

 # Only switch the terminal when the currently active terminal is the
 target
 # terminal. This prevents display switches while booting.

 # The "2" might be replaced if X runs on another virtual terminal.
 VT=2

 if [ $(/usr/bin/fgconsole) -eq $VT ]; then
    /usr/bin/chvt 1
    /usr/bin/chvt $VT
    exit 0
 else
    exit 1
 fi
 --------------------------------------------------------------------------------

RHEL 4.6+ and 5.1+ have included a workaround, called wdaemon (http://jake.ruivo.org/~aris/wdaemon). However, it doesn't work out of the box. You need to configure the daemon and turn it on to make it work. Please follow the guideline provided by Aristeu Rozanski, the author of the daemon, at http://jake.ruivo.org/~aris/wdaemon/README.txt for details.







Copyright (C) 2002-2011 - LinuxWacom -Last updated July 23, 2012
This website and its contents are licensed under the GNU GENERAL PUBLIC LICENSE.