2

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
    Jul 6 '20 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
    Jul 6 '20 at 13:47
  • You'll need to lift those from the RaspiOS repo.
    – Dougie
    Jul 6 '20 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
    Jul 6 '20 at 17:43
  • Try it on the ubuntu 32-bit. I summarized all the step here: zengliyang.wordpress.com/2021/01/04/… Jan 7 at 4:25
2

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.

4
  • This works well for me, tried Ubuntu (Desktop) 21.04 with camera enabled.
    – Raffi
    Jul 21 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
    Jul 25 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
    Jul 26 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
    Sep 10 at 3:37
1

The short answer is "no." Raspberry Pi userland doesn't support 64 bit yet. This seems to be the root cause: https://github.com/raspberrypi/userland/issues/630#issuecomment-654369049

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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