I have created an armeabi API 21 emulator in the AVD manager in Android Studio, set it to use the webcam as a front camera, and launched it. The problem is that it's not able to open it, as I'm getting this error:
emulator: ERROR: camera_device_start_capturing: VIDIOC_STREAMON on camera '/dev/video0' has failed: Timer expired emulator: ERROR: _camera_client_query_start: Cannot start camera '/dev/video0' for NV21[640x480]: Inappropriate ioctl for device
How can I solve this?
The webcam works normally using other software. The operative system is Ubuntu 14.04.
In Android Studio, go to AVD Manager, click on edit (pencil) button in Actions. After that, in next appearing window, click on Advance settings, and then scroll down and in Camera options, select webcam for front and back.
To enable Camera in your Android Emulator, just add following highlighted code in your AVD’s config.ini file. You can find the config.ini
file under your <userdirectory>/.android
folder.
File: ~/.android/config.ini
hw.lcd.density=160<br> skin.name=HVGA<br> skin.path=platforms\android-9\skins\HVGA<br> hw.cpu.arch=arm<br> abi.type=armeabi<br> vm.heapSize=24<br> image.sysdir.1=platforms\android-9\images\<br> hw.camera=yes<br> sdcard.size=64M<br>
In case you don’t find the config.ini
file or want to enable Camera support through Android SDK and AVD Manager do the following:
Open Android SDK and AVD Manager:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With