7

Whenever I do any kind of file transfer using USB, whether to a USB stick, or with my Android phone, or anything else, it is ridiculously slow.

enter image description here

It says 59.8 KB/sec, which would be an awesome speed if this were 1991 and I was using a modem to dial up to my local BBS. Surely USB technology is better than that...? 37 seconds to move less data than the equivelent of 1 MP3 file?

Also, regardless of what it says about speed and time, the reality is much, much slower. I routinely see it say something like "37 seconds left" and have to wait for minutes. Sometimes, if I want to move large amounts of files, it can say it will take 8 hours or more.

Is this normal? My computer may not be the most awesome on the market, and about a year old, but it's an i5 with 4GB RAM and modern components, so surely this isn't the hardware's fault.

What can I do to get better USB data transfer performance?

Also, I did look at this question, but my newbie eyes don't see anything that look like an actual solution, just a lot of discussion about what transfer rates could or should be.


Update: As requested in the comments, I've generated a whole bunch of output from the command line, and put it on Ubuntu Pastebin. Please see it here.

I've also posted the output from lsusb -t with my Android phone connected (which is the device I am most concerned about getting reasonable speeds with).


Update 2: As requested in the comments, I removed everything except the mouse and keyboard, and then only attached one extra device at a time for testing. Here is some output from dd:

My Sony video camera:

$ dd if=/dev/zero of=/media/disk/testfile bs=128k count=800 conv=fdatasync
800+0 records in
800+0 records out
104857600 bytes (105 MB) copied, 6.00824 s, 17.5 MB/s

My Android phone:

$ dd if=/dev/zero of=/media/C3AD-13DC/testfile bs=128k count=800 conv=fdatasync
800+0 records in
800+0 records out
104857600 bytes (105 MB) copied, 52.357 s, 2.0 MB/s

The camera performed much better than usual, and while the phone wasn't as bad as it has been (about twice as fast as I've ever seen), it's still significantly slower than the camera.

