# How to fix camera video device node indices (/dev/videoX)?

**URL:** <https://genio-community.mediatek.com/t/how-to-fix-camera-video-device-node-indices-dev-videox/2835>\
**Category:** Yocto\
**Tags:** Question, Camera, Video, Genio-720, IoT-Yocto\
**Created:** [July 28, 2026, 2:36am UTC](https://genio-community.mediatek.com/t/how-to-fix-camera-video-device-node-indices-dev-videox/2835 "2026-07-28T02:36:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew.hess](https://yyz2.discourse-cdn.com/flex004/user_avatar/genio-community.mediatek.com/andrew.hess/32/74_2.png) [@andrew.hess](https://genio-community.mediatek.com/u/andrew.hess)\
**Post date:** [July 28, 2026, 2:36am UTC](https://genio-community.mediatek.com/t/how-to-fix-camera-video-device-node-indices-dev-videox/2835/1 "2026-07-28T02:36:51Z")

</div>

Hi there,

I’m working with the camera subsystem on the **IoT Yocto Genio-720 (MT8391)** platform and have a question regarding device node enumeration.

During registration, the **1a092000.camsv2** video stream registers a V4L2 video node (`/dev/videoX`). I have observed that the index (`X`) of these nodes is not guaranteed to be consistent across reboots.

In my use case, it is important that the `/dev/videoX` nodes remain **fixed and predictable** so that my pipeline can reference them reliably.

**Question:** Is there a recommended method to assign or lock these device nodes to fixed indices?

Any guidance or best practices would be greatly appreciated.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![andy.hsieh](https://yyz2.discourse-cdn.com/flex004/user_avatar/genio-community.mediatek.com/andy.hsieh/32/22_2.png) [@andy.hsieh](https://genio-community.mediatek.com/u/andy.hsieh)\
**Post date:** [July 29, 2026, 3:06am UTC](https://genio-community.mediatek.com/t/how-to-fix-camera-video-device-node-indices-dev-videox/2835/3 "2026-07-29T03:06:24Z")

</div>

Hi @andrew.hess ,

The V4L2 video device nodes (`/dev/videoX`) are created through the kernel API `video_register_device`. You can refer to the official Linux documentation for details:

> **[2.4. Video device' s internal representation — The Linux Kernel documentation](https://www.kernel.org/doc/html/v6.6/driver-api/media/v4l2-dev.html?highlight=video_register_device#c.video_register_device)**
>
> type of V4L2 device node

As described there, this API accepts an `nr` parameter that specifies the desired video device number (minor index). When `nr` is set to `-1` (the default), the framework automatically assigns the first free node, which is why the index may vary across reboots depending on registration order.

In the CAMSV driver, the video device is registered at the following location:

[https://gitlab.com/mediatek/aiot/bsp/linux/-/blob/mtk-v6.6/drivers/media/platform/mediatek/isp/isp\_6s/camsv/mtk\_camsv\_video.c?ref\_type=heads#L753](https://gitlab.com/mediatek/aiot/bsp/linux/-/blob/mtk-v6.6/drivers/media/platform/mediatek/isp/isp_6s/camsv/mtk_camsv_video.c?ref_type=heads#L753)

To lock the node to a fixed and predictable index, you may modify this call to pass an explicit value for `nr` instead of `-1`.

Please note: several other video devices on this platform are registered using the default “first free” mechanism (e.g., MDP, Video Codec, JPEG Codec, USB camera, etc.). Be aware that the `nr` argument acts as a **starting search index** rather than a hard requirement. If the index you hard-code is already occupied, the framework will **not fail** ; instead, it will silently fall through to the next available number. As a result, passing an explicit `nr` alone cannot fully guarantee a fixed node — it only raises the likelihood of landing on your preferred index.

Best regards,  
Andy Hsieh
