Author Topic: Touch HID windows 8  (Read 23114 times)

tallman

  • Member
  • ***
  • Posts: 25
Touch HID windows 8
« on: February 21, 2014, 02:52:30 pm »
Hello,
My device works great in win7, with touch and mouse through HID.  I can't get it to work in windows 8.  The primary difference I see is "Scan Time" which windows specs says must be the time in 100us (microsecond).  I don't really see any other difference.  Since the device didn't work straight from win7 to win8, I added the scan time.  I've added width, and height because some of the docs say it's required, some say not.

All the analyzer/sniffer tells me I'm doing it right and I get no errors.  But I get no touch either.

1. What do I do next to debug?  All looks good, just to working

2. How can something be USB HID, but in Windows it uses things like scan time that is not part of USB HID.  Shouldn't it still work without that scan time and be plug and play supported?

Thanks for any help.
Brent

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Touch HID windows 8
« Reply #1 on: February 23, 2014, 08:41:49 pm »
I have no solution, just some thoughts.

If adding scan time didn't fix it, perhaps the problem is elsewhere.

It's possible that the device always had a problem but Win7 is more forgiving about it.

If you have an off-the-shelf product that works, putting a hardware analyzer on it might reveal something.


tallman

  • Member
  • ***
  • Posts: 25
Re: Touch HID windows 8
« Reply #2 on: February 24, 2014, 03:18:58 am »
Thank you for your response.  After trying and pouring over the specs on MSDN, I'm down to the only thing I haven't messed with, but don't totally understand it. 

The docs refer to Contact count maximum as a required usage.

http://msdn.microsoft.com/en-us/library/windows/hardware/jj151563(v=vs.85).aspx
shows
Code: [Select]
    0x85, REPORTID_MAX_COUNT,           //   REPORT_ID (Feature)             
    0x09, 0x55,                         //   USAGE(Contact Count Maximum)
    0x95, 0x01,                         //   REPORT_COUNT (1)
    0x25, 0x02,                         //   LOGICAL_MAXIMUM (2)
    0xb1, 0x02,                         //   FEATURE (Data,Var,Abs)
I don't quite understand from hardware what I'm supposed to do with this. 
a. What do I put for ReportID_MAX_COUNT next to the 0x85,
b. am I supposed to send the contact count maximum from my device, or is this supposed to be sent to me? 
c.  Is feature really same as INPUT, and I can build an array just like my INPUT array's I'm sending?

In my case, lets say the maximum count is 10.  I suspect it's important for me to tell Windows this.
Thanks for reviewing this.
Brent

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Touch HID windows 8
« Reply #3 on: February 24, 2014, 12:06:11 pm »
Did you see this docx file:

Digitizer Drivers for Windows Touch and Pen-Based Computers

(search for it)

tallman

  • Member
  • ***
  • Posts: 25
Re: Touch HID windows 8
« Reply #4 on: February 24, 2014, 12:51:20 pm »
Jan,
I did.  I've read through this material quite a bit looking for some clue or answer.  This doc is a windows 7, but I rechecked the first couple pages of results from search just to make sure I didn't see anything new.

I'm now focused still on trying to send the max count feature into Windows from my device.  The getreport funcationality isn't described really well in my Atmel docs.  I don't know if this is a rabbit hole, but I'm not sure what else to do.  I have verified repeatedly I'm sending all required info to the Windows 8, but the documentation contradicts itself on numerous occasions.

Is there any way to diagnose the internals of HID drivers in windows?

Brent
« Last Edit: February 24, 2014, 12:58:31 pm by tallman »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Touch HID windows 8
« Reply #5 on: February 25, 2014, 09:24:01 am »
I would look for a similar, working device and view its report descriptor.

tallman

  • Member
  • ***
  • Posts: 25
Re: Touch HID windows 8
« Reply #6 on: February 25, 2014, 10:37:01 am »
Well, of course that device is hard to find.  Touch screens don't use USB that I can see, and touch pads (I just bought Logitech) have their own driver.  It's kind of an unusual thing to want to send touch information, without a touch screen.  This is a new device coming to market.

Anyways, I feel like a dope I can't figure this out, and I'm looking bad because I'm causing delays :(.  Right now I have it wrapped under a composite device.  I'm thinking it's worth the trouble to make it not composite, to see if it works, and helps identify where the issue is.  Do you think that would make any difference?  It is identified properly as a touch device to win 8 now, under the composite.

Thanks.
Brent

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Touch HID windows 8
« Reply #7 on: February 25, 2014, 11:43:22 am »
Yes, if you can remove the second function and just test the one that's causing trouble, that might reveal something and would at least remove one possible source of problems.

