Character device 2026-11-05
A character device is a device interface accessed through a character-special device node. In the Linux model, the node's file metadata identifies character-device type and a represented device number; the device driver defines the supported read, write and control operations. The word character does not restrict the exchanged data to readable text.[ref]
Device file metadata in the Linux man-pages project. inode(7), file types and Device ID; mknod(2), S_IFCHR
A useful concrete example is
/dev/null. Data written to it are discarded, and a read returns zero bytes to indicate end of file. /dev/zero also discards writes but supplies zero-valued bytes on reads.[ref] These two interfaces have different behaviours even though both use character-special files.For an original byte-level trace, suppose an application successfully writes the three bytes
41 00 42 to /dev/null. A later read does not return those bytes: the interface is a data sink. A read requesting three bytes from /dev/zero, if completed without interruption, instead supplies 00 00 00. The embedded zero byte in the write and zero bytes in the read are ordinary binary values, not restrictions to a text alphabet.The familiar file descriptor operations provide a common access framework, but their meanings depend on the device. A video device node can offer format negotiation and buffer controls through Video4Linux; another character device may expose a stream. Character-device type alone does not promise ordinary-file storage, a particular message boundary or a useful seek operation.
The distinction from a block device concerns the interface category. A device node is the named file system object, while the character device is the interface it represents. Several nodes can identify the same represented interface, and a pathname's inode identity does not by itself identify a distinct physical peripheral.
Device node 2026-11-05
A device node is a special file system object through which a program accesses a device interface. In the Linux model, its inode records a device-special file type and a device number; the path supplies a name in the file-system namespace. Opening it supplies a file descriptor through which the applicable device driver handles operations. Device-special objects differ from ordinary files containing a stored byte sequence.[ref]
Device file metadata in the Linux man-pages project. inode(7), device ID and file types; mknod(2), DESCRIPTION
Two device identifiers must be distinguished. The metadata field
st_dev identifies the device containing the file system that holds the inode. For a character device or block device, st_rdev instead identifies the represented device. Its major and minor numbers belong to that represented-device identification. The inode's own number is a third identifier.[ref]Device file metadata in the Linux man-pages project. inode(7), Device where inode resides and Device ID; mknod(2), dev argument
For an original metadata example, stipulate that names
/dev/example-a and /dev/example-b reach different inodes numbered 42 and 43 in one file system. Both inodes have character-device type and represented-device numbers (240,7). They name the same device interface in this example despite being different named file-system objects. Different permissions on the nodes can still affect access. Their inode numbers alone do not identify two physical devices.A character device presents a driver-defined stream or control interface; it need not contain human-readable characters. A block device presents block-oriented storage access. The special-file type is part of the identification, so equal numerical major/minor pairs do not alone equate character and block interfaces. A video device node is a concrete Video4Linux example, whose supported functions must still be queried.
Creating a device-special file supplies a namespace entry and device identification; it does not manufacture hardware, load a guaranteed working driver or establish a supported data format. Conversely, a symbolic link pointing to a device node is an ordinary naming indirection: its target's special-file metadata determines the accessed interface.
V4L2 multi-planar API 2026-11-05
The V4L2 multi-planar API is the Video4Linux interface for describing video buffers whose data may occupy several image memory planes. A buffer acts as a container, while per-plane descriptors identify the relevant storage. This supports formats such as NV12M and NV21M without assuming that one plane immediately follows another.[ref]
Single- and multi-planar APIs in the Linux Kernel documentation. §1.26, discontiguous frame storage and interface extensions
A multi-planar interface and a multi-planar format are different choices. The interface can also carry supported single-planar formats when described through its structures; the reverse interface cannot describe a multi-planar format. Buffer-type names ending in
_MPLANE identify the multi-planar interface, rather than specifying a colour model or sampling ratio.[ref]Single- and multi-planar APIs in the Linux Kernel documentation. §1.26.1, API versus format; opening buffer-type description
A practical interpretation depends on the structure being read. In
v4l2_buffer, length means a number of plane-array elements under the multi-planar API. Inside a V4L2 plane descriptor, length instead means that plane's allocation size in bytes.[ref]For an original descriptor example, a frame with two planes has a container plane count of two and stipulated plane capacities4096 and2048 bytes. Treating the outer count as a two-byte storage capacity, or treating4096 as the number of plane descriptors, confuses quantities with different meanings. The sum6144 describes those declared capacities, not the number of active image bytes.
The negotiated pixel format still determines the component arrangement. Descriptors for two planes could represent a luma plane plus interleaved colour differences; they do not automatically mean one red plane and one green plane. Framebuffer stride, sample encoding and chroma sample location remain part of interpreting the image.
Video device node 2026-11-05
A video device node is a device node through which an application accesses a supported video or metadata interface in Video4Linux. A conventional path is
/dev/video0, but the name identifies a kernel interface rather than a persistent physical-camera identity. Device drivers register the interfaces, and applications open them to obtain file descriptors for the appropriate operations.[ref]A single hardware peripheral can expose several interfaces. Conversely, a path numbered zero can refer to different hardware after discovery order changes. The kernel documentation identifies
/dev/v4l/by-id/ and /dev/v4l/by-path/ links as alternatives for identifying devices independently of transient numbering.[ref]Opening devices and querying capabilities in the Linux Kernel video API documentation. §1.1.2, naming notes and example device links
For an original selection example, suppose cameras A and B are discovered in that order and receive paths
/dev/video0 and /dev/video1. On another boot B is discovered first, reversing those assignments. A configuration containing only /dev/video0 then selects a different camera while remaining a valid path. Identifying the intended hardware and querying the opened interface's capabilities addresses two separate questions.The returned file descriptor refers to an open instance; it is not the camera number. An application may receive descriptor 7 when opening
/dev/video0, and another application may also have a descriptor 7 referring to another object in its own descriptor table. File descriptors are local process handles, while the device path belongs to the file system namespace.Before interpreting data, query the interface with
VIDIOC_QUERYCAP and negotiate its supported pixel format. A video device node alone does not imply support for NV12M, a chosen image size or the V4L2 multi-planar API. The resulting image memory planes and video buffer payload must follow the actual negotiated interface.