From: Peter Hutterer on
On Sun, May 23, 2010 at 10:48:35PM -0700, Ping Cheng wrote:
> On Sun, May 23, 2010 at 10:25 PM, Peter Hutterer
> <peter.hutterer(a)who-t.net> wrote:
> > On Fri, May 21, 2010 at 11:25:41PM +0200, Henrik Rydberg wrote:
> >> Ping Cheng wrote:
> >> > On Fri, May 21, 2010 at 8:19 AM, Rafi Rubin <rafi(a)seas.upenn.edu> wrote:
> >> [...]
> >> >> Ping: please confirm, are you actually talking about each finger simultaneously sending multiple positions?
> >> >
> >> > You are definitely on the right track. �The fingers/touch objects can
> >> > be represented two-dimensionally (x,y) instead of one-dimensionally
> >> > (ABS_MT_TRACKING_ID). �I think we can survive with the current MT_BLOB
> >> > definition although some optimization would be helpful, especially for
> >> > filtering. For the sake of Henrik great effort, I'd like to see his
> >> > current patchset gets in the tree before we start another round of
> >> > "suggestions".
> >> >
> >> > Thank you for asking.
> >>
> >> Regarding blobs, I confused myself yesterday. The original intention of the blob
> >> �id was in fact to be able to "paint" more generic contact forms. However, no
> >> driver has come close to doing this yet, so it has gotten close to no attention.
> >> Now, to address the question of how to communicate more elaborate contact forms,
> >> it seems one can combine the two goals "one position per slot" and "multiple
> >> positions per contact" by simply repeating the same tracking id for a set of
> >> slots, like this:
> >>
> >> ABS_SLOT 0
> >> ABS_MT_TRACKING_ID 14
> >> ABS_MT_POSITION_X x[0]
> >> ABS_MT_POSITION_Y y[0]
> >> ABS_SLOT 1
> >> ABS_MT_TRACKING_ID 14
> >> ABS_MT_POSITION_X x[1]
> >> ABS_MT_POSITION_Y y[1]
> >> ABS_SLOT 2
> >> ABS_MT_TRACKING_ID 14
> >> ABS_MT_POSITION_X x[2]
> >> ABS_MT_POSITION_Y y[2]
> >>
> >> Not all too different from what you suggested, and there is no blob id involved
> >> at all. And yes, it would require additional parsing power at the user end.
> >> Something for later.
> >
> > This is confusing me now :)
> >
> > How would a device get multiple x/y coordinates for a single contact? I
> > could understand a range of coordinates but that's what we have the
> > ABS_MT_WIDTH_MAJOR/MINOR for. If a touchpoint sends two different x/y
> > coordinates, wouldn't that be two touchpoints, tracked individually and thus
> > with a different tracking ID?
> >
> > I read the example above as _the_ example for using blob IDs to combine
> > multiple contacts into one semantic contact.
>
> As Henrik pointed out, the current BLOB format is for "more generic
> contact forms", such as rectangles or ellipses. They are special
> blobs. A generic (true) blob doesn't have to have a regular shape. It
> is most likely in an irregular shape. They would be represented in an
> array of points/contacts/(x,y)s, whichever term works for you :).

Hmm. I always assumed blob is for irregular shapes, and rectangles or others
are just subsets of irregular shapes (with slightly less 'ir', maybe).
So what would be the difference between these two event streams?

ABS_SLOT 0
ABS_MT_TRACKING_ID 14
ABS_MT_POSITION_X x[0]
ABS_MT_POSITION_Y y[0]
ABS_SLOT 1
ABS_MT_TRACKING_ID 14
ABS_MT_POSITION_X x[1]
ABS_MT_POSITION_Y y[1]


