How to use libcamera-apps on RPi4 (v13)

This short article shows how to take images with CSI cameras on RPi4 with the help of libcamera-jpeg

A lot of things changed between RPi3 (Android 7) and RPi4 (Android 13) when it comes to CSI cameras and taking images. The well known raspistill cannot be supported on RPi4 because the library that handles cameras in the Linux kernel changed to libcamera. We've started adding libcamera-apps to our build, which have alternatives to raspistill like libcamera-jpeg.  

One crucial difference to consider is that the Android services block access to the cameras and libcamera-apps cannot access them. In order to use libcamera-jpeg you have to stop the Android services:

adb shell
rpi4:/ $ sushell
# to see what provider are running:
sushell:/ # getprop | grep camera
sushell:/ # stop cameraserver
sushell:/ # stop vendor.camera-provider-2-5
sushell:/ # stop vendor.camera-provider-2-5-ext
sushell:/ # libcamera-jpeg -n -v 2 -o /sdcard/camera.jpeg

Note: Once the Android services are stopped, Android apps won't be able to access the cameras. Meaning you either have access to the cameras in Linux or Android.