Closed dpetrecki closed 1 year ago
FFmpeg is included in Raspberry Vanilla Automotive builds and it does what it's intended (decoding H.264/H.265/AV1/etc videos).
v4l-utils are debugging tools and are not included in Raspberry Vanilla builds by default. v4l2-ctl is not needed for camera to function. You could easily add it to your build if you need it for debugging. Add https://github.com/lineage-rpi/android_external_v4l-utils/tree/lineage-20.0 to the device manifest and add the tool you want to build in device.mk, e.g.:
PRODUCT_PACKAGES += \
v4l2-ctl
Raspberry Vanilla includes two camera HALs. libcamera for CSI camera modules: https://github.com/raspberry-vanilla/android_external_libcamera/tree/android-13.0 https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-13.0/device.mk#L98-L118
Android external camera HAL for UVC webcams: https://source.android.com/docs/core/camera/external-usb-cameras https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-13.0/device.mk#L89-L96
Both work on Automotive builds as well given you've enabled the default camera service (ENABLE_CAMERA_SERVICE := true
).
https://android.googlesource.com/platform/packages/services/Car/+/refs/tags/android-13.0.0_r67/car_product/build/car_base.mk#63
I haven't looked into the EVS HAL or if it's even supposed to work with UVC webcams. Again, reading https://android.googlesource.com/platform/packages/services/Car/+/refs/tags/android-13.0.0_r67/car_product/build/car_base.mk, this doesn't seem to be correct way to enable EVS. You would simply need to add:
ENABLE_EVS_SERVICE := true
CUSTOMIZE_EVS_SERVICE_PARAMETER := true #not sure if needed
ENABLE_EVS_SAMPLE := true
ENABLE_CAREVSSERVICE_SAMPLE := true
ENABLE_REAR_VIEW_CAMERA_SAMPLE := true
Error message is very clear at least. Could be e.g. permissions issue (https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-13.0/ramdisk/ueventd.rpi4.rc#L7) if it's present otherwise.
2023-08-21 12:49:33.517 691-748 CarServiceJNI com.android.car E /dev/video0 is not available
2023-08-21 12:49:33.517 691-748 CarServiceJNI com.android.car E Failed to open a camera device
2023-08-21 12:49:33.517 691-748 CAR.EVS com.android.car E Failed to open a target camera device
EVS HAL and the sample EVS camera preview app seem to work with USB UVC webcam. Image is a bit stretched but I'm not sure if that's intentional. CSI camera modules are not supported with EVS.
Please sync your sources.
You're awesome! 😍 I've spent a week investigating this issue.
Hello, the standard image from https://konstakang.com/devices/rpi4/AOSP13/ contains ffmpeg and v4l2-ctl and basically the USB-connected camera works. But the build aosp_rpi4_car-userdebug doesn't include those two and I can't read from the camera. My camera is UVC-compatible Logitech c920. I've tested it with EvsCameraPreview and OpenCamera (https://opencamera.org.uk/) This is all I've added to the build (aosp_rpi4_car.mk):
and the overlay:
The camera is connected as /dev/video0 and /dev/video1 (i don't know, why is it twice, but on the non-automotive build v4l2-ctl shows no stream on /dev/video1) :
Logcat with
evs
filter:Full logcat when opening EvsCameraPreview:
Any idea, how to use the camera in the automotive build?