USB Controller Mode vs Performance

This is for discussing general topics about how to use VirtualBox.
Post Reply
The BC Factor
Posts: 3
Joined: 18. Dec 2016, 19:04
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7 (x64)
Location: USA

USB Controller Mode vs Performance

Post by The BC Factor »

Hi Everyone,

Hopefully just a quick question to my quell my curiosity...

If there any performance benefit to selecting the EHCI or XHCI controller modes vs the OHCI mode? Does it make any difference in the throughput of the USB?
(FYI: I am running VirtualBox 5.1.10 on a Linux machine. (Ubuntu 16.04) My guest OS is Windows 7 64-bit.)

Thanks.
-Brian
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: USB Controller Mode vs Performance

Post by socratis »

The BC Factor wrote:Does it make any difference in the throughput of the USB?
  • Difference as in "if I have a USB 1.1 device, which controller should I choose"? Because that's the only time you'd involve all 3 controllers in a comparison. Do you care about performance in a mouse, keyboard or similar speed devices?
  • Difference as in "if I have a USB 2 device, which controller should I choose"? Because that's the only time you'd involve the EHCI and xHCI controllers in a comparison. The OHCI won't work.
  • Difference as in "if I have a USB 3 device, which controller should I choose"? Because there's only the xHCI controller that you can use.
The only time I can see this question as valid is if you have a USB2 device (like a hard drive) and you're wondering between USB2 and USB3. So, which USB device are we talking about? Of course, as you understand, xHCI (the fastest, but mind you that your guest has to support xHCI) supports all three of the USB device kinds, so why the question?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
The BC Factor
Posts: 3
Joined: 18. Dec 2016, 19:04
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7 (x64)
Location: USA

Re: USB Controller Mode vs Performance

Post by The BC Factor »

Let me see if I can clarify myself...

I understand that on a "real" computer, if you want USB3.0 speed you need to have a USB3.0 controller (which my physical computer has). I was just wondering if the "virtual" USB controller places limitations on communications speed depending on which controller mode you pick, or if simulating a more advanced controller mode (like xHCI) would actually slow down the transfer rate because of more virtualization overhead. Because, under the virtual machine, Windows 7 is not interfacing with a "real" controller, thus the physical limitations dictating speed are removed. This could potentially mean that even though Windows 7 sees an OHCI controller, since it is mapped to a "real" xHCI controller, USB3 speeds are possible because the physical hardware supports such speeds.

As I mentioned, this is more just idle curiosity than anything. I just wondered, when using high-speed USB devices, if any real world performance differences existed depending on what controller you simulate.

-Brian
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: USB Controller Mode vs Performance

Post by michaln »

The BC Factor wrote:I was just wondering if the "virtual" USB controller places limitations on communications speed depending on which controller mode you pick,
It doesn't, except it does. There is no physical signaling and no physical speed limit, but it's not possible to attach every device to every controller. You can't attach USB3 devices (running at USB3 speeds) to OHCI (or EHCI), so speed is moot. That is different from, say, Ethernet, where 10M/100M/1G/10G speeds are indistinguishable on the software level.
or if simulating a more advanced controller mode (like xHCI) would actually slow down the transfer rate because of more virtualization overhead.
As it turns out, the more advanced controller is massively more efficient and easier to emulate. So it actually speeds things up a lot. UHCI/OHCI/EHCI are horrible designs that weren't very advanced even back in 1995/2000 when they started out. On the other hand, xHCI is a complete redesign, much more modern and much more virtualization-friendly. When designing xHCI, virtualization was actually a concern, for the older controllers that was not the case.
The BC Factor
Posts: 3
Joined: 18. Dec 2016, 19:04
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7 (x64)
Location: USA

Re: USB Controller Mode vs Performance

Post by The BC Factor »

Thanks for the replies.

Interesting to hear that the xHCI controller is actually more efficient to implement that an OCHI/ECHI controller. I didn't know that xHCI was a complete redesign. Just thought it was another minor revision of the USB spec to bump up the speed.

Again, thanks for the info.
-Brian
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: USB Controller Mode vs Performance

Post by michaln »

Nothing could be further from the truth :) USB3 has almost nothing in common with USB2. Which is why USB3 did not replace USB2 but rather lives alongside it.
Post Reply