Page 1 of 2

Webcam autostart

Posted: 30. Nov 2013, 14:09
by Suncatcher
Is it possible to to make webcam start automatically in guest OS? I mean without going to Devices menu and checking webcam checkbox.
Especially I'm interested in headless mode via VRDP.

Re: Webcam autostart

Posted: 30. Nov 2013, 19:21
by noteirak
Use USB filters within the VM configuration

Re: Webcam autostart

Posted: 4. Dec 2013, 12:32
by Suncatcher
noteirak wrote:Use USB filters within the VM configuration
But I cannot find my webcam among them. My laptop is Asus S500CA
How to determine which of the devices is webcam? I see one "unknown device" among them but it doesn't seem to be webcam because I tried to add it and haven't succeed.

Re: Webcam autostart

Posted: 4. Dec 2013, 13:23
by noteirak
Webcam on laptop usually mean it can't be used, since they are directly locked by the host OS without a way to disconnect the webcam and get the lock on Virtualbox.

Re: Webcam autostart

Posted: 4. Dec 2013, 13:31
by Suncatcher
noteirak wrote:Webcam on laptop usually mean it can't be used, since they are directly locked by the host OS without a way to disconnect the webcam and get the lock on Virtualbox.
It's sad.
But on the Windows 7 guest webcam works stable if connected manually.
Or do you mean that it's impossible to autoconnect webcam on laptops?

Re: Webcam autostart

Posted: 4. Dec 2013, 15:08
by noteirak
I mean the host OS locks the webcam, and it cannot be unplugged to release the lock. So Virtualbox can never get a lock on it, and pass it to the guest.

Re: Webcam autostart

Posted: 4. Dec 2013, 15:35
by Suncatcher
noteirak wrote:I mean the host OS locks the webcam, and it cannot be unplugged to release the lock. So Virtualbox can never get a lock on it, and pass it to the guest.
But as I say
But on the Windows 7 guest webcam works stable if connected manually.
I mean my Win 7 guest is running on the same laptop.
Is is a pleasent exception and undocumented feature? It shouldn't be so?

Re: Webcam autostart

Posted: 6. Dec 2013, 13:45
by noteirak
So the list is not the same while the VM os running or powered off?

Re: Webcam autostart

Posted: 7. Dec 2013, 06:41
by Suncatcher
noteirak wrote:So the list is not the same while the VM os running or powered off?
Yes. List is not the same. If I do not connect webcam via Devices menu list will look like this:
no cam.png
no cam.png (21.62 KiB) Viewed 3139 times
If I connect it, the unknown device will transform into Azurewave USB2.0 UVC HD Webcam
connected-1.png
connected-1.png (6.67 KiB) Viewed 3139 times
Then I made some trick. I've added cam to USB filters during machine run when it recognized.
cam filter.png
cam filter.png (36.74 KiB) Viewed 3139 times

Re: Webcam autostart

Posted: 7. Dec 2013, 06:51
by Suncatcher
But trick had no sense - it haven't been connected during boot. Furthermore, if the filter is enabled it doesn't work even if connected manually.
It can be seen on screenshot - Skype tried but couldn't get picture from cam and then wrote "Cannot use. The device is busy by other program" or something similar.
connected.png
connected.png (102.9 KiB) Viewed 3139 times
But I don't give up so easy and I've made some tests.
Some cases all was wonderful: the cam was connected on boot and it worked!!!
Some cases failed: the device have been unrecognized and and have been listed as "unknown usb device".
Some cases were 50/50: the device worked (when connected via Device/Webcam) but not listed correctly (the screens were made during the same boot):
yes-no.png
yes-no.png (96.79 KiB) Viewed 3139 times
yes-no1.png
yes-no1.png (12.22 KiB) Viewed 3139 times
In some cases the device didn't worked and didn't listed correctly.

I can conclude that I wasn't able to achieve unambiguous behavior of the program.

Re: Webcam autostart

Posted: 7. Dec 2013, 20:06
by noteirak
In the Device Manager in the host, do you always see the webcam under its true name when you see it as "Unknown Device" in Virtualbox?

Re: Webcam autostart

Posted: 8. Dec 2013, 00:32
by mpack
AFAIK, "Unknown device" simply means that the device driver doesn't supply a readable name, just a numeric ID. It doesn't imply less functionality.

Re: Webcam autostart

Posted: 8. Dec 2013, 01:52
by noteirak
Indeed, but from the OP screenshots, it is not always named "Unknown Device", so I suspect the issue being on the host.

Re: Webcam autostart

Posted: 8. Dec 2013, 13:27
by mpack
Or the two menus use two different methods for obtaining the device name. :-)

Re: Webcam autostart

Posted: 8. Dec 2013, 16:56
by noteirak
That would be nasty then, and bug-prone. But AFAIK they both use the same method, being only one in the API.