Firefly Open Source Community

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

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

1395

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1395

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

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


Reply

Use props Report

1395

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1395
Posted at 12/27/2018 17:29:20        Only Author  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

64

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
64
Posted at 12/28/2018 08:24:43        Only Author  3#
Wow awesome!
This is a tremendous development that can increase the scale of the firefly board users.

But..
How can it be?
Cameras are physically use the same address on the same bus.
What tricks were used?
Reply

Use props Report

1395

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1395
Posted at 12/28/2018 10:32:43        Only Author  4#
@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

64

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
64
Posted at 12/28/2018 11:48:46        Only Author  5#
penguin Posted at 12/28/2018 10:32
@acidpero you are right, hitting the point.

At first, we are thinking of changing the OV13850's i ...

Oh god. you nice hacker
How did you program that pin?
is that available on device driver code? or dts?
I can not catch it.
if u okay, get me some hint.
Reply

Use props Report

1395

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1395
Posted at 12/28/2018 14:17:04        Only Author  6#
@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

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 1/14/2019 14:14:27        Only Author  7#
Hi there

Are you able to get raw camera data with the driver? RGB888
Reply

Use props Report

1395

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1395
Posted at 1/14/2019 17:25:04        Only Author  8#
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

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 1/15/2019 18:09:03        Only Author  9#
penguin Posted at 1/14/2019 17:25
Hi @loopdavid , I haven't done that.

But according to http://opensource.rock-chips.com/wiki_Rockc ...

OK great thanks!
Reply

Use props Report

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 1/23/2019 11:24:09        Only Author  10#
Hello - should this script work on the ROC-RK3399? We run the script but afterwards the unit would not boot.
Reply

Use props Report

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

This forum Credits Rules

Quick Reply Back to top Back to list