ABS_SLOT 0
ABS_MT_TRACKING_ID 14
ABS_MT_BLOB_ID 1
ABS_MT_POSITION_X x[0]
ABS_MT_POSITION_Y y[0]
ABS_SLOT 1
ABS_MT_BLOB_ID 1
ABS_MT_TRACKING_ID 15
ABS_MT_POSITION_X x[1]
ABS_MT_POSITION_Y y[1]

Cheers,
Peter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Henrik Rydberg on
Peter Hutterer wrote:
[...]
>>> This is confusing me now :)
>>>
>>> How would a device get multiple x/y coordinates for a single contact? I
>>> could understand a range of coordinates but that's what we have the
>>> ABS_MT_WIDTH_MAJOR/MINOR for. If a touchpoint sends two different x/y
>>> coordinates, wouldn't that be two touchpoints, tracked individually and thus
>>> with a different tracking ID?
>>>
>>> I read the example above as _the_ example for using blob IDs to combine
>>> multiple contacts into one semantic contact.
>> As Henrik pointed out, the current BLOB format is for "more generic
>> contact forms", such as rectangles or ellipses. They are special
>> blobs. A generic (true) blob doesn't have to have a regular shape. It
>> is most likely in an irregular shape. They would be represented in an
>> array of points/contacts/(x,y)s, whichever term works for you :).
>
> Hmm. I always assumed blob is for irregular shapes, and rectangles or others
> are just subsets of irregular shapes (with slightly less 'ir', maybe).
> So what would be the difference between these two event streams?
>
> ABS_SLOT 0
> ABS_MT_TRACKING_ID 14
> ABS_MT_POSITION_X x[0]
> ABS_MT_POSITION_Y y[0]
> ABS_SLOT 1
> ABS_MT_TRACKING_ID 14
> ABS_MT_POSITION_X x[1]
> ABS_MT_POSITION_Y y[1]
>
>
> ABS_SLOT 0
> ABS_MT_TRACKING_ID 14
> ABS_MT_BLOB_ID 1
> ABS_MT_POSITION_X x[0]
> ABS_MT_POSITION_Y y[0]
> ABS_SLOT 1
> ABS_MT_BLOB_ID 1
> ABS_MT_TRACKING_ID 15
> ABS_MT_POSITION_X x[1]
> ABS_MT_POSITION_Y y[1]

I, for one, prefer a third example, but for some other time. I know, the first
example is my fault, but it was created to illustrate that it is possible, not
that it is a particularly good idea. :-)

For type A devices, in the absence of identifiable contacts, there is room for
geometrical groupings of different kinds. Since all data is transferred between
synchronization points, the ABS_MT_BLOB_ID serves this purpose well.

However, for type B devices, seeking to reduce bandwidth by adding the concept
of identifiable contacts, it does not make sense to send overly detailed data.
If anything, the shape of a contact should be communicated in a simpler way,
maybe by extending the ABS_MT_TOOL_TYPE list.

Here is an attempt to capture the above constraints in the documentation:

@@ -244,15 +244,16 @@ MT_TOOL_PEN [2].
ABS_MT_BLOB_ID

The BLOB_ID groups several packets together into one arbitrarily shaped
-contact. This is a low-level anonymous grouping, and should not be confused
-with the high-level trackingID [5]. Most kernel drivers will not have blob
-capability, and can safely omit the event.
+contact. This is a low-level anonymous grouping for type A devices, and
+should not be confused with the high-level trackingID [5]. Most type A
+devices do not have blob capability, so drivers can safely omit this event.

ABS_MT_TRACKING_ID

The TRACKING_ID identifies an initiated contact throughout its life cycle
-[5]. There are currently only a few devices that support it, so this event
-should normally be omitted.
+[5]. This event is mandatory for type B devices. The value range of the
+TRACKING_ID should be large enough to ensure unique identification of a
+contact maintained over an extended period of time.

