mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

[Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 9:59 am

Just wondering if anyone has/can get fswebcam command running in Pixel VM on virtulabox to access a USB webcam plugged into Win10 PC

Reason for asking is that I'd like to develop a motion cv python app on my PC VM then just port it to a PiZero robot for deployment

(My only Pi3 tied up doing other things at moment so not really available to play with)

User avatar
topguy
Posts: 6523
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 12:59 pm

Are you trying this and failing or is it a theoretical question ?
Remember to give your guest OS ( Pixel ) access to the hardware. USB devices can only be controlled by guest or host not both at the same time.

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 1:11 pm

Tried and failed - my cam shows up under USB devices but if you click on it it says
Failed to attach
and under details says busy with previous request
USB devices can only be controlled by guest or host not both at the same time.
Can't see any option to prevent host win10 from accessing USB devices anywhere

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 1:13 pm

And both the mouse and keyboard are USB devices and they share OK

User avatar
topguy
Posts: 6523
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 1:43 pm

Are your version of VirtualBox up to date ?

You could try to enable the camera already in the VM settings, it should then try to grab the device before the VM starts booting.
But the main problem might still be that Win10 already is accessing the camera through some service or utility that came with the camera.

Keyboard and mouse are handled very differently by VB than most other USB devices.

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 2:18 pm

Are your version of VirtualBox up to date ?
Shall I switch it off and on again granny? :)

(I installed it last week)


Where do I "enable the camera"?
:)

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 2:20 pm

In user interface devices the webcam is ticked

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 2:20 pm

I'm really looking for someone with a PC, webcam and Pixel running in a virtualbox vm to try their system out BTW

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 2:30 pm

eureka

Turns out web cam was USB 2 and needed VirtualBox extension pack installing

fswebcam returns an image :)

mattmiller
Posts: 2245
Joined: Thu Feb 05, 2015 11:25 pm

Re: [Pixel in VM]Accesing USB webcam

Thu Jan 12, 2017 9:58 pm

And I've just followed a tutorial for detecting objects - ran exactly the same opencv install commands and python file as for the Pi and it just worked 1st time :)

very impressed with the Pi Raspbian compatibility :)

Return to “Other”