WDF_USB_CONTINUOUS_READER_CONFIG

Hi.

I?ve just given a driver to my friend for this guncon and he says that the refresh isn?t fast enough. I?m using WdfUsbContinuous reader and I have tried increasing the pending requests from 0 to 6 to 1024 (I had to try.) and it is still missing data, is there a way to increase the frequency? I am reading documents on manual read and write requests at the moment but my knownledge isn?t good enough and I know that I said my last question would be my last but I think this is important enough for him.

Thanks.

If the host cannot keep up with the maximum number of pending reads (which is 10), something is wrong with your device in its expectations of the host or what it is doing on the wire.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Thursday, September 17, 2009 12:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG

Hi.

I?ve just given a driver to my friend for this guncon and he says that the refresh isn?t fast enough. I?m using WdfUsbContinuous reader and I have tried increasing the pending requests from 0 to 6 to 1024 (I had to try.) and it is still missing data, is there a way to increase the frequency? I am reading documents on manual read and write requests at the moment but my knownledge isn?t good enough and I know that I said my last question would be my last but I think this is important enough for him.

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

As far as I am aware there is nothing wrong with the device. It works on a PS2, maybe that is the best it can be on the computer. I wasn?t sure if wdfcontinous was on a regular timer. In that case I?ll let him know. Maybe its just the gun because other people have created drivers like this and dont appear to have problems. Thanks.

I don’t understand. You have a keyboard filter right? Keyboard filters do not use a usb continuous reader on either a ps2 or hid keyboard. You only a continuous reader on the stack enumerated by usbhub or usbccgp, not anything downstream. And no the cont reader is not timer based, it just sends down IRPs and lets them complete asynchronously

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Thursday, September 17, 2009 1:22 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDF_USB_CONTINUOUS_READER_CONFIG

As far as I am aware there is nothing wrong with the device. It works on a PS2, maybe that is the best it can be on the computer. I wasn?t sure if wdfcontinous was on a regular timer. In that case I?ll let him know. Maybe its just the gun because other people have created drivers like this and dont appear to have problems. Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

It?s the gun then.

Basically what is happening is I have a piece of hardware where buttons are pressed. The driver picks this up and everytime wdfcontinous is executed it communicates with another driver. A keyboard filter and the filter injects keys to the keyboard. It all works as it should, but the button on the game controller has to be held down for at least 1/2second before it is reconised, which in the experience of gameplay is a long time.

xxxxx@hotmail.com wrote:

I´ve just given a driver to my friend for this guncon and he says that the refresh isn´t fast enough.

What’s a “guncon”?

Exactly what does he mean by “refresh isn’t fast enough”?

I´m using WdfUsbContinuous reader and I have tried increasing the pending requests from 0 to 6 to 1024 (I had to try.) and it is still missing data, is there a way to increase the frequency?

How large are the requests? How do you know you are missing data? Is
this a bulk pipe?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

guncon is the name of PS2 gun you use to play with, it has a usb connection and for the most part works on a pc when you create a driver.

He means that you cannot simply press a button as you do on a PS2 you have to hold it down for a time or more.

The data coming back are 8 bytes long, and it is using an interrupt pipe not a bulk pipe.

I know data is missing because the button can physically be pressed down - a click can be heard - released and nothing happens. If you press the button down, and hold it the desired event happens.

If I press the button just as the continiousdata preforms its read the data is picked up, if I do it a milisecond too late I have to wait until the next read completion. So the event can be instantinious to being a second out.

I hope that makes sense.

xxxxx@hotmail.com wrote:

I know data is missing because the button can physically be pressed down - a click can be heard - released and nothing happens. If you press the button down, and hold it the desired event happens.

If I press the button just as the continiousdata preforms its read the data is picked up, if I do it a milisecond too late I have to wait until the next read completion. So the event can be instantinious to being a second out.

I hope that makes sense.

So, your interrupt pipe has an interval of one second? That’s the
problem, then, isn’t it? Why don’t you set the interval to, say, 10ms?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

That?s my question. How do I do it? I?m using wdfusbcontiniousreader.

Thankyou I am reading the documentation now.

Thanks.

xxxxx@hotmail.com wrote:

That´s my question. How do I do it? I´m using wdfusbcontiniousreader.

The interval is set by the descriptors in the device.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

MSDN says the value can not be changed as I think you are implying too.

It doesn?t say anything about changing the device from low to high to a high speed device. What would I need to look up if I were to attempt this?

Thanks.