Henrik

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Henrik Rydberg on
Ping Cheng wrote:
[...]
> This topic is outside of the _MT_ protocol discussion.
>
> However, it is indeed an issue with all filtered input events, both
> for MT and regular ones.
>
> I think we need to add an ioctl to enable user land driver/client to
> signal the kernel driver to send all events without filtering, just
> once. Hot-plugged devices and X driver starts after user has contacted
> with the device are two examples that the client would miss filtered
> events.
>
> Dmitry, do you think it is a valid suggestion?
>
> I've had this issue for ages (but never had time to work on it :(.

It would be easy to initialize a catch-up when opening the device for a new
client (evdev_open()).

Henrik

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dmitry Torokhov on
On Sun, May 23, 2010 at 11:07:27PM -0700, Ping Cheng wrote:
> On Sun, May 23, 2010 at 9:58 PM, Peter Hutterer
> <peter.hutterer(a)who-t.net> wrote:
> >> > And yes, you could add it once we find it's an issue, but by then someone
> >> > has already spent time to work around this. And when you then start sending
> >> > slot events all the time, you admit that writing the workaround was just a
> >> > time waster :)
> >>
> >> Work around what, exactly?
> >
> > I was referring to having a protocol where processes has to ignore contacts
> > already down until they've been there when a contact was pressed (and your
> > comment that if this becomes an issue it could be added lateron).
> > Now, the ignoring part needs to be written (this is the "workaround"
> > referred to above). if you're planning to add it later, we need to cater for
> > that part as well then, having two implementations depending on the kernel
> > versions.
> >
> > but this is just for clarification, it's a moot point anyway given that
> > button events have the same behaviour.
>
> This topic is outside of the _MT_ protocol discussion.
>
> However, it is indeed an issue with all filtered input events, both
> for MT and regular ones.
>
> I think we need to add an ioctl to enable user land driver/client to
> signal the kernel driver to send all events without filtering, just
> once. Hot-plugged devices and X driver starts after user has contacted
> with the device are two examples that the client would miss filtered
> events.
>
> Dmitry, do you think it is a valid suggestion?
>

What about using EVIOCGKEY/EVIOCGSW/EVIOCGABS?

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Ping Cheng on
On Mon, May 24, 2010 at 8:59 AM, Dmitry Torokhov
<dmitry.torokhov(a)gmail.com> wrote:
> On Sun, May 23, 2010 at 11:07:27PM -0700, Ping Cheng wrote:
>> On Sun, May 23, 2010 at 9:58 PM, Peter Hutterer
>> <peter.hutterer(a)who-t.net> wrote:
>> >> > And yes, you could add it once we find it's an issue, but by then someone
>> >> > has already spent time to work around this. And when you then start sending
>> >> > slot events all the time, you admit that writing the workaround was just a
>> >> > time waster :)
>> >>
>> >> Work around what, exactly?
>> >
>> > I was referring to having a protocol where processes has to ignore contacts
>> > already down until they've been there when a contact was pressed (and your
>> > comment that if this becomes an issue it could be added lateron).
>> > Now, the ignoring part needs to be written (this is the "workaround"
>> > referred to above). if you're planning to add it later, we need to cater for
>> > that part as well then, having two implementations depending on the kernel
>> > versions.
>> >
>> > but this is just for clarification, it's a moot point anyway given that
>> > button events have the same behaviour.
>>
>> This topic is outside of the _MT_ protocol discussion.
>>
>> However, it is indeed an issue with all filtered input events, both
>> for MT and regular ones.
>>
>> I think we need to add an ioctl to enable user land driver/client to
>> signal the kernel driver to send all events without filtering, just
>> once. Hot-plugged devices and X driver starts after user has contacted
>> with the device are two examples that the client would miss filtered
>> events.
>>
>> Dmitry, do you think it is a valid suggestion?
>>
>
> What about using EVIOCGKEY/EVIOCGSW/EVIOCGABS?

Those EVIOCs only give us the static values (max/min/supported keys,
etc.). We need their dynamic input data here, the actual x, y,
button, pressure, etc. Am I missing something about those EVIOs?

Ping
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/