Install touch screen linux

Ubuntu Wiki

This page is a documentation of my dealings with various touchscreen devices I’ve encountered. In my experience, most modern devices work out of the box with both 10.04 LTS or 12.04 LTS, but lack the proper calibration or configuration. Some older devices, especially those embedded in laptops such as GD Itronix line of rugged computers, use serial interfaces which lack the configuration to work in Linux. The methods documented here should work with other distros as well.

Global Dynamics Itronix GoBook XR-1

This is a rugged laptop I picked up from ebay for a good price, which the seller wiped with Ubuntu 10.04 due to the expense of Microsoft’s Windows relicensing fee. The device has an integrated serial touchscreen, and the manufacturer is notorious for hiding any and all documentation on legacy devices such as this one. With a little trial and error however, it’s relatively simple to configure this and similar devices. This method should work for most GD products, including the newer GD8000 which replaced this device. Skip to the section for configuring serial devices for these machines.

Checking for touchscreen connectivity

When encountering a new device, the first order of business is to determine how the touchscreen is connected to your computer. If the touchscreen produces no events out of the box, check to see if it’s an USB device or not:

USB connection

Check the output for any reference to a touchscreen. If your touchscreen has an USB interface, and it isn’t working, then you may need to blacklist the usbtouchscreen driver for it to work:

sudo modprobe -r usbtouchscreen

If your touchscreen begins to produce events, then you can permanently blacklist the usbtouchscreen driver:

echo "blacklist usbtouchscreen" | sudo tee -a /etc/modprobe.d/blacklist.conf

Some touchscreens might already have good or perfect calibrations, otherwise you’ll need to continue to the calibration section.

Serial connection

If there is no reference to a touchscreen device in your lsusb output, the connection is most likely through one of your serial ports. The actual IRQ mapping varies between manufacturers. In the case of Itronix devices, the default is /dev/ttyS3. A simple way to check for connections is to check each one for events:

Touch anywhere on your screen to check for any character output. If nothing happens, quit screen by pressing Ctrl+A and then the ‘\’ key to quit. Continue with /dev/ttyS1, etc. until you get a response. Once you’ve determined the device, we can try a few different drivers. In the case of Itronix (and most other devices using the Touchkit driver), the correct driver is touchit213.

sudo inputattach --touchit213 /dev/ttyS3

Will work for most touchkit screens. The calibration or one or more axes may be swapped, but if the calibration is approximate then it’s probably the correct driver. Press Ctrl+C to try a new mode. inputattach supports any of the following modes, which includes external touchscreens which may attach through a physical serial port:

--h3600ts -ipaq Ipaq h3600 touchscreend --elotouch -elo ELO touchscreen, 10-byte mode --elo4002 -elo6b ELO touchscreen, 6-byte mode --elo271-140 -elo4b ELO touchscreen, 4-byte mode --elo261-280 -elo3b ELO Touchscreen, 3-byte mode --mtouch -mtouch MicroTouch (3M) touchscreen --touchit213 -t213 Sahara Touch-iT213 Tablet PC --touchright -tr Touchright serial touchscreen --touchwin -tw Touchwindow serial touchscreen --penmount -pm Penmount touchscreen --fujitsu -fjt Fujitsu serial touchscreen

If your device is built into a laptop, you’ll have the best luck with the mtouch, touchright, touchwin, or touchit213 drivers. Likewise, non-Elo external touchscreens will most likely use touchit213. If your device is a tablet with stylus-only input, fujitsu is a popular maker of embedded tablet devices.

Читайте также:  Linux mint раздача интернета

To attach the touchscreen at startup, edit your /etc/rc.local to look like the following:

/usr/bin/inputattach --daemon --always -t213 /dev/ttyS3 exit 0

Replace -t213 with your appropriate driver and /dev/ttyS3 with the correct device.

Again, don’t worry if the calibration isn’t perfect, or if an axis is inverted or reversed — this will be addressed in the calibration section.

Calibration

Thanks to the wonderful work of the freedesktop.org developers, calibration is no longer a black art in Linux. The calibration utility is included in Ubuntu 12.04 and later:

