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:
- First of all, check all connections. We had many cases when customers forgot or incorrectly connected touchscreen to miniUSB add-on board.
- 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.
- 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
- 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
- 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.
- 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/
- 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
- Still no success? Drop e-mail to [email protected] and provide description of problem + photo of your LCD touch connection + output of commands “lsusb” and “dmesg” entered in Linux console.
If touch works with PC, then hardware is OK. What software do you use? Does your kernel has N-trig touch driver?
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.
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:
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: 18.104.22.168.0 (8014 b086)
and one has:
ntrig 0003:1B96:0007.0005: Firmware version: 22.214.171.124.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 for rising this question, I will check if this is possible and write how-to in 1-2 weeks. Stay tuned.
any news on updating the firmware?
Yes, we have news – I will make blog post after come back to office from CNY holidays.
The same is possible after standard touch screen calibaration with xinput-calibrator tool.
I would suggest to check this How-to: https://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″ capacitive touch uses “hid-multitouch” driver, not “n-trig”.
Zooming (pinch) doesn’t work (Ubuntu 18.04.2 LTS). Any idea why ?