* [Qemu-devel] Webcams under KVM and Linux
@ 2011-05-29 13:01 Peter Baitz
2011-05-29 13:37 ` Andreas Färber
0 siblings, 1 reply; 13+ messages in thread
From: Peter Baitz @ 2011-05-29 13:01 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]
Hello,
I had asked a question of some of your Sourceforge contacts for KVM - Qemu on addition of webcam support, specifically the following - and was given the following interesting answer. I would indeed like to hear more about what the project is adding to KVM - Qemu to allow video to work with webcams (currently I run Fedora 15 as host and Fedora 11 under KVM and while the webcam driver and video device shows up in the guest I get no video. Also there is confusion for me if the host is supposed to have its webcam driver loaded and device enabled or not).
I was told I could try to add a complete host controller to the guest, but am not entirely sure I understand what that means? Looking for specifics? Is there a suggestion for doing this during install of the KVM guest, or can this be done while the guest is running, or otherwise?
Many thanks,
Peter
-----------------------------------------------------------------------------------
> You need to ask to KVM guys. You should notice that it is not just adding
> ISOC and USB 2.0 support, but also to prioritize the processing of isoc
> packets on a virtual environment, and to provide enough throughput for
> video streams
>
> Can you tell me if KVM will be implementing Webcam support as
> described above - the components missing that need to be
> implemented for webcams to work - in any upcoming version of KVM ?
It's work in progress, but not by me. Please check the qemu-devel mailing list archive, specifically regarding recent discussions about EHCI (USB 2.0). Some of those threads address isochronous transfer as well.
In the meantime, you could also try to assign a complete host controller to the guest to get a webcam working. I tried this a while ago, though the result was only moderately well working here.
--------------------------------------------------
[-- Attachment #2: Type: text/html, Size: 2088 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-29 13:01 [Qemu-devel] Webcams under KVM and Linux Peter Baitz
@ 2011-05-29 13:37 ` Andreas Färber
2011-05-29 13:53 ` Natalia Portillo
2011-05-30 10:38 ` Gerd Hoffmann
0 siblings, 2 replies; 13+ messages in thread
From: Andreas Färber @ 2011-05-29 13:37 UTC (permalink / raw)
To: Peter Baitz; +Cc: QEMU Developers
Hello,
Am 29.05.2011 um 15:01 schrieb Peter Baitz:
>
>> [...] You should notice that it is not just adding
>> ISOC and USB 2.0 support, but also to prioritize the processing of
>> isoc
>> packets on a virtual environment, and to provide enough throughput
>> for
>> video streams
>
> [...] Please check the qemu-devel mailing list archive, specifically
> regarding recent discussions about EHCI (USB 2.0). Some of those
> threads address isochronous transfer as well.
>
> In the meantime, you could also try to assign a complete host
> controller to the guest to get a webcam working. I tried this a
> while ago, though the result was only moderately well working here.
> [...] I would indeed like to hear more about what the project is
> adding to KVM - Qemu to allow video to work with webcams
[...]
> I was told I could try to add a complete host controller to the
> guest, but am not entirely sure I understand what that means?
> Looking for specifics? Is there a suggestion for doing this during
> install of the KVM guest, or can this be done while the guest is
> running, or otherwise?
Independent of the ongoing EHCI work, I remember a patch specifically
for webcams a while ago, try searching the archives for V4L.
Andreas
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-29 13:37 ` Andreas Färber
@ 2011-05-29 13:53 ` Natalia Portillo
2011-05-29 14:03 ` Peter Baitz
2011-05-30 10:38 ` Gerd Hoffmann
1 sibling, 1 reply; 13+ messages in thread
From: Natalia Portillo @ 2011-05-29 13:53 UTC (permalink / raw)
To: Andreas Färber; +Cc: Peter Baitz, QEMU Developers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
More concretely search for patches sent by me.
Even when EHCI is finished still is the problem of isochronous transfer not working well because of timing issues on QEMU.
My patches overcome the need for ISO transfer and EHCI controllers completely, as well as providing an universal device to the guest that works with every Windows >XP, every Linux and even Mac OS X.
El 29/05/2011, a las 14:37, Andreas Färber escribió:
> Hello,
>
> Am 29.05.2011 um 15:01 schrieb Peter Baitz:
>
>>
>>> [...] You should notice that it is not just adding
>>> ISOC and USB 2.0 support, but also to prioritize the processing of isoc
>>> packets on a virtual environment, and to provide enough throughput for
>>> video streams
>>
>> [...] Please check the qemu-devel mailing list archive, specifically regarding recent discussions about EHCI (USB 2.0). Some of those threads address isochronous transfer as well.
>>
>> In the meantime, you could also try to assign a complete host controller to the guest to get a webcam working. I tried this a while ago, though the result was only moderately well working here.
>
>> [...] I would indeed like to hear more about what the project is adding to KVM - Qemu to allow video to work with webcams
> [...]
>> I was told I could try to add a complete host controller to the guest, but am not entirely sure I understand what that means? Looking for specifics? Is there a suggestion for doing this during install of the KVM guest, or can this be done while the guest is running, or otherwise?
>
> Independent of the ongoing EHCI work, I remember a patch specifically for webcams a while ago, try searching the archives for V4L.
>
> Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
iF4EAREIAAYFAk3iT+QACgkQv/wfOsykIRTtxQD+KCTGZhuzrZMzmYDvY5NFO0+F
QQwdE0aYVntQWpHMG5YBAJsFT5wd7/8FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh
=n0hn
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-29 13:53 ` Natalia Portillo
@ 2011-05-29 14:03 ` Peter Baitz
2011-05-30 12:50 ` Natalia Portillo
0 siblings, 1 reply; 13+ messages in thread
From: Peter Baitz @ 2011-05-29 14:03 UTC (permalink / raw)
To: Andreas Färber, Natalia Portillo; +Cc: QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 3502 bytes --]
Hello Natalia and Andreas,
Thank you for the replies and suggestions. I will lookup V4L.
Natalia,
So your patch creates a generic webcam under KVM/Qemu to allow many webcams to work?
My only concern is the following: I use specific Philips webcams, and one in particular has a long exposure modification that the PWC driver (Fedora 11 guest on Fedora 15 host) coupled with Qastrocam-G2 (v4.9) allows the "shutter" to remain open through USB control of the LED. If the guest restorts to using a generic webcam driver, I think this would preclude functionality that the native driver supports ?
Also, can you tell me - when KVM is running my guest, should the PWC webcam driver be loaded and/or the /dev/video0 on the HOST (F15), versus the guest (F11) ? I am confused as to which components are supposed to be enabled or disabled while running the guest webcam. What I see is when I enable the webcam USB device in KVM, it appears to disable the /dev/video0 on the host an brings it up in the guest. And the pwc driver loads and remains on both host and guest.
Peter
--- On Sun, 5/29/11, Natalia Portillo <claunia@claunia.com> wrote:
From: Natalia Portillo <claunia@claunia.com>
Subject: Re: [Qemu-devel] Webcams under KVM and Linux
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: "Peter Baitz" <ussenterprisencc1701@rocketmail.com>, "QEMU Developers" <qemu-devel@nongnu.org>
Date: Sunday, May 29, 2011, 1:53 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
More concretely search for patches sent by me.
Even when EHCI is finished still is the problem of isochronous transfer not working well because of timing issues on QEMU.
My patches overcome the need for ISO transfer and EHCI controllers completely, as well as providing an universal device to the guest that works with every Windows >XP, every Linux and even Mac OS X.
El 29/05/2011, a las 14:37, Andreas Färber escribió:
> Hello,
>
> Am 29.05.2011 um 15:01 schrieb Peter Baitz:
>
>>
>>> [...] You should notice that it is not just adding
>>> ISOC and USB 2.0 support, but also to prioritize the processing of isoc
>>> packets on a virtual environment, and to provide enough throughput for
>>> video streams
>>
>> [...] Please check the qemu-devel mailing list archive, specifically regarding recent discussions about EHCI (USB 2.0). Some of those threads address isochronous transfer as well.
>>
>> In the meantime, you could also try to assign a complete host controller to the guest to get a webcam working. I tried this a while ago, though the result was only moderately well working here.
>
>> [...] I would indeed like to hear more about what the project is adding to KVM - Qemu to allow video to work with webcams
> [...]
>> I was told I could try to add a complete host controller to the guest, but am not entirely sure I understand what that means? Looking for specifics? Is there a suggestion for doing this during install of the KVM guest, or can this be done while the guest is running, or otherwise?
>
> Independent of the ongoing EHCI work, I remember a patch specifically for webcams a while ago, try searching the archives for V4L.
>
> Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
iF4EAREIAAYFAk3iT+QACgkQv/wfOsykIRTtxQD+KCTGZhuzrZMzmYDvY5NFO0+F
QQwdE0aYVntQWpHMG5YBAJsFT5wd7/8FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh
=n0hn
-----END PGP SIGNATURE-----
[-- Attachment #2: Type: text/html, Size: 4161 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-29 13:37 ` Andreas Färber
2011-05-29 13:53 ` Natalia Portillo
@ 2011-05-30 10:38 ` Gerd Hoffmann
2011-05-30 20:47 ` Brad Hards
1 sibling, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2011-05-30 10:38 UTC (permalink / raw)
To: Andreas Färber; +Cc: Peter Baitz, QEMU Developers
Hi,
>> I was told I could try to add a complete host controller to the guest,
>> but am not entirely sure I understand what that means? Looking for
>> specifics? Is there a suggestion for doing this during install of the
>> KVM guest, or can this be done while the guest is running, or otherwise?
>
> Independent of the ongoing EHCI work, I remember a patch specifically
> for webcams a while ago, try searching the archives for V4L.
Latest master (aka upcoming 0.15) has a bunch of iso xfer fixes merged
and using usb 1.1 webcams with usb-host should work reasonable well.
Using usb 2.0 cams with usb-host obviously depend on upcoming EHCI for
usb 2.0 support. There are also some glitches not tracked down yet.
The usb 2.0 cam in built into my Lenovo T500 starts streaming but stops
quickly (after 1-2 frames) for not-yet known reasons.
I think people are also working on camera emulation, i.e. pass any (even
non-usb) v4l devices as usb webcam to the guest. No idea what the
status here is.
cheers,
Gerd
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-29 14:03 ` Peter Baitz
@ 2011-05-30 12:50 ` Natalia Portillo
2011-05-30 14:56 ` Gerd Hoffmann
2011-05-30 16:34 ` Peter Baitz
0 siblings, 2 replies; 13+ messages in thread
From: Natalia Portillo @ 2011-05-30 12:50 UTC (permalink / raw)
To: Peter Baitz; +Cc: Andreas Färber, QEMU Developers, Hoffmann Gerd
[-- Attachment #1.1: Type: text/plain, Size: 5796 bytes --]
Exactly what my webcam does is:
Takes a frame from ANY available V4L2 device (/dev/video0), caches it, and sends it completely to the guest before requesting any other frame.
With this way you need your host driver loaded, but you will get never a blackout.
What it happens is a thing commonly known in game emulators (like for example ePSX) as framedrop, that is, you get a slower framerate but not blackouts.
The guest sees a common USB Video Class Device webcam with no controls (this can be enhanced easily), so basically you cannot change any parameter.
However all the webcams I tested automatically managed that in the firmware with no intervention from any of the drivers (host or guest), changing white balance and brightness to the adequate values.
You can see it working without KVM in:
http://www.youtube.com/watch?v=_Yo9TWPDXCo
http://www.youtube.com/watch?v=fzGYvjZzx6E
The webcam emulation works with TCG (without KVM), albeit slower, enough to do videoconference because of the following:
Using direct connection method (USB passthrough) even when the ISO xfers and ECHI 2.0 are completely emulated will always find the following: the host is faster than the guest, so the real webcam will always be streaming faster than the guest can process it.
Frames are sent in pieces, and if the frame does not arrive completely from start to end on all pieces the guest will blackout, and continue black until it receives a complete frame.
With fast webcams, like 60 fps ones, this will happen so commonly that there will be no image at all.
You can easily see this in VMWare, Parallels or VirtualBox, all of them emulate ISO xfers and EHCI 2.0 and when using a webcam it's not really practical.
Framedrop prevents that. From the 60 frames sent in a second by the host, if the guest can process only 10, it will receive 10 complete frames, and see the webcam as a 10fps one.
That's atomic.
Also my patch supports, as I already said, any V4L2 device including webcams, DV cameras, TV tuners from any kind of interface be it Firewire, USB, PCI, Serial, AGP, so on.
El 29/05/2011, a las 15:03, Peter Baitz escribió:
> Hello Natalia and Andreas,
>
> Thank you for the replies and suggestions. I will lookup V4L.
>
> Natalia,
>
> So your patch creates a generic webcam under KVM/Qemu to allow many webcams to work?
>
> My only concern is the following: I use specific Philips webcams, and one in particular has a long exposure modification that the PWC driver (Fedora 11 guest on Fedora 15 host) coupled with Qastrocam-G2 (v4.9) allows the "shutter" to remain open through USB control of the LED. If the guest restorts to using a generic webcam driver, I think this would preclude functionality that the native driver supports ?
>
> Also, can you tell me - when KVM is running my guest, should the PWC webcam driver be loaded and/or the /dev/video0 on the HOST (F15), versus the guest (F11) ? I am confused as to which components are supposed to be enabled or disabled while running the guest webcam. What I see is when I enable the webcam USB device in KVM, it appears to disable the /dev/video0 on the host an brings it up in the guest. And the pwc driver loads and remains on both host and guest.
>
> Peter
>
>
> --- On Sun, 5/29/11, Natalia Portillo <claunia@claunia.com> wrote:
>
> From: Natalia Portillo <claunia@claunia.com>
> Subject: Re: [Qemu-devel] Webcams under KVM and Linux
> To: "Andreas Färber" <andreas.faerber@web.de>
> Cc: "Peter Baitz" <ussenterprisencc1701@rocketmail.com>, "QEMU Developers" <qemu-devel@nongnu.org>
> Date: Sunday, May 29, 2011, 1:53 PM
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> More concretely search for patches sent by me.
>
> Even when EHCI is finished still is the problem of isochronous transfer not working well because of timing issues on QEMU.
>
> My patches overcome the need for ISO transfer and EHCI controllers completely, as well as providing an universal device to the guest that works with every Windows >XP, every Linux and even Mac OS X.
>
> El 29/05/2011, a las 14:37, Andreas Färber escribió:
>
> > Hello,
> >
> > Am 29.05.2011 um 15:01 schrieb Peter Baitz:
> >
> >>
> >>> [...] You should notice that it is not just adding
> >>> ISOC and USB 2.0 support, but also to prioritize the processing of isoc
> >>> packets on a virtual environment, and to provide enough throughput for
> >>> video streams
> >>
> >> [...] Please check the qemu-devel mailing list archive, specifically regarding recent discussions about EHCI (USB 2.0). Some of those threads address isochronous transfer as well.
> >>
> >> In the meantime, you could also try to assign a complete host controller to the guest to get a webcam working. I tried this a while ago, though the result was only moderately well working here.
> >
> >> [...] I would indeed like to hear more about what the project is adding to KVM - Qemu to allow video to work with webcams
> > [...]
> >> I was told I could try to add a complete host controller to the guest, but am not entirely sure I understand what that means? Looking for specifics? Is there a suggestion for doing this during install of the KVM guest, or can this be done while the guest is running, or otherwise?
> >
> > Independent of the ongoing EHCI work, I remember a patch specifically for webcams a while ago, try searching the archives for V4L.
> >
> > Andreas
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
>
> iF4EAREIAAYFAk3iT+QACgkQv/wfOsykIRTtxQD+KCTGZhuzrZMzmYDvY5NFO0+F
> QQwdE0aYVntQWpHMG5YBAJsFT5wd7/8FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh
> =n0hn
> -----END PGP SIGNATURE-----
[-- Attachment #1.2: Type: text/html, Size: 7211 bytes --]
[-- Attachment #2: Mensaje firmado digitalmente --]
[-- Type: application/pgp-signature, Size: 275 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 12:50 ` Natalia Portillo
@ 2011-05-30 14:56 ` Gerd Hoffmann
2011-05-30 18:19 ` Natalia Portillo
2011-05-30 16:34 ` Peter Baitz
1 sibling, 1 reply; 13+ messages in thread
From: Gerd Hoffmann @ 2011-05-30 14:56 UTC (permalink / raw)
To: Natalia Portillo; +Cc: Peter Baitz, Andreas Färber, QEMU Developers
On 05/30/11 14:50, Natalia Portillo wrote:
> Exactly what my webcam does is:
>
> Takes a frame from ANY available V4L2 device (/dev/video0), caches it,
> and sends it completely to the guest before requesting any other frame.
I think you can double-buffer (i.e. let the host driver fill one buffer
while sending the other one to the guest). Probably gives a slightly
higher frame rate, but maybe at cost of added latencies.
> The guest sees a common USB Video Class Device webcam with no controls
> (this can be enhanced easily), so basically you cannot change any parameter.
> However all the webcams I tested automatically managed that in the
> firmware with no intervention from any of the drivers (host or guest),
> changing white balance and brightness to the adequate values.
Nice. Patches are waiting for EHCI being merged I guess?
cheers,
Gerd
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 12:50 ` Natalia Portillo
2011-05-30 14:56 ` Gerd Hoffmann
@ 2011-05-30 16:34 ` Peter Baitz
1 sibling, 0 replies; 13+ messages in thread
From: Peter Baitz @ 2011-05-30 16:34 UTC (permalink / raw)
To: Natalia Portillo; +Cc: Andreas Färber, QEMU Developers, Hoffmann Gerd
[-- Attachment #1: Type: text/plain, Size: 6951 bytes --]
Sounds great Natalia.
Two things I'd like to let you all know.
(1) I am using a VM guest because I need the slightly older pwc driver in Fedora 11 which works with long exposure mods - so that is why I was trying it in a VM. If you use a generic or use the hosts pwc driver, it will break certain things. That's why it's important the guest driver is used for me anyway.
(2) I tried this with VMware Player, and you will be happen to know, even though the guest OS detected the pwc webcam and loaded the driver and the video device /dev/video0 and lsusb shows the Philips cam there, all video software tested reports it cannot find the video camera. Opposite of this is KVM/Qemu which does all the same as described, but at least video software reports it finds the webcam, but no video at this time - since you all are working on that. So KVM might be doing better in this regard.
Peter
--- On Mon, 5/30/11, Natalia Portillo <claunia@claunia.com> wrote:
From: Natalia Portillo <claunia@claunia.com>
Subject: Re: [Qemu-devel] Webcams under KVM and Linux
To: "Peter Baitz" <ussenterprisencc1701@rocketmail.com>
Cc: "Andreas Färber" <andreas.faerber@web.de>, "QEMU Developers" <qemu-devel@nongnu.org>, "Hoffmann Gerd" <kraxel@redhat.com>
Date: Monday, May 30, 2011, 12:50 PM
Exactly what my webcam does is:
Takes a frame from ANY available V4L2 device (/dev/video0), caches it, and sends it completely to the guest before requesting any other frame.
With this way you need your host driver loaded, but you will get never a blackout.
What it happens is a thing commonly known in game emulators (like for example ePSX) as framedrop, that is, you get a slower framerate but not blackouts.
The guest sees a common USB Video Class Device webcam with no controls (this can be enhanced easily), so basically you cannot change any parameter.However all the webcams I tested automatically managed that in the firmware with no intervention from any of the drivers (host or guest), changing white balance and brightness to the adequate values.
You can see it working without KVM in:http://www.youtube.com/watch?v=_Yo9TWPDXCohttp://www.youtube.com/watch?v=fzGYvjZzx6E
The webcam emulation works with TCG (without KVM), albeit slower, enough to do videoconference because of the following:
Using direct connection method (USB passthrough) even when the ISO xfers and ECHI 2.0 are completely emulated will always find the following: the host is faster than the guest, so the real webcam will always be streaming faster than the guest can process it.Frames are sent in pieces, and if the frame does not arrive completely from start to end on all pieces the guest will blackout, and continue black until it receives a complete frame.
With fast webcams, like 60 fps ones, this will happen so commonly that there will be no image at all.
You can easily see this in VMWare, Parallels or VirtualBox, all of them emulate ISO xfers and EHCI 2.0 and when using a webcam it's not really practical.
Framedrop prevents that. From the 60 frames sent in a second by the host, if the guest can process only 10, it will receive 10 complete frames, and see the webcam as a 10fps one.That's atomic.
Also my patch supports, as I already said, any V4L2 device including webcams, DV cameras, TV tuners from any kind of interface be it Firewire, USB, PCI, Serial, AGP, so on.
El 29/05/2011, a las 15:03, Peter Baitz escribió:
Hello Natalia and Andreas,
Thank you for the replies and suggestions. I will lookup V4L.
Natalia,
So your patch creates a generic webcam under KVM/Qemu to allow many webcams to work?
My only concern is the following: I use specific Philips webcams, and one in particular has a long exposure modification that the PWC driver (Fedora 11 guest on Fedora 15 host) coupled with Qastrocam-G2 (v4.9) allows the "shutter" to remain open through USB control of the LED. If the guest restorts to using a generic webcam driver, I think this would preclude functionality that the native driver supports ?
Also, can you tell me - when KVM is running my guest, should the PWC webcam driver be loaded and/or the /dev/video0 on the HOST (F15), versus the guest (F11) ? I am confused as to which
components are supposed to be enabled or disabled while running the guest webcam. What I see is when I enable the webcam USB device in KVM, it appears to disable the /dev/video0 on the host an brings it up in the guest. And the pwc driver loads and remains on both host and guest.
Peter
--- On Sun, 5/29/11, Natalia Portillo <claunia@claunia.com> wrote:
From: Natalia Portillo <claunia@claunia.com>
Subject: Re: [Qemu-devel] Webcams under KVM and Linux
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: "Peter Baitz" <ussenterprisencc1701@rocketmail.com>, "QEMU Developers" <qemu-devel@nongnu.org>
Date: Sunday, May 29, 2011, 1:53 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
More concretely search for patches sent by
me.
Even when EHCI is finished still is the problem of isochronous transfer not working well because of timing issues on QEMU.
My patches overcome the need for ISO transfer and EHCI controllers completely, as well as providing an universal device to the guest that works with every Windows >XP, every Linux and even Mac OS X.
El 29/05/2011, a las 14:37, Andreas Färber escribió:
> Hello,
>
> Am 29.05.2011 um 15:01 schrieb Peter Baitz:
>
>>
>>> [...] You should notice that it is not just adding
>>> ISOC and USB 2.0 support, but also to prioritize the processing of isoc
>>> packets on a virtual environment, and to provide enough throughput for
>>> video streams
>>
>> [...] Please check the qemu-devel mailing list archive, specifically regarding recent discussions about EHCI (USB 2.0). Some of those threads address isochronous
transfer as well.
>>
>> In the meantime, you could also try to assign a complete host controller to the guest to get a webcam working. I tried this a while ago, though the result was only moderately well working here.
>
>> [...] I would indeed like to hear more about what the project is adding to KVM - Qemu to allow video to work with webcams
> [...]
>> I was told I could try to add a complete host controller to the guest, but am not entirely sure I understand what that means? Looking for specifics? Is there a suggestion for doing this during install of the KVM guest, or can this be done while the guest is running, or otherwise?
>
> Independent of the ongoing EHCI work, I remember a patch specifically for webcams a while ago, try searching the archives for V4L.
>
> Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment:
GPGTools - http://gpgtools.org
iF4EAREIAAYFAk3iT+QACgkQv/wfOsykIRTtxQD+KCTGZhuzrZMzmYDvY5NFO0+F
QQwdE0aYVntQWpHMG5YBAJsFT5wd7/8FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh
=n0hn
-----END PGP SIGNATURE-----
[-- Attachment #2: Type: text/html, Size: 9293 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 14:56 ` Gerd Hoffmann
@ 2011-05-30 18:19 ` Natalia Portillo
2011-05-31 7:01 ` Gerd Hoffmann
0 siblings, 1 reply; 13+ messages in thread
From: Natalia Portillo @ 2011-05-30 18:19 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Peter Baitz, Andreas Färber, QEMU Developers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
El 30/05/2011, a las 15:56, Gerd Hoffmann escribió:
> On 05/30/11 14:50, Natalia Portillo wrote:
>> Exactly what my webcam does is:
>>
>> Takes a frame from ANY available V4L2 device (/dev/video0), caches it,
>> and sends it completely to the guest before requesting any other frame.
>
> I think you can double-buffer (i.e. let the host driver fill one buffer while sending the other one to the guest). Probably gives a slightly higher frame rate, but maybe at cost of added latencies.
Indeed you can infinite-buffer it, but there is really no gain, the added latency makes an effective lower frame rate (total number of real frames seen by the guest in percentage)
>> The guest sees a common USB Video Class Device webcam with no controls
>> (this can be enhanced easily), so basically you cannot change any parameter.
>> However all the webcams I tested automatically managed that in the
>> firmware with no intervention from any of the drivers (host or guest),
>> changing white balance and brightness to the adequate values.
>
> Nice. Patches are waiting for EHCI being merged I guess?
Patches are on RFC on June 2010 ML messages.
There are some updates I did to the emulation (internal conversion from YUV2 to MJPEG, gives twice the framerate when the host webcam is YUV2 only) that I have not sent to RFC yet.
There are also some things that can be enhanced (conversion of more strange RAWs like OV511's, show the guest the controls of the real webcam) easily but I won't do that until a legal problem about the usage of my emulation code along with all the rest of QEMU by a commercial vendor in violation of GPL is solved.
It works really well with USB 1.1 (up to 24fps with KVM, up to 10fps with TCG), but your when EHCI is merged it will allow bigger resolutions easily
The most curious and interesting thing is that, while the specification says there can be webcams using bulk transfers (that's what mine is doing) I've seen NONE in wild. All do ISO.
Peter about your exact problem you may have more luck requesting that feature to the corresponding linux's driver maintainer.
> cheers,
> Gerd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
iF4EAREIAAYFAk3j38QACgkQv/wfOsykIRQfjAEAgrl7eaK6qD4urzZCyGWEYoL2
yaEJbHEDybANWSOAVDkBALyMIVjvVCHzSq3wVH/8fh2Hc6Yp235PrMHduUzdC7Xj
=pXPT
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 10:38 ` Gerd Hoffmann
@ 2011-05-30 20:47 ` Brad Hards
2011-05-30 23:39 ` Natalia Portillo
0 siblings, 1 reply; 13+ messages in thread
From: Brad Hards @ 2011-05-30 20:47 UTC (permalink / raw)
To: qemu-devel, claunia
On Mon, 30 May 2011 08:38:35 pm Gerd Hoffmann wrote:
> I think people are also working on camera emulation, i.e. pass any (even
> non-usb) v4l devices as usb webcam to the guest. No idea what the
> status here is.
I have it in early development. Its far from complete - just enough for the
software (e.g. cheese or uvcview on the guest) to believe that there really is
a UVC device there and try to open it.
I wasn't planning on being able to connect any V4L(2) device to the emulation.
I was thinking more along the lines of a gstreamer output, or a fixed image, or
a test pattern.
Natalia: if possible, could you provide an overview of your work in this area?
Brad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 20:47 ` Brad Hards
@ 2011-05-30 23:39 ` Natalia Portillo
2011-05-31 0:41 ` Brad Hards
0 siblings, 1 reply; 13+ messages in thread
From: Natalia Portillo @ 2011-05-30 23:39 UTC (permalink / raw)
To: Brad Hards; +Cc: qemu-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
El 30/05/2011, a las 21:47, Brad Hards escribió:
> On Mon, 30 May 2011 08:38:35 pm Gerd Hoffmann wrote:
>> I think people are also working on camera emulation, i.e. pass any (even
>> non-usb) v4l devices as usb webcam to the guest. No idea what the
>> status here is.
> I have it in early development. Its far from complete - just enough for the
> software (e.g. cheese or uvcview on the guest) to believe that there really is
> a UVC device there and try to open it.
>
> I wasn't planning on being able to connect any V4L(2) device to the emulation.
> I was thinking more along the lines of a gstreamer output, or a fixed image, or
> a test pattern.
>
> Natalia: if possible, could you provide an overview of your work in this area?
The best should be for you to check for the patches I sent (june 2010 on the ML) and enhance what is left to be done.
Reinventing the wheel is non-sense.
> Brad
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
iF4EAREIAAYFAk3kKpcACgkQv/wfOsykIRQ+OQEAurhvZGDv4j+ut50vT75PLF3R
KGsAEBsBkgnP1c+De68A/R3RWheXXnBFSh2BCaTZYtykdYc8jVxCS76uFLWUDqRL
=Fs+h
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 23:39 ` Natalia Portillo
@ 2011-05-31 0:41 ` Brad Hards
0 siblings, 0 replies; 13+ messages in thread
From: Brad Hards @ 2011-05-31 0:41 UTC (permalink / raw)
To: qemu-devel
On Tue, 31 May 2011 09:39:02 AM Natalia Portillo wrote:
> > Natalia: if possible, could you provide an overview of your work in this
> > area?
>
> The best should be for you to check for the patches I sent (june 2010 on
> the ML) and enhance what is left to be done.
Sorry I wasn't clear. I'll try to ask more direct questions:
1. Are you still working in this area?
2. Do you have changes on top of the June 2010 set?
3. Would you like to review incremental patches relative to your changes, or
should I just work independently? That is, do I send the changes to you or to
Gerd?
> Reinventing the wheel is non-sense.
Thanks for the support :-(
Brad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] Webcams under KVM and Linux
2011-05-30 18:19 ` Natalia Portillo
@ 2011-05-31 7:01 ` Gerd Hoffmann
0 siblings, 0 replies; 13+ messages in thread
From: Gerd Hoffmann @ 2011-05-31 7:01 UTC (permalink / raw)
To: Natalia Portillo; +Cc: Peter Baitz, Andreas Färber, QEMU Developers
Hi,
>>> Takes a frame from ANY available V4L2 device (/dev/video0),
>>> caches it, and sends it completely to the guest before requesting
>>> any other frame.
>>
>> I think you can double-buffer (i.e. let the host driver fill one
>> buffer while sending the other one to the guest). Probably gives a
>> slightly higher frame rate, but maybe at cost of added latencies.
>
> Indeed you can infinite-buffer it, but there is really no gain, the
> added latency makes an effective lower frame rate (total number of
> real frames seen by the guest in percentage)
Just two buffers, so capture and sending to the guest can be
parallelized. More buffers don't really help and just increase latency.
>> Nice. Patches are waiting for EHCI being merged I guess?
>
> Patches are on RFC on June 2010 ML messages. There are some updates I
> did to the emulation (internal conversion from YUV2 to MJPEG, gives
> twice the framerate when the host webcam is YUV2 only) that I have
> not sent to RFC yet.
Can you repost the latest version for review so we can get the bits merged?
> There are also some things that can be enhanced (conversion of more
> strange RAWs like OV511's, show the guest the controls of the real
> webcam) easily but I won't do that until a legal problem about the
> usage of my emulation code along with all the rest of QEMU by a
> commercial vendor in violation of GPL is solved.
Thats fine, we can always add it later once the legal issues are sorted.
> It works really well with USB 1.1 (up to 24fps with KVM, up to 10fps
> with TCG), but your when EHCI is merged it will allow bigger
> resolutions easily
Great.
> The most curious and interesting thing is that, while the
> specification says there can be webcams using bulk transfers (that's
> what mine is doing) I've seen NONE in wild. All do ISO.
Using bulk certainly makes sense for a virtual device.
cheers,
Gerd
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-05-31 7:02 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-29 13:01 [Qemu-devel] Webcams under KVM and Linux Peter Baitz
2011-05-29 13:37 ` Andreas Färber
2011-05-29 13:53 ` Natalia Portillo
2011-05-29 14:03 ` Peter Baitz
2011-05-30 12:50 ` Natalia Portillo
2011-05-30 14:56 ` Gerd Hoffmann
2011-05-30 18:19 ` Natalia Portillo
2011-05-31 7:01 ` Gerd Hoffmann
2011-05-30 16:34 ` Peter Baitz
2011-05-30 10:38 ` Gerd Hoffmann
2011-05-30 20:47 ` Brad Hards
2011-05-30 23:39 ` Natalia Portillo
2011-05-31 0:41 ` Brad Hards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).