sudo apt-get install xinput-calibrator

And for 10.04, there’s a ppa available:

sudo add-apt-repository ppa:tias/xinput-calibrator-ppa sudo apt-get update && sudo apt-get install xinput-calibrator

Packages and source files are available for other distros here.

The use is pretty straight forward. I had issues getting it to work properly with HAL, however this will work regardless:

xinput_calibrator --output-type xinput

Follow the instructions pressing each target, and the calibration output will be printed to the terminal. The calibration will be set immediately, but will not survive reboots. If you’re using GDM, you can put the calibration command in your /etc/gdm/Init/Default. I placed calibration values for my XR-1 in both GDM and as a gnome startup script, since it uses automatic login:

/usr/bin/xinput set-prop "Sahara Touch-iT213 Serial TouchScreen" "Evdev Axis Inversion" 0 1 /usr/bin/xinput set-int-prop "Sahara Touch-iT213 Serial TouchScreen" "Evdev Axis Calibration" 32 27 2027 39 1977

Inverted/reversed axes

If your axes are swapped or reversed with the calibration output from xinput_calibrator (after a reboot or X restart), you may need to invert them explicitly, as I did with the XR-1.

xinput set-prop "Sahara Touch-iT213 Serial TouchScreen" "Evdev Axis Inversion" 0 1

The 0 and 1 in the above command enables axis inversion for the x or y axis (0=normal, 1=invert).

If your x and y axis are swapped, use the «Evdev Axis Swap» 1 verb:

xinput set-prop "Sahara Touch-iT213 Serial TouchScreen" "Evdev Axis Swap" 1

When you’re satisfied with the result, you may need to perform calibration again with xinput-calibrator.

Troubleshooting

Different modes and drivers accept different xinput options. To get your touchscreen’s device name, use xinput list. Individual driver options can be obtained by using xinput list-props , where is either the device name as a string or the

Читайте также:  Linux отключить сессию пользователя

eGalax Touchscreens in 14.04LTS

Files

You can get the files here on the website of EETI eGalax

Unzip the file

Just unzip the file in the current directory

gunzip /home/$USER/Downloads/eGTouch_v2.5.4330.L-x.zip

Here is a quick rundown of the steps

Ensure the Kernel Modules start on boot

Modify the file /etc/modules to add the modules usbtouchscreen and usbhid. These must come after lp and before rtc.

/etc/modules

 1  # /etc/modules: kernel modules to load at boot time.  2  #  3  # This file contains the names of kernel modules that should be loaded  4  # at boot time, one per line. Lines beginning with "#" are ignored.  5    6  loop  7  lp  8  usbtouchscreen  9  usbhid  10  rtc 

Load the Kernel Modules (only the 1st time)

Then load the modules by hand the 1st time (or reboot)

sudo modprobe usbtouchscreen usbhid

Move the Daemon and Calibration Files

Move al the files in the folder /home/user/Downloads/eGalax/eGTouch_v2.5.4330.L-x/eGTouch64/eGTouch64withX to /usr/local/bin/ *Note the following command is one line

sudo rsync -avz /home/$USER/Downloads/eGalax/eGTouch_v2.5.4330.L-x/eGTouch64/eGTouch64withX /usr/local/bin/

Place Upstart Job

place the following Upstart job in /etc/init

/etc/init/egalaxtouch.conf

 1  #!/bin/bash  2    3  description "Start the egalax touchscreen daemon on boot"  4  author "globeone Damiön la Bagh"  5    6  start on runlevel 2  7    8  exec /usr/local/bin/eGTouchD 

Start the Touchscreen Daemon

Start the touchscreen daemon with the following command

sudo service egalaxtouch start

Calibration

Calibrate the Touchscreen with eGTouchU

sudo /usr/local/bin/eGTouchU

For Dual Screen Configurations:

Follow the onscreen prompts of the config program for dual screen setup choose Left or Right mode!

Then calibrate the screen using the tools tab

Touchscreen (последним исправлял пользователь 200 2015-05-30 10:25:36)

The material on this wiki is available under a free license, see Copyright / License for details.

Источник

