[mythtv-users] FYI - HDPVR in a KVM VM possible using usbip service

Matt Mossholder matt at mossholder.com
Mon Oct 10 01:05:14 UTC 2011

On Sun, Oct 9, 2011 at 8:49 PM, Raymond Wagner <raymond at wagnerrp.com> wrote:
> On 10/9/2011 19:13, Matt Mossholder wrote:
>>       Then I ran across the usbip package available in Ubuntu Natty
>> (unsure on other releases, and unable to locate it for Fedora in a
>> quick search). This package lets you specify a USB device to share on
>> one system, and attach it to a virtual USB controller on another.
> USB is designed for 1.5 microseconds of latency from one device to the
> next.  It allows for devices to be seven deep using daisy-chained hubs,
> meaning the host should expect a response from any device in around 10
> microseconds.  If you spend a couple thousand on Infiniband or Myranet
> hardware, you can achieve those low latencies.  If you're communicating
> across a physical network segment using a custom communications protocol
> on raw ethernet frames, you can get close.

While all of what you say may be true, you can't argue with results.
I've now recorded 3 X .5 hour shows, with no glitching. Also keep in
mind that the average ping response time between the VM and the host
is between .2 and .3 _milliseconds_. We're talking about everything
living on one box here.  10 microseconds sure sounds like a lot in

> If you're using standard IP protocol, which something named "usbip"
> almost certainly is, you're looking at hundreds of microseconds
> minimum.  That may be fine for a peripheral like a mouse or keyboard.
> For something like a tuner or video capture device, with limited cache
> and real communication deadline needs, it will work much less well.  If
> your host machine can run usbip, then clearly it is running Linux.  Why
> not just run MythTV on the host?

Because the backend was already running in a VM before I decided to
move the HD-PVR off of the frontend and onto the VM hosted backend.
Rather than rebuild things, this seemed like a good workaround until
KVM supports EHCI/USB 2.0 passthrough natively.

>> Not bad for something so crazy :)
> I'm sure the LinuxTV devs who hang around here and have had the pleasure
> of trying to write USB capture drivers can tell you just how crazy it is
> to try to use USB devices in a VM.

More information about the mythtv-users mailing list