阅读:1677回复:3
USB传输速率奇低,有何因?
环境:Philips TM1300 +pSOS
USB host Controller:VIA vt6202 文件系统:我们公司自己的HTfat32 主控器驱动,Mass Storage驱动 都是我们自己实现的,当然,具体的实现方式还是 参考自linux的原代码。 目前存在着2个主要的严重问题是: 第一,数据传输过程中偶尔会出错,具体是,当经过大量的数据传输,特别是传输2G的数据之后,会出现数据发送不出去,且整个都被挂起。 第二,传输速率的问题,做了个测试,往移动硬盘连续写4G的数据,要花8小时55分钟的时间,换算一下,只有可怜的大约1Mb/s(兆比特每秒)的速度。如果外接的是U盘(flash存),传输速度更是慢得惊人,44Kb/s。 偶尔数据传输出错可能是我这边的中断处理上存在问题。 传输速率呢?跟主控器驱动,设备驱动的实现细节相关,文件系统也应该有关系吧? 还请各位兄台上来谈谈,这2个问题可能的原因.谢谢!!!^_^ |
|
沙发#
发布于:2005-04-23 11:26
在未挂接文件系统,直接读写移动硬盘扇区的情况下,USB的传输速率也才只有16Mbps而已,请问各位大哥,传输速率的关键问题会是出在哪呢?
大家自己实现出来的USB2.0 Host端都有几M的速度呢? |
|
板凳#
发布于:2005-04-27 08:29
昨天在linux的文档中找到如下一段,我想我问题应该就是出在这里了。
In typical situations, a usb_bulk_msg() loop writing out 4 KB chunks is going to waste more than half the USB 2.0 bandwidth. Delays between the I/O completion and the driver issuing the next request will take longer than the I/O. If that same loop used 16 KB chunks, it\'d be better; a sequence of 128 KB chunks would waste a lot less. But rather than depending on such large I/O buffers to make synchronous I/O be efficient, it\'s better to just queue up several (bulk) requests to the HC, and wait for them all to complete (or be canceled on error). Such URB queuing should work with all the USB 1.1 HC drivers too. In the Linux 2.5 kernels, new usb_sg_*() api calls have been defined; they queue all the buffers from a scatterlist. They also use scatterlist DMA mapping (which might apply an IOMMU) and IRQ reduction, all of which will help make high speed transfers run as fast as they can. |
|
地板#
发布于:2005-04-27 09:25
当然和使用队列和Buffer有直接联系
昨天在linux的文档中找到如下一段,我想我问题应该就是出在这里了。 |
|
|