5

Does picamera work on Ubuntu 20.04 arm64?

I am on pi4 4gb.

  1. Added start_x=1 to /boot/firmware/usercfg.txt and rebooted. Checked for updates.
  2. pip3 install picamera - ok.

When import picamera is called, I get:

OSError: libbcm_host.so: cannot open shared object file: No such file or directory

I searched for libbcm_host.so and could not find anything. sudo ldconfig -v | grep libbcm did not return any results. I also searched /usr/lib/ and /usr/local/lib/.

Thank you!

5
  • You'll need these alien packages libraspberrypi0 libraspberrypi-dev libraspberrypi-doc libraspberrypi-bin.
    – Dougie
    Commented Jul 6, 2020 at 10:36
  • These alien packages are not found when running sudo apt install. I think the issue is that I have a 64 bit version of ubuntu, I'll try to build the library from source
    – lead-free
    Commented Jul 6, 2020 at 13:47
  • You'll need to lift those from the RaspiOS repo.
    – Dougie
    Commented Jul 6, 2020 at 14:44
  • It turns out that the required libraries fail to build on 64bit yet, the good news is that the pi community is actively working on the issue.
    – lead-free
    Commented Jul 6, 2020 at 17:43
  • Try it on the ubuntu 32-bit. I summarized all the step here: zengliyang.wordpress.com/2021/01/04/… Commented Jan 7, 2021 at 4:25

1 Answer 1

5

The longer answer is that rpi does not support it in their packages. The camera is functional under aarch64.

Don't install the rpi packages picamera on Ubuntu 20.04 64 bit, instead use opencv, for example, to access and process images or video. OpenCV example for taking a single image:

import cv2

# open camera
cap = cv2.VideoCapture('/dev/video0', cv2.CAP_V4L)

# set dimensions
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1440)

# take frame
ret, frame = cap.read()
# write frame to file
cv2.imwrite('image.jpg', frame)
# release camera
cap.release()

This is tested under Ubuntu 20.04.2 LTS 64bit using the RPI HQ Camera v1.0 2018 and functions as expected.

5
  • This works well for me, tried Ubuntu (Desktop) 21.04 with camera enabled.
    – Raffi
    Commented Jul 21, 2021 at 14:12
  • This seems to be a good workaround if you just need to read the camera stream, but it doesn't allow you to tweak the low-level camera settings. I would assume this becomes a major issue with the newer HQ Camera hardware.
    – lead-free
    Commented Jul 25, 2021 at 18:51
  • 1
    @lead-free under the hood it just uses V4L if that is selected as capture device driver. So you could add an extra subprocess call to configure the V4L capture settings with v4l2-ctl -d /dev/video0 -c *=*. IMHO, using cv2 and directly calling the capture driver is not a workaround.
    – Aduen
    Commented Jul 26, 2021 at 16:38
  • @Aduen Thanks for your answer! Adjusting setting through v4l2 directly worked well in my application. There is a python wrapper for v4l2, also reading this stackoverflow question helped.
    – lead-free
    Commented Sep 10, 2021 at 3:37
  • There is now PiCamera2 in alpha testing pypi.org/project/picamera2/0.2.2 and datasheets.raspberrypi.com/camera/picamera2-manual.pdf
    – uhoh
    Commented Aug 17, 2023 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.