![]() |
|
help with LCD touch configuration using tslib - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6) +---- Forum: Armbian (https://forum.pine64.org/forumdisplay.php?fid=84) +---- Thread: help with LCD touch configuration using tslib (/showthread.php?tid=3219) |
help with LCD touch configuration using tslib - Learnincurve - 02-06-2017 Hi, I bought a Pine64+ board and screen, with a view to using it as a Squeezebox Touch replacement through a USB dac. The board ticks a lot of the hardware boxes for a Squeezebox Touch, with dedicated ethernet and USB ports/busses. Armbian runs out of the box and supports the touchscreen - at least with legacy 3.10.104 kernel. With mainline kernel (4.10 at time of writing) touchscreen support is available through the generic "goodix" module, but this requires some extra configuration. I have not yet evaluated the mainline kernel's readiness to run the system that I have in mind. Using Armbian legacy (3.10.104), I have installed the packaged Squeezelite from the Armbian repository and Jivelite compiles and runs without errors using https://github.com/sindrom91/LuaJIT/tree/ARM64 Athough touch events work perfectly in Xfce, they are "all over the place" in Jivelite, so I'm trying to create a tslib/SDL calibration. Just now I'm struggling with "tslib: Selected device is not a touchscreen (must support ABS and KEY event types)" Googling throws up one or two bits of advice, such as: From http://http://www.cubieforums.com/index.php/topic,4008.0/prev_next,prev.html#new: Quote:Check if input-raw.c has: and from http://stackoverflow.com/questions/11937287/touchscreen-and-driver-installed-but-tslib-cannot-calibrate: Quote:Try to add (I'm assuming this should also be in input-raw.c) If I look at my own input-raw.c, I see: Code: static int check_fd(struct tslib_input *i)
{
struct tsdev *ts = i->module.dev;
int version;
long evbit[BITS_TO_LONGS(EV_CNT)];
long absbit[BITS_TO_LONGS(ABS_CNT)];
long keybit[BITS_TO_LONGS(KEY_CNT)];
long synbit[BITS_TO_LONGS(SYN_CNT)];
if (ioctl(ts->fd, EVIOCGVERSION, &version) < 0) {
fprintf(stderr, "tslib: Selected device is not a Linux input event device\n");
return -1;
}
/* support version EV_VERSION 0x010000 and 0x010001
* this check causes more troubles than it solves here */
if (version < EV_VERSION)
fprintf(stderr, "tslib: Warning: Selected device uses a different version of the event protocol than tslib was compiled for\n");
if ( (ioctl(ts->fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
!(evbit[BIT_WORD(EV_ABS)] & BIT_MASK(EV_ABS)) ||
!(evbit[BIT_WORD(EV_KEY)] & BIT_MASK(EV_KEY)) ) {
fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS and KEY event types)\n");
return -1;
}
if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit)) < 0 ||
!(absbit[BIT_WORD(ABS_X)] & BIT_MASK(ABS_X)) ||
!(absbit[BIT_WORD(ABS_Y)] & BIT_MASK(ABS_Y))) {
if (!(absbit[BIT_WORD(ABS_MT_POSITION_X)] & BIT_MASK(ABS_MT_POSITION_X)) ||
!(absbit[BIT_WORD(ABS_MT_POSITION_Y)] & BIT_MASK(ABS_MT_POSITION_Y))) {
fprintf(stderr, "tslib: Selected device is not a touchscreen (must support ABS_X/Y or ABS_MT_POSITION_X/Y events)\n");
return -1;
}
}
/* Since some touchscreens (eg. infrared) physically can't measure pressure,
* the input system doesn't report it on those. Tslib relies on pressure, thus
* we set it to constant 255. It's still controlled by BTN_TOUCH/BTN_LEFT -
* when not touched, the pressure is forced to 0. */
if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE)))
i->no_pressure = 1;
if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
!(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH) ||
keybit[BIT_WORD(BTN_LEFT)] & BIT_MASK(BTN_LEFT))) {
fprintf(stderr, "tslib: Selected device is not a touchscreen (must support BTN_TOUCH or BTN_LEFT events)\n");
return -1;
}
/* Remember whether we have a multitouch device. We need to know for ABS_X,
* ABS_Y and ABS_PRESSURE data. */
if ((absbit[BIT_WORD(ABS_MT_POSITION_X)] & BIT_MASK(ABS_MT_POSITION_X)) &&
(absbit[BIT_WORD(ABS_MT_POSITION_Y)] & BIT_MASK(ABS_MT_POSITION_Y)))
i->mt = 1;
/* remember if we have a device that doesn't support pressure. We have to
* set pressure ourselves in this case. */
if (i->mt && !(absbit[BIT_WORD(ABS_MT_PRESSURE)] & BIT_MASK(ABS_MT_PRESSURE)))
i->no_pressure = 1;
if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN))
i->using_syn = 1;
if ((ioctl(ts->fd, EVIOCGBIT(EV_SYN, sizeof(synbit)), synbit)) == -1)
fprintf(stderr, "tslib: ioctl error\n");
/* remember whether we have a multitouch type A device */
if (i->mt && synbit[BIT_WORD(SYN_MT_REPORT)] & BIT_MASK(SYN_MT_REPORT) &&
!(absbit[BIT_WORD(ABS_MT_SLOT)] & BIT_MASK(ABS_MT_SLOT)))
i->type_a = 1;
if (i->grab_events == GRAB_EVENTS_WANTED) {
if (ioctl(ts->fd, EVIOCGRAB, (void *)1)) {
fprintf(stderr, "tslib: Unable to grab selected input device\n");
return -1;
}
i->grab_events = GRAB_EVENTS_ACTIVE;
}
return ts->fd;
}
and I can't see why the test is failing as
Can anyone point me in the right direction to getting the device calibrated? I figure that if I (with help) can get this working, it might be an excellent and cheap squeezebox touch alternative. BR. --Marius- |