{"id":649,"date":"2011-01-07T03:16:19","date_gmt":"2011-01-07T08:16:19","guid":{"rendered":"http:\/\/scope-eye.net\/?p=649"},"modified":"2011-01-07T03:26:22","modified_gmt":"2011-01-07T08:26:22","slug":"the-wacom-tablet-adventure","status":"publish","type":"post","link":"https:\/\/scope-eye.net\/?p=649","title":{"rendered":"The Wacom Tablet Adventure"},"content":{"rendered":"<p>So my big present for Christmas this year was a Wacom tablet&#8230;  I had asked for this knowing it might be a challenge to get it working on my two Linux systems, let alone doing something useful&#8230;  And while I&#8217;ve dabbled with modeling in Blender (and creating textures and other graphics in GIMP) it&#8217;s not something I do quite enough of that I felt sure I really <em>needed<\/em> a $200 input device to do it better&#8230;  But now that it&#8217;s up and running I think it&#8217;ll be a great piece of gear for me, and I look forward to learning to use it better. I wanted to write this post largely so that if anybody else found themselves facing similar technical difficulties, they&#8217;d be able to find this posting and get some guidance.<br \/>\n<!--more--><br \/>\nThis post is time stamped in WordPress, of course, but just in case, this was all happening in the last week of December, 2010. I was running Debian stable (&#8220;lenny&#8221;) on a EEE 901, kernel version 2.6.26.2. If you&#8217;re reading this five years later, the information here is probably outdated&#8230;\u00a0 But then again, maybe not?\u00a0 I&#8217;m looking forward to those hoverboards you&#8217;ve got, BTW.<\/p>\n<p>The tablet I got is called the &#8220;Bamboo Fun&#8221; or &#8220;Bamboo Fun &amp; Touch&#8221;.  Actually this particular model goes by a few different designations, which was actually one of the challenges in figuring out why it didn&#8217;t work initially&#8230;  The source code for the Linux Wacom driver calls it &#8220;Wacom Bamboo Comic 2FG&#8221; &#8211; and the device itself has the model number &#8220;CTH-661&#8221; printed on the back &#8211; anyway, it&#8217;s a medium-sized tablet with pressure sensitivity but no tilt, four buttons, and a multi-touch sensor.<br \/>\nSo first thing I did was try plugging it in and seeing if it worked. It didn&#8217;t. This was slightly confusing because the version of the Wacom driver I was using (the stock one that comes with Linux 2.6.26) says it supports the Wacom &#8220;Bamboo Fun&#8221;.  But I did the x.org config and plugged in the tablet and got nothing.  I tried monitoring events with xinput and directly using wacdump on various files in <strong>\/dev\/input<\/strong>&#8230;  I wasn&#8217;t sure at this point if something was wrong with my config, or if my software didn&#8217;t support the tablet &#8211; I didn&#8217;t know what I&#8217;d have to do to fix the situation, or even if support existed in the Linux Wacom driver for my tablet.<br \/>\nEarly on I noticed that plugging in and unplugging the tablet didn&#8217;t result in an input device being created or destroyed in <strong>\/dev\/input\/<\/strong> &#8211; so that was a big clue that the Wacom driver simply wasn&#8217;t working for my tablet. But the important question was <em>why<\/em>. To answer that, I used lsusb to find the tablet:<\/p>\n<pre>Bus 003 Device 002: ID 056a:00d8 Wacom Co., Ltd<\/pre>\n<p>Those numbers after &#8220;ID&#8221; are the USB device&#8217;s vendor and product IDs. Those IDs are intended to uniquely identify the type of a USB device so that driver software on the host computer can claim devices it knows how to talk to. The vendor ID, &#8220;056a&#8221; identifies the device as a Wacom item, while &#8220;d8&#8221; identifies what particular Wacom item it is.<br \/>\nThe first stop was the kernel source. It seemed the kernel driver didn&#8217;t support this tablet but I wanted to be sure. I found the driver in <strong>\/usr\/src\/linux\/drivers\/input\/tablet<\/strong> &#8211; the specific file of interest, as it turned out, was <strong>wacom_wac.c<\/strong>. I needed to find the place in the driver containing the product IDs of the supported devices. Scrolling down I found two different sections of interest:<\/p>\n<pre>static const struct wacom_features wacom_features_0x18 =\r\n        { \"Wacom BambooFun 6x8\",  WACOM_PKGLEN_BBFUN,     21648, 13530,  511, 63, WACOM_MO };\r\n...\r\n        { USB_DEVICE_WACOM(0x18) },\r\n        { USB_DEVICE_WACOM(0x19) },<\/pre>\n<p>The &#8220;USB_DEVICE_WACOM&#8221; stuff is the list of all the USB devices supported by the driver. (My device, 0xD8, wasn&#8217;t on it.) The &#8220;wacom_features&#8221; struct is part of a data table identifying the properties of each tablet listed in the device ID table. It was no shock to find my tablet wasn&#8217;t on the list &#8211; but it was good to have that confirmed, and I now knew what to look for, to make sure a newer version of the driver supported the tablet before going to the trouble of compiling it.<br \/>\nSo the next stop was <a href=\"http:\/\/linuxwacom.sf.net\">The Linux Wacom Project<\/a> to see if they had a newer driver available and if it would support my tablet. Because there&#8217;s so many regional variants of the product names it was damn near impossible to tell from a change log, etc. whether my device was supported. So I downloaded the latest version of their kernel driver (0.10.10-1), linked from the main page. The package includes source directories for two different versions of the kernel: 2.6.30 (through 2.6.35, presumably) and 2.6.36 (and onward). I checked the copy of wacom_wac.c in the 2.6.36 directory and was pleased to find my tablet (0xD8) listed. (But as &#8220;Bamboo Comic 2FG&#8221;? WTF? I guess it&#8217;s too much to ask that Wacom pick a product name and stick with it&#8230;)<br \/>\nThe archive didn&#8217;t seem to include a version for the kernel I was already running (2.6.26) so it seemed like a kernel upgrade was going to be necessary. Apart from the fact that this task would take a long time on my laptop (being an Atom-powered lightweight) I wasn&#8217;t looking forward to it, but I felt it was about time for a kernel upgrade anyway.<br \/>\nSo I got the kernel source (2.6.36&#8217;s copy of the Wacom driver didn&#8217;t include my tablet, so I had to copy it in) and built the thing. Rebooting into the new kernel gave me a bit of trouble &#8217;cause I haven&#8217;t done it in a while (I&#8217;m still not used to Debian&#8217;s way of handling kernels &#8211; the kernel is always loaded with an &#8220;initramfs&#8221; containing all the kernel modules &#8211; and then later in the boot process the initramfs is discarded and the real root fs is mounted..  I forgot to provide an initramfs image, and my boot menu configuration didn&#8217;t give me the opportunity to boot the older kernel image &#8211; so my first attempt failed and actually made the machine unbootable. I actually had to boot off a USB stick to fix the problem&#8230;)  Once I finally booted into the new kernel, plugging in the tablet created a device file in <strong>\/dev\/input<\/strong>, as well as the expected symlink <strong>\/dev\/input\/wacom<\/strong>.  And <strong>wacdump<\/strong> worked, too! So that was good news.<br \/>\nHowever, the tablet still didn&#8217;t work in X. Or rather it did, but only as a mouse. The xinput devices I&#8217;d set up for it in xorg.conf didn&#8217;t work, no data came out of them. So it seemed I was going to have to upgrade the input driver for X as well. Looking at the Linux Wacom site again, it seemed the updated X driver was going to depend on a newer version of x.org &#8211; version 1.7.  Looking at the package <strong>xserver-xorg-core<\/strong>, the version in Debian Lenny was just 1.4.2.  I wasn&#8217;t about to try compiling x.org on my laptop, so to get the updated version of X I switched apt to get packages from Debian &#8220;unstable&#8221; (Debian &#8220;testing&#8221; would have worked as well). In addition to the X input driver source from Linux Wacom, I needed the package &#8220;<strong>xserver-xorg-dev<\/strong>&#8220;, containing the header files and such necessary to build an xinput driver from source. I also installed &#8220;<strong>xserver-xorg-input-wacom<\/strong>&#8221; &#8211; it didn&#8217;t work with my tablet, so I still had to rebuild it from source, but the Debian package included a configuration file, (<strong>\/usr\/share\/X11\/xorg.conf.d\/20-wacom.conf<\/strong>) that could detect when a Wacom tablet was attached and set up the xinput devices accordingly.  Once I realized this i commented out my changes to <strong>xorg.conf<\/strong>&#8230;<br \/>\nDebian upgrades are always a bit traumatic in my experience, because so much changes all at once. But this one actually went quite well for the most part. After the upgrade, a few features like on-screen displays for the volume control keys and such (which hadn&#8217;t worked before) now worked&#8230;  So I built and installed the Wacom xinput driver &#8211; and finally, it worked! It still amazes me what a difference a tablet can make when working in GIMP. GIMP allows you to assign different aspects of the stylus (like pressure or velocity) to different traits of the tool you&#8217;re using: you can scale your brush, vary opacity or color, and so on. It&#8217;s incredible what a difference that extra bit of control can do: suddenly it was almost like smearing paint around.<br \/>\nSo, mission accomplished! I was now able to use my Wacom tablet as a regular pointing device, and I could also draw with it (with pressure sensitivity), use the eraser as a separate tool, etc. However, somehow the upgrade had caused some problems on my system: I first discovered this when running on battery power, and plugging the laptop in: the screen went black and the laptop went unresponsive. I discovered that it also did this if I closed the machine, or even if I ran &#8220;pm-suspend&#8221; at the command line. This baffled me for a while and I briefly just worked around it. But then it started doing the black-screen crash on bootup as well.<br \/>\nThis put me in an awkward position. I couldn&#8217;t boot into my new kernel (2.6.36) because it would crash before I could log in. I could boot into my old kernel (2.6.26) &#8211; however, the new versions of X and my wireless card drivers didn&#8217;t work in that kernel version &#8211; and I don&#8217;t know how to connect to a wireless access point in Linux without using gnome-network-manager anyway, so the only way I could access the network on that machine (to install packages, etc.) at that point was via ethernet cable. For a while I thought some mysterious failure might have occurred in the process of building my new kernel &#8211; but I couldn&#8217;t think of why that would happen, and didn&#8217;t want to go through the hours-long procedure of building the kernel <em>again<\/em> just on an unsubstantiated hunch that something was wrong with it&#8230;  But for a short while it seemed like the kernel was the culprit: for some reason all my ACPI-related stuff was causing that crash, and only (apparently) in that one kernel that I&#8217;d built&#8230;  Except, as it turned out, the crash also occurred in a 2.6.32 kernel I&#8217;d installed from Debian. It was clearly ACPI-related so I rebooted into 2.6.26 and removed all the ACPI stuff, then went back to 2.6.36 and reinstalled it again&#8230;  Things seemed to work, but then I rebooted and it crashed again. Finally, by experimentation I discovered that it was one specific ACPI scripts package, &#8220;eeepc-acpi-scripts&#8221; that was causing the problem. I removed that package and all the ACPI features continued to work with the exception of a couple hotkeys I never use (the unlabeled user-configurable keys, which &#8220;<strong>eeepc-acpi-scripts<\/strong>&#8221; had bound to &#8220;turn off webcam&#8221; and &#8220;turn on\/off bluetooth&#8221;) &#8211; but the crashes went away.  So &#8220;<strong>eeepc-acpi-scripts<\/strong>&#8221; = <strong>evil<\/strong>. Maybe at some point the package was a good thing, but at this point it clearly conflicts quite badly with something, and so now, therefore, it is evil.<br \/>\nSo now all appears to be well&#8230;  Which is good, because those ACPI crashes were really frustrating&#8230;\u00a0 I still don&#8217;t know what exactly was causing those crashes, but it&#8217;s fixed now, and my laptop&#8217;s running better than ever.\u00a0 Plus there&#8217;s the tablet.\u00a0 I&#8217;ve got a tablet now.\u00a0 Tablets are <em>cool<\/em>.<br \/>\nIncidentally, a few days ago Linux version 2.6.37 was released. It includes the updated Wacom kernel driver, which will make things easier when I finally get the tablet working on my desktop machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So my big present for Christmas this year was a Wacom tablet&#8230; I had asked for this knowing it might be a challenge to get it working on my two Linux systems, let alone doing something useful&#8230; And while I&#8217;ve dabbled with modeling in Blender (and creating textures and other graphics in GIMP) it&#8217;s not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[54,53,52],"_links":{"self":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/649"}],"collection":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=649"}],"version-history":[{"count":3,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":651,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/649\/revisions\/651"}],"wp:attachment":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}