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!
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:
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
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