Received: from eggs.gnu.org ([140.186.70.92]:51449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR1vW-0004yu-5v for qemu-devel@nongnu.org; Mon, 30 May 2011 08:50:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QR1vU-0002qr-Ai for qemu-devel@nongnu.org; Mon, 30 May 2011 08:50:34 -0400 Received: from 149.red-80-37-155.staticip.rima-tde.net ([80.37.155.149]:62526 helo=mail.claunia.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QR1vS-0002qj-3d for qemu-devel@nongnu.org; Mon, 30 May 2011 08:50:32 -0400 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="Apple-Mail-58--112374352" From: Natalia Portillo In-Reply-To: <654825.49014.qm@web65303.mail.ac2.yahoo.com> Date: Mon, 30 May 2011 13:50:23 +0100 Message-Id: References: <654825.49014.qm@web65303.mail.ac2.yahoo.com> Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Webcams under KVM and Linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Baitz Cc: =?iso-8859-1?Q?Andreas_F=E4rber?= , QEMU Developers , Hoffmann Gerd This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-58--112374352 Content-Type: multipart/alternative; boundary=Apple-Mail-57--112374400 --Apple-Mail-57--112374400 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 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=3D_Yo9TWPDXCo http://www.youtube.com/watch?v=3DfzGYvjZzx6E 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. =46rom 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=F3: > Hello Natalia and Andreas, >=20 > Thank you for the replies and suggestions. I will lookup V4L. =20 >=20 > Natalia, >=20 > So your patch creates a generic webcam under KVM/Qemu to allow many = webcams to work? >=20 > 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 ? =20 >=20 > 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. =20 >=20 > Peter >=20 >=20 > --- On Sun, 5/29/11, Natalia Portillo wrote: >=20 > From: Natalia Portillo > Subject: Re: [Qemu-devel] Webcams under KVM and Linux > To: "Andreas F=E4rber" > Cc: "Peter Baitz" , "QEMU = Developers" > Date: Sunday, May 29, 2011, 1:53 PM >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 > More concretely search for patches sent by me. >=20 > Even when EHCI is finished still is the problem of isochronous = transfer not working well because of timing issues on QEMU. >=20 > 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. >=20 > El 29/05/2011, a las 14:37, Andreas F=E4rber escribi=F3: >=20 > > Hello, > >=20 > > Am 29.05.2011 um 15:01 schrieb Peter Baitz: > >=20 > >>=20 > >>> [...] 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 > >>=20 > >> [...] 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. > >>=20 > >> 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. > >=20 > >> [...] 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? > >=20 > > Independent of the ongoing EHCI work, I remember a patch = specifically for webcams a while ago, try searching the archives for = V4L. > >=20 > > Andreas >=20 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - http://gpgtools.org >=20 > iF4EAREIAAYFAk3iT+QACgkQv/wfOsykIRTtxQD+KCTGZhuzrZMzmYDvY5NFO0+F > QQwdE0aYVntQWpHMG5YBAJsFT5wd7/8FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh > =3Dn0hn > -----END PGP SIGNATURE----- --Apple-Mail-57--112374400 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 http://www.youtube.c= om/watch?v=3D_Yo9TWPDXCo

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. =46rom 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=F3:

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=E4rber" = <andreas.faerber@web.de>
C= c: "Peter Baitz" <ussenterprisencc1701@r= ocketmail.com>, "QEMU Developers" <qemu-devel@nongnu.org>
Dat= e: 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=E4rber = escribi=F3:

> 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/8= FxOIt3aL1lwFqXtKc9y9TrrNog95gnoVh
=3Dn0hn
-----END PGP = SIGNATURE-----

= --Apple-Mail-57--112374400-- --Apple-Mail-58--112374352 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: Mensaje firmado digitalmente content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org iF4EAREIAAYFAk3jkpAACgkQv/wfOsykIRRaUgD8ChPlwUbcFFI9+YniHy+oQ+oE n+pgWEjysBDIxvBcEawBAIyhdb3V3IojU7yIQmRuTmG5isaexQwXDY3L663ZZ2Wt =N+08 -----END PGP SIGNATURE----- --Apple-Mail-58--112374352--