A lot of this stuff isn't well documented. Does it appear in Device Manager without an error? Any problems noted in the setupapilog file:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff550900%28v=vs.85%29.aspx

raul

  • Member
  • ***
  • Posts: 6
Re: Touch HID windows 8
« Reply #8 on: February 26, 2014, 10:29:40 am »
Brent,

Thank you for your response.  After trying and pouring over the specs on MSDN, I'm down to the only thing I haven't messed with, but don't totally understand it. 

The docs refer to Contact count maximum as a required usage.

http://msdn.microsoft.com/en-us/library/windows/hardware/jj151563(v=vs.85).aspx
shows
Code: [Select]
    0x85, REPORTID_MAX_COUNT,           //   REPORT_ID (Feature)             
    0x09, 0x55,                         //   USAGE(Contact Count Maximum)
    0x95, 0x01,                         //   REPORT_COUNT (1)
    0x25, 0x02,                         //   LOGICAL_MAXIMUM (2)
    0xb1, 0x02,                         //   FEATURE (Data,Var,Abs)
I don't quite understand from hardware what I'm supposed to do with this. 
a. What do I put for ReportID_MAX_COUNT next to the 0x85,
b. am I supposed to send the contact count maximum from my device, or is this supposed to be sent to me? 
c.  Is feature really same as INPUT, and I can build an array just like my INPUT array's I'm sending?

In my case, lets say the maximum count is 10.  I suspect it's important for me to tell Windows this.
Thanks for reviewing this.
Brent

