用Bulk传输VBI信息时,发现字幕经常出现拼写错误的问题,查了一下,原来是bulk pipe 的transfer sizes设置错误,超出了大小限制。
USB transfer sizes有如下限制:
在Windows 2000, Windows XP and Windows 2003 Server中,Transfer Sizes 的最大值:
控制管道:
4,000 bytes
块、中断管道:
256,000 bytes
同步管道:
全速设备:256帧, 高速设备:1024 帧
驱动可以设置USBD_PIPE_INFORMATION结构的成员变量MaximumTransferSize,但是一定要小于Transfer Sizes 的最大值。
The following table lists the maximum transfer sizes for each type of pipe for the major versions of Windows:
| Version of Windows | Type of Pipe | Maximum Transfer Size |
|---|---|---|
| Windows 2000 | Control pipe endpoint 0 | 4 kilobytes |
| Control pipe | 64 kilobytes | |
| Interrupt or bulk pipe | Theoretically unlimited | |
| Windows XP | Control pipe endpoint 0 | 4 kilobytes |
| Control pipe | 64 kilobytes | |
| Interrupt pipe | Theoretically unlimited | |
| Bulk pipe | 256 kilobytes | |
| Windows Vista | Control pipe endpoint 0 | 4 kilobytes |
| Control pipe | 64 kilobytes | |
| Interrupt or bulk pipe | Unlimited transfers. |
具体来说:
VOID
UsbBuildInterruptOrBulkTransferRequest(
IN OUT PURB Urb,
IN USHORT Length,
IN USBD_PIPE_HANDLE PipeHandle,
IN PVOID TransferBuffer OPTIONAL,
IN PMDL TransferBufferMDL OPTIONAL,
IN ULONG TransferBufferLength, ----注意要小于上面提到的限制
IN ULONG TransferFlags,
IN PURB Link
);
在使用Bulk传输VBI信息时,发现字幕拼写错误频发,原因为bulkpipe的transfersizes设置超出限制。文章详细介绍了Windows系统下USB传输的大小限制,并给出了解决方案。
3731

被折叠的 条评论
为什么被折叠?



