Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. Synchronized Stereo Camera HAT
  5. Driver Installation For Arducam 1MP OV9281 Synchronized Camera

Driver Installation For Arducam 1MP OV9281 Synchronized Camera

Driver Installation(Previous Version)

1. Driver note

Note:

This driver can just be installed on the Buster system.

There are 3 drivers for Raspberry Pi:

  • Official driver
  • Arducam MIPI camera driver
  • Arducam V4L2 driver

1)Arducam MIPI camera driver is not in conflict with the official driver.

2)Arducam V4L2 driver is in conflict with the official driver. If you want to use the official driver, you need to uninstall the Arducam V4L2 driver first.

3)Arducam V4L2 driver is in conflict with Arducam MIPI camera driver. If you want to use the Arducam MIPI camera driver, you need to uninstall the Arducam V4L2 driver first.

4)Arducam V4L2 driver automatically overwrites the other two drivers. After uninstalling the Arducam V4L2 driver, it automatically reverts to the official driver.

The product is driven by the Arducam V4L2.

2. Check the driver

Determine if the system is installed with the Arducam V4L2 driver.

Enter the config.txt :

sudo nano /boot/config.txt

Press【PageDown】several times or scroll your mouse wheel down to check if there is “dtoverlay=arducam”.

dtoverlayarducam”

1)If you see “dtoverlay=arducam”, the Arducam V4L2 driver has been previously installed and is in a valid state. Press 【Ctrl+X】, 【Enter】to exit the config.txt.

2)If you see “#dtoverlay=arducam”, it means you have installed Arducam V4L2 driver before, but it is uninstalled now, remove the “#” to restore the V4L2 driver. Then reboot Pi to take effect. Press 【Ctrl+X】【Y】,【Enter】to save the change and exit the config.txt.

3)If you don’t see “dtoverlay=arducam” or “#dtoverlay=arducam”, it means that Arducam’s V4L2 driver has never been installed before, so you need to follow the instructions below for a complete installation. Press 【Ctrl+X】, 【Enter】to exit the config.txt.

3. Install the driver

#Download driver package

wget https://github.com/ArduCAM/Arducam_OBISP_MIPI_Camera_Module/releases/download/v2.0/arducam_obisp_camera_driver.tar.gz
Download driver package1 1

#Extract the archive files

tar zxvf arducam_obisp_camera_driver.tar.gz
Extract the archive files1 3

#Enter the extracted folder

cd arducam_obisp_camera_driver

#Install the driver

./install.sh
Install the driver1 2

#Reboot the device

Press y, and then hit Enter to reboot.

Get an error?

If your operating system is not released by the official Raspberry Pi, the driver installation will report an error and give a version error message.

version error b0267

Check out Raspberry Pi official supported operating system:

https://www.raspberrypi.org/software/operating-systems/

4. Uninstall the driver

Note that the driver will occupy CSI hardware resources. After installation, you will not be able to use the raspistill tool. There are two ways to uninstall Arducam V4L2 driver:

Method 1: Execute the uninstall command
cd Release/
./uninstall_driver.sh

NOTE

You have to reboot your Pi to make it effective.

Method 2: Modify configuration files

1)Type the following command:

sudo nano /boot/config.txt

2.Press【PageDown】several times or scroll your mouse wheel down to check if there is “dtoverlay=arducam”.

dtoverlayarducam”

Modify “dtoverlay=arducam” as “#dtoverlay=arducam” to uninstall the V4L2 driver. Press 【Ctrl+X】【Y】,【Enter】to save the change and exit.

NOTE

You have to reboot your Pi to make it effective.

First Use

1. Check whether the camera is detected

ls /dev/video0
Check whether the camera is detected b0267

2. Check the video format supported

v4l2-ctl --list-formats-ext
Check the video format supported b0267 pi
Run the command without results?

You might have to check the ribbon connection or install the drivers correctly, then reboot the Raspberry Pi.

3. Preview the camera feed in real-time

#RAW10

arducamstill -t 0 -pixfmt Y10P -w 5120 -h 800

#RAW8

arducamstill -t 0 -pixfmt GREY -w 5120 -h 800 
Preview the camera feed in real time b0267 pi 1

The last line shows frame in real time.

​GREY for RAW8 and Y10P for RAW10.

​-w and -h indicate the width and height of the input image.

pic b0267

Press Ctrl+C to exit the preview.

NOTE

The HAT can output 45fps, but the Raspberry Pi performance is limited to displaying 30fps (the 8G version of the Raspberry Pi can output 38fps).

Advanced Commands

#View v4l2 command parameters

v4l2-ctl -l

#Adjust exposure

v4l2-ctl -c exposure=100

#Adjust gain

v4l2-ctl -c gain=14

4. Receive data without displaying the image

Dropped frames may exist due to platform performance. You can test the actual input frames by only receiving data without displaying the image.

#RAW10

v4l2-ctl --set-fmt-video=width=5120,height=800,pixelformat='Y10P' --stream-mmap --stream-count=-1 -d /dev/video0

#RAW8

v4l2-ctl --set-fmt-video=width=5120,height=800,pixelformat='GREY' --stream-mmap --stream-count=-1 -d /dev/video0
Preview the camera feed in real time b0267 pi 1
frame rate when displaying the image
Receive data without displaying the image b0267 pi
frame rate when receiving data without displaying the image

5. Adjust exposure

Open two terminals, the first one is for executing the displaying images command, the second one is for executing the adjusting exposure command.

#Adjust exposure:

v4l2-ctl -c exposure=1000

#Check exposure parameters (minimum, maximum, default)

v4l2-ctl -l

For example, execute the below command in the second terminal:

v4l2-ctl -c exposure=4000
Adjust exposure b0267 pi

Turning up the exposure time results in a brighter image and a lower frame rate.

Adjust exposure b0267 pi 1

6. Adjust gain

Open two terminals, the first one is for executing the displaying images command, the second one is for executing the adjusting gain command.

#Adjust gain:

v4l2-ctl -c gain=12

#Check exposure parameters (minimum, maximum, default)

v4l2-ctl -l

For example, execute the below command in the second terminal:

v4l2-ctl -c gain=12
Adjust gain b0267 pi

Turning up the gain results in a brighter image and no change in frame rate.

Adjust gain b0267 pi 1

7. Change frame rate


Type the following command, and change the value of “X” to change the frame rate.

v4l2-ctl -c frame_rate=X

For example, you want to change the frame rate to 30. First, open two terminals, type the following command in the first terminal

arducamstill -t 0 -pixfmt GREY -w 5120 -h 800
Change frame rate b0267
The last line shows the current frame rate in real-time, and the RAW8 configuration defaults to 58fps.

Type the following command in the second terminal to change the frame rate:

v4l2-ctl -c frame_rate=30
Change frame rate b0267 1
The frame rate changes to 30fps.

Type the following command in the second terminal to view the frame rate range of the current display mode:

v4l2-ctl -l
Change frame rate b0267 2
You can change the frame rate from 5fps to 46fps. If the set frame rate exceeds the maximum value, it will work according to the maximum value. The same goes for the minimum value.

Important Note

Dropped frames may exist due to the platform performance.

For example, if the frame rate is set to 46 fps, the display only goes up to 38fps.

IMPORTANT NOTE b0267 pi1

But when you use only receiving data without displaying the image, the frame rate goes back to 45fps. (The frame rate values here are not real-time and are calculated iteratively with historical values, changing slowly.)

IMPORTANT NOTE b0267 pi2
Was this article helpful to you? Yes No