问题
Error message in event log:
Emulator: emulator: ERROR: cmd_camera_device_start_capturing: Unable to set video format: 0
Emulator: emulator: ERROR: _camera_client_start: Cannot start camera 'AndroidEmulatorVC0' for NV21[1280x720]: No error
Emulator Configuration:
config.ini
AvdId=Pixel_2_XL_API_27
PlayStore.enabled=false
abi.type=x86
avd.ini.displayname=Pixel 2 XL API 27
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.forceColdBoot=no
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.camera.back=emulated
hw.camera.front=webcam0
hw.cpu.arch=x86
hw.cpu.ncore=2
hw.dPad=no
hw.device.hash2=MD5:1a4fa6b2569f0b76bfb9824b6b6fc976
hw.device.manufacturer=Google
hw.device.name=pixel_2_xl
hw.gps=yes
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=Portrait
hw.keyboard=yes
hw.lcd.density=560
hw.lcd.height=2880
hw.lcd.width=1440
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=no
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images\android-27\google_apis\x86\
runtime.network.latency=none
runtime.network.speed=full
sdcard.path=C:\Users\h193409\.android\avd\Pixel_2_XL_API_27.avd\sdcard.img
sdcard.size=1 GiB
showDeviceFrame=yes
skin.dynamic=yes
skin.name=pixel_2_xl
skin.path=C:\Android\Sdk\skins\pixel_2_xl
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=256
Observation: when starting camera app in the emulator then led light start blinking near webcam for approx 10 seconds.
webcam works perfectly with other programs in the system like Skype, chrome browser
Tried all the suggestions provided in StackOverflow. Link1 Link2
回答1:
Try sdcard.size=128M
. There may not be enough memory while using sdcard.size=1 GiB
.
来源:https://stackoverflow.com/questions/49004794/android-emulator-unable-to-open-connect-with-real-webcam