> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Camera

The IQ8-EVK supports camera sensor connectivity through three MIPI CSI interfaces, supporting both C-PHY and D-PHY modes.

## Hardware Architecture

### CSI Interface Mapping

| CSI Interface | Analog Switch     | Camera Connector | B2B Connector       |
| ------------- | ----------------- | ---------------- | ------------------- |
| CSI0          | U45 (TMUX646ZECR) | JCAM0            | JEXP4, Pins 111–120 |
| CSI1          | U42 (TMUX646ZECR) | JCAM1            | JEXP4, Pins 51–60   |
| CSI2          | U44 (TMUX646ZECR) | JCAM2            | JEXP4, Pins 40–49   |

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/iq8275_camera_interface.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=d37bd4d98e138e5f99d753385ed3b378" width="796" height="710" data-path="Ubuntu/images/peripheral-interfaces/iq8275_camera_interface.png" />

### DIP Switch Configuration

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Camera_dipswitch.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=94f4c6e39c1dae2cae22dd7741525ce1" width="416" height="145" data-path="Ubuntu/images/peripheral-interfaces/Camera_dipswitch.png" />

| Switch | ON                    | OFF (default)    |
| ------ | --------------------- | ---------------- |
| SW1-5  | CSI0 → GMSL mezzanine | CSI0 → mainboard |
| SW1-6  | CSI1 → GMSL mezzanine | CSI1 → mainboard |
| SW1-7  | CSI2 → GMSL mezzanine | CSI2 → mainboard |

## Supported MIPI CSI Camera Sensors

### ov9282 Camera Sensor

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/ov9282_camera_sensor.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=218e6065fa810b14982347d16280c62d" width="292" height="184" data-path="Ubuntu/images/peripheral-interfaces/ov9282_camera_sensor.png" />

### Arducam imx577 Camera Sensor

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/Rasberrypi_imx577_camera_sensor.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=8008fcdf4e8bbaf3f53d3ee1e8e35188" width="388" height="315" data-path="Ubuntu/images/peripheral-interfaces/Rasberrypi_imx577_camera_sensor.png" />

**Arducam sensor requires an additional converter board(Arducam 22-pin to Qualcomm 30-pin CSI adapter)**

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/BoardSide_Flexi_cable_converter_for_RasberryPi_based_Camera.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=d1f84333b6e0a9997e222bcf55c6a936" width="656" height="253" data-path="Ubuntu/images/peripheral-interfaces/BoardSide_Flexi_cable_converter_for_RasberryPi_based_Camera.png" />

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Cameraside_Flexi_cable_converter_for_RasberryPi_based_Camera.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=d1728c4cb529f42d6fc9f89c853ecb3c" width="874" height="354" data-path="Ubuntu/images/peripheral-interfaces/Cameraside_Flexi_cable_converter_for_RasberryPi_based_Camera.png" />

**Arducam imx577 sensor + 22 pin flex cable + converter board**

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/arducam_flexcable_frontside.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=2ab9e3f94fabd1127d5a3a9fc0e6a822" width="1164" height="308" data-path="Ubuntu/images/peripheral-interfaces/arducam_flexcable_frontside.png" />

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/arducam_flexcable_backside.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=188d9119bcfa0a3335a39ccf185b32aa" width="1197" height="382" data-path="Ubuntu/images/peripheral-interfaces/arducam_flexcable_backside.png" />

### Arducam imx577 Camera Sensor connection to iq8275

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/rb4_with_arducam_imx577.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=e08065194d482f9f8ab1ac87a1fd384b" width="678" height="873" data-path="Ubuntu/images/peripheral-interfaces/rb4_with_arducam_imx577.png" />

### ov9282 Camera Sensor connection to iq8275

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/rb4_with_arducam_ov9282.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=1c620bd48b2385c8c2d138e1a7db6953" width="668" height="794" data-path="Ubuntu/images/peripheral-interfaces/rb4_with_arducam_ov9282.png" />

## Supported Resolutions

