Date: Tue, 25 Jul 2017 11:56:09 -0400 From: Anthony Jenkins <Scoobi_doo@yahoo.com> To: Hans Petter Selasky <hps@selasky.org>, freebsd-usb@freebsd.org Subject: Re: PATCH: uep(4) support for (my) eGalax touchscreen Message-ID: <57bc8301-5dae-3d1d-f057-8c42509be4bb@yahoo.com> In-Reply-To: <b192e2ff-dc08-2edb-f58e-55166ee752bc@selasky.org> References: <9be27e1a-aada-f53a-879f-24d7da4f42be@yahoo.com> <743ccf34-cbf6-17a8-fa2c-d174ff56abee@yahoo.com> <b192e2ff-dc08-2edb-f58e-55166ee752bc@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/24/2017 04:18 PM, Hans Petter Selasky wrote: > On 07/24/17 22:10, Anthony Jenkins via freebsd-usb wrote: >> >> On 07/24/2017 03:28 PM, Anthony Jenkins via freebsd-usb wrote: >>> I'm trying to add support for uep(4) to detect and properly emit touc= h >>> events to x11-drivers/xf86-input-egalax. What I have works, but has >>> some >>> issues, particularly: >>> >>> - close(2)ing the device node causes a USB_ST_ERROR in the >>> uep_intr_callback(); it's probably from my attempt to port an >>> initialization control message from Linux >>> - I massage the touch events from my device into the legacy uep(4) >>> event structure since my multitouch-supporting touchscreen has 12-bit= s >>> of resolution per axis, but legacy uep(4) only had 11 >>> - For some reason my Y-axis is inverted; I had to subtract its >>> coordinate from the max Y value. I'll probably add an ioctl(2) to se= t >>> axis inversion behavior dynamically rather than hardcode it. >>> - I capture all the multitouch info from the USB packets, but I don= 't >>> know (yet) if xf86-input-egalax can do anything with it >>> - x11-drivers/xf86-input-egalax's default min/max ranges are "silly= " >>> (500/1500), but I didn't add the trivial patch to it. I'd like to ad= d >>> an ioctl(2) that lets xf86-input-egalax query uep(4) for axis ranges,= >>> but as I've written my patch, uep(4) doesn't know its ranges until it= >>> gets a touch packet. >>> - I started adding support for evdev(4) reporting (added header fil= es >>> and device struct members), but it's nowhere near finished. >>> - I have no idea how common this eGalax protocol is or how to >>> determine >>> what protocol to use from the driver. Right now I assume a byte 0 of= >>> 0x06 means "multitouch event". >>> - My x11-servers/xorg-server is patched to associate /dev/uep0 >>> with the >>> xf86-input-egalax driver; I guess I'll have to make that available to= o. >>> My config/devd.c is substantially different from stock. >> >> The main problem with uep(4) was either xorg-server or xf86-input-egal= ax >> started doing asynchronous I/O on the device node using fcntl(F_SETOWN= ); >> the original uep(4) expected userland to open(2)/read(2) the device >> node. I had to add the FIOSETOWN support, but I don't know if there's= a >> way to remove a process as owner (call fcntl(F_SETOWN, NULL)?). If so= , >> I'll need to handle that case. >> >> I can stick this up in the FreeBSD code review site if desired. >> >> Anthony >> >>> Logging is sort of noisy at the moment when touching the screen, but = it >>> "Just Works (TM)" with my touchscreen, my slightly-patched >>> xf86-input-egalax driver and KDE4. >>> >>> uep(4) patch: >>> https://github.com/ScoobiFreeBSD/freebsd/commit/62c11d484d5fb61749240= b439612f852c5148222 >>> >>> x11-servers/xorg-server patch: >>> https://github.com/ScoobiFreeBSD/freebsd-ports/commit/9465237f83ab8fb= 27249abfe803f94b6b8c3b945 >>> >>> >>> Suggestions/comments welcome. Currently looking for help with the >>> USB_ST_ERROR issue, although I think I may know what's wrong (this >>> is my >>> 1st attempt at USB stack programming). >>> >>> Anthony Jenkins >>> > > Just a dumb question: Have you tried to use webcamd with your device? > It's been a while, and multimedia/webcamd + xf86-input-evdev /had/ worked, but it's been months since I'd gotten it to work, and it would always drop the first touch event. I can try again to get that configuration to work, but I like the native (stub) driver architecture (except for the maintenance needed). Linux' drivers/input/touchscreen/usbtouchscreen.c driver pretty much does the same thing Anthony > --HPS > --=20 Anthony Jenkins
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57bc8301-5dae-3d1d-f057-8c42509be4bb>