The above says that you need to create a Feature report. The ReportID_MAX_COUNT can be whatever number you want (as long as it doesn't match any other Feature (and possibly input, and output) Report ID.
Then when Windows ask for that report ID, you reply with a report stating your maximum number of supported touches.
Note that the descriptor you show there, already sets the maximum to two. [ I don't understand why that maximum is not set to 0xFF, as AFAIK it has little value].

If you post your descriptor, I can have a look at it.

Hope this helps.
Raul

tallman

  • Member
  • ***
  • Posts: 25
Re: Touch HID windows 8
« Reply #9 on: February 26, 2014, 06:30:31 pm »
I've removed the composite to reduce the issues.  I've checked the setuplog and all looks fine in windows 8.1.  I found others had an issue with windows enhanced power management causing problems, so I've deactivated that for this device.

Here is the setuplog.  In the device manager it is recognized as a touch device just fine, but none of the commands do anything to it.  I've again verified using a software analyser the data is getting there the way I'm intending, and I'm matching the MSDN site's descriptor documentation.

To attempt to simplify I'm using their single finger hybrid mode report descriptor.
http://msdn.microsoft.com/en-us/library/windows/hardware/jj151563(v=vs.85).aspx

Here is my descriptor.
Thanks for all who review.
Brent
Code: [Select]
       {
                    0x05, 0x0d,                    // USAGE_PAGE (Digitizers)                                                                2
                    0x09, 0x04,                    // USAGE (Touch Screen)                                                                               2
                    0xa1, 0x01,                    // COLLECTION (Application)                                                              2
                    0x85, 0x01,                            // REPORT_ID (Touch)                                                                     2
                    0x09, 0x22,                    // USAGE (Finger)                                                                              65 down to collection
                    0xa1, 0x02,                    // COLLECTION (Logical)
                    0x09, 0x42,                    // USAGE (Tip Switch)
                    0x15, 0x00,                    // LOGICAL_MINIMUM (0)
                    0x25, 0x01,                    // LOGICAL_MAXIMUM (1)
                    0x75, 0x01,                    // REPORT_SIZE (1)
                    0x95, 0x01,                    // REPORT_COUNT (1)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)  bit 0
                    0x09, 0x32,                    // USAGE (In Range)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)  bit 1
                    0x95, 0x06,                    // REPORT_COUNT (6)   bit 2-7 blank
                    0x81, 0x03,                    // INPUT (Cnst,Ary,Abs)
                    0x75, 0x08,                    // REPORT_SIZE (8)
                    0x09, 0x51,                    // USAGE ( Contact Identifier)
                    0x95, 0x01,                    // REPORT_COUNT (1)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)  //40
                                 
                    0x05, 0x01,                    // USAGE_PAGE (Generic Desk..
                    0x15, 0x00,                    // LOGICAL_MINIMUM (0)
                    0x26, 0xff, 0x0f,              // LOGICAL_MAXIMUM (4095)
                    0x75, 0x10,                    // REPORT_SIZE (16)
                    0x55, 0x0e,                    // UNIT_EXPONENT (-2)
                    0x65, 0x33,                    // UNIT(Inch,EngLinear)
                    0x09, 0x30,                    // USAGE (X)
                    0x35, 0x00,                    // PHYSICAL_MINIMUM (0)
                    0x46, 0x56, 0x05,              // PHYSICAL_MAXIMUM (1366)
                                  0x95, 0x01,                         //       REPORT_COUNT (1)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)
                    0x46, 0x00, 0x03,              // PHYSICAL_MAXIMUM (768)
                    0x09, 0x31,                    // USAGE (Y)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)  29
                    0xc0,                                        // END_COLLECTION
                    0x05, 0x0d,                    // USAGE_PAGE (Digitizers)
                                  0x55, 0x0C,                         //     UNIT_EXPONENT (-4)
                                  0x66, 0x01, 0x10,                   //     UNIT (Seconds)
                                  0x47, 0xff, 0xff, 0x00, 0x00,      //       PHYSICAL_MAXIMUM (65535)
                                  0x27, 0xff, 0xff, 0x00, 0x00,         //   LOGICAL_MAXIMUM (65535)
                                  0x75, 0x10,                           //   REPORT_SIZE (16)
                                  0x95, 0x01,                           //   REPORT_COUNT (1)
                                  0x09, 0x56,                         //   USAGE (Scan Time)
                                  0x81, 0x02,                           //   INPUT (Data,Var,Abs)   23
                                 
                    0x09, 0x54,                    // USAGE (Contact Count)
                    0x95, 0x01,                    // REPORT_COUNT (1)
                    0x75, 0x08,                    // REPORT_SIZE (8)
                    0x81, 0x02,                    // INPUT (Data,Var,Abs)
                    0x85, 0x02,                    // REPORT_ID (Contact Count Max)
                    0x09, 0x55,                    // USAGE(Contact Count Maximum)
                    0x95, 0x01,                    // REPORT_COUNT (1)
                    0x25, 0x02,                    // LOGICAL_MAXIMUM (2)
                    0xb1, 0x02,                    // FEATURE (Data,Var,Abs)
                    0xc0,                           // END_COLLECTION                                                                                   45
       
              0x05, 0x01,                         // USAGE_PAGE (Generic Desktop)     0
              0x09, 0x02,                         // USAGE (Mouse)                    2
              0xa1, 0x01,                         // COLLECTION (Application)         4
              0x85, 0x03,               //   REPORT_ID (Mouse)              6
              0x09, 0x01,                         //   USAGE (Pointer)                8
              0xa1, 0x00,                         //   COLLECTION (Physical)          10
              0x05, 0x09,                         //     USAGE_PAGE (Button)          12
              0x19, 0x01,                         //     USAGE_MINIMUM (Button 1)     14
              0x29, 0x02,                         //     USAGE_MAXIMUM (Button 2)     16
              0x15, 0x00,                         //     LOGICAL_MINIMUM (0)          18
              0x25, 0x01,                         //     LOGICAL_MAXIMUM (1)          20
              0x75, 0x01,                         //     REPORT_SIZE (1)              22
              0x95, 0x02,                         //     REPORT_COUNT (2)             24
              0x81, 0x02,                         //     INPUT (Data,Var,Abs)         26
              0x95, 0x06,                         //     REPORT_COUNT (6)             28
              0x81, 0x03,                         //     INPUT (Cnst,Var,Abs)         30
              0x05, 0x01,                         //     USAGE_PAGE (Generic Desktop) 32
              0x09, 0x30,                         //     USAGE (X)                    34
              0x09, 0x31,                         //     USAGE (Y)                    36
              0x15, 0x81,                         //     LOGICAL_MINIMUM (-127)       38
              0x25, 0x7f,                         //     LOGICAL_MAXIMUM (127)        40
              0x75, 0x08,                         //     REPORT_SIZE (8)              42
              0x95, 0x02,                         //     REPORT_COUNT (2)             44
              0x81, 0x06,                         //     INPUT (Data,Var,Rel)         46
              0xc0,                               //   END_COLLECTION                 48
              0xc0                                // END_COLLECTION                   49/50
                     }

tallman

  • Member
  • ***
  • Posts: 25
Re: Touch HID windows 8
« Reply #10 on: February 26, 2014, 09:49:31 pm »
Finally progress!!!  I'd like to have the past week of my life back.

I changed the Contact Count Maximum from a feature (which I couldn't figure out how to send as feature through the embedded code) to straight INPUT.  Once I sent this in the descriptor, walah!   Windows 8.1 finally see's it as a touch device.  It really is required by the device.  Interestingly, though the scan time which is stated as required, wasn't.  It may make it work better, but it isn't required because I don't have it in my current code, and it's working now.  Nor Width, and Height again for next persons help.

So I'm good now.
Thanks all for help, and hope this helps someone else not lose a week.
Brent