| Resolution  | Aspect Ratio | IMX577 | OV9282 |
| ----------- | ------------ | ------ | ------ |
| 4000 × 3000 | 4:3          | Yes    | No     |
| 3840 × 2160 | 16:9         | Yes    | No     |
| 1920 × 1080 | 16:9         | Yes    | No     |
| 1280 × 720  | 16:9         | Yes    | Yes    |
| 1024 × 768  | 4:3          | Yes    | Yes    |
| 640 × 480   | 4:3          | Yes    | Yes    |
| 320 × 240   | 4:3          | Yes    | Yes    |

<Note>
  * Advanced features such as SHDR, LDC, and EIS are not supported on IQ-8275.
  * There is no hardware JPEG encoder — snapshots use a software encoder running on the CPU.
</Note>

## Camera Streaming

### Single Camera Stream

```bash theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=0 ! \
  'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! fakesink
```

The above command starts the camera with 720p at 30 FPS configuration.
The frame coming from the camera sensor is thrown away by fakesink.
If the gst pipeline status is changed to “PLAYING” as shown below, this indicates that the camera is running.
Since this command dumps camera frames to fakesink, nothing will be saved on the device.
If the pipeline status changes to `PLAYING`, the camera is running. Press `Ctrl+C` to stop.

```bash theme={null}
gbm_create_device(187): Info: backend name is: msm_drm
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
```

### Video Encoding

```bash theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=0 ! \
  video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,\
  interlace-mode=progressive,colorimetry=bt601 ! \
  v4l2h264enc capture-io-mode=4 output-io-mode=5 \
  extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
  h264parse ! mp4mux ! filesink location=/home/ubuntu/mux_avc.mp4
```

### Object Detection Pipeline

Download required models and assets first:

```bash theme={null}
cd /home/ubuntu
curl -L -O https://raw.githubusercontent.com/quic/sample-apps-for-qualcomm-linux/refs/heads/main/qualcomm-linux/scripts/download_artifacts.sh
sudo chmod +x download_artifacts.sh && sudo ./download_artifacts.sh
```

## Multi-Camera with Offline IFE

The IQ-8275 has two IFEs for real-time bayer-to-YUV processing. The **Offline IFE** feature allows a single IFE to process two cameras in offline mode, enabling concurrent streaming from all four cameras.

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/camera_offline_IFE.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=37704df0003785a5ce4d5ba4730f22df" width="709" height="361" data-path="Ubuntu/images/peripheral-interfaces/camera_offline_IFE.png" />

<Note>
  A maximum of two cameras can operate concurrently with real-time IFE. All four cameras can operate concurrently using the Offline IFE feature.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Camera App Not Working">
    <Steps>
      <Step title="Check camera module connection and DIP switch settings" />

      <Step title="Restart cam-server">
        ```bash theme={null}
        systemctl restart cam-server
        ```
      </Step>

      <Step title="Run a single-stream test">
        ```bash theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=0 ! \
          video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! fakesink
        ```
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Camera Sensor Not Probing">
    ```bash theme={null}
    journalctl -f > /home/ubuntu/log.txt
    ```

    Look for: `CAM_INFO: CAM-SENSOR: Probe success, slot:0, ...`

    If no probe success appears, check the flex cable connection or camera module.
  </Accordion>

  <Accordion title="Camera Not Streaming">
    ```bash theme={null}
    sudo su
    echo 3 > /sys/kernel/debug/camera/ife/ife_csid_debug
    dmesg -w > /home/ubuntu/dmesg.txt
    ```
  </Accordion>
</AccordionGroup>

## Resources

| Topic                                  | Link                                                                                                                                    |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Camera Architecture                    | [Camera Architecture](https://docs.qualcomm.com/doc/80-70023-17A/topic/camera-architecture.html)                                        |
| Camera Sensor Driver Development       | [Camera Sensor Driver Development](https://docs.qualcomm.com/doc/80-70023-17A/topic/camera-sensor-driver-development.html)              |
| Customize Camera Use Case and Pipeline | [Customize Camera Use Case and Pipeline](https://docs.qualcomm.com/doc/80-70023-17A/topic/customize-camera-use-case-and-pipelines.html) |
