Skip to content

samples: drivers: video_uvc: add UVC webcam sample - #889

Open
JuhoEskeli-AlifSemi wants to merge 1 commit into
alifsemi:mainfrom
JuhoEskeli-AlifSemi:uvc_sample
Open

samples: drivers: video_uvc: add UVC webcam sample#889
JuhoEskeli-AlifSemi wants to merge 1 commit into
alifsemi:mainfrom
JuhoEskeli-AlifSemi:uvc_sample

Conversation

@JuhoEskeli-AlifSemi

@JuhoEskeli-AlifSemi JuhoEskeli-AlifSemi commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new Zephyr sample application for streaming camera frames as a USB Video Class (UVC) webcam from Alif boards. It adds all required configuration, overlays, and documentation to support E1C SK, B1 SK, and E8 DK boards with their respective camera pipelines and formats. The sample supports both uncompressed RGB565 and MJPEG streaming, depending on the board and camera configuration.

The most important changes are:

Sample Application Introduction and Documentation

  • Added a new sample application video_uvc with build system (CMakeLists.txt), configuration (Kconfig), and a comprehensive README.md describing supported boards, camera pipelines, build instructions, and usage details. [1] [2] [3]

Board-Specific Configuration and Overlays

  • Added board overlays and Kconfig fragments for E1C SK (alif_e1c_sk_ae1c1f4051920hh_rtss_he.overlay, alif_e1c_sk_ae1c1f4051920hh_rtss_he.conf) and B1 SK (alif_b1_sk_ab1c1f4m51820ph0_rtss_he.overlay, alif_b1_sk_ab1c1f4m51820ph0_rtss_he.conf) to configure the LP-CAM pipeline (OV5640 camera to RGB565 UVC) and allocate appropriate buffer pools. [1] [2] [3]

  • Added a detailed overlay and configuration for E8 DK (alif_e8_dk_ae822fa0e5597xx0_rtss_hp.conf) supporting MIPI CSI-2 sensors, ISP processing, and JPEG encoding for MJPEG streaming.

Memory and Buffer Management

  • Configured video buffer pool sizes and counts in .conf files to match the requirements of each board and camera pipeline, ensuring efficient streaming and avoiding sensor power-cycling. [1] [2]

Device Tree and Peripheral Setup

  • Overlays set up the required device tree nodes for camera, LP-CAM, ISP, JPEG encoder, USB, and GPIO/I2C peripherals, with careful attention to memory regions, pin control, and peripheral status. [1] [2] [3]

These changes provide a ready-to-use, board-agnostic UVC webcam sample for Alif platforms, with flexible sensor and pipeline selection at build time.

Add a sample that captures camera frames on an Alif board and streams
them to a host as a standard USB Video Class (UVC) webcam using the
in-tree UVC class (CONFIG_USBD_VIDEO_CLASS).

The pipeline and advertised format are selected at build time from the
devicetree of the target board:

- E1C SK / B1 SK: an OV5640 parallel camera on the LP-CAM bus, streamed
  as uncompressed RGB565 480x272.
- E8 DK (RTSS-HP): an ARX3A0, MT9M114 or OV5675 MIPI CSI-2
  camera through the ISP and the Hantro VC9000E hardware JPEG encoder,
  streamed as MJPEG. The sensor is chosen by the devicetree overlay
  (ARX3A0 560x560, MT9M114 1280x720, OV5675 1024x768).

The application configures the capture pipeline, binds the UVC device to
the frame source with uvc_set_video_dev(), and shuttles finished frames
into the UVC device with video_enqueue()/video_dequeue(); the host pulls
frames at its own pace, which throttles the capture loop. On the E8 each
captured NV12 frame is compressed by the hardware JPEG encoder before
being sent.

Signed-off-by: Juho Eskeli <juho.eskeli@alifsemi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant