Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 53 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ This repository contains reference drivers and configurations for Intel MIPI CSI
## Getting Started with Reference Camera

1. Install Intel BKC image:
- Go to rdc.intel.com
- Download IPU Master Collateral (Document #817101)
- Go to [rdc.intel.com](https://www.intel.com/content/www/us/en/resources-documentation/developer.html)
- Download IPU Master Collateral (Document [#817101](https://www.intel.com/content/www/us/en/secure/content-details/817101/intel-ipu6-enabling-partners-technical-collaterals-advisory.html?DocID=817101))
- In Document #817101
- Go to **Linux Getting Started Guide (GSG) Documentation** section
- Search for your platform under **Platform** column
Expand All @@ -47,7 +47,7 @@ cd Intel-MIPI-CSI-Camera-Reference-Driver
git checkout <release-tag>
```

3. Clone ipu repositories and checkout to below commits
3. Clone IPU repositories and checkout to below commits
```bash
cd $HOME
git clone -b iotg_ipu6 https://github.com/intel/ipu6-camera-bins.git
Expand All @@ -60,7 +60,7 @@ cd ipu6-camera-hal
git checkout a647a0a0c660c1e43b00ae9e06c0a74428120f3a

cd $HOME
git clone -b icmaerasrc_slim_api https://github.com/intel/icamerasrc.git
git clone -b icamerasrc_slim_api https://github.com/intel/icamerasrc.git
cd icamerasrc
git checkout 4fb31db76b618aae72184c59314b839dedb42689

Expand All @@ -70,15 +70,12 @@ cd ipu6-drivers
git checkout 71e2e426f3e16f8bc42bf2f88a21fa95eeca5923
```

4. Deploy and build IPU userspace components
4. Deploy ipu6-camera-bins runtime & development files
```bash
# ipu6-camera-bins: Deploy files using below steps:
# Runtime Files
mkdir -p /lib/firmware/intel/ipu
sudo cp -r $HOME/ipu6-camera-bins/lib/lib* /usr/lib/
sudo cp -r $HOME/ipu6-camera-bins/lib/firmware/intel/ipu/*.bin /lib/firmware/intel/ipu

# Development files
mkdir -p /usr/include /usr/lib/pkgconfig
sudo cp -r $HOME/ipu6-camera-bins/include/* /usr/include/
sudo cp -r $HOME/ipu6-camera-bins/lib/pkgconfig/* /usr/lib/pkgconfig/
Expand All @@ -87,60 +84,79 @@ for lib in $HOME/ipu6-camera-bins/lib/lib*.so.*; do \
lib=${lib##*/}; \
sudo ln -s $lib /usr/lib/${lib%.*}; \
done
```

# ipu6-camera-hal and icamerasrc: Build using below steps:
# Make sure ipu6-camera-hal & icamerasrc are both in same directory, i.e. $HOME.
5. Build ipu6-camera-hal (ipu6-camera-hal & icamerasrc repository must be in same directory, i.e. $HOME)
```bash
cd $HOME
cp $HOME/ipu6-camera-hal/build.sh .
# To build IPU6EPMTL with DMA (recommended)
./build.sh -d --board ipu_mtl

# To build IPU6EPMTL without DMA
./build.sh --board ipu_mtl
./build.sh -d --board ipu_mtl
```

# Install built libraries to Target
sudo cp -r $HOME/out/<target>/install/etc/* /etc/
sudo cp -r $HOME/out/<target>/install/usr/include/* /usr/include/
sudo cp -r $HOME/out/<target>/install/usr/lib/* /usr/lib/
6. Install built libraries to target system
```bash
sudo cp -r $HOME/out/ipu_mtl/install/etc/* /etc/
sudo cp -r $HOME/out/ipu_mtl/install/usr/include/* /usr/include/
sudo cp -r $HOME/out/ipu_mtl/install/usr/lib/* /usr/lib/
```

5. (optional) Setup media-ctl to Version 1.30 for debugging
7. (optional) Setup media-ctl to Version 1.30 for debugging
```bash
# Install dependencies
sudo apt-get install debhelper doxygen gcc git graphviz libasound2-dev libjpeg-dev libqt5opengl5-dev libudev-dev libx11-dev meson pkg-config qtbase5-dev udev libsdl2-dev libbpf-dev llvm clang libjson-c-dev
sudo apt-get install \
debhelper doxygen gcc git graphviz \
libasound2-dev libjpeg-dev libqt5opengl5-dev libudev-dev libx11-dev \
meson pkg-config qtbase5-dev udev libsdl2-dev libbpf-dev llvm clang \
libjson-c-dev

# Build and install v4l-utils 1.30
git clone https://github.com/gjasny/v4l-utils.git -b stable-1.30
cd v4l-utils
meson build/
sudo ninja -C build/ install
```

6. (If needed) Refer to `doc/\<sensor\>/kernelspace.md`, if there are dependency patches to enable the sensor, apply the patch to **ipu6-drivers**.
8. Configure isys_freq value in `/etc/modprobe.d/ipu.conf`
```bash
sudo bash -c 'echo "options intel-ipu6 isys_freq_override=400" >> /etc/modprobe.d/ipu.conf'
```

9. Apply kernel patches (if required)

Refer to `doc/<sensor>/kernelspace.md` to check if dependency patches are needed for your sensor.
If patches are required, apply them to the **ipu6-drivers** repository:

```bash
cd $HOME/ipu6-drivers
git am $HOME/Intel-MIPI-CSI-Camera-Reference-Driver/.../XXX.patch
git am $HOME/Intel-MIPI-CSI-Camera-Reference-Driver/patch/<kernel_version>/XXX.patch
```

7. Dkms build ipu6-drivers
10. Build and install ipu6-drivers using DKMS
```bash
cd $HOME/ipu6-drivers

sudo dkms remove ipu6-drivers/0.0.0
sudo rm -rf /usr/src/ipu6-drivers-0.0.0/

sudo dkms add .
sudo dkms build -m ipu6-drivers -v 0.0.0
sudo dkms install -m ipu6-drivers -v 0.0.0
```

8. Dkms build this repository
11. Build and install Intel-MIPI-CSI-Camera-Reference-Driver using DKMS
```bash
cd $HOME/Intel-MIPI-CSI-Camera-Reference-Driver

sudo dkms remove ipu-camera-sensor/0.1
sudo rm -rf /usr/src/ipu-camera-sensor-0.1/

sudo dkms add .
sudo dkms build -m ipu-camera-sensor -v 0.1
sudo dkms install -m ipu-camera-sensor -v 0.1
```

9. Power off Board. Connect Sensor Hardware. Power On Board and Sensor.
12. Power off the board. Connect sensor hardware. Power on the board and sensor (if external power required).

10. Boot into BIOS menu. Configure BIOS option according to config/\<sensor\>/userspace-\<interface\>.md,
13. Boot into BIOS menu. Configure BIOS options according to `config/<sensor>/userspace-<interface>.md`
- Follow Section **BIOS Configuration Table**
- **\<IPU VERSION\> Camera Option** and/or
- **\<IPU VERSION\> Control Logic**
Expand All @@ -149,22 +165,24 @@ sudo dkms install -m ipu-camera-sensor -v 0.1
- Follow `config/isx031/userspace-gmsl.md`
- Follow **BIOS Configuration Table** >> **IPU6EPMTL Camera Option**

11. Boot into OS. Check if sensor is enumerated correctly in media-ctl
- If sensor is not listed, re-check hardware connection and BIOS configuration
14. Boot into OS. Check if sensor is enumerated correctly in media-ctl
- If sensor is not listed
- Recheck hardware connection (Step 12)
- Recheck BIOS configuration (Step 13)
- If issue persists, refer to Intel IPU Team for support.
```bash
media-ctl -p | grep -ie <sensor>
```

12. Setup XML file according to config/\<sensor\>/userspace-\<interface\>.md,
15. Setup XML file according to `config/<sensor>/userspace-<interface>.md`
- Follow Section **Camera XML File Setup**
- **\<IPU VERSION\> Configuration**

For example, for ISX031 GMSL on K6.12 IPU6EPMTL platform:
- Follow `config/isx031/userspace-gmsl.md`
- Follow **Camera XML File Setup** >> **IPU6EPMTL Configuration** section

13. Export below environment variables or add to shell profile (e.g., `~/.bashrc` )
16. Export below environment variables or add to shell profile (e.g. `~/.bashrc` )
```bash
export DISPLAY=:0; xhost +
export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0
Expand All @@ -178,19 +196,19 @@ export logSink=terminal
rm -rf ~/.cache/gstreamer-1.0
```

14. Run Gstreamer command according to config/\<sensor\>/userspace-\<interface\>.md,
17. Run GStreamer command according to `config/<sensor>/userspace-<interface>.md`
- Follow Section **Sample Userspace Command**
- Copy and run command based on your use case.

For example, for 1x ISX031 GMSL on K6.12 IPU6EPMTL platform:
- Follow `config/isx031/userspace-gmsl.md`
- Follow **Sample Userspace Command** >> **Number of Stream (Single Stream / Multi Stream) Selection** >> command for x1 stream

15. Enjoy your camera stream!
18. Enjoy your camera stream!

## Documentation

Detailed documentation for each sensor can be found in the `doc/` directory, organized by sensor model.
Detailed documentation for each sensor can be found in the [doc/](doc) directory, organized by sensor model.

## Contributing

Expand Down
46 changes: 46 additions & 0 deletions config/ar0233/ipu6/ar0820-ar0233-1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (C) 2025 Intel Corporation.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<CameraSettings>
<Sensor name="ar0233-1" description="AR0233 GMSL Sensor 1" virtualChannel="true" vcGroupId="0">
<MediaCtlConfig id="0" mediaCfg="1" ConfigMode="AUTO" outputWidth="1920" outputHeight="1080" format="V4L2_PIX_FMT_UYVY">
<format name="ar0820 a" pad="0" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="max9x a-0" pad="0" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="max9x a-0" pad="2" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="max9x a" pad="0" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="max9x a" pad="4" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="Intel IPU6 CSI2 0" pad="0" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="Intel IPU6 CSI2 0" pad="1" width="1920" height="1080" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<link srcName="ar0820 a" srcPad="0" sinkName="max9x a-0" sinkPad="0" enable="true"/>
<link srcName="max9x a-0" srcPad="2" sinkName="max9x a" sinkPad="4" enable="true"/>
<link srcName="max9x a" srcPad="0" sinkName="Intel IPU6 CSI2 0" sinkPad="0" enable="true"/>
<link srcName="Intel IPU6 CSI2 0" srcPad="1" sinkName="Intel IPU6 ISYS Capture 0" sinkPad="0" enable="true"/>
<route name="max9x a-0" sinkPad="0" sinkStream="0" srcPad="2" srcStream="0" flag="1"/>
<route name="max9x a" sinkPad="4" sinkStream="0" srcPad="0" srcStream="0" flag="1"/>
<route name="Intel IPU6 CSI2 0" sinkPad="0" sinkStream="0" srcPad="1" srcStream="0" flag="1"/>
<videonode name="Intel IPU6 ISYS Capture 0" videoNodeType="VIDEO_GENERIC"/>
<videonode name="Intel IPU6 CSI2 0" videoNodeType="VIDEO_ISYS_RECEIVER"/>
<videonode name="ar0820 a" videoNodeType="VIDEO_PIXEL_ARRAY"/>
</MediaCtlConfig>
<StaticMetadata>
<!-- format,widthxheight,field(none:0,alternate:7),mcId -->
<supportedStreamConfig value="V4L2_PIX_FMT_UYVY,1920x1080,0,0"/>
</StaticMetadata>
<supportedISysFormat value="V4L2_PIX_FMT_UYVY"/>
<vcAggregator value="max9x a,0"/>
<enableAIQ value="false"/>
</Sensor>
</CameraSettings>
81 changes: 73 additions & 8 deletions config/ar0233/userspace-gmsl.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,103 @@
## Description

This document provides configuration details for **ar0233** sensor. The BIOS configuration, camera XML file setup, and userspace commands for this sensor is using the **AR0820 GMSL sensor's** setup. Please refer to `config/ar0820/userspace-gmsl.md` for complete configuration details.
This document details the configuration settings for the AR0233 GMSL sensor, providing essential information for system integration. The table below presents the key parameters and their respective values used during system setup and validation.

**Important:** Before using the AR0233 sensor, modify the sensor's XML file resolution value to **1920x1080** to match the AR0233's supported resolution.
## BIOS Configuration Table

**Note:** No External Clock required.

#### IPU6EPMTL Camera Option

**Note:** AR0233 sensor reuses AR0820 sensor Custom HID

| | Camera1 Link options |
|--- |--- |
| Sensor Model | User Custom |
| Custom HID | AR0820 |
| Lanes Clock division | 4 4 2 2 |
| CRD Version | CRD-D |
| GPIO control | No Control Logic |
| Camera position | Front |
| Flash Support | Driver default |
| Privacy LED | Driver default |
| Rotation | 90 |
| PPR Value | 4 |
| PPR Unit | 2 |
| Camera module name | |
| MIPI port | 0 |
| LaneUsed | x4 |
| MCLK | 19200000 |
| EEPROM Type | ROM_NONE |
| VCM Type | VCM_NONE |
| Number of I2C Components | 3 |
| I2C Channel | I2C1 |
| Device 0 | |
| I2C Address | 48 |
| Device Type | Sensor |
| Device 1 | |
| I2C Address | 44 |
| Device Type | Sensor |
| Device 2 | |
| I2C Address | 50 |
| Device Type | Sensor |
| Customize Device ID List | |
| Customize Device ID Number | 17 |
| Customize Device ID Number | 18 |
| Customize Device ID Number | 19 |
| Flash Driver Selection | Disabled |

## Camera XML File Setup

#### IPU6EPMTL Configuration

1. Import files below to `/etc/camera/ipu6epmtl/sensor`
- ar0820-ar0233-1.xml

2. Append new sensors into `/etc/camera/ipu6epmtl/libcamhal_profile.xml`
```xml
<availableSensors value="...,ar0820-ar0233-1-0"/>
```

## Sample Userspace Command

#### Sensor Device Selection

| Sensor Number | Command Pipeline |
|----------|----------|
| 1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=**ar0820-1** printfps=true io-mode=4 ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,width=1920,height=1080' ! glimagesink sync=false |
| 2 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=**ar0820-2** printfps=true io-mode=4 ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,width=1920,height=1080' ! glimagesink sync=false |
| 1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=**ar0233-1** printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,width=1920,height=1080' ! glimagesink sync=false |

**Note**: Refer to icamerasrc device-name property for more sensor details.

#### Frame Buffer Memory Type (IO Mode) Selection

| IO Mode | Command Pipeline |
|----------|----------|
| MMAP | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0820-1 printfps=true io-mode=**1** ! '**video/x-raw,format=UYVY**,width=1920,height=1080' ! glimagesink sync=false |
| DMA MODE | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0820-1 printfps=true io-mode=**4** ! '**video/x-raw(memory:DMABuf),drm-format=UYVY**,width=1920,height=1080' ! glimagesink sync=false |
| MMAP | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0233-1 printfps=true io-mode=**mmap** ! '**video/x-raw,format=UYVY**,width=1920,height=1080' ! glimagesink sync=false |
| DMA MODE | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0233-1 printfps=true io-mode=**dma_mode** ! '**video/x-raw(memory:DMABuf),drm-format=UYVY**,width=1920,height=1080' ! glimagesink sync=false |

**Note**: Refer to icamerasrc io-mode property for more sensor details.

#### Sensor Resolution Selection

| Resolution | Command Pipeline |
|----------|----------|
| 1920x1080 | gst-launch-1.0 icamerasrc num-buffers=-1 scene-mode=normal device-name=ar0233-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,**width=1920,height=1080**' ! glimagesink sync=false |

#### Sensor Format Selection

| Format | Command Pipeline |
|----------|----------|
| UYVY | gst-launch-1.0 icamerasrc num-buffers=-1 scene-mode=normal device-name=ar0233-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),**drm-format=UYVY**,width=1920,height=1080' ! glimagesink sync=false |

#### Number of Stream (Single Stream / Multi Stream) Selection

| Number of Stream | Command Pipeline |
|----------|----------|
| x1 | gst-launch-1.0 icamerasrc num-buffers=-1 **num-vc=1** scene-mode=normal device-name=**ar0820-1** printfps=true io-mode=4 ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,width=1920,height=1080' ! glimagesink sync=false |
| x1 | gst-launch-1.0 icamerasrc num-buffers=-1 **num-vc=1** scene-mode=normal device-name=**ar0233-1** printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=UYVY,width=1920,height=1080' ! glimagesink sync=false |

#### FPS Result

| Number of Stream | IO Mode | FPS Result |
|----------|----------|----------|
| x1 | MMAP | 30 |
| x1 | DMA MODE | 30 |
| x1 | DMA MODE | 30 |
2 changes: 1 addition & 1 deletion config/ar0820/ipu6/ar0820-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<CameraSettings>
<Sensor name="ar0820-1" description="AR0820 GMSL (Sensing) Sensor 1" virtualChannel="true" vcGroupId="0">
<Sensor name="ar0820-1" description="AR0820 GMSL Sensor 1" virtualChannel="true" vcGroupId="0">
<MediaCtlConfig id="0" mediaCfg="1" ConfigMode="AUTO" outputWidth="3840" outputHeight="2160" format="V4L2_PIX_FMT_UYVY">
<format name="ar0820 a" pad="0" width="3840" height="2160" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
<format name="max9x a-0" pad="0" width="3840" height="2160" format="V4L2_MBUS_FMT_UYVY8_1X16" stream="0"/>
Expand Down
Loading