Questioner
  • 6,839
  • What type of files are copying, and the specifications of your USB medium (USB flash drive, external HD, etc). – Mitch Jun 27 '12 at 09:32
  • 1
    @Mitch: I appreciate you trying to narrow down some specifics, but I think the point really is that this happens with any kind of USB connection (external HD, stick drive, camera, Android phone...) and with any kind of file (large files, small files, many files, few files, and any and every file type). – Questioner Jun 27 '12 at 15:29
  • @izx: I've added the output you requested to the question. I hope that contains the information you were asking for. – Questioner Jun 27 '12 at 15:36
  • Thanks Dave, hopefully it does. I will look at it when I'm back from work in the evening and try to come up with some suggestions. – ish Jun 27 '12 at 15:44
  • Since it happens with any USB storage (I suppose it does with any file system), and with any file size, it could be just a matter of disabling USB Legacy Support and enabling AHCI within your BIOS. – jasmines Jul 06 '12 at 10:53
  • @jasmines: Thank you for the suggestion. I turned off USB Legacy support and enabled AHCI (after spending a while figuring out what it was and where to set it). Unfortunately, it doesn't seem to have improved the situation. – Questioner Jul 06 '12 at 16:13
  • A few shots in the dark: you have this: hub 1-1:1.0: Cannot enable port 2. Maybe the USB cable is bad? several times in the kernel logs, could this be the reason? Do you have any external hubs or extenders? Are they powered or not? Finally, could you post lsusb -t when (at least) one of the storage devices is connected? – taneli Jul 06 '12 at 19:16
  • @taneli: I have added the ouput you requested to the question. Also, I tried different USB cables, but with the same results. Thee connection is directly from the computer to the device, with no hubs or any intermediary steps. – Questioner Jul 07 '12 at 04:55
  • If I can interpret the logs correctly, your Samsung phone's connection is initialized at 1.5Mbit (USB 1.0), although I cannot find why. It could be that ECHI is not initialized correctly and "downgrades" your connections so you could try disabling/removing as a check (you'll work with USB 1.1 speeds). http://forum.ubuntu-fr.org/viewtopic.php?id=46380 – Astyanax Jul 07 '12 at 07:40
  • This device: SAMSUNG File-Stor Gadget 0001 seems to be giving write errors, which would indicate a hardware problem (either device or host), possibly further slowing down or introducing arbitrary delays to file operations. Does it work correctly with other computers? – taneli Jul 07 '12 at 10:14
  • @Astyanax: I will try disabling ECHI, but the link you provide is in French, and unfortunately I neither speak French or understand anything about what ECHI is, so are there more specific instructions in English as to how I do that? – Questioner Jul 07 '12 at 10:26
  • @taneli: It seems to work correctly when attached to my laptop, which is also running Ubuntu 12.04. – Questioner Jul 07 '12 at 10:27
  • Have you tried other USB ports? If the keyboard or the wacom (tablet?) are working correctly, could you try to plug the storage devices to those ports (or did you already try)? If that does not help, could you try unplugging all other USB devices, and just leave the storage (and maybe keyboard or mouse) connected, and see if that helps? I've seen motherboards with design faults that prevented simultaneous use of certain pairs of USB ports, possibly due to insufficient power. – taneli Jul 07 '12 at 10:39
  • @Dave M G: Check http://www.geekdevs.com/2010/04/solved-unable-to-enumerate-usb-device-disabling-ehci_hcd/ and http://www.vlara.co.uk/blog/?p=287. Of course, before that, check if it's some kind of hardware problem as taneli suggested and if it happens in other configurations. Does it also happen in current LiveCD configurations? Does this also happen in a windows environment (if possible to test). It seems you have an i7 core so you probably have a new PC, so it would be an unfortunate event but you never know... – Astyanax Jul 07 '12 at 11:22
  • @Astyanax: Something very strange has happened. I booted to a live CD to see if the USB speeds were different. With the Live CD, it was much faster. Something around 4MB/s. I thought this was evidence that there was a configuration problem in my regular install. However, I rebooted back to my installed system, tried a test transfer one more time to be sure, but the speed is now exactly the same as it was with the Live CD. Could something have changed by using the LiveCD? That seems unlikely, but I tested before the Live CD, and it was definitely slower before... so this is very odd. – Questioner Jul 07 '12 at 13:08
  • Since you succesfully got rid of USB legacy mode, I'm quite sure the problem will go away within your next kernel upgrade. – jasmines Jul 09 '12 at 07:34
  • @jasmines: Why would updating the kernel after disabling USB legacy make any difference? – Questioner Jul 09 '12 at 08:18
  • Because needed kernel modules will be included in the upgrade and unneeded ones (the one that ensures USB legacy, for example) will be unlisted. I would like to help with the correct module to unload, but I couldn't find it. – jasmines Jul 09 '12 at 10:08
  • This is a bug more than 4 years old, and still present https://bugs.launchpad.net/ubuntu/+source/linux/+bug/197762 Just look on Google for "linux slow usb transfers". You will find dozens of threads, but no working solutions so far. – jap1968 Jul 09 '12 at 10:13
  • @jap1968: Bummer. – Questioner Jul 09 '12 at 10:28
  • @jasmines: Unfortunately, it seems whatever was different was temporary, as my USB transfer speed has returned to being excruciatingly slow. Also, there was a kernel update yesterday (which broke lightdm, but that's another story), so it would appear that disabling USB legacy and then having a kernel update does not fix the problem. – Questioner Jul 09 '12 at 11:02
  • What is this device? |__ Port 6: Dev 3, If 0, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M – dobey Jul 11 '12 at 21:36
  • @dobey: I don't know what that would be. The only thing I can guess at is that my Android has a 12GB drive, but the line you quote says 12"M", not 12"GB", so I can't be sure. – Questioner Jul 12 '12 at 02:55
  • The only thing I can think of is that there is an internal/external hub coming in somewhere where one USB 1.1 device is forcing all ports speeds to (shared!) 12 mbits/sec. What is your exact motherboard model number and manufacturer? Note also this repeated error: hub 1-1:1.0: Cannot enable port 2. Maybe the USB cable is bad? may be a hardware/motherboard problem. – ish Jul 12 '12 at 09:38
  • @izx: There was a hub on my computer, and I've removed it now. I'm a little mixed up now having run all sorts of commands and connected and disconnected cables. Right now I'm testing transferring some files, and it's faster than before (820.6kB/sec), but I can't be sure if that's just another anomoly like before when I tested the live CD. Is there a definitive command I can run when transferring files so that I can be sure if I'm seeing improvement or change? – Questioner Jul 12 '12 at 11:27
  • Make sure the only USB devices connected are the keyboard, mouse and a storage device, all to ports on the back of the computer. We'll suppose your USB or phone is mounted at /media/mystorage, replace as appropriate. Type dd if=/dev/zero of=/media/mystorage/testfile bs=128k count=800 oflag=fdatasync and when it ends, note the speed shown. Do the same with the phone, and note speed. Paste speeds here :) – ish Jul 12 '12 at 11:34
  • @DaveMG The 12M there is the speed. 1.5M is USB 1.0, 12M is USB 1.1, and 480M is USB 2.0. Also, "hub" doesn't necessarily mean an external USB hub device. Your lsusb output shows 2 root hubs, with a couple of hubs connected to them (which may be internal to your computer, to allow for the number of ports available internally and externally). – dobey Jul 12 '12 at 13:06
  • @izx: Unfortunately, the command you suggest says: dd: invalid output flag:fdatasync'` – Questioner Jul 12 '12 at 14:51
  • Sorry Dave, typo: please replace that part with conv=fdatasync not oflag. – ish Jul 12 '12 at 16:13
  • @izx: Thanks. I've added the output to the question. – Questioner Jul 12 '12 at 17:54
  • Dave: motherboard manufacturer and model number, please. Thanks! – ish Jul 12 '12 at 22:21
  • @izx: Short of tearing my computer open, how can I determine that? – Questioner Jul 13 '12 at 02:41

2 Answers2

7

After all the diagnostics Dave, this certainly looks like a problem being caused by your hub(s) -- first of all, the USB 1.1 external hub you're using, and possibly one of the internal chips on your motherboard used to provide physical USB ports.

  • 17.5 Mbytes/sec to your Sony Video Camera's flash memory is close to the practical throughput limits of USB 2.0; the 2.0 Mbytes/sec with your Android phone may just be because its flash doesn't support faster writes.
  • Your motherboard is a Foxconn P55MX, as this clue from dmesg on line 1308 of your paste tells us: DMI: ThirdWave Corporation Prime Series/P55MX Series, BIOS 080015 09/15/2009
  • The Intel P55 chipset contains two USB 2.0 controllers (or root hubs), providing up to 8 and 6 ports respectively:
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
    
  • One big problem is this external hub to which you have your mouse/keyboard/tablet connected; it looks like a USB 1.1 hub (or a poorly designed USB 2.0 hub). Connecting the 1.1 hub forces that root hub to downgrade all its ports to USB 1.1 speeds. A USB 2.0 hub contains translators which prevent this behavior:
            |__ Port 4: Dev 8, If 0, Class=hub, Driver=hub/4p, 12M
  • The btusb is just a Bluetooth dongle you plugged in.

Anyway, it appears the intermittent problem is caused when something forces the root hub to downgrade all ports to USB 1.0/USB 1.1 speeds -- 60 kbytes/sec is close to real-world USB 1.0 speeds IIRC!

Now, replacing your external hub with a proper USB 2.0 one should fix these problems; if not, something may be wrong with the actual Intel chip on the motherboard or its connection to the physical ports, and you may have to have it replaced under warranty.

ish
  • 139,926
  • Thanks very much for this thorough analysis. I really appreciate you taking the time. +50 bounty for being so complete. The hub you are talking about is actually an Aten switcher, so I can switch between two computers and use the same keyboard and monitors. It's hard to just replace it, but are you saying that one of the devices on the hub is USB 1.1, then the HUB treats all devices like USB 1.1? The reason I ask is because it would be hard/expensive to replace this switcher, so if it was a matter of making sure all devices on it were USB 2, that might be more feasible. – Questioner Jul 14 '12 at 03:18
  • @DaveMG, thanks! Model number of Aten switcher please? – ish Jul 14 '12 at 03:21
  • If there's more information I can provide to get this working, please let me know. The problem has returned, so I'm far from out of the woods. – Questioner Jul 28 '12 at 12:52
2

Something very strange has happened. I booted to a live CD to see if the USB speeds were different. With the Live CD, it was much faster. Something around 4MB/s. I thought this was evidence that there was a configuration problem in my regular install. However, I rebooted back to my installed system, tried a test transfer one more time to be sure, but the speed is now exactly the same as it was with the Live CD. Could something have changed by using the LiveCD? That seems unlikely, but I tested before the Live CD, and it was definitely slower before... so this is very odd.

Judging by this, you are clearly suffering from either A) faulty hardware or B) a faulty USB driver

If you have other similar USB ports that work well on your system, then it is very likely just faulty hardware with that single port.

Sepero
  • 4,557
  • ... or I'm just suffering the bug that was linked to in the comments, where the USB rate slows over time, and so it temporaroly appeared that it had improved after the reboot. I'm not saying that is definitely the case, just that nothing is quite so clear, and there are still many possibilities. – Questioner Jul 12 '12 at 14:29
  • The initial text on that bug reads "NOTICE: please do not add more comments to this bug! If you have a problem with USB transfers, please file your own report as these problems are typically hardware-dependent. Thanks!" You can verify that the problem is not related to nautilus/gnome/unity by using the commandline program pv to transfer your files. pv file > /media/usb/file. With this, you can securely conclude that the issue is hardware or driver fault. – Sepero Jul 13 '12 at 06:45