How To Get the Touchscreen Working in Xubuntu Linux on an Insignia Flex 11.6″ Tablet

The Insignia Flex 11.6″ tablet (NS-P11W7100) felt like a great deal at the time. It was about $100 and came with a quad core 1.4Ghz CPU and a paltry, but possibly sufficient 2GB of RAM. Storage is also only 32GB. For Windows 10, this is just crap. So I decided to install Xubuntu Linux to get it to run things faster.

And faster it was! Wow! I can play HD video without stuttering, and many other simple tasks now happen instantly instead of waiting forever for Windows 10 to get around to it.

Only one problem, many of the devices did not work out of the box. So I’m going to share with you today part of my journey: getting the touchscreen to work in Xubuntu Linux!

For now, I’ll skip telling you how to install Xubuntu. There are other tutorials on the Internet for that, but if someone comments asking for a better walkthrough, I’ll certainly give you one. I had success by using Rufus to create the bootable USB key, though. Also you’ll need to set the security setting in your BIOS to off (Del key at the Insignia logo).

Firmware

I was able to obtain the firmware for the Insignia Flex NS-P11W7100 touchscreen by visiting the gsl firmware repository by onitake on Github. There is a thread there where I have also documented my journey.

Читайте также:  Tiny linux core install

You will need to copy this file to /lib/firmware/silead on your own machine.

tar -xvf mssl1680.fw_.tar /lib/firmware/silead/

This will take a while, and once it’s finished, you will have the firmware necessary for your Insignia Flex NS-P11W7100 on your machine. Yay!

evdev

But that’s not all! Now you need to install Xorg evdev. This package seems to work far better than the default. It works for me, so I’m sure it’ll work for you. (Unless Xubuntu changes significantly after I make this tutorial.)

sudo apt install xserver-xorg-input-evdev xserver-xorg-core xinput-calibrator

This will install evdev and xinput_calibrator which will be used in the next step. For now, reboot your machine.

Calibration

Once you reboot, you should notice your tablet responding to touch! But it’s all wrong! It’s up in the top left of the screen no matter where you touch and it’s upside-down! xinput_calibrator to the rescue!

Now you’ll see your screen is completely taken over by a calibration program. Follow the instructions, pressing first the + at the top left of your screen, then top right, then the bottom two. It may take a few tries before the calibrator accepts your input. Once it does, it will present you with your calibration details and they should look like this:

$ xinput_calibrator Calibrating EVDEV driver for "silead_ts" calibration values (from XInput): min_x=42, max_x=1946 and min_y=1500, max_y=11 Doing dynamic recalibration: Setting calibration data: 50, 1944, 1517, -9 --> Making the calibration permanent 

Immediately you should notice touch is working much better. If not, try running xinput_calibrator again. If the problem persists, I suggest you read the repository linked above. It has a lot of great info.

Save your changes

But we’re not done yet! That output is telling you something important! You need to save your config in order for it to work next time you reboot. So let’s do that now. Copy the “Section … EndSection” value and open the terminal again to edit the config file.

sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Now you can paste in the configuration.

Section "InputClass" Identifier "calibration" MatchProduct "silead_ts" Option "Calibration" "50 1944 1517 -9" Option "SwapAxes" "0" EndSection

That’s it! You have configured your touchscreen! Enjoy! Paint a nice picture on your lovely (actually really crappy) touchscreen and share it! 🙂

Bonus round: fix the sound!

I had issues after re-installing Xubuntu for this tutorial. I had no sound! Audio apps couldn’t even find a working audio output. They just froze at 0:00 time. (Both Parole and YouTube in Firefox were tested.)

To fix it, I simply downloaded the whole repository here: https://github.com/plbossart/UCM

Download a zip or check it out. It doesn’t matter. Get the files and copy them over to /usr/share/alsa/ucm/

After doing this I had sound! But it was too quiet. 🙁

The fix was to open up alsamixer, make sure the headphone output wasn’t muted for headphones, and turn DOWN the volumes of the left and right headphones and speakers. The headphone gain seems to be reveresed. The speaker gain seems to shut right off after green. So I just set it to the top green value.

Источник

Оцените статью
Adblock
detector