Problem emulating phone camera with a normal USB webcam

I'm developing a simple Xamarin Form using VS2019 and Oreo as simulated android. I would like to use my USB Logitech Webcam 200 in order to simulate phone camera. This basically to avoid the deploymnet of the app in the phone with USB and save time.

I've configured the ADM adding hw.camera property and enabling it. Than i've tried to set hw.back.camera to webcam0 and hw.front.camera to none, but when i open camera in the emulated device it gives an error and camera app crash, also my app doesn't work.

I've tried to check the log and mainly i've found: E/[email protected](1393): open: cannot open camera 0! My webcam is good and drivers are installed on my win10 (i use it regularly with Skype and other apps).

I also tried with VS2017 in my PC and also tried in another PC with VS2019.

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    You can try to passthrough a USB device with of vendor ID and device ID and set the read/write permissions for /dev/bus/usb,or that you can create a udev rule like this thread.

    https://stackoverflow.com/a/19916836/10627299

    If you do not know to the use Emulator command, please open your sdk path. add the sdk path to environment variables.

    After that, you can open a command line to run the emulator -list-avds command line etc.

Sign In or Register to comment.