can't use webcam on Android-x86 guest

Discussions related to using VirtualBox on Linux hosts.
Post Reply
otlichnik73
Posts: 5
Joined: 29. Apr 2021, 22:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Android-x86

can't use webcam on Android-x86 guest

Post by otlichnik73 »

Hi! A bit of a newbie here... If I am in the wrong section, please suggest...

Host: Linux Mint 20.1, guest: Android-x86 android emulator. Can't use webcam (attached via USB to host). Can see it in "Devices" in the guest's menu; but when testing (in the browser, via a webcam test site) can not detect the device. Extension pack installed. Guest additions - not sure; when I select on "installll guest additions CD, nothing happens. But it shows as mounted.

I have a Linux guest on the same host, webcam works fine.

(Not sure if this is related, I don't seem to see anything in USB devices on any of the guests. Bu8t like I said, webcam still works on Linux guest)

Any suggestions anyone? Perhaps I need to install guest additions, can it be done with this guest? I hope to use the camera with a certain app; the whole reason for the installation.

Thanks! :?:
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: can't use webcam on Android-x86 guest

Post by mpack »

There are no GAs for Android guests.

Do you have Internet access working in the guest? It probably needs that to download drivers for the webcam. To be clear: if you plug a device into a virtual guest USB port then the guest has to have support for that device. The host is a different PC and support there does not help.
otlichnik73
Posts: 5
Joined: 29. Apr 2021, 22:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Android-x86

Re: can't use webcam on Android-x86 guest

Post by otlichnik73 »

mpack wrote:There are no GAs for Android guests.

Do you have Internet access working in the guest? It probably needs that to download drivers for the webcam. To be clear: if you plug a device into a virtual guest USB port then the guest has to have support for that device. The host is a different PC and support there does not help.
Thanks!
Yes, the internet is working on the guest.
What do you mean by "plug a device into virtual gues USB port"? I plug in USB camera into an actual physical USB on the physical machine (and nothing happens). How do I plug into a "virtual USB port"?

Cheers!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: can't use webcam on Android-x86 guest

Post by mpack »

The host and the VM are separate PCs. Plugging a USB device into a port on PC A is not much help if you want to use it on PC B, at least not unless you installed some special redirection software and told it which USB devices to redirect.

The latter of which is exactly what you need to do with VirtualBox.

Read: USB Basics and Troubleshooting.
otlichnik73
Posts: 5
Joined: 29. Apr 2021, 22:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Android-x86

Re: can't use webcam on Android-x86 guest

Post by otlichnik73 »

mpack wrote:The host and the VM are separate PCs. Plugging a USB device into port on PC A is not much help if you want to use it on PC B, at least not unless you installed some special redirection software and told it which USB devices to redirect.

The latter of which is exactly what you need to do with VirtualBox.

Read: USB Basics and Troubleshooting.
Thanks a lot for being patient with a newbie! I have installed the "extras" and added my user to the "vbox" group. Now I can see the camera in USB devices in the guest window's menu and I can capture it ( I assume).
I downloaded two "USB camera" apps. Bothe detect the camera, one even says "congratulations your device is otd compatible". But neither displays a picture, just a black screen.
When I try to test it in bowser (eg via website like "test my camera" etc) it can not detect the camera.

(This camea works "plug-and-play" in Linux physical machine)

Any ideas for further troubleshooting?
Cheers
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: can't use webcam on Android-x86 guest

Post by mpack »

USB is essentially a network protocol, and accessing a device is very similar in concept to sharing a printer on a network. I.e. every PC that wants to use it must have a network connection, plus an additional driver so it can understand the capabilities of this particular printer. USB devices likewise: the USB part only solves the comms/connection problem, you need additional drivers to actually use each device.

Common devices will often be covered by some sort of application standard, so the OS may have native drivers for that "device class". For example, USB mass storage, USB mouse.

I'm not an expert on webcams - I find it surprisingly practical to not bother owning one - I believe there is an application standard for webcams, but I don't know if drivers for it are native to Android, and I don't know if your webcam adheres to that standard. If not then you'd need an Android x86 driver from the webcam manufacturer (a driver which, let's face it, will not exist).

The fact that some of your software doesn't recognize that a webcam is present makes me think that the class driver is not running.

Displaying a picture is not the job of the webcam. It just delivers the pixel data, and the software receiving the data displays it. If you are getting a black screen then it's either because (a) the class driver is missing, or (b) the display software needs something more upmarket than basic VESA graphics, which is all you'll get from an Android VM in VirtualBox.
otlichnik73
Posts: 5
Joined: 29. Apr 2021, 22:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Android-x86

Re: can't use webcam on Android-x86 guest

Post by otlichnik73 »

mpack wrote:USB is essentially a network protocol,.... If not then you'd need an Android x86 driver from the webcam manufacturer (a driver which, let's face it, will not exist).

The fact that some of your software doesn't recognize that a webcam is present makes me think that the class driver is not running.

Displaying a picture is not the job of the webcam. It just delivers the pixel data, and the software receiving the data displays it. If you are getting a black screen then it's either because (a) the class driver is missing, or (b) the display software needs something more upmarket than basic VESA graphics, which is you'll get from an Android VM in VirtualBox.
Thanks a million for the detailed explanation!
So you think it is unlikely that a driver exists for the webcam?
I have never used Android before. I stay away from smartphones and devices, but I am a devoted Linux desktop user.
It just happens that I need to use a particular app that only exists as an Android app.
Is there a way to install device drivers on Android (as we would in Linux/Windows)?
(Or - I suppose there are webcams out there that are known to have Android drivers.)
Cheers!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: can't use webcam on Android-x86 guest

Post by mpack »

I don't use Android - rather I do, but those devices are just toys, not work tools - I don't give them any thought.

But yes, all operating systems require a driver for every device unless support for it is built into the kernel (only the CPU and motherboard stuff can expect that). Whether the version of Android that you chose to install comes with a suitable driver already - no idea. As I said, I don't use webcams other than the ones in the aforesaid toys, all of which are running the tailored versions of Android that they came with. I have never tried to use a camera from a generic Android install.

Also, cutting to the chase: Android x86 is not a real OS IMO. The market reality is that Android will almost always be running on ARM CPUs, so that is where the development effort goes, including the effort needed to accelerate high rez video to a reasonable frame rate. In reality nobody cares about running Android on x86 (a market already well served by Windows, Linux and MacOS), which is why I say that nobody will have written a driver - unless there's a class driver which is native to Android-x86. Though it's hard to see why anyone would expend even that effort.

Linux is at least intended for PCs, so is not comparable to the Android market.
otlichnik73
Posts: 5
Joined: 29. Apr 2021, 22:22
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Android-x86

Re: can't use webcam on Android-x86 guest

Post by otlichnik73 »

mpack wrote:..., which is why I say that nobody will have written a driver - unless there's a class driver which is native to Android-x86. Though it's hard to see why anyone would expend even that effort.

Linux is at least intended for PCs, so is not comparable to the Android market.
Ok, I see...
I noticed that they sell usb webcams "for Android devices" - perhaps I can purchase one and hope that there will be a driver for it... somehow? The difference is I guess is that I will be "plugging it in" not into a smart phone, but into a virtual Android device. Does that make a difference?
Post Reply