Skip to content

Conversation

@paamand
Copy link
Contributor

@paamand paamand commented Jan 8, 2020

Making it very clear that the USB "frames" are in fact 1ms frames and not microframes.

Making it very clear that the "frames" are in fact 1ms frames and not microframes.
Making it very clear that the "frames" are in fact 1ms frames and not microframes.
Making it very clear that the "frames" are in fact 1ms frames and not microframes.
Making it very clear that the "frames" are in fact 1ms frames and not microframes.
@msftclas
Copy link

msftclas commented Jan 8, 2020

CLA assistant check
All CLA requirements met.

@GrantMeStrength
Copy link
Collaborator

Hi Bill. Let me know if you can't OK this one.

@GrantMeStrength GrantMeStrength removed their assignment Jan 21, 2020
@PRMerger12
Copy link

@paamand : Thanks for your contribution! The author(s) have been notified to review your proposed change.

If the caller submits multiple read requests to stream data from the device, the transfer size should be a multiple of the maximum bytes per interval (as returned by <a href="https://docs.microsoft.com/windows/desktop/api/winusb/nf-winusb-winusb_querypipeex">WinUsb_QueryPipeEx</a>) * 8 / interval.


Because of the transfer packaging, <b>only full 1ms USB frames are available</b> and low-latency applications requiring microframe transfers must use a kernel mode driver instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this statement. Regardless of whether WinUsb or a kernel-mode driver is used, the underlying kernel-mode interface only allows isochronous transfers to be scheduled on a 1ms frame boundary. For high-speed/SuperSpeed devices which microframes are scheduled is determined by the interval of the endpoint.

Whether a developer needs to use a kernel-mode driver versus WinUSB for low-latency applications is determined by the latency between completion of the isoch transfer on the bus and when the driver or app is notified of that completion. It has nothing to do with frames versus micro-frames.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with both statements. But the critical point here is that lowest latency notification of the driver/app is only done at the 1ms interval regardless of the bInterval of the endpoint. How about:

Suggested change
Because of the transfer packaging, <b>only full 1ms USB frames are available</b> and low-latency applications requiring microframe transfers must use a kernel mode driver instead.
Because of the transfer packaging used in the underlying kernel-mode interface, the lowest latency notification to an application or driver is 1ms intervals. This also applies to high-speed/SuperSpeed devices regardless of the interval specified by the endpoint. Applications requiring sub-millisecond latency must implement a custom kernel-mode driver.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would only take the typo fixes for these changes. Discussion about the need for a user-mode app versus kernel-mode driver should not be part of the API documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but details about the imposed limitations of the implementation is definitely useful for anyone using the API in latency critical applications.

If the caller submits multiple write requests to stream data to the device, the transfer size should be a multiple of the maximum bytes per interval (as returned by <a href="https://docs.microsoft.com/windows/desktop/api/winusb/nf-winusb-winusb_querypipeex">WinUsb_QueryPipeEx</a>) * 8 / interval.


Because of the transfer packaging, <b>only full 1ms USB frames are available</b> and low-latency applications requiring microframe transfers must use a kernel mode driver instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment to previous comment.



<b>WinUsb_ReadIsochPipeAsap</b> packetizes the transfer buffer so that in each interval, the host can send the maximum bytes allowed per interval. The maximum bytes is as specified by the endpoint descriptor for full and high-speed endpoints, and endpoint companion descriptor for SuperSpeed endpoints.
<b>WinUsb_ReadIsochPipeAsap</b> packetizes the transfer buffer so that in each 1ms interval, the host can send the maximum bytes allowed per interval. The maximum bytes is as specified by the endpoint descriptor for full and high-speed endpoints, and endpoint companion descriptor for SuperSpeed endpoints.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Packetization is at the micro-frame (125us) level for high-speed/SuperSpeed endpoints, so saying "1ms interval" is not really accurate.
  2. Should say the host can receive the maximum bytes allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Agree that this is not accurate. Intention is to document the consequence of packetization for low-latency applications. This is done by the insertion at line 113. Remove this change.
  2. True. Fixed in PR Fixed ambiguity of "read" vs "write". #33

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<b>WinUsb_ReadIsochPipeAsap</b> packetizes the transfer buffer so that in each 1ms interval, the host can send the maximum bytes allowed per interval. The maximum bytes is as specified by the endpoint descriptor for full and high-speed endpoints, and endpoint companion descriptor for SuperSpeed endpoints.
<b>WinUsb_ReadIsochPipeAsap</b> packetizes the transfer buffer so that in each interval, the host can send the maximum bytes allowed per interval. The maximum bytes is as specified by the endpoint descriptor for full and high-speed endpoints, and endpoint companion descriptor for SuperSpeed endpoints.

@GrantMeStrength GrantMeStrength removed their assignment Feb 12, 2020
Copy link

@billlattimer billlattimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paamand can you please amend your commit to include the just the correction lines? Thanks!

Trying to keep the amendment accurate and helpful for developers.
@PRMerger15
Copy link

@paamand : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Trying to keep the amendment accurate and helpful for developers
Trying to keep the amendment accurate and helpful for developers
@PRMerger16
Copy link

@paamand : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Trying to keep the amendment accurate and helpful for developers
@paamand
Copy link
Contributor Author

paamand commented Feb 26, 2020

@paamand can you please amend your commit to include the just the correction lines? Thanks!

@billlattimer The minor typo corrections are fixed in PR #33. This is about clarifying the constraints of the packetization for low-latency applications. I've done my best to do this as accurate as possible. Updated with commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants