Firefly Open Source Community

   Login   |   Register   |
New_Topic
12
New Topic
Print Previous Topic Next Topic

[Linux] Dual OV13850 cameras finally land on Firefly-RK3399 in Ubuntu 18.04!

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388

【Linux】 Dual OV13850 cameras finally land on Firefly-RK3399 in Ubuntu 18.04!

Posted at 12/27/2018 17:24:14      View:66745 | Replies:37        Print     [Copy Link] 1#
Photo first, engineer style with a messy desktop


Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 12/27/2018 17:29:20      2#
Last edited by penguin In 1/5/2019 15:19 Editor

UPDATE:* 20190105
- update to camera-engine-rkisp_1.5.0
- update to the latest firefly stable kernel with dual cameras patches
- fix setup script, remove /opt/gstreamer from environment.

For the bravery, I've written an installation manual which can be read on:

   http://wiki.t-firefly.com/firefly-rk3399-repo/dualcamera/INSTALL.txt

Below is just a copy of it:

# Prerequisite

To install dual cameras experimental support, you need:

- a Firefly-RK3399 board
- flashed with firmware Firefly-RK3399-ubuntu18.04_20181017.img
- two 30-pin OV13850 cameras from the Firefly Shop
- Internet access from the board

# Installation

WARNING: Please BACKUP your data first. The following procedure will have the
risk of ruining your filesystem and system boot.

Download the script and run:

  1.     wget -O dual-camera-setup.sh http://wiki.t-firefly.com/firefly-rk3399-repo/dualcamera/dual-camera-setup.txt
  2.     sudo bash dual-camera-setup
Copy the code

This script will install the necessary packages and scripts, flash the new kernel.

After completion, please REBOOT your board to have the new kernel take effect.

# Run

After reboot, setup the pipeline by running:

    sudo /etc/init.d/S50set_pipeline start

Then start the preview of dual cameras:

    sudo dual-camera-rkisp.sh

The two windows vanish quickly, you need to run the command above again.

# Known bugs
- First run may fail.

# Fixed bugs

- Fixed: (20181228) Repeated run of sudo dual-camera-rkisp.sh will cause the cameras fail to start.

Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 12/28/2018 10:32:43      3#
@acidpero you are right, hitting the point.

At first, we are thinking of changing the OV13850's i2c address physically by
its SID pin. The SCCB address will be 0x20 when SID pin is low,  be 0x6c
when high.

But it is not the best option after all, right? Asking a user to iron a copper wire to the camera
is not good. Besides, Android can support dual cameras without it.

Then we read thoroughly the chip spec, and found the cure, which is quoted:

  1. In the OV13850, the SCCB ID is controlled by the SID pin, and can be programmable. If SID is low, the sensor’s SCCB
  2. address comes from register 0x300C which has a default value of 0x20. If SID is high, the sensor’s SCCB address comes
  3. from register 0x3661 which has a default value of 0x6C.
Copy the code


That's what we want, to change the i2c address on demand. After some trial and error, it proves that it is completely viable.

Later we have to deal with the sharing use of power regulators and reset pin,
and more tests to ensure that both single camera (connected with either mipi port)
and dual cameras work with the same kernel image and dtb.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 12/28/2018 14:17:04      4#
@acidpero , no, please read after that. we did not program that pin.

We end up programming the SC_SCCB_ID register:

0x300C SC_SCCB_ID 0x20 RW SCCB ID
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 1/14/2019 17:25:04      5#
Hi @loopdavid , I haven't done that.

But according to http://opensource.rock-chips.com/wiki_Rockchip-isp1 ,
The RGB data can be retrieved from the isp1_selfpath.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 1/25/2019 11:03:03      6#
This script is only tested and worked for Firefly-RK3399 board.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 1/27/2019 16:38:06      7#
It might work. Just go ahead and try.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 2/13/2019 17:04:01      8#
@PpHLNmt1R
source code is already at:

   https://github.com/FireflyTeam/k ... le-4.4-rk3399-linux

@acidpero
truly i'm not an expert on ov13850.
you can try to use 4 lanes by modifying dts node
and the ov13850 sensor driver.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 2/18/2019 09:12:35      9#
@ballsystemlord  So you are mentioning the user space support of the cameras.
Good question! Actually, the deb packages in Ubuntu are ported from the buildroot
repository in github.com/rockchip-linux, where the gstreamer and camera-engine-rkisp
are contained. You can check it out for reference.
Reply

Use props Report

1388

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1388
Posted at 2/25/2019 09:24:32      10#
@hsedidin
Performance issue depends on the context.
Both cameras use different MIPI controller with 2 lanes,
the bandwidth not being a problem.
The preview using gstreamer is smooth.
Reply

Use props Report

Return to List
12
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list