From d2d71de3513e3e985538e834e4ebb42084d4921b Mon Sep 17 00:00:00 2001 From: Konsta Date: Tue, 22 Aug 2023 18:53:07 +0300 Subject: [PATCH] car: add evs hal * EVS camera HAL supports UVC USB webcams. CSI camera modules are not supported with EVS. CSI camera modules need to be disconnected when using EVS so that UVC USB webcam will populate the first video device (/dev/video0). * Enable default Android camera service so regular camera apps can be used as well (CSI camera modules & UVC USB webcams). * Fixes https://github.com/raspberry-vanilla/android_local_manifest/issues/23 --- aosp_rpi4_car.mk | 12 +++ camera/evs_config_override.json | 85 +++++++++++++++++++ .../res/values/config.xml | 9 ++ 3 files changed, 106 insertions(+) create mode 100644 camera/evs_config_override.json diff --git a/aosp_rpi4_car.mk b/aosp_rpi4_car.mk index 36dac9f..ec256ac 100644 --- a/aosp_rpi4_car.mk +++ b/aosp_rpi4_car.mk @@ -39,6 +39,18 @@ PRODUCT_VENDOR_PROPERTIES += \ bluetooth.profile.sap.server.enabled=false \ bluetooth.profile.vcp.controller.enabled=false +# Camera +ENABLE_CAMERA_SERVICE := true + +# EVS +ENABLE_CAREVSSERVICE_SAMPLE := true +ENABLE_EVS_SAMPLE := true +ENABLE_EVS_SERVICE := true +ENABLE_REAR_VIEW_CAMERA_SAMPLE := true + +PRODUCT_COPY_FILES += \ + device/brcm/rpi4/camera/evs_config_override.json:${TARGET_COPY_OUT_SYSTEM}/etc/automotive/evs/config_override.json + # Overlays PRODUCT_PACKAGES += \ AndroidRpiOverlay \ diff --git a/camera/evs_config_override.json b/camera/evs_config_override.json new file mode 100644 index 0000000..4ba431e --- /dev/null +++ b/camera/evs_config_override.json @@ -0,0 +1,85 @@ + +{ + "car" : { + "width" : 76.7, + "wheelBase" : 117.9, + "frontExtent" : 44.7, + "rearExtent" : 40 + }, + "displays" : [ + { + "_comment": "Display0", + "displayPort" : 0, + "frontRange" : 100, + "rearRange" : 100 + }, + { + "_comment": "Display1", + "displayPort" : 1, + "frontRange" : 100, + "rearRange" : 100 + } + ], + "graphic" : { + "frontPixel" : -20, + "rearPixel" : 260 + }, + "cameras" : [ + { + "cameraId" : "/dev/video0", + "function" : "reverse", + "x" : 0.0, + "y" : 20.0, + "z" : 48, + "yaw" : 180, + "pitch" : -10, + "roll" : 0, + "hfov" : 115, + "vfov" : 80, + "hflip" : true, + "vflip" : false + }, + { + "cameraId" : "1", + "function" : "front", + "x" : 0.0, + "y" : 100.0, + "z" : 48, + "yaw" : 0, + "pitch" : -10, + "roll" : 0, + "hfov" : 115, + "vfov" : 80, + "hflip" : false, + "vflip" : false + }, + { + "cameraId" : "2", + "function" : "right", + "x" : -25.0, + "y" : 60.0, + "z" : 88, + "yaw" : -90, + "pitch" : -10, + "roll" : 0, + "hfov" : 60, + "vfov" : 62, + "hflip" : false, + "vflip" : false + }, + { + "cameraId" : "3", + "function" : "left", + "x" : 20.0, + "y" : 60.0, + "z" : 88, + "yaw" : 90, + "pitch" : -10, + "roll" : 0, + "hfov" : 60, + "vfov" : 62, + "hflip" : false, + "vflip" : false + } + ] +} diff --git a/overlay/CarServiceRpiOverlay/res/values/config.xml b/overlay/CarServiceRpiOverlay/res/values/config.xml index 49c298a..9e7ae7e 100644 --- a/overlay/CarServiceRpiOverlay/res/values/config.xml +++ b/overlay/CarServiceRpiOverlay/res/values/config.xml @@ -26,4 +26,13 @@ Setting this string to empty will disable the feature. --> + + /dev/video0 + + + + com.google.android.car.evs/com.google.android.car.evs.CarEvsCameraPreviewActivity + +