Hmmm… I’m not sure I understand your question, exactly, but the speed is determined by the Device Descriptor. There are several ways of handling the change from full speed (did you mean “full” speed, above??) to high speed in your device firmware… such as swapping device descriptors quickly after the initial speed detection. The endpoint configuration has the polling interval, defined by the device firmware.

Did that help any?

Peter
OSR

xxxxx@hotmail.com wrote:

MSDN says the value can not be changed as I think you are implying too.

Are you referring to the interval? As I said, that’s set in the
device’s configuration descriptor. Do you have control over the
firmware in the device?

It doesn´t say anything about changing the device from low to high to a high speed device. What would I need to look up if I were to attempt this?

This is also something the device hardware must do, when it is first
enumerated.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Even if it was set to 1 second, the slowest that the existing host controllers poll is about every 32ms, so that wouldn’t explain the 1/2 second delay.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, September 17, 2009 2:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG

xxxxx@hotmail.com wrote:

I know data is missing because the button can physically be pressed down - a click can be heard - released and nothing happens. If you press the button down, and hold it the desired event happens.

If I press the button just as the continiousdata preforms its read the data is picked up, if I do it a milisecond too late I have to wait until the next read completion. So the event can be instantinious to being a second out.

I hope that makes sense.

So, your interrupt pipe has an interval of one second? That’s the
problem, then, isn’t it? Why don’t you set the interval to, say, 10ms?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Tim, I don?t. Is there any other way I can do anything?

Randy, the 1/2 second delay was guess work. the time difference in DebugView is 1.2.

xxxxx@hotmail.com wrote:

Tim, I don´t. Is there any other way I can do anything?

If you don’t control the firmware, then you’re just shooting in the dark.

Randy, the 1/2 second delay was guess work. the time difference in DebugView is 1.2.

1.2 what? 1.2 seconds? That’s an eternity. What is that the
difference between?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

USB is not my forte, so Tim you may tell me to go back to sleep. :slight_smile:

However, having had “missed” interrupts and “lost” data on several different
drivers I have written there is one possibility that I have as to see
discussed: Improper handling of the ISR/DPC interface.

Data can very easily be missed or lost when the interrupt service routines
blindly queues a DPC. Since the rule of thumb is only one DPC on the queue
at a time, the first one queued is the one you get and the last one queued
goes into the proverbial bit bucket. Hence, I have found the best way to
handle the ISR/DPC is to queue the volatile data available during the
interrupt so that you never ever loose it. Any resulting request to the DPC
queue will simply mean that the DPC is going to be called at the end of the
interrupt. You can of course check the state of your event queue and NOT
queue the DPC if there is an event in your queue. The DPC will always run
ALL the way to the end of its “event” queue. If the interrupt triggers
during DPC processing you know the last data received will be in the last
item on the DPC’s event queue. Obviously you have to be sensible about what
spinlocks you hold and for how long. Assuming that the data you have in the
ISR is the data you will see in the DPC is folly. It very well may not be,
unless the developer takes to steps to make certain that it is.

Ok … if USB don’t work that way then ignore all the above. And if this has
already been discussed, then ignore the reiteration.

The personal opinion of
Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Randy Aull
Sent: Friday, September 18, 2009 12:18 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG

Even if it was set to 1 second, the slowest that the existing host
controllers poll is about every 32ms, so that wouldn’t explain the 1/2
second delay.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Thursday, September 17, 2009 2:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WDF_USB_CONTINUOUS_READER_CONFIG

xxxxx@hotmail.com wrote:

I know data is missing because the button can physically be pressed down -
a click can be heard - released and nothing happens. If you press the button
down, and hold it the desired event happens.

If I press the button just as the continiousdata preforms its read the
data is picked up, if I do it a milisecond too late I have to wait until the
next read completion. So the event can be instantinious to being a second
out.

I hope that makes sense.

So, your interrupt pipe has an interval of one second? That’s the
problem, then, isn’t it? Why don’t you set the interval to, say, 10ms?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 4438 (20090918) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4438 (20090918) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Gary G. Little wrote:

USB is not my forte, so Tim you may tell me to go back to sleep. :slight_smile:

However, having had “missed” interrupts and “lost” data on several different
drivers I have written there is one possibility that I have as to see
discussed: Improper handling of the ISR/DPC interface.

Ok … if USB don’t work that way then ignore all the above. And if this has
already been discussed, then ignore the reiteration.

Well, in USB all of that is handled by the host controller driver. USB
client drivers don’t worry about mundane issues like DMA and ISRs. We
just submit URBs and wait for the completion. 1394 is the same.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.