October 4, 2012   Posted by: Dr. Ace Jeangle

How to get touchscreen working

Some Linux distros come with these drivers included in kernel, others not. If you can’t use touchscreen after Linux is running in X GUI mode or if you don’t have assigned input device in console mode, then you should do the following:

  1. First of all, check all connections. We had many cases when customers forgot or incorrectly connected touchscreen to miniUSB add-on board.
  2. Connect just touchscreen through USB cable to normal PC running Windows. If touchscreen is detected and you can use it in Windows, then all connections are OK and you can proceed further.
  3. If your Linux kernel does not include drivers for touchscreen, then you should recompile kernel with the following options:
    • for AUO LCD (1024×600 px): “Device Drivers –> HID Devices –> Special HID drivers –> HID Multitouch panels“, option name: CONFIG_HID_MULTITOUCH, available in mainline kernel since version 2.6.38
    • for LG LCD (1280×800 px, black frame): “Device Drivers –> HID Devices –> Special HID drivers –> N-Trig touchscreens“, option name: CONFIG_HID_NTRIG, available in mainline kernel since version 2.6.31
  4. If you run Android, then you can encounter problem with non-correct touchscreen vs screen resolution. This happen because Android supposes default screen resolution for external LCD as 720p or 1080p (touchscreen is connected by USB and is considered as external device), but our LCD is 1024×600 or 1280×800. You can easy check it by simply turning on option “Show touches” in Settings->Developer options of Android. Then you will notice the difference in real position of touch and Android touch position. This can be easy improved by placing one of below files to /system/usr/idc folder of Android rootfs. After that touchscreen size and LCD size will match.
    File for Ntrig touchscreen (1280×800, black frame)
    File for Cando touchscreen (1024×600)

    See below links for additional information on touchscreen devices functionality under Android:
    Touch devices in Android
    Input device configuration files
  5. You can use console command getevent (sources for Linux are here: getevent.zip) to check what touchscreen returns when you touch it. Also, you can get more details about touchscreen and its modes with commands getevent -p and getevent -i.
  6. N-trig touchscreen can be tuned with some parameters:
    • min_width – minimum touch contact width to accept
    • min_height – minimum touch contact height to accept
    • activate_slack – number of touch frames to ignore at the start of touch input
    • deactivate_slack – number of empty frames to ignore before deactivating touch
    • activation_width – width threshold to immediately start processing touch events
    • activation_height – height threshold to immediately start processing touch events

    They can be changed right from console, see here for details: http://baruch.siach.name/blog/posts/linux_kernel_module_parameters/

  7. If you have problems with touchscreen, like “crazy” cursor jumps or “phantom” mouse clicks, then try to follow this guide How to calibrate N-Trig touchscreen
  8. Still no success? Drop e-mail to support@chalk-elec.com and provide description of problem + photo of your LCD touch connection + output of commands “lsusb” and “dmesg” entered in Linux console.
11 comments posted in: blog   |   How-To
11 comments
  1. Dr. Ace Jeangle
    Nov 21, 2012

    If touch works with PC, then hardware is OK. What software do you use? Does your kernel has N-trig touch driver?

  2. holundermannski
    Dec 13, 2012

    Hi my Touchscreen AUO didn’t worked with my Raspberry Pi until I recogniced that it gets switched on and off in dmesg Output.
    I now use a Powered USB-Hub and all works perfect expect multitouch.
    I think Multitouch gestures is more a Debian Setting thing.

    Just as information for other people how use this Screen with their Pi.

    Thanks for the great product.

  3. Jason Kridner
    Jan 03, 2013

    Thanks! This really did “just work” for me on BeagleBone.

    Here’s my full patch to enable support for the 10″ LCD with LVDS cape:
    https://github.com/jadonk/kernel/commit/ade06090f88cb4fd5c4fa370c8f11f8100eb003b

  4. Patrick Heeb
    Jan 14, 2013

    Hi

    I have 3 different models of the 10” LCD Bundle with the N-Trig touchscreen.

    2 of them have the Firmware version:
    ntrig 0003:1B96:0007.000B: Firmware version: 2.0.4.53.0 (8014 b086)

    and one has:
    ntrig 0003:1B96:0007.0005: Firmware version: 3.4.10.53.0 (5116 b046)

    The two with the “old” Firmware have a slight sluggish behaviour. The one with the newer firmware works way better.

    Is it possible to update the Firmware of the N-Trig touch?

    Thanks

    • Dr. Ace Jeangle
      Jan 17, 2013

      Thanks for rising this question, I will check if this is possible and write how-to in 1-2 weeks. Stay tuned.

      • Patrick Heeb
        Feb 13, 2013

        any news on updating the firmware?

        • Dr. Ace Jeangle
          Feb 17, 2013

          Yes, we have news – I will make blog post after come back to office from CNY holidays.

  5. Dr. Ace Jeangle
    Jan 17, 2013

    The same is possible after standard touch screen calibaration with xinput-calibrator tool.

  6. Dr. Ace Jeangle
    Jan 31, 2013

    I would suggest to check this How-to: https://www.chalk-elec.com/?p=1592
    It definitely works outside of X, and under Qt5, because Digia’ team bought it from us to make installation for their developers days.

  7. Dr. Ace Jeangle
    Jun 27, 2014

    7″ capacitive touch uses “hid-multitouch” driver, not “n-trig”.

  8. Amine
    Jul 29, 2019

    Zooming (pinch) doesn’t work (Ubuntu 18.04.2 LTS). Any idea why ?

    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow us