> ## 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.

# Stream cameras

> Connect camera sensors to your reference hardware platform and stream using GStreamer and V4L2 APIs — QCS6490, IQ-9075-EVK, IQ-8275-EVK, and IQ615.

<div style={{display:'flex',gap:'8px',flexWrap:'wrap',marginBottom:'16px'}}>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>QCS6490</span>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>IQ-9075-EVK</span>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>IQ-8275-EVK</span>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>IQ615</span>
  <span style={{background:'#f0fdf4',color:'#166534',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>Stable</span>
</div>

<CardGroup cols={4}>
  <Card title="MIPI CSI" icon="camera">Multi-platform support</Card>
  <Card title="GMSL" icon="link">Quad deserializer</Card>
  <Card title="GStreamer" icon="microchip">Primary API</Card>
  <Card title="V4L2" icon="bolt">Driver API</Card>
</CardGroup>

***

This page describes how to connect camera sensors to your reference hardware platform and provides information about available APIs.

***

## 01 · Set up the camera

<Tabs>
  <Tab title="QCS6490">
    ## QCS6490 Camera Topology

    **Default camera modules**

    * **OV9282**
    * **IMX577**

    ***

    ## RB3G2 Vision Mezzanine: MIPI CSI

    ### Camera Connections

    | Slot      | Sensor | Status    |
    | --------- | ------ | --------- |
    | **CAM0A** | OV9282 | Supported |
    | **CAM3**  | IMX577 | Supported |

    Connect:

    * **OV9282 → CAM0A**
    * **IMX577 → CAM3**

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camera_module_connection_1.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=f463ae54c2682a9c34eb998359c4e3af" width="389" height="254" data-path="Technologies/Camera/images/camera_module_connection_1.png" />
    </div>

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camera_module_connection_2.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=4caacb8995de6f68bb6fa0028f903e16" width="411" height="297" data-path="Technologies/Camera/images/camera_module_connection_2.png" />
    </div>

    ### SW2300 DIP Switch on Interposer Board

    | Slot      | SW2300 Switch 1 | Default | Function                  |
    | --------- | --------------- | ------- | ------------------------- |
    | **CAM0A** | Not required    | N/A     | Works without DIP setting |
    | **CAM3**  | **OFF**         | OFF     | Enables CAM3 use          |

    <Note>
      To use the **CAM3** slot on the vision mezzanine board, **SW2300 switch 1 must be OFF**.
      This is the **default** state.
      **CAM0A** works without any DIP switch setting.
    </Note>

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/SW2300_dip.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3bf290df9aecaed93f9f97e88a618e95" width="411" height="277" data-path="Technologies/Camera/images/SW2300_dip.png" />
    </div>

    ***

    ## RB3G2 Vision Mezzanine: GMSL

    There are **two GMSL slots** on the vision mezzanine board:

    * **GMSL1**
    * **GMSL2**

    | Slot      | Shared CSI           | Switch Required          | Default State | Status    |
    | --------- | -------------------- | ------------------------ | ------------- | --------- |
    | **GMSL1** | No                   | None                     | N/A           | Supported |
    | **GMSL2** | Shares CSI with CAM3 | **SW2300 switch 1 = ON** | OFF           | Supported |

    <Note>
      **Important**

      * **GMSL1** works without any hardware setting
      * **CAM3 CSI** and **GMSL2** share the same CSI path
      * To use **GMSL2**, set **SW2300 switch 1 to ON**
      * Default state of SW2300 switch 1 is **OFF**
    </Note>

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/GMSL_slots.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3d5b757c51cdfa232b1034f9b0bca4bd" width="411" height="247" data-path="Technologies/Camera/images/GMSL_slots.png" />
    </div>

    ***

    ## RB3G2 Interposer Board: MIPI CSI

    ### Camera Connections

    | Slot     | Sensor | Status    |
    | -------- | ------ | --------- |
    | **CAM1** | OV9282 | Supported |
    | **CAM2** | IMX577 | Supported |

    Connect:

    * **OV9282 → CAM1**
    * **IMX577 → CAM2**

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/connect_mipi_csi_on_interposer_board.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=0a270d160149caef009b5d037495c6c8" width="740" height="621" data-path="Technologies/Camera/images/connect_mipi_csi_on_interposer_board.png" />
    </div>

    ### DIP Switch Settings

    | Switch            | Setting | Default | Purpose          |
    | ----------------- | ------- | ------- | ---------------- |
    | **CSI1\_DIP\_SW** | **ON**  | OFF     | Enables **CAM1** |
    | **CSI2\_DIP\_SW** | **ON**  | OFF     | Enables **CAM2** |

    <Note>
      Set **CSI1\_DIP\_SW** and **CSI2\_DIP\_SW** to **ON** to use **CAM1** and **CAM2** on the interposer board.
      Default state is **OFF**.
    </Note>

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/dip_switch_setting.jpg?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=f9c4fea85c0132526e94a28804bba92f" width="872" height="759" data-path="Technologies/Camera/images/dip_switch_setting.jpg" />
    </div>

    ***

    ## Supported Features

    | Feature  | IMX577 (CAM3) | OV9282 (CAM0A) | AR0231 (GMSL) |
    | -------- | ------------- | -------------- | ------------- |
    | **SHDR** | Yes           | No             | No            |
    | **LDC**  | Yes           | No             | No            |
    | **EIS**  | Yes           | No             | No            |
  </Tab>

  <Tab title="IQ-9075-EVK">
    ## IQ-9075-EVK Camera Topology

    IQ-9075-EVK is offered as the **core kit**.
    The core kit supports **MIPI CSI** cameras only.
    **GMSL** cameras require a separate **GMSL mezzanine board** connected to the core kit.

    | Interface    | Hardware Path           | Status                         |
    | ------------ | ----------------------- | ------------------------------ |
    | **MIPI CSI** | Core kit / main board   | **Supported**                  |
    | **GMSL**     | External GMSL mezzanine | **Supported via add-on board** |

    In the IQ-9075-EVK hardware stack:

    * The core kit / main board exposes **four MIPI CSI (C/D-PHY) connectors**
    * The GMSL mezzanine board exposes **four GMSL ports (0 to 3)**

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/mipi_hardware_connectivity.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=5c2d8b2dc97512cbcd666c7aa93bad52" width="424" height="324" data-path="Technologies/Camera/images/mipi_hardware_connectivity.png" />
    </div>

    ***

    ## GMSL Port Map

    There are **four GMSL ports (0 to 3)** on the GMSL mezzanine board.

    <Note>
      **Important**

      * GMSL port numbering is **not sequential**
      * Port numbers are assigned based on the **CSI index** to which the GMSL port is connected
      * Each GMSL port connects to a **MAX96724 quad GMSL deserializer**
      * Each deserializer is connected to **one CSI**
    </Note>

    | Port       | CSI Mapping       | Deserializer | Status       | Sensor Class                |
    | ---------- | ----------------- | ------------ | ------------ | --------------------------- |
    | **Port-0** | CSI-based mapping | MAX96724     | **Enabled**  | OX03F10 Bayer               |
    | **Port-1** | CSI-based mapping | MAX96724     | **Disabled** | Not enabled in this release |
    | **Port-2** | CSI-based mapping | MAX96724     | **Enabled**  | OX03F10 YUV                 |
    | **Port-3** | CSI-based mapping | MAX96724     | **Enabled**  | OX03F10 YUV                 |

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/gmsl-camera-connection.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=66d7c82f747afede134b9fcfe6a0bd96" width="354" height="260" data-path="Technologies/Camera/images/gmsl-camera-connection.png" />
    </div>

    <Note>
      **Current release status**

      * **Port-0**, **Port-2**, and **Port-3** are enabled for GMSL cameras
      * **Port-1** is not enabled
    </Note>

    ### Port Capacity

    Each GMSL port contains **four slots** (also referred to as **channels**) numbered **1 to 4**.

    | Item                    | Value   |
    | ----------------------- | ------- |
    | **Slots per GMSL port** | 4       |
    | **Channel range**       | 1 to 4  |
    | **Cameras per port**    | Up to 4 |

    ### Sensor Support by Port

    | Port       | Supported Sensor   | Resolution / FPS     | Capacity  |
    | ---------- | ------------------ | -------------------- | --------- |
    | **Port-0** | OX03F10 Bayer GMSL | 1824 × 1536 @ 30 FPS | 4 cameras |
    | **Port-2** | OX03F10 YUV GMSL   | 1920 × 1536 @ 30 FPS | 4 cameras |
    | **Port-3** | OX03F10 YUV GMSL   | 1920 × 1536 @ 30 FPS | 4 cameras |

    ***

    ## DIP Switch Setup

    IQ-9075-EVK has **four CSI PHYs**.
    Each CSI PHY can be routed to either a **MIPI camera port** or a **GMSL camera port** using the DIP switch on the core kit / main board.

    The switch assignment differs between **EVT** and **DVT/PVT** hardware.

    <Tabs>
      <Tab title="EVT Hardware">
        DIP switch setting for IQ-9075-EVK EVT hardware:

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/dip-switch-sw2.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c65ad2eb779a417701b4a292f5a51015" width="506" height="288" data-path="Technologies/Camera/images/dip-switch-sw2.png" />
        </div>

        | Switch    | OFF (Default) | ON  | Connection When ON    | Connection When OFF |
        | --------- | ------------- | --- | --------------------- | ------------------- |
        | **SW2-1** | HIGH          | LOW | CSI0 → GMSL mezzanine | CSI0 → main board   |
        | **SW2-2** | HIGH          | LOW | CSI1 → GMSL mezzanine | CSI1 → main board   |
        | **SW2-3** | HIGH          | LOW | CSI2 → GMSL mezzanine | CSI2 → main board   |
        | **SW2-4** | HIGH          | LOW | CSI3 → GMSL mezzanine | CSI3 → main board   |
      </Tab>

      <Tab title="DVT/PVT Hardware">
        DIP switch setting for IQ-9075-EVK DVT/PVT hardware:

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/dip-switch-dvt-pvt.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=be190a7b60c279e7b5f080b1b6c1019c" width="418" height="140" data-path="Technologies/Camera/images/dip-switch-dvt-pvt.png" />
        </div>

        | Switch    | ON                    | OFF (Default)     |
        | --------- | --------------------- | ----------------- |
        | **SW1-5** | CSI0 → GMSL mezzanine | CSI0 → main board |
        | **SW1-6** | CSI1 → GMSL mezzanine | CSI1 → main board |
        | **SW1-7** | CSI2 → GMSL mezzanine | CSI2 → main board |
        | **SW1-8** | CSI3 → GMSL mezzanine | CSI3 → main board |
      </Tab>
    </Tabs>

    ***

    ## Concurrent Camera Support

    ### MIPI Support

    The software supports the **OV9282 MIPI camera**.

    | MIPI Camera | Supported Resolution / FPS |      CAM0 |      CAM1 |      CAM2 |      CAM3 | Notes                                                                                                                                                                                       |
    | ----------- | -------------------------- | --------: | --------: | --------: | --------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **OV9282**  | 1280 × 720 @ 30 FPS        | Supported | Supported | Supported | Supported | Any camera can operate independently. A maximum of **two cameras** can run concurrently with **real-time IFE**. All **four cameras** can run concurrently with the **Offline IFE** feature. |

    ### GMSL Support

    The software supports **OX03F10 Bayer** and **OX03F10 YUV** GMSL cameras.

    | GMSL Port           | Supported Resolution / FPS | Sensor        | Notes                                                                                                                                                                                                                     |
    | ------------------- | -------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Port-0**          | 1824 × 1536 @ 30 FPS       | OX03F10 Bayer | Four OX03F10 Bayer GMSL cameras can be connected on Port-0. Any one camera can operate independently. All four cameras on a single port can run concurrently using the **Per Port Group** feature.                        |
    | **Port-2**          | 1920 × 1536 @ 30 FPS       | OX03F10 YUV   | Four OX03F10 YUV GMSL cameras can be connected on Port-2. Any one camera can operate independently. All four cameras on a single port can run concurrently using the **Per Port Group** feature.                          |
    | **Port-3**          | 1920 × 1536 @ 30 FPS       | OX03F10 YUV   | Four OX03F10 YUV GMSL cameras can be connected on Port-3. Any one camera can operate independently. All four cameras on a single port can run concurrently using the **Per Port Group** feature.                          |
    | **Port-2 + Port-3** | 1920 × 1536 @ 30 FPS       | OX03F10 YUV   | Eight OX03F10 YUV GMSL cameras can be connected, four on Port-2 and four on Port-3. Any one camera from each port can operate independently. All eight cameras can run concurrently using the **Per Port Group** feature. |

    ### GMSL + MIPI Concurrency

    | CAM0                       | CAM1                       | GMSL Port-2                      | GMSL Port-3                      | Notes                                                                            |
    | -------------------------- | -------------------------- | -------------------------------- | -------------------------------- | -------------------------------------------------------------------------------- |
    | OV9282 1280 × 720 @ 30 FPS | OV9282 1280 × 720 @ 30 FPS | OX03F10 YUV 1920 × 1080 @ 30 FPS | OX03F10 YUV 1920 × 1080 @ 30 FPS | Any camera can operate independently. All four cameras can operate concurrently. |
  </Tab>

  <Tab title="IQ-8275-EVK">
    ## IQ-8275-EVK Camera Topology

    IQ-8275-EVK is offered in the **core kit**.
    The core kit supports **MIPI CSI** cameras.
    **GMSL** cameras require a separate **GMSL mezzanine board** connected to the core kit.

    | Interface    | Hardware Path  | Status                         |
    | ------------ | -------------- | ------------------------------ |
    | **MIPI CSI** | Main board     | **Supported**                  |
    | **GMSL**     | GMSL mezzanine | **Supported via add-on board** |

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/rb4_core_kit_mipi_connectors.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=ac20d4ecda703883b2fce9854222cda4" width="409" height="284" data-path="Technologies/Camera/images/rb4_core_kit_mipi_connectors.png" />
    </div>

    ***

    ## GMSL Port Map

    There are **four GMSL ports (0 to 3)** on the GMSL mezzanine board.

    <Note>
      **Important**

      * GMSL port numbering is **not sequential**
      * Port numbers are defined by the **CSI index** to which the GMSL port is connected
      * Ports **0, 1, and 2** each connect to a **MAX96724 quad GMSL deserializer**
      * Each deserializer is connected to **one CSI**
      * **Port-3** is a **dummy port**
    </Note>

    | Port       | CSI Mapping       | Deserializer | Status        | Sensor Class   |
    | ---------- | ----------------- | ------------ | ------------- | -------------- |
    | **Port-0** | CSI-based mapping | MAX96724     | **Supported** | OX03F10 Bayer  |
    | **Port-1** | CSI-based mapping | MAX96724     | **Disabled**  | Hardware issue |
    | **Port-2** | CSI-based mapping | MAX96724     | **Supported** | OX03F10 YUV    |
    | **Port-3** | —                 | —            | **Dummy**     | No support     |

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/gmsl_ports_evt_hw.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=453e20da657659038dd13970214ad65e" width="487" height="317" data-path="Technologies/Camera/images/gmsl_ports_evt_hw.png" />
    </div>

    <Note>
      **Current release status**

      * **Port-0** and **Port-2** are supported for GMSL cameras
      * **Port-1** is not enabled due to a hardware issue
      * **Port-3** is a dummy port
    </Note>

    ### Port Capacity

    Each GMSL port contains **four slots** (also referred to as **channels**) numbered **1 to 4**.

    | Item                      | Value              |
    | ------------------------- | ------------------ |
    | **Slots per GMSL port**   | 4                  |
    | **Channel range**         | 1 to 4             |
    | **Cameras per port**      | Up to 4            |
    | **Port-0 sensor support** | OX03F10 Bayer GMSL |
    | **Port-2 sensor support** | OX03F10 YUV GMSL   |

    ***

    ## DIP Switch Setup

    IQ-8275-EVK has **three CSI PHYs**.
    Each CSI PHY can be routed to either a **MIPI camera port** or a **GMSL camera port** using the DIP switch on the core kit/main board.

    The switch assignment differs for **EVT** and **DVT/PVT** hardware.

    <Tabs>
      <Tab title="EVT Hardware">
        DIP switch setting on IQ-8275-EVK EVT hardware:

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/rb4_dip_switch_sw2.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=3422075c2c6fa0a29d40a9c9d5c1e90d" width="506" height="288" data-path="Technologies/Camera/images/rb4_dip_switch_sw2.png" />
        </div>

        | Switch    | ON                    | OFF (Default)     |
        | --------- | --------------------- | ----------------- |
        | **SW2-1** | CSI0 → GMSL mezzanine | CSI0 → main board |
        | **SW2-2** | CSI1 → GMSL mezzanine | CSI1 → main board |
        | **SW2-3** | CSI2 → GMSL mezzanine | CSI2 → main board |
      </Tab>

      <Tab title="DVT / PVT Hardware">
        DIP switch setting on IQ-8275-EVK DVT/PVT hardware:

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/dip-switch-dvt-pvt.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=be190a7b60c279e7b5f080b1b6c1019c" width="418" height="140" data-path="Technologies/Camera/images/dip-switch-dvt-pvt.png" />
        </div>

        | Switch    | ON                    | OFF (Default)     |
        | --------- | --------------------- | ----------------- |
        | **SW1-5** | CSI0 → GMSL mezzanine | CSI0 → main board |
        | **SW1-6** | CSI1 → GMSL mezzanine | CSI1 → main board |
        | **SW1-7** | CSI2 → GMSL mezzanine | CSI2 → main board |
      </Tab>
    </Tabs>

    ***

    ## Concurrent Camera Support

    ### MIPI Support

    The software supports the **OV9282 MIPI camera**.

    | MIPI Camera | Supported Resolution / FPS |      CAM0 |      CAM1 |      CAM2 | Notes                                                                                                                                                                      |
    | ----------- | -------------------------- | --------: | --------: | --------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **OV9282**  | 1280 × 720 @ 30 FPS        | Supported | Supported | Supported | Any camera can operate independently. Up to **two cameras** can run concurrently with **real-time IFE**. All **three cameras** can run concurrently using **Offline IFE**. |

    ### GMSL Support

    The software supports **OX03F10 Bayer** and **OX03F10 YUV** GMSL cameras.

    | GMSL Port  | Supported Resolution / FPS | Sensor        | Notes                                                                                                                                                                                      |
    | ---------- | -------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | **Port-0** | 1824 × 1536 @ 30 FPS       | OX03F10 Bayer | Four Bayer GMSL cameras can be connected on Port-0. Any one camera can operate independently. All four cameras on a single port can run concurrently using the **Per Port Group** feature. |
    | **Port-2** | 1920 × 1536 @ 30 FPS       | OX03F10 YUV   | Four YUV GMSL cameras can be connected on Port-2. Any one camera can operate independently. All four cameras on a single port can run concurrently using the **Per Port Group** feature.   |

    ### GMSL Port-0 + Port-2 Concurrency

    | Configuration                                             | Status        | Notes                                                                       |
    | --------------------------------------------------------- | ------------- | --------------------------------------------------------------------------- |
    | **4× OX03F10 Bayer on Port-0 + 4× OX03F10 YUV on Port-2** | **Supported** | All eight cameras can run concurrently using the **Per Port Group** feature |
    | **Independent camera on each port**                       | **Supported** | Any one camera from each port can operate independently                     |
    | **Full 8-camera concurrency on IQ-8275-EVK**              | **Stable**    | All eight cameras can run concurrently                                      |

    ### GMSL + MIPI Concurrency

    | GMSL Port-0                            | MIPI                                   | GMSL Port-2                          | Status        |
    | -------------------------------------- | -------------------------------------- | ------------------------------------ | ------------- |
    | **OX03F10 Bayer 1824 × 1536 @ 30 FPS** | **OV9282 1280 × 720 @ 30 FPS**         | **OX03F10 YUV 1920 × 1080 @ 30 FPS** | **Supported** |
    | **OV9282 1280 × 720 @ 30 FPS**         | **OX03F10 Bayer 1824 × 1536 @ 30 FPS** | **OX03F10 YUV 1920 × 1080 @ 30 FPS** | **Supported** |

    **Rule:** Any camera can operate independently.
    **Result:** All three cameras can run concurrently.
  </Tab>

  <Tab title="IQ615">
    ## IQ615 EVK Camera Topology

    The IQ615 EVK supports **MIPI CSI cameras**.
    **GMSL** is routed through a dedicated interface, but **GMSL cameras are not enabled in the current release**.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/615-board-connectors.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=4614ca26870a941b06f7f1ef2a9a150b" width="681" height="358" data-path="Technologies/Camera/images/615-board-connectors.png" />
    </div>

    ### Board Overview

    | Interface | Connector           | Lane Count | Default State             | Status                             |
    | --------- | ------------------- | ---------: | ------------------------- | ---------------------------------- |
    | **CSI0**  | 22-pin CSI          |     2-lane | Enabled                   | **Supported**                      |
    | **CSI1**  | 22-pin CSI          |     4-lane | Routed to GMSL by default | **Supported via SW13**             |
    | **GMSL**  | Dedicated GMSL slot |          — | Available                 | **Not enabled in current release** |

    <Note>
      **Important**

      * The IQ615 EVK does **not** ship with a default sensor connection
      * **CSI0** requires **no DIP switch configuration**
      * **CSI1** uses **SW13** for path selection
    </Note>

    ***

    ## CSI1 Path Selection

    **SW13 controls CSI1 routing.**

    | SW13 Setting | CSI1 Routing                 | Result                       |
    | ------------ | ---------------------------- | ---------------------------- |
    | **OFF**      | GMSL deserializer path       | CSI1 configured for **GMSL** |
    | **ON**       | 22-pin camera connector path | CSI1 configured for **MIPI** |

    <Note>
      **Default state:** SW13 is **OFF**

      * CSI1 defaults to the **GMSL path**
      * CSI1 can be switched to **MIPI** by setting SW13 to **ON**
    </Note>

    ***

    ## GMSL Interface

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/615-gmsl-interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=173ea64b01787426d94dbb518e7b3617" width="682" height="493" data-path="Technologies/Camera/images/615-gmsl-interface.png" />
    </div>

    | Item                           | Status       |
    | ------------------------------ | ------------ |
    | **GMSL slot**                  | Present      |
    | **Additional hardware config** | Not required |
    | **Current release support**    | **Disabled** |

    <Note>
      GMSL cameras are currently **not enabled** on the IQ615 EVK board.
    </Note>

    ***

    ## Switch Configuration

    | Carrier Board Function       | Switch       | Configuration                  | Comment             |
    | ---------------------------- | ------------ | ------------------------------ | ------------------- |
    | Enable **MIPI** for **CSI1** | **SW13 OFF** | GMSL deserializer → CSI1       | Default state       |
    | Enable **MIPI** for **CSI1** | **SW13 ON**  | 22-pin camera connector → CSI1 | Switch to MIPI path |

    ### Summary

    | Path     | CSI0           | CSI1                          | GMSL                                        |
    | -------- | -------------- | ----------------------------- | ------------------------------------------- |
    | **MIPI** | Direct use     | Enabled via **SW13 ON**       | Not enabled                                 |
    | **GMSL** | Not applicable | Default path via **SW13 OFF** | Present, but not enabled in current release |
  </Tab>

  <Tab title="IQx7181">
    IQx7181 EVK provides multiple camera serial interface (CSI) connectors, supporting camera modules with different PHY types and lane configurations.
    This enables flexible camera connectivity for bring-up and validation use cases.

    ## Interface summary

    The following table provides a summary of interface configurations.

    | CSI Interface |      Sensor     |    PHY Type   |                 Notes                |
    | :-----------: | :-------------: | :-----------: | :----------------------------------: |
    |      CSI0     |     OG0VA1B     |     D-PHY     |                1-lane                |
    |      CSI1     | IMX766 / IMX577 | C-PHY / D-PHY | 30-pin (default) or 22-pin via SW2-6 |
    |      CSI2     |      IMX766     |     C-PHY     |                  N/A                 |
    |      CSI4     |      IMX688     |     C-PHY     |                  N/A                 |

    ***

    ## Supported CSI interfaces

    The available CSI interfaces on the IQx7181 EVK are:

    * CSI0
    * CSI1
    * CSI2
    * CSI4

    The following image shows the CSI connector layout on the IQx7181 EVK board.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/x7181-board-connectors.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=6f91ef25bc1cbeac3d62d0ef0951d215" alt="IQx7181 EVK CSI connector locations" width="501" height="718" data-path="Technologies/Camera/images/x7181-board-connectors.png" />
    </div>

    ***

    ## CSI interface details

    ### CSI0 interface

    * Connected sensor: OG0VA1B
    * Lane configuration: 1-lane
    * PHY type: D-PHY

    ### CSI4 interface

    * Connected sensor: IMX688
    * PHY type: C-PHY

    ### CSI1 and CSI2 interfaces

    * Default connected sensor: IMX766 (C-PHY)
    * Optional configuration: CSI1 can connect to a 22-pin D-PHY IMX577 sensor

    ***

    ## Configure CSI1 connector (30-pin and 22-pin)

    The CSI1 interface supports two physical connector types:

    * 30-pin connector
    * 22-pin connector

    Select the active connector on CSI1 using switch SW2-6 as described in the following table.

    | SW2-6 position | Active connector |
    | :------------: | :--------------: |
    |  OFF (default) | 30-pin connector |
    |       ON       | 22-pin connector |

    <Note>
      The default configuration is SW2-6 = OFF, which enables the 30-pin CSI1 connector.
    </Note>

    ***

    ## Use IMX577 sensor with CSI1

    When connecting an IMX577 image sensor:

    * Use the CSI1 22-pin interface.
    * Set SW2-6 to ON to enable the 22-pin connector.
    * Connect the sensor using a 22-pin Type-B FFC/FPC cable.
    * Ensure the cable orientation and pin alignment are correct before powering on the system.
  </Tab>
</Tabs>

***

## 02 · Choose the stream API

Qualcomm Linux supports the following APIs for camera:

<CardGroup cols={2}>
  <Card title="GStreamer API" icon="film" href="stream-cameras#03-·-stream-camera-with-the-gstreamer-api">
    GStreamer is an open-source multimedia framework. Qualcomm provides a GStreamer plugin (`qtiqmmfsrc`) that allows developers to control the camera subsystem in applications. See [Qualcomm GStreamer plugins](https://docs.qualcomm.com/bundle/publicresource/topics/80-70023-50/qim-sdk-plugins.html) for more information.
  </Card>

  <Card title="V4L2 API" icon="microchip" href="stream-cameras#04-·-stream-camera-with-the-v4l2-api">
    V4L2 is a framework within the Linux kernel that provides support for video capture, video output, and other multimedia devices. Developers can operate the camera using the V4L2 API. The V4L2 API, which uses the CAMSS driver, is suitable for developers who only need to obtain raw images from the camera.
  </Card>
</CardGroup>

***

## 03 · Stream camera with the GStreamer API

`gst-launch-1.0` is a command-line GStreamer utility used to build and run a GStreamer pipeline. The pipeline is specified as a collection of elements with properties separated by exclamation marks (`!`).

### Prerequisites

To use [gst-launch-1.0](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html?gi-language=c) and GStreamer plugins, flash the Config2 image. For overlay configuration details, see [Overlay Configurations](https://dragonwingdocs.qualcomm.com/Key-Documents/Migration-Guide/use-overlay-configurations-to-derive-image-recipes).

<Note>
  Connect to the device console using SSH. See [How To SSH?](https://dragonwingdocs.qualcomm.com/Linux/devices/iq9075-evk/set-up-the-device#connect-over-ssh) for instructions.
</Note>

<Steps>
  <Step title="🗑️ Clear GStreamer Registry">
    <Accordion title="Clear GStreamer registry (if needed)">
      If a GStreamer command was executed before enabling the camera overlay, the GStreamer registry must be cleared after enabling the camera overlay. Run the following command to clear the registry:

      ```bash Terminal theme={null}
      rm ~/.cache/gstreamer-1.0/registry.aarch64.bin
      ```
    </Accordion>
  </Step>

  <Step title="📉 Tune Log Level">
    <Accordion title="Log Level Tuning (if needed)">
      Camera use-cases are expected to run on a performance (perf) build for optimal results. On default builds, reduce the kernel console log level as shown below:

      ```bash Terminal theme={null}
      echo 4 > /proc/sys/kernel/printk
      ```
    </Accordion>
  </Step>

  <Step title="⚡ Activate Adreno OpenCL for cam-server">
    <Accordion title="Activate Adreno OpenCL for cam-server (For Advanced Camera Use-cases only)">
      Before running any Advanced camera use cases like SHDRv2, SHDRv3, Defog, etc., configure the `cam-server` systemd service to use the Adreno OpenCL ICD library.

      <Steps>
        <Step title="🛠️ Open the service override">
          Edit the `cam-server` systemd unit so it can load a custom environment file.

          ```bash Terminal theme={null}
          systemctl edit --full cam-server
          ```

          Add this line under the `[Service]` section:

          ```bash Terminal theme={null}
          EnvironmentFile=/etc/cam-server-env
          ```

          Save and exit.
        </Step>

        <Step title="⚙️ Point to Adreno OpenCL">
          Set the OpenCL ICD path used by `cam-server`.

          ```bash Terminal theme={null}
          echo "OCL_ICD_FILENAMES=/usr/lib/libOpenCL_adreno.so.1" > /etc/cam-server-env
          ```
        </Step>

        <Step title="🔄 Reload and restart">
          Apply the updated service configuration and restart `cam-server`.

          ```bash Terminal theme={null}
          systemctl daemon-reload
          systemctl restart cam-server
          ```
        </Step>
      </Steps>
    </Accordion>
  </Step>
</Steps>

***

### Run camera use cases

<Tabs>
  <Tab title="QCS6490">
    <Note>
      Ensure that MIPI cameras are connected to CSI slots. The OV9282 MIPI camera should be connected to the CAM 0A slot and the IMX577 MIPI camera should be connected to the CAM3 slot.
    </Note>

    #### Single camera stream start

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Fakesink) 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>

      <Step title="Verify pipeline status">
        This 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.

        ```text Log Output 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
        ```

        To stop the camera, press **CTRL+C**.
      </Step>
    </Steps>

    ***

    #### Video encoding

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (MP4 Record) 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=/opt/mux_avc.mp4
        ```

        This command starts the camera with 720p at 30 FPS configuration and saves it as a video file after h264 video encoding. If the gst pipeline status is changed to "PLAYING", this indicates the camera is running.

        To stop the camera, press **CTRL+C**.
      </Step>

      <Step title="Pull recorded content">
        `/opt/mux_avc.mp4` is generated on the device. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/mux_avc.mp4 .
        ```
      </Step>
    </Steps>

    ***

    #### Video encoding and snapshot

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Snapshot + Video) theme={null}
        gst-pipeline-app -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=/opt/mux_avc.mp4 \
        camsrc.image_1 ! "image/jpeg,width=1280,height=720,framerate=30/1" \
        ! multifilesink location=/opt/frame%d.jpg async=false sync=true enable-last-sample=false
        ```
      </Step>

      <Step title="Navigate the menu">
        Press **Enter**. This command will print the following menu and wait for user input.

        ```text Menu theme={null}
        ##################################### MENU #####################################
        ============================== Pipeline Controls==============================
        (0) NULL: Set the pipeline into NULL state
        (1) READY: Set the pipeline into READY state
        (2) PAUSED: Set the pipeline into PAUSED state
        (3) PLAYING: Set the pipeline into PLAYING state
        ==================================== Other====================================
        (p) Plugin Mode: Choose a plugin which to control
        (q) Quit : Exit the application
        Choose an option:
        ```
      </Step>

      <Step title="Take a snapshot">
        Use the following menu steps to take a snapshot while recording video.

        ```text Menu Steps theme={null}
        (1) ready -> (3) Playing -> (p)Plugin Mode : Select (8)camerasrc -> (37) capture-image -> (1): still - Snapshot ->(1) Snapshot count ( 'guint' value for arg1)
        ```
      </Step>

      <Step title="Stop and retrieve files">
        To stop the camera, press **Enter**, press **b** (back), and then press **q** (quit). The recorded video file and snapshot images are saved in `/opt/`. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/<file name> .
        ```
      </Step>
    </Steps>

    ***

    #### MIPI multi-camera streaming

    QCS6490 has five CSI PHYs to which you can connect five MIPI cameras.

    QCS6490 has three IFEs and two IFE Lites. This means you can run three cameras with IFEs and two cameras with IFE Lites. IFE Lites only support raw dumps from the sensor. You can connect mono cameras to the IFE Lites, dump raw frames, and then convert the output to YUV frames using a CHI node.

    To validate five camera concurrency on the RB3 platform:

    <Steps>
      <Step title="Connect MIPI cameras">
        Connect MIPI cameras as described in the following table.

        | **Slot** |  **Camera sensor**  |
        | :------: | :-----------------: |
        |  CAM 0A  |  OV9282 mono camera |
        |  CAM 0B  |  OV9282 mono camera |
        |   CAM1   | IMX577 bayer camera |
        |   CAM2   | IMX577 bayer camera |
        |   CAM3   | IMX577 bayer camera |
      </Step>

      <Step title="Run GST commands for all five cameras concurrently">
        <Note>
          For OV9282 mono cameras, a separate camera pipeline (RealTimeMonoToYUV) is used. This pipeline uses IFE Lites to dump the raw frame and then convert it to a YUV frame using a CHI node. Use the GST parameter `ife-direct-stream=1` to use this camera pipeline. Since it runs with an IFE Lite, 2A is not applied on these cameras.
        </Note>

        <Note>
          The QCS6490 maximum encode capability is 4K\@30. Thus, the total encode processing from all five cameras has to be under the 4k\@30 limit.
        </Note>

        **Cam 0: IMX577**

        ```bash GStreamer (Cam 0) theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=0 ! video/x-raw,format=NV12,width=1920,height=1080,\
        framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=5000000,\
        video_bitrate_mode=0;" ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/Cam_0_1080p.mp4
        ```

        **Cam 1: IMX577**

        ```bash GStreamer (Cam 1) theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=1 ! video/x-raw,format=NV12,width=1920,height=1080,\
        framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=5000000,\
        video_bitrate_mode=0;" ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/Cam_1_1080p.mp4
        ```

        **Cam 8: IMX577**

        ```bash GStreamer (Cam 8) theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=8 ! video/x-raw,format=NV12,width=1920,height=1080,\
        framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=5000000,\
        video_bitrate_mode=0;" ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/Cam_8_1080p.mp4
        ```

        **Cam 2: OV9282**

        ```bash GStreamer (Cam 2) theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=2 ife-direct-stream=1 ! video/x-raw,format=NV12,width=1280,height=720,\
        framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=5000000,\
        video_bitrate_mode=0;" ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/Cam_2_720p.mp4
        ```

        **Cam 3: OV9282**

        ```bash GStreamer (Cam 3) theme={null}
        gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=3 ife-direct-stream=1 ! video/x-raw,format=NV12,width=1280,height=720,\
        framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=5000000,\
        video_bitrate_mode=0;" ! queue ! h264parse ! mp4mux ! queue ! filesink location=/opt/Cam_3_720p.mp4
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="IQ-9075-EVK">
    <Note>
      Ensure that the camera (MIPI or GMSL) sensor is connected to the IQ-9075-EVK device. You can connect OV9282 MIPI cameras on CSI slots. Connect OX03f10 Bayer GMSL cameras to GMSL Port-0 and OX03f10 YUV GMSL cameras to Port-2 and Port-3.
    </Note>

    #### Single camera stream start

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Fakesink) 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>

      <Step title="Verify pipeline status">
        The following 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.

        ```text Log Output 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
        ```

        To stop the camera, press **CTRL+C**.
      </Step>
    </Steps>

    ***

    #### Video encoding

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (MP4 Record) 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=/opt/mux_avc.mp4
        ```

        This command starts the camera with 720p at 30 FPS configuration and saves it as a video file after h264 video encoding. If the gst pipeline status is changed to "PLAYING", this indicates the camera is running. To stop the camera, press **CTRL+C**.
      </Step>

      <Step title="Pull recorded content">
        `/opt/mux_avc.mp4` is generated on the device. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/mux_avc.mp4 .
        ```
      </Step>
    </Steps>

    ***

    #### Video encoding and snapshot

    IQ-9075-EVK doesn't have a hardware JPEG encoder. The snapshot use case works using a software JPEG encoder algorithm that runs on the CPU.

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Snapshot + Video) theme={null}
        gst-pipeline-app -e qtiqmmfsrc name=camsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720,\
        framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 \
        output-io-mode=5 extra-controls="controls,video_bitrate_mode=0,video_bitrate=6000000;" ! queue ! \
        h264parse ! mp4mux ! queue ! filesink location="/opt/mux_720_avc.mp4" camsrc.image_1 ! "image/jpeg,\
        width=1280,height=720,framerate=30/1" ! multifilesink location=/opt/frame%d.jpg async=false sync=true \
        enable-last-sample=false
        ```
      </Step>

      <Step title="Navigate the menu">
        Press **Enter**. This command will print the following menu and wait for user input.

        ```text Menu theme={null}
        ##################################### MENU #####################################
        ============================== Pipeline Controls==============================
        (0)       NULL: Set the pipeline into NULL state
        (1)       READY: Set the pipeline into READY state
        (2)       PAUSED: Set the pipeline into PAUSED state
        (3)       PLAYING: Set the pipeline into PLAYING state
        ==================================== Other====================================
        (p)       Plugin Mode: Choose a plugin which to control
        (q)       Quit : Exit the application

        Choose an option:
        ```
      </Step>

      <Step title="Take a snapshot">
        Use the following menu steps to take a snapshot while recording video.

        ```text Menu Steps theme={null}
        (1) ready -> (3) Playing -> (p)Plugin Mode : Select (11)camerasrc ->
        (38) capture-image -> (1): still - Snapshot ->(1) Snapshot count ( 'guint' value for arg1)
        ```
      </Step>

      <Step title="Stop and retrieve files">
        To stop the camera, press **Enter**, press **b** (back), and then press **q** (quit). The recorded video file and snapshot images are saved in `/opt/`. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/<file name> .
        ```
      </Step>
    </Steps>

    ***

    #### MIPI multi-camera streaming

    There are four MIPI CSI slots present on the IQ-9075-EVK main board. Connect OV9282 cameras to MIPI CSI ports. You can run any two OV9282 cameras concurrently out of four cameras.

    Run the following GST command in two different terminals with camera = 0, 1 to validate MIPI camera concurrency. Use different file names when saving the encoded file of each camera.

    ```bash GStreamer (Dual MIPI) 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=/opt/mux_avc.mp4
    ```

    You can also run all four MIPI cameras concurrently using the offline IFE feature. Refer to [Support multi-camera using offline IFE](./support-multi-camera-using-offline-ife) for information on four camera validation.

    ***

    #### GMSL multi-camera streaming

    A single GMSL port contains four slots, allowing connection of four GMSL cameras to a single CSI using different virtual channel IDs. The four cameras connected on one CSI are treated as group. A group of cameras can be run concurrently using the [per port grouping feature](./support-per-port-grouping).
  </Tab>

  <Tab title="IQ-8275-EVK">
    <Note>
      Ensure that the camera (MIPI or GMSL) sensor is connected to the IQ-8275-EVK device. You can connect OV9282 MIPI cameras on CSI slots. Connect OX03f10 bayer GMSL cameras to GMSL Port-0 and OX03f10 YUV GMSL cameras to GMSL Port-2.
    </Note>

    #### Single camera stream start

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Fakesink) 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>

      <Step title="Verify pipeline status">
        The following 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.

        ```text Log Output 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
        ```

        To stop the camera, press **CTRL+C**.
      </Step>
    </Steps>

    ***

    #### Video encoding

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (MP4 Record) 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=/opt/mux_avc.mp4
        ```

        This command starts the camera with 720p at 30 FPS configuration and saves it as a video file after h264 video encoding. If the gst pipeline status is changed to "PLAYING", this indicates the camera is running. To stop the camera, press **CTRL+C**.
      </Step>

      <Step title="Pull recorded content">
        `/opt/mux_avc.mp4` is generated on the device. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/mux_avc.mp4 .
        ```
      </Step>
    </Steps>

    ***

    #### Video encoding and snapshot

    IQ-8275-EVK doesn't have a hardware JPEG encoder. The snapshot use case works using a software JPEG encoder algorithm that runs on the CPU.

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Snapshot + Video) theme={null}
        gst-pipeline-app -e qtiqmmfsrc name=camsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720,\
        framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 \
        output-io-mode=5 extra-controls="controls,video_bitrate_mode=0,video_bitrate=6000000;" ! queue ! \
        h264parse ! mp4mux ! queue ! filesink location="/opt/mux_720_avc.mp4" camsrc.image_1 ! "image/jpeg,\
        width=1280,height=720,framerate=30/1" ! multifilesink location=/opt/frame%d.jpg async=false sync=true \
        enable-last-sample=false
        ```
      </Step>

      <Step title="Navigate the menu">
        Press **Enter**. This command will print the following menu and wait for user input.

        ```text Menu theme={null}
        ##################################### MENU #####################################
        ============================== Pipeline Controls==============================
        (0)       NULL: Set the pipeline into NULL state
        (1)       READY: Set the pipeline into READY state
        (2)       PAUSED: Set the pipeline into PAUSED state
        (3)       PLAYING: Set the pipeline into PLAYING state
        ==================================== Other====================================
        (p)       Plugin Mode: Choose a plugin which to control
        (q)       Quit : Exit the application

        Choose an option:
        ```
      </Step>

      <Step title="Take a snapshot">
        Use the following menu steps to take a snapshot while recording video.

        ```text Menu Steps theme={null}
        (1) ready -> (3) Playing -> (p)Plugin Mode : Select (11)camerasrc ->
        (38) capture-image -> (1): still - Snapshot ->(1) Snapshot count ( 'guint' value for arg1)
        ```
      </Step>

      <Step title="Stop and retrieve files">
        To stop the camera, press **Enter**, press **b** (back), and then press **q** (quit). The recorded video file and snapshot images are saved in `/opt/`. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/<file name> .
        ```
      </Step>
    </Steps>

    ***

    #### MIPI multi-camera streaming

    There are three MIPI CSI slots present on the IQ-8275-EVK main board. Connect OV9282 cameras to MIPI CSI ports. You can run any two OV9282 cameras concurrently.

    Run the following GST command in two different terminals with camera = 0, 1 to validate MIPI camera concurrency. Use different file names when saving the encoded file of each camera.

    ```bash GStreamer (Dual MIPI) 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=/opt/mux_avc.mp4
    ```

    You can also run all three MIPI cameras concurrently using the offline IFE feature. Refer to [Support multi-camera using offline IFE](./support-multi-camera-using-offline-ife) for information on three camera validation.

    ***

    #### GMSL multi-camera streaming

    A single GMSL port contains four slots, allowing connection of four GMSL cameras to a single CSI using different virtual channel IDs. The four cameras connected on one CSI are treated as group. A group of cameras can be run concurrently using the [per port grouping feature](./support-per-port-grouping).
  </Tab>

  <Tab title="IQ615">
    <Note>
      Ensure that the camera MIPI sensor is connected to the IQ15 device. You can connect IMX577 MIPI cameras on CSI slots.
    </Note>

    #### Single camera stream start

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Fakesink) 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>

      <Step title="Verify pipeline status">
        The following 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.

        ```text Log Output 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
        ```

        To stop the camera, press **CTRL+C**.
      </Step>
    </Steps>

    ***

    #### Video encoding

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (MP4 Record) 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=/opt/mux_avc.mp4
        ```

        This command starts the camera with 720p at 30 FPS configuration and saves it as a video file after h264 video encoding. If the gst pipeline status is changed to "PLAYING", this indicates the camera is running. To stop the camera, press **CTRL+C**.
      </Step>

      <Step title="Pull recorded content">
        `/opt/mux_avc.mp4` is generated on the device. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/mux_avc.mp4 .
        ```
      </Step>
    </Steps>

    ***

    #### Video encoding and snapshot

    IQ-9075-EVK doesn't have a hardware JPEG encoder. The snapshot use case works using a software JPEG encoder algorithm that runs on the CPU.

    <Steps>
      <Step title="Run the pipeline">
        Run the following command in the device terminal:

        ```bash GStreamer (Snapshot + Video) theme={null}
        gst-pipeline-app -e qtiqmmfsrc name=camsrc camera=0 ! video/x-raw,format=NV12,width=1280,height=720,\
        framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 \
        output-io-mode=5 extra-controls="controls,video_bitrate_mode=0,video_bitrate=6000000;" ! queue ! \
        h264parse ! mp4mux ! queue ! filesink location="/opt/mux_720_avc.mp4" camsrc.image_1 ! "image/jpeg,\
        width=1280,height=720,framerate=30/1" ! multifilesink location=/opt/frame%d.jpg async=false sync=true \
        enable-last-sample=false
        ```
      </Step>

      <Step title="Navigate the menu">
        Press **Enter**. This command will print the following menu and wait for user input.

        ```text Menu theme={null}
        ##################################### MENU #####################################
        ============================== Pipeline Controls==============================
        (0)       NULL: Set the pipeline into NULL state
        (1)       READY: Set the pipeline into READY state
        (2)       PAUSED: Set the pipeline into PAUSED state
        (3)       PLAYING: Set the pipeline into PLAYING state
        ==================================== Other====================================
        (p)       Plugin Mode: Choose a plugin which to control
        (q)       Quit : Exit the application

        Choose an option:
        ```
      </Step>

      <Step title="Take a snapshot">
        Use the following menu steps to take a snapshot while recording video.

        ```text Menu Steps theme={null}
        (1) ready -> (3) Playing -> (p)Plugin Mode : Select (11)camerasrc ->
        (38) capture-image -> (1): still - Snapshot ->(1) Snapshot count ( 'guint' value for arg1)
        ```
      </Step>

      <Step title="Stop and retrieve files">
        To stop the camera, press **Enter**, press **b** (back), and then press **q** (quit). The recorded video file and snapshot images are saved in `/opt/`. The recorded content can be pulled from the device by running the following scp command on the host PC:

        ```bash SCP (SSH) theme={null}
        $ scp -r root@[ip-addr]:/opt/<file name> .
        ```
      </Step>
    </Steps>

    ***
  </Tab>

  <Tab title="IQX7181">
    GStreamer app support is not enabled in this release.
  </Tab>
</Tabs>

***

### Other GStreamer Samples

The QIM SDK includes [GStreamer sample applications for camera](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/sample-application/multimedia-sample-applications) and sample applications for [AI/ML and other multimedia applications](https://docs.qualcomm.com/bundle/publicresource/topics/80-70023-50/example-applications.html).

<Note>
  Before using the sample applications, ensure that the installation prerequisites for gst-launch-1.0 and GStreamer plugins are met.
</Note>

See [Multimedia use case examples](https://docs.qualcomm.com/bundle/publicresource/topics/80-70023-50/multimedia-use-cases.html) for examples using `gst-launch-1.0`.

***

## 04 · Stream camera with the V4L2 API

To use the V4L2 API, flash the Config1 image. For overlay configuration details, see [Overlay Configurations](https://dragonwingdocs.qualcomm.com/Key-Documents/Migration-Guide/use-overlay-configurations-to-derive-image-recipes).

<Tabs>
  <Tab title="QCS6490">
    The V4L2 framework within the Linux kernel supports video devices. It provides an API that allows user space applications to interact with devices such as cameras and video capture cards.

    More information on V4L2 is available from [kernel.org](http://kernel.org).

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/V4L2_interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=2d389eb4a92ae46d9e3009d2845c9416" width="409" height="397" data-path="Technologies/Camera/images/V4L2_interface.png" />
    </div>

    Qualcomm supports the V4L2 interface camera ISP driver for raw frame dump functionality in the upstream kernel.

    ***

    ### CAMSS driver

    The Qualcomm camera subsystem (CAMSS) driver in the upstream kernel implements the V4L2, media controller, and V4L2 subdev interfaces.

    Camera sensors using the V4L2 subdev interface in the kernel are supported.

    The CAMSS driver consists of:

    * **CSIPHY module** – Handles the physical layer of the CSI2 receivers. A separate camera sensor can be connected to each CSIPHY module.
    * **CSI Decoder (CSID) module** – Handles the protocol and application layers of the CSI2 receivers. A CSID can decode a data stream from any CSIPHY.
    * **Video Front End (VFE) module** – Represents the Image Front End (IFE) that contains Raw Dump Interface (RDI) input interfaces that bypass the image processing pipeline. The VFE also contains the AXI bus interface which writes output data to memory.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camss_driver.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3f34b24492d5a24b4bae5ce3fca77383" width="985" height="738" data-path="Technologies/Camera/images/camss_driver.png" />
    </div>

    The CAMSS driver implements the V4L2 interface. Each CSIPHY, CSID, and VFE module is represented by a single V4L2 sub-device.

    As shown in the following diagram, each CSIPHY can connect to each CSID. Each CSID can connect to each VFE. Each RDI port has an individual video node.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/csiphy_csid_connections.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=9ac30a5ba8491264dc57452ec449b879" width="3704" height="707" data-path="Technologies/Camera/images/csiphy_csid_connections.png" />
    </div>

    CAMSS V4L2 drivers are in `<kernel_root>/drivers/media/platform/qcom/camss`. `<kernel_root>` is the directory of the Linux kernel.

    ***

    ### V4L2 sample application — Yavta

    This section describes how to capture raw frame data using an application that supports the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM3 slot of the RB3 device.
    </Note>

    <Note>
      Yavta is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify that the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        root@rb3gen2-core-kit:/# lsmod |grep -iE "qcom_camss|imx412"
        imx412                 16384  0
        qcom_camss            569344  20
        ```

        The expected result is that the IMX412 sensor driver and qcom\_camss camera subsystem modules are loaded successfully, confirming the upstream camera stack is active.
      </Step>

      <Step title="Check the media node number">
        Run the following command to print the media device node number for the CAMSS driver.

        If /dev/media0 does not list the qcom-camss driver, try it with /dev/media1.

        ```bash Check Media Node theme={null}
        # media-ctl -p -d /dev/media0 | grep camss
        driver       qcom-camss
        bus info     platform:acaf000.camss
        ```
      </Step>

      <Step title="Check the media device graph">
        Run the following command to check the media device graph:

        ```bash Media Device Graph theme={null}
        media-ctl -p -d /dev/media'x'
        ```

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/check-media-device-graph.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e6ad0b7b921d0444ae235e510d760b1d" width="1075" height="362" data-path="Technologies/Camera/images/check-media-device-graph.png" />
        </div>
      </Step>

      <Step title="Find the sensor name">
        Run the following command to print the sensor name to the terminal:

        ```bash Find Sensor theme={null}
        # cat /sys/dev/char/81\:*/name | grep imx
        imx577 21-001a
        ```
      </Step>

      <Step title="Configure the media controller">
        The media controller utility (media-ctrl) is a [V4L2 utility](https://git.linuxtv.org/v4l-utils.git) used to configure camera subsystem subdevices. Use `media-ctl --help` to print usage information.

        <Note>
          Replace \[x] with the number found via :ref. \<Check the media node number>. For example, `# media-ctl -d /dev/media1 --reset`.
        </Note>

        1. Reset all links to inactive:
           ```bash Reset Links theme={null}
           # media-ctl -d /dev/media[x] --reset
           ```
        2. Configure the camera sensor format and resolution on pipeline nodes:
           ```bash Configure Sensor theme={null}
           # media-ctl -d /dev/media[x] -V '"imx577 17-001a":0[fmt:SRGGB10/4056x3040 field:none]'
           ```
        3. Configure CSIPHY with 4056x3040 resolution:
           ```bash Configure CSIPHY theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csiphy3":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_csiphy3":1[fmt: SRGGB10/4056x3040]'
           ```
        4. Configure CSID with 4056x3040 resolution:
           ```bash Configure CSID theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csid0":0[fmt:SRGGB10/4056x3040] '
           # media-ctl -d /dev/media[x] -V '"msm_csid0":1[fmt:SRGGB10/ 4056x3040]'
           ```
        5. Configure ISP with 3840x2160 resolution:
           ```bash Configure ISP theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":1[fmt: SRGGB10/4056x3040]'
           ```
        6. Link the pipeline:
           ```bash Link Pipeline theme={null}
           # media-ctl -d /dev/media[x] -l '"msm_csiphy3":1->"msm_csid0":0[1]'
           # media-ctl -d /dev/media[x] -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
           ```
      </Step>

      <Step title="Capture images">
        The [Yavta test application](https://git.ideasonboard.org/yavta.git) validates the camera using the V4L2 interface. Run Yavta to capture images:

        ```bash Yavta Capture theme={null}
        # yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 --capture=5 --file='frame-#.raw'
        ```
      </Step>
    </Steps>

    ***

    ### V4L2 sample application — libcamera

    libcamera is an open-source software framework. It handles control of the V4L2 camera interface and exposes a native C++ API to upper layers. The applications and upper-level frameworks run based on the [libcamera framework](https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-core.html).

    See [libcamera architecture](https://libcamera.org/docs.html#libcamera-architecture) for more detail about the libcamera architecture.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/libcamera_framework.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c97752fbe4d6e6f45dad91f9f2f43d90" width="463" height="477" data-path="Technologies/Camera/images/libcamera_framework.png" />
    </div>

    libcamera is validated using the [cam utility](https://libcamera.org/getting-started.html#basic-testing-with-cam-utility).

    ### Capture raw frame data

    The following steps describe how to capture raw frame data with the camera utility app using the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM3 slot of the RB3 device.
    </Note>

    <Note>
      libcamera is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify that the qcom\_camss and IMX412 modules are loaded by running the following lsmod command:

        ```bash Verify Modules theme={null}
        # lsmod | grep qcom_camss
        # lsmod | grep imx412
        ```
      </Step>

      <Step title="Delete uncalibrated.yaml">
        ```bash Delete YAML theme={null}
        # rm -rf /usr/share/libcamera/ipa/simple/uncalibrated.yaml
        ```
      </Step>

      <Step title="Run the cam utility">
        ```bash Run cam Utility theme={null}
        # cam -c 1 --capture=10 --file='frame-#.raw'
        ```

        This runs the utility and captures 10 raw frames in the root directory and saves them into files.

        Check the console log messages for information about the resolution and format of the dumped images.

        ```text Log Output theme={null}
        Using camera /base/soc@0/cci@ac4b000/i2c-bus@1/camera@1a as cam0 [0:15:01.067615799] [2155] INFO Camera camera.cpp:945 configuring streams:
        (0) 4056x3040-SRGGB10_CSI2P
        cam0: Capture 10 frames
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="IQ-9075-EVK">
    The V4L2 framework within the Linux kernel supports video devices. It provides an API that allows user space applications to interact with devices such as cameras and video capture cards.

    More information on V4L2 is available from [kernel.org](http://kernel.org).

    Qualcomm supports the V4L2 interface camera ISP driver for raw frame dump functionality in the upstream kernel.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/V4L2_interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=2d389eb4a92ae46d9e3009d2845c9416" width="409" height="397" data-path="Technologies/Camera/images/V4L2_interface.png" />
    </div>

    ***

    ### CAMSS driver

    The Qualcomm camera subsystem (CAMSS) driver in the upstream kernel implements the V4L2, media controller, and V4L2 subdev interfaces.

    Camera sensors using the V4L2 subdev interface in the kernel are supported.

    The CAMSS driver consists of:

    * **CSIPHY module** – Handles the physical layer of the CSI2 receivers. A separate camera sensor can be connected to each CSIPHY module.
    * **CSI Decoder (CSID) module** – Handles the protocol and application layers of the CSI2 receivers. A CSID can decode a data stream from any CSIPHY.
    * **Video Front End (VFE) module** – Represents the Image Front End (IFE) that contains Raw Dump Interface (RDI) input interfaces that bypass the image processing pipeline. The VFE also contains the AXI bus interface which writes output data to memory.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camss_driver.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3f34b24492d5a24b4bae5ce3fca77383" width="985" height="738" data-path="Technologies/Camera/images/camss_driver.png" />
    </div>

    The CAMSS driver implements the V4L2 interface. Each CSIPHY, CSID, and VFE module is represented by a single V4L2 sub-device.

    As shown in the following diagram, each CSIPHY can connect to each CSID. Each CSID can connect to each VFE. Each RDI port has an individual video node.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/csiphy_csid_connections.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=9ac30a5ba8491264dc57452ec449b879" width="3704" height="707" data-path="Technologies/Camera/images/csiphy_csid_connections.png" />
    </div>

    CAMSS V4L2 drivers are in `<kernel_root>/drivers/media/platform/qcom/camss`. `<kernel_root>` is the directory of the Linux kernel.

    ***

    ### V4L2 sample application — Yavta

    This section describes how to capture raw frame data using an application that supports the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ-9075-EVK device.
    </Note>

    <Note>
      Yavta is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        root@iq-9075-evk:/# lsmod |grep -iE "qcom_camss|imx412"
        qcom_camss            569344  20
        imx412                 16384  0
        ```

        The expected result is that the IMX412 sensor driver and qcom\_camss camera subsystem modules are loaded successfully, confirming the upstream camera stack is active.
      </Step>

      <Step title="Check the media node number">
        Run the following command to print the media device node number for the CAMSS driver.

        If /dev/media0 does not list the qcom-camss driver, try it with /dev/media1.

        ```bash Check Media Node theme={null}
        # media-ctl -p -d /dev/media1 | grep camss
        driver       qcom-camss
        bus info     platform:acaf000.camss
        ```
      </Step>

      <Step title="Check the media device graph">
        Run the following command to check the media device graph:

        ```bash Media Device Graph theme={null}
        media-ctl -p -d /dev/media'x'
        ```

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/check-media-device-graph.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e6ad0b7b921d0444ae235e510d760b1d" width="1075" height="362" data-path="Technologies/Camera/images/check-media-device-graph.png" />
        </div>
      </Step>

      <Step title="Find the sensor name">
        Run the following command to print the sensor name to the terminal:

        ```bash Find Sensor theme={null}
        # cat /sys/dev/char/81\:*/name | grep imx
        imx577 21-001a
        ```
      </Step>

      <Step title="Configure the media controller">
        The media controller utility (media-ctrl) is a [V4L2 utility](https://git.linuxtv.org/v4l-utils.git) used to configure camera subsystem subdevices. Use `media-ctl --help` to print usage information.

        <Note>
          Replace \[x] with the number found via :ref. \<Check the media node number>. For example, `# media-ctl -d /dev/media1 --reset`.
        </Note>

        1. Reset all links to inactive:
           ```bash Reset Links theme={null}
           # media-ctl -d /dev/media[x] --reset
           ```
        2. Configure the camera sensor format and resolution on pipeline nodes:
           ```bash Configure Sensor theme={null}
           # media-ctl -d /dev/media[x] -V '"imx577 21-001a":0[fmt:SRGGB10/ 4056x3040 field:none]'
           ```
        3. Configure CSIPHY with 4056x3040 resolution:
           ```bash Configure CSIPHY theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":1[fmt: SRGGB10/ 4056x3040]'
           ```
        4. Configure CSID with 4056x3040 resolution:
           ```bash Configure CSID theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csid0":0[fmt:SRGGB10/4056x3040] '
           # media-ctl -d /dev/media[x] -V '"msm_csid0":1[fmt:SRGGB10/ 4056x3040]'
           ```
        5. Configure ISP with 3840x2160 resolution:
           ```bash Configure ISP theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":1[fmt: SRGGB10/ 4056x3040]'
           ```
        6. Link the pipeline:
           ```bash Link Pipeline theme={null}
           # media-ctl -d /dev/media[x] -l '"msm_csiphy1":1->"msm_csid0":0[1]'
           # media-ctl -d /dev/media[x] -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
           ```
      </Step>

      <Step title="Capture images">
        The [Yavta test application](https://git.ideasonboard.org/yavta.git) validates the camera using the V4L2 interface. Run Yavta to capture images:

        ```bash Yavta Capture theme={null}
        # yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 --capture=5 --file='frame-#.raw'
        ```
      </Step>
    </Steps>

    ***

    ### V4L2 sample application — libcamera

    libcamera is an open-source software framework. It handles control of the V4L2 camera interface and exposes a native C++ API to upper layers. The applications and upper-level frameworks run based on the [libcamera framework](https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-core.html).

    See [libcamera architecture](https://libcamera.org/docs.html#libcamera-architecture) for more detail about the libcamera architecture.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/libcamera_framework.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c97752fbe4d6e6f45dad91f9f2f43d90" width="463" height="477" data-path="Technologies/Camera/images/libcamera_framework.png" />
    </div>

    libcamera is validated using the [cam utility](https://libcamera.org/getting-started.html#basic-testing-with-cam-utility).

    ### Capture raw frame data

    The following steps describe how to capture raw frame data with the camera utility app using the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ-9075-EVK device.
    </Note>

    <Note>
      libcamera is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        # lsmod | grep qcom_camss
        # lsmod | grep imx412
        ```
      </Step>

      <Step title="Delete uncalibrated.yaml">
        ```bash Delete YAML theme={null}
        # rm -rf /usr/share/libcamera/ipa/simple/uncalibrated.yaml
        ```
      </Step>

      <Step title="Run the cam utility">
        ```bash Run cam Utility theme={null}
        # cam -c 1 --capture=10 --file='frame-#.raw'
        ```

        This runs the utility and captures 10 raw frames in the root directory and saves them into files.

        Check the console log messages for information about the resolution and format of the dumped images.

        ```text Log Output theme={null}
        Using camera /base/soc@0/cci@ac4b000/i2c-bus@1/camera@1a as cam0 [0:15:01.067615799] [2155] INFO Camera camera.cpp:945 configuring streams:
        (0) 4056x3040-SRGGB10_CSI2P
        cam0: Capture 10 frames
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="IQ-8275-EVK">
    The V4L2 framework within the Linux kernel supports video devices. It provides an API that allows user space applications to interact with devices such as cameras and video capture cards.

    More information on V4L2 is available from [kernel.org](http://kernel.org).

    Qualcomm supports the V4L2 interface camera ISP driver for raw frame dump functionality in the upstream kernel.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/V4L2_interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=2d389eb4a92ae46d9e3009d2845c9416" width="409" height="397" data-path="Technologies/Camera/images/V4L2_interface.png" />
    </div>

    ***

    ### CAMSS driver

    The Qualcomm camera subsystem (CAMSS) driver in the upstream kernel implements the V4L2, media controller, and V4L2 subdev interfaces.

    Camera sensors using the V4L2 subdev interface in the kernel are supported.

    The CAMSS driver consists of:

    * **CSIPHY module** – Handles the physical layer of the CSI2 receivers. A separate camera sensor can be connected to each CSIPHY module.
    * **CSI Decoder (CSID) module** – Handles the protocol and application layers of the CSI2 receivers. A CSID can decode a data stream from any CSIPHY.
    * **Video Front End (VFE) module** – Represents the Image Front End (IFE) that contains Raw Dump Interface (RDI) input interfaces that bypass the image processing pipeline. The VFE also contains the AXI bus interface which writes output data to memory.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camss_driver.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3f34b24492d5a24b4bae5ce3fca77383" width="985" height="738" data-path="Technologies/Camera/images/camss_driver.png" />
    </div>

    The CAMSS driver implements the V4L2 interface. Each CSIPHY, CSID, and VFE module is represented by a single V4L2 sub-device.

    As shown in the following diagram, each CSIPHY can connect to each CSID. Each CSID can connect to each VFE. Each RDI port has an individual video node.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/csiphy_csid_connections.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=9ac30a5ba8491264dc57452ec449b879" width="3704" height="707" data-path="Technologies/Camera/images/csiphy_csid_connections.png" />
    </div>

    CAMSS V4L2 drivers are in `<kernel_root>/drivers/media/platform/qcom/camss`. `<kernel_root>` is the directory of the Linux kernel.

    ***

    ### V4L2 sample application — Yavta

    This section describes how to capture raw frame data using an application that supports the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ-8275-EVK device.
    </Note>

    <Note>
      Yavta is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        root@iq-8275-evk:/# lsmod |grep -iE "qcom_camss|imx412"
        qcom_camss            569344  20
        imx412                 16384  0
        ```

        The expected result is that the IMX412 sensor driver and qcom\_camss camera subsystem modules are loaded successfully, confirming the upstream camera stack is active.
      </Step>

      <Step title="Check the media node number">
        Run the following command to print the media device node number for the CAMSS driver.

        If /dev/media0 does not list the qcom-camss driver, try it with /dev/media1.

        ```bash Check Media Node theme={null}
        # media-ctl -p -d /dev/media1 | grep camss
        driver       qcom-camss
        bus info     platform:acaf000.camss
        ```
      </Step>

      <Step title="Check the media device graph">
        Run the following command to check the media device graph:

        ```bash Media Device Graph theme={null}
        media-ctl -p -d /dev/media'x'
        ```

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/check-media-device-graph.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e6ad0b7b921d0444ae235e510d760b1d" width="1075" height="362" data-path="Technologies/Camera/images/check-media-device-graph.png" />
        </div>
      </Step>

      <Step title="Find the sensor name">
        Run the following command to print the sensor name to the terminal:

        ```bash Find Sensor theme={null}
        # cat /sys/dev/char/81\:*/name | grep imx
        imx577 21-001a
        ```
      </Step>

      <Step title="Configure the media controller">
        The media controller utility (media-ctrl) is a [V4L2 utility](https://git.linuxtv.org/v4l-utils.git) used to configure camera subsystem subdevices. Use `media-ctl --help` to print usage information.

        <Note>
          Replace \[x] with the number found via :ref. \<Check the media node number>. For example, `# media-ctl -d /dev/media1 --reset`.
        </Note>

        1. Reset all links to inactive:
           ```bash Reset Links theme={null}
           # media-ctl -d /dev/media[x] --reset
           ```
        2. Configure the camera sensor format and resolution on pipeline nodes:
           ```bash Configure Sensor theme={null}
           # media-ctl -d /dev/media[x] -V '"imx577 21-001a":0[fmt:SRGGB10/ 4056x3040 field:none]'
           ```
        3. Configure CSIPHY with 4056x3040 resolution:
           ```bash Configure CSIPHY theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":1[fmt: SRGGB10/ 4056x3040]'
           ```
        4. Configure CSID with 4056x3040 resolution:
           ```bash Configure CSID theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csid0":0[fmt:SRGGB10/4056x3040] '
           # media-ctl -d /dev/media[x] -V '"msm_csid0":1[fmt:SRGGB10/ 4056x3040]'
           ```
        5. Configure ISP with 3840x2160 resolution:
           ```bash Configure ISP theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":1[fmt: SRGGB10/ 4056x3040]'
           ```
        6. Link the pipeline:
           ```bash Link Pipeline theme={null}
           # media-ctl -d /dev/media[x] -l '"msm_csiphy1":1->"msm_csid0":0[1]'
           # media-ctl -d /dev/media[x] -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
           ```
      </Step>

      <Step title="Capture images">
        The [Yavta test application](https://git.ideasonboard.org/yavta.git) validates the camera using the V4L2 interface. Run Yavta to capture images:

        ```bash Yavta Capture theme={null}
        # yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 --capture=5 --file='frame-#.raw'
        ```
      </Step>
    </Steps>

    ***

    ### V4L2 sample application — libcamera

    libcamera is an open-source software framework. It handles control of the V4L2 camera interface and exposes a native C++ API to upper layers. The applications and upper-level frameworks run based on the [libcamera framework](https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-core.html).

    See [libcamera architecture](https://libcamera.org/docs.html#libcamera-architecture) for more detail about the libcamera architecture.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/libcamera_framework.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c97752fbe4d6e6f45dad91f9f2f43d90" width="463" height="477" data-path="Technologies/Camera/images/libcamera_framework.png" />
    </div>

    libcamera is validated using the [cam utility](https://libcamera.org/getting-started.html#basic-testing-with-cam-utility).

    ### Capture raw frame data

    The following steps describe how to capture raw frame data with the camera utility app using the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ-8275-EVK device.
    </Note>

    <Note>
      libcamera is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        # lsmod | grep qcom_camss
        # lsmod | grep imx412
        ```
      </Step>

      <Step title="Delete uncalibrated.yaml">
        ```bash Delete YAML theme={null}
        # rm -rf /usr/share/libcamera/ipa/simple/uncalibrated.yaml
        ```
      </Step>

      <Step title="Run the cam utility">
        ```bash Run cam Utility theme={null}
        # cam -c 1 --capture=10 --file='frame-#.raw'
        ```

        This runs the utility and captures 10 raw frames in the root directory and saves them into files.

        Check the console log messages for information about the resolution and format of the dumped images.

        ```text Log Output theme={null}
        Using camera /base/soc@0/cci@ac4b000/i2c-bus@1/camera@1a as cam0 [0:15:01.067615799] [2155] INFO Camera camera.cpp:945 configuring streams:
        (0) 4056x3040-SRGGB10_CSI2P
        cam0: Capture 10 frames
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="IQ615">
    The V4L2 framework within the Linux kernel supports video devices. It provides an API that allows user space applications to interact with devices such as cameras and video capture cards.

    More information on V4L2 is available from [kernel.org](http://kernel.org).

    Qualcomm supports the V4L2 interface camera ISP driver for raw frame dump functionality in the upstream kernel.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/V4L2_interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=2d389eb4a92ae46d9e3009d2845c9416" width="409" height="397" data-path="Technologies/Camera/images/V4L2_interface.png" />
    </div>

    ***

    ### CAMSS driver

    The Qualcomm camera subsystem (CAMSS) driver in the upstream kernel implements the V4L2, media controller, and V4L2 subdev interfaces.

    Camera sensors using the V4L2 subdev interface in the kernel are supported.

    The CAMSS driver consists of:

    * **CSIPHY module** – Handles the physical layer of the CSI2 receivers. A separate camera sensor can be connected to each CSIPHY module.
    * **CSI Decoder (CSID) module** – Handles the protocol and application layers of the CSI2 receivers. A CSID can decode a data stream from any CSIPHY.
    * **Video Front End (VFE) module** – Represents the Image Front End (IFE) that contains Raw Dump Interface (RDI) input interfaces that bypass the image processing pipeline. The VFE also contains the AXI bus interface which writes output data to memory.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camss_driver.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3f34b24492d5a24b4bae5ce3fca77383" width="985" height="738" data-path="Technologies/Camera/images/camss_driver.png" />
    </div>

    The CAMSS driver implements the V4L2 interface. Each CSIPHY, CSID, and VFE module is represented by a single V4L2 sub-device.

    As shown in the following diagram, each CSIPHY can connect to each CSID. Each CSID can connect to each VFE. Each RDI port has an individual video node.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/csiphy_csid_connections.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=9ac30a5ba8491264dc57452ec449b879" width="3704" height="707" data-path="Technologies/Camera/images/csiphy_csid_connections.png" />
    </div>

    CAMSS V4L2 drivers are in `<kernel_root>/drivers/media/platform/qcom/camss`. `<kernel_root>` is the directory of the Linux kernel.

    ***

    ### V4L2 sample application — Yavta

    This section describes how to capture raw frame data using an application that supports the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ615 device.
    </Note>

    <Note>
      Yavta is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        root@iq-615-evk:/# lsmod |grep -iE "qcom_camss|imx412"
        qcom_camss            569344  20
        imx412                 16384  0
        ```

        The expected result is that the IMX412 sensor driver and qcom\_camss camera subsystem modules are loaded successfully, confirming the upstream camera stack is active.
      </Step>

      <Step title="Check the media node number">
        Run the following command to print the media device node number for the CAMSS driver.

        If /dev/media0 does not list the qcom-camss driver, try it with /dev/media1.

        ```bash Check Media Node theme={null}
        # media-ctl -p -d /dev/media1 | grep camss
        driver       qcom-camss
        bus info     platform:acaf000.camss
        ```
      </Step>

      <Step title="Check the media device graph">
        Run the following command to check the media device graph:

        ```bash Media Device Graph theme={null}
        media-ctl -p -d /dev/media'x'
        ```

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/check-media-device-graph.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e6ad0b7b921d0444ae235e510d760b1d" width="1075" height="362" data-path="Technologies/Camera/images/check-media-device-graph.png" />
        </div>
      </Step>

      <Step title="Find the sensor name">
        Run the following command to print the sensor name to the terminal:

        ```bash Find Sensor theme={null}
        # cat /sys/dev/char/81\:*/name | grep imx
        imx577 21-001a
        ```
      </Step>

      <Step title="Configure the media controller">
        The media controller utility (media-ctrl) is a [V4L2 utility](https://git.linuxtv.org/v4l-utils.git) used to configure camera subsystem subdevices. Use `media-ctl --help` to print usage information.

        <Note>
          Replace \[x] with the number found via :ref. \<Check the media node number>. For example, `# media-ctl -d /dev/media1 --reset`.
        </Note>

        1. Reset all links to inactive:
           ```bash Reset Links theme={null}
           # media-ctl -d /dev/media[x] --reset
           ```
        2. Configure the camera sensor format and resolution on pipeline nodes:
           ```bash Configure Sensor theme={null}
           # media-ctl -d /dev/media[x] -V '"imx577 21-001a":0[fmt:SRGGB10/ 4056x3040 field:none]'
           ```
        3. Configure CSIPHY with 4056x3040 resolution:
           ```bash Configure CSIPHY theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":1[fmt: SRGGB10/ 4056x3040]'
           ```
        4. Configure CSID with 4056x3040 resolution:
           ```bash Configure CSID theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csid0":0[fmt:SRGGB10/4056x3040] '
           # media-ctl -d /dev/media[x] -V '"msm_csid0":1[fmt:SRGGB10/ 4056x3040]'
           ```
        5. Configure ISP with 3840x2160 resolution:
           ```bash Configure ISP theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":1[fmt: SRGGB10/ 4056x3040]'
           ```
        6. Link the pipeline:
           ```bash Link Pipeline theme={null}
           # media-ctl -d /dev/media[x] -l '"msm_csiphy1":1->"msm_csid0":0[1]'
           # media-ctl -d /dev/media[x] -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
           ```
      </Step>

      <Step title="Capture images">
        The [Yavta test application](https://git.ideasonboard.org/yavta.git) validates the camera using the V4L2 interface. Run Yavta to capture images:

        ```bash Yavta Capture theme={null}
        # yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 --capture=5 --file='frame-#.raw'
        ```
      </Step>
    </Steps>

    ***

    ### V4L2 sample application — libcamera

    libcamera is an open-source software framework. It handles control of the V4L2 camera interface and exposes a native C++ API to upper layers. The applications and upper-level frameworks run based on the [libcamera framework](https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-core.html).

    See [libcamera architecture](https://libcamera.org/docs.html#libcamera-architecture) for more detail about the libcamera architecture.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/libcamera_framework.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c97752fbe4d6e6f45dad91f9f2f43d90" width="463" height="477" data-path="Technologies/Camera/images/libcamera_framework.png" />
    </div>

    libcamera is validated using the [cam utility](https://libcamera.org/getting-started.html#basic-testing-with-cam-utility).

    ### Capture raw frame data

    The following steps describe how to capture raw frame data with the camera utility app using the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQ615 device.
    </Note>

    <Note>
      libcamera is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        # lsmod | grep qcom_camss
        # lsmod | grep imx412
        ```
      </Step>

      <Step title="Delete uncalibrated.yaml">
        ```bash Delete YAML theme={null}
        # rm -rf /usr/share/libcamera/ipa/simple/uncalibrated.yaml
        ```
      </Step>

      <Step title="Run the cam utility">
        ```bash Run cam Utility theme={null}
        # cam -c 1 --capture=10 --file='frame-#.raw'
        ```

        This runs the utility and captures 10 raw frames in the root directory and saves them into files.

        Check the console log messages for information about the resolution and format of the dumped images.

        ```text Log Output theme={null}
        Using camera /base/soc@0/cci@ac4b000/i2c-bus@1/camera@1a as cam0 [0:15:01.067615799] [2155] INFO Camera camera.cpp:945 configuring streams:
        (0) 4056x3040-SRGGB10_CSI2P
        cam0: Capture 10 frames
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="IQx7181">
    The V4L2 framework within the Linux kernel supports video devices. It provides an API that allows user space applications to interact with devices such as cameras and video capture cards.

    More information on V4L2 is available from [kernel.org](http://kernel.org).

    Qualcomm supports the V4L2 interface camera ISP driver for raw frame dump functionality in the upstream kernel.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/V4L2_interface.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=2d389eb4a92ae46d9e3009d2845c9416" width="409" height="397" data-path="Technologies/Camera/images/V4L2_interface.png" />
    </div>

    ***

    ### CAMSS driver

    The Qualcomm camera subsystem (CAMSS) driver in the upstream kernel implements the V4L2, media controller, and V4L2 subdev interfaces.

    Camera sensors using the V4L2 subdev interface in the kernel are supported.

    The CAMSS driver consists of:

    * **CSIPHY module** – Handles the physical layer of the CSI2 receivers. A separate camera sensor can be connected to each CSIPHY module.
    * **CSI Decoder (CSID) module** – Handles the protocol and application layers of the CSI2 receivers. A CSID can decode a data stream from any CSIPHY.
    * **Video Front End (VFE) module** – Represents the Image Front End (IFE) that contains Raw Dump Interface (RDI) input interfaces that bypass the image processing pipeline. The VFE also contains the AXI bus interface which writes output data to memory.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/camss_driver.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=3f34b24492d5a24b4bae5ce3fca77383" width="985" height="738" data-path="Technologies/Camera/images/camss_driver.png" />
    </div>

    The CAMSS driver implements the V4L2 interface. Each CSIPHY, CSID, and VFE module is represented by a single V4L2 sub-device.

    As shown in the following diagram, each CSIPHY can connect to each CSID. Each CSID can connect to each VFE. Each RDI port has an individual video node.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/csiphy_csid_connections.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=9ac30a5ba8491264dc57452ec449b879" width="3704" height="707" data-path="Technologies/Camera/images/csiphy_csid_connections.png" />
    </div>

    CAMSS V4L2 drivers are in `<kernel_root>/drivers/media/platform/qcom/camss`. `<kernel_root>` is the directory of the Linux kernel.

    ***

    ### V4L2 sample application — Yavta

    This section describes how to capture raw frame data using an application that supports the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 (CSI1 22-pin) slot of the IQx7181 device.
    </Note>

    <Note>
      Yavta is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
           lsmod | grep qcom_camss 
           lsmod | grep imx412
        ```
      </Step>

      <Step title="Check the media node number">
        Run the following command to print the media device node number for the CAMSS driver.

        If /dev/media0 does not list the qcom-camss driver, try it with /dev/media1.

        ```bash Check Media Node theme={null}
        # media-ctl -p -d /dev/media1 | grep camss
        driver       qcom-camss
        bus info     platform:acaf000.camss
        ```
      </Step>

      <Step title="Check the media device graph">
        Run the following command to check the media device graph:

        ```bash Media Device Graph theme={null}
        media-ctl -p -d /dev/media'x'
        ```

        <div className="flex flex-col items-center gap-2">
          <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Camera/images/check-media-device-graph.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e6ad0b7b921d0444ae235e510d760b1d" width="1075" height="362" data-path="Technologies/Camera/images/check-media-device-graph.png" />
        </div>
      </Step>

      <Step title="Find the sensor name">
        Run the following command to print the sensor name to the terminal:

        ```bash Find Sensor theme={null}
        # cat /sys/dev/char/81\:*/name | grep imx
        imx577 21-001a
        ```
      </Step>

      <Step title="Configure the media controller">
        The media controller utility (media-ctrl) is a [V4L2 utility](https://git.linuxtv.org/v4l-utils.git) used to configure camera subsystem subdevices. Use `media-ctl --help` to print usage information.

        <Note>
          Replace \[x] with the number found via :ref. \<Check the media node number>. For example, `# media-ctl -d /dev/media1 --reset`.
        </Note>

        1. Reset all links to inactive:
           ```bash Reset Links theme={null}
           # media-ctl -d /dev/media[x] --reset
           ```
        2. Configure the camera sensor format and resolution on pipeline nodes:
           ```bash Configure Sensor theme={null}
           # media-ctl -d /dev/media[x] -V '"imx577 21-001a":0[fmt:SRGGB10/ 4056x3040 field:none]'
           ```
        3. Configure CSIPHY with 4056x3040 resolution:
           ```bash Configure CSIPHY theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_csiphy1":1[fmt: SRGGB10/ 4056x3040]'
           ```
        4. Configure CSID with 4056x3040 resolution:
           ```bash Configure CSID theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_csid0":0[fmt:SRGGB10/4056x3040] '
           # media-ctl -d /dev/media[x] -V '"msm_csid0":1[fmt:SRGGB10/ 4056x3040]'
           ```
        5. Configure ISP with 3840x2160 resolution:
           ```bash Configure ISP theme={null}
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/ 4056x3040]'
           # media-ctl -d /dev/media[x] -V '"msm_vfe0_rdi0":1[fmt: SRGGB10/ 4056x3040]'
           ```
        6. Link the pipeline:
           ```bash Link Pipeline theme={null}
           # media-ctl -d /dev/media[x] -l '"msm_csiphy1":1->"msm_csid0":0[1]'
           # media-ctl -d /dev/media[x] -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
           ```
      </Step>

      <Step title="Capture images">
        The [Yavta test application](https://git.ideasonboard.org/yavta.git) validates the camera using the V4L2 interface. Run Yavta to capture images:

        ```bash Yavta Capture theme={null}
        # yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 --capture=5 --file='frame-#.raw'
        ```
      </Step>
    </Steps>

    ***

    ### V4L2 sample application — libcamera

    libcamera is an open-source software framework. It handles control of the V4L2 camera interface and exposes a native C++ API to upper layers. The applications and upper-level frameworks run based on the [libcamera framework](https://www.kernel.org/doc/html/v4.9/media/kapi/v4l2-core.html).

    See [libcamera architecture](https://libcamera.org/docs.html#libcamera-architecture) for more detail about the libcamera architecture.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/mGpYCfBsZaJSFIEo/Technologies/Camera/images/libcamera_framework.png?fit=max&auto=format&n=mGpYCfBsZaJSFIEo&q=85&s=c97752fbe4d6e6f45dad91f9f2f43d90" width="463" height="477" data-path="Technologies/Camera/images/libcamera_framework.png" />
    </div>

    libcamera is validated using the [cam utility](https://libcamera.org/getting-started.html#basic-testing-with-cam-utility).

    ### Capture raw frame data

    The following steps describe how to capture raw frame data with the camera utility app using the V4L2 interface.

    <Note>
      Connect the IMX577 MIPI camera sensor to the CAM1 slot of the IQx7181 device.
    </Note>

    <Note>
      libcamera is available by default as part of the image; no explicit installation is required.
    </Note>

    <Steps>
      <Step title="Verify the CAMSS module">
        The IMX412 and CAMSS modules are loaded by default. Verify the qcom\_camss and IMX412 modules are loaded by running the following lsmod commands:

        ```bash Verify Modules theme={null}
        # lsmod | grep qcom_camss
        # lsmod | grep imx412
        ```
      </Step>

      <Step title="Delete uncalibrated.yaml">
        ```bash Delete YAML theme={null}
        # rm -rf /usr/share/libcamera/ipa/simple/uncalibrated.yaml
        ```
      </Step>

      <Step title="Run the cam utility">
        ```bash Run cam Utility theme={null}
        # cam -c 1 --capture=10 --file='frame-#.raw'
        ```

        This runs the utility and captures 10 raw frames in the root directory and saves them into files.

        Check the console log messages for information about the resolution and format of the dumped images.

        ```text Log Output theme={null}
        Using camera /base/soc@0/cci@ac4b000/i2c-bus@1/camera@1a as cam0 [0:15:01.067615799] [2155] INFO Camera camera.cpp:945 configuring streams:
        (0) 4056x3040-SRGGB10_CSI2P
        cam0: Capture 10 frames
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## **USB camera**

Qualcomm Linux devices provide driver support for USB web cameras that adhere to the USB video class (UVC) standard. The UVC video driver exposes these cameras as V4L2 video devices, which can be accessed through the character device nodes such as /dev/videoX. See [USB camera configuration](https://dragonwingdocs.qualcomm.com/System/Interfaces/usb) for an USB camera usage. The sample application [gst-usb-single-camera-app](https://dragonwingdocs.qualcomm.com/Ubuntu/devices/iq9075-evk/peripherals-interfaces/USB#usb-camera) can be used for USB camera validation.

## **Network camera**

A network camera can be supported with the open source GStreamer plugin. Getting a camera stream from the network depends on the network protocols supported by the GStreamer plugin. Developers can use an open source GStreamer plugin (for example, rtspsrc) to handle camera streams from the network and create a pipeline as needed. See [rtspsrc](https://gstreamer.freedesktop.org/documentation/rtsp/rtspsrc.html?gi-language=c) for plugin details.

The sample application [gst-ai-multistream-inference](https://dragonwingdocs.qualcomm.com/Tools/Qualcomm-Device-Cloud/run-sample-applications) can also be used for network camera validation. See [Bring up Ethernet](https://dragonwingdocs.qualcomm.com/Technologies/Ethernet/bring-up-ethernet) for instructions on setting up an Ethernet network connection.

For developing a GStreamer application on the Qualcomm platform, see [Qualcomm Intelligent Multimedia SDK](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK).
