1e6a47023SSakari Ailus.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2e6a47023SSakari Ailus 3e6a47023SSakari Ailus.. _v4l2-meta-fmt-d4xx: 4e6a47023SSakari Ailus 5e6a47023SSakari Ailus******************************* 6e6a47023SSakari AilusV4L2_META_FMT_D4XX ('D4XX') 7e6a47023SSakari Ailus******************************* 8e6a47023SSakari Ailus 9e6a47023SSakari AilusIntel D4xx UVC Cameras Metadata 10e6a47023SSakari Ailus 11e6a47023SSakari Ailus 12e6a47023SSakari AilusDescription 13e6a47023SSakari Ailus=========== 14e6a47023SSakari Ailus 15e7f61113SDmitry PerchanovIntel D4xx (D435, D455 and others) cameras include per-frame metadata in their UVC 16e6a47023SSakari Ailuspayload headers, following the Microsoft(R) UVC extension proposal [1_]. That 17e6a47023SSakari Ailusmeans, that the private D4XX metadata, following the standard UVC header, is 18e6a47023SSakari Ailusorganised in blocks. D4XX cameras implement several standard block types, 19e6a47023SSakari Ailusproposed by Microsoft, and several proprietary ones. Supported standard metadata 20e6a47023SSakari Ailustypes are MetadataId_CaptureStats (ID 3), MetadataId_CameraExtrinsics (ID 4), 21e6a47023SSakari Ailusand MetadataId_CameraIntrinsics (ID 5). For their description see [1_]. This 22e6a47023SSakari Ailusdocument describes proprietary metadata types, used by D4xx cameras. 23e6a47023SSakari Ailus 24e6a47023SSakari AilusV4L2_META_FMT_D4XX buffers follow the metadata buffer layout of 25e6a47023SSakari AilusV4L2_META_FMT_UVC with the only difference, that it also includes proprietary 26e6a47023SSakari Ailuspayload header data. D4xx cameras use bulk transfers and only send one payload 27e6a47023SSakari Ailusper frame, therefore their headers cannot be larger than 255 bytes. 28e6a47023SSakari Ailus 29e7f61113SDmitry PerchanovThis document implements Intel Configuration version 3 [9_]. 30e7f61113SDmitry Perchanov 31e6a47023SSakari AilusBelow are proprietary Microsoft style metadata types, used by D4xx cameras, 32e6a47023SSakari Ailuswhere all fields are in little endian order: 33e6a47023SSakari Ailus 34e6a47023SSakari Ailus.. tabularcolumns:: |p{5.0cm}|p{12.5cm}| 35e6a47023SSakari Ailus 36e6a47023SSakari Ailus 37e6a47023SSakari Ailus.. flat-table:: D4xx metadata 38e6a47023SSakari Ailus :widths: 1 2 39e6a47023SSakari Ailus :header-rows: 1 40e6a47023SSakari Ailus :stub-columns: 0 41e6a47023SSakari Ailus 42e6a47023SSakari Ailus * - **Field** 43e6a47023SSakari Ailus - **Description** 44e6a47023SSakari Ailus * - :cspan:`1` *Depth Control* 45e6a47023SSakari Ailus * - __u32 ID 46e6a47023SSakari Ailus - 0x80000000 47e6a47023SSakari Ailus * - __u32 Size 48e7f61113SDmitry Perchanov - Size in bytes, include ID (all protocol versions: 60) 49e6a47023SSakari Ailus * - __u32 Version 50e7f61113SDmitry Perchanov - Version of this structure. The documentation herein covers versions 1, 51e7f61113SDmitry Perchanov 2 and 3. The version number will be incremented when new fields are 52e6a47023SSakari Ailus added. 53e6a47023SSakari Ailus * - __u32 Flags 54e6a47023SSakari Ailus - A bitmask of flags: see [2_] below 55e6a47023SSakari Ailus * - __u32 Gain 56e6a47023SSakari Ailus - Gain value in internal units, same as the V4L2_CID_GAIN control, used to 57e6a47023SSakari Ailus capture the frame 58e6a47023SSakari Ailus * - __u32 Exposure 59e6a47023SSakari Ailus - Exposure time (in microseconds) used to capture the frame 60e6a47023SSakari Ailus * - __u32 Laser power 61e6a47023SSakari Ailus - Power of the laser LED 0-360, used for depth measurement 62e6a47023SSakari Ailus * - __u32 AE mode 63e6a47023SSakari Ailus - 0: manual; 1: automatic exposure 64e6a47023SSakari Ailus * - __u32 Exposure priority 65e6a47023SSakari Ailus - Exposure priority value: 0 - constant frame rate 66e6a47023SSakari Ailus * - __u32 AE ROI left 67e6a47023SSakari Ailus - Left border of the AE Region of Interest (all ROI values are in pixels 68e6a47023SSakari Ailus and lie between 0 and maximum width or height respectively) 69e6a47023SSakari Ailus * - __u32 AE ROI right 70e6a47023SSakari Ailus - Right border of the AE Region of Interest 71e6a47023SSakari Ailus * - __u32 AE ROI top 72e6a47023SSakari Ailus - Top border of the AE Region of Interest 73e6a47023SSakari Ailus * - __u32 AE ROI bottom 74e6a47023SSakari Ailus - Bottom border of the AE Region of Interest 75e6a47023SSakari Ailus * - __u32 Preset 76e6a47023SSakari Ailus - Preset selector value, default: 0, unless changed by the user 77e7f61113SDmitry Perchanov * - __u8 Emitter mode (v3 only) (__u32 Laser mode for v1) [8_] 78e7f61113SDmitry Perchanov - 0: off, 1: on, same as __u32 Laser mode for v1 79e7f61113SDmitry Perchanov * - __u8 RFU byte (v3 only) 80e7f61113SDmitry Perchanov - Spare byte for future use 81e7f61113SDmitry Perchanov * - __u16 LED Power (v3 only) 82e7f61113SDmitry Perchanov - Led power value 0-360 (F416 SKU) 83e6a47023SSakari Ailus * - :cspan:`1` *Capture Timing* 84e6a47023SSakari Ailus * - __u32 ID 85e6a47023SSakari Ailus - 0x80000001 86e6a47023SSakari Ailus * - __u32 Size 87e7f61113SDmitry Perchanov - Size in bytes, include ID (all protocol versions: 40) 88e6a47023SSakari Ailus * - __u32 Version 89e6a47023SSakari Ailus - Version of this structure. The documentation herein corresponds to 90e6a47023SSakari Ailus version xxx. The version number will be incremented when new fields are 91e6a47023SSakari Ailus added. 92e6a47023SSakari Ailus * - __u32 Flags 93e6a47023SSakari Ailus - A bitmask of flags: see [3_] below 94e6a47023SSakari Ailus * - __u32 Frame counter 95e6a47023SSakari Ailus - Monotonically increasing counter 96e6a47023SSakari Ailus * - __u32 Optical time 97e6a47023SSakari Ailus - Time in microseconds from the beginning of a frame till its middle 98e6a47023SSakari Ailus * - __u32 Readout time 99e6a47023SSakari Ailus - Time, used to read out a frame in microseconds 100e6a47023SSakari Ailus * - __u32 Exposure time 101e6a47023SSakari Ailus - Frame exposure time in microseconds 102e6a47023SSakari Ailus * - __u32 Frame interval 103e6a47023SSakari Ailus - In microseconds = 1000000 / framerate 104e6a47023SSakari Ailus * - __u32 Pipe latency 105e6a47023SSakari Ailus - Time in microseconds from start of frame to data in USB buffer 106e6a47023SSakari Ailus * - :cspan:`1` *Configuration* 107e6a47023SSakari Ailus * - __u32 ID 108e6a47023SSakari Ailus - 0x80000002 109e6a47023SSakari Ailus * - __u32 Size 110e7f61113SDmitry Perchanov - Size in bytes, include ID (v1:36, v3:40) 111e6a47023SSakari Ailus * - __u32 Version 112e6a47023SSakari Ailus - Version of this structure. The documentation herein corresponds to 113e6a47023SSakari Ailus version xxx. The version number will be incremented when new fields are 114e6a47023SSakari Ailus added. 115e6a47023SSakari Ailus * - __u32 Flags 116e6a47023SSakari Ailus - A bitmask of flags: see [4_] below 117e6a47023SSakari Ailus * - __u8 Hardware type 118e6a47023SSakari Ailus - Camera hardware version [5_] 119e6a47023SSakari Ailus * - __u8 SKU ID 120e6a47023SSakari Ailus - Camera hardware configuration [6_] 121e6a47023SSakari Ailus * - __u32 Cookie 122e6a47023SSakari Ailus - Internal synchronisation 123e6a47023SSakari Ailus * - __u16 Format 124e6a47023SSakari Ailus - Image format code [7_] 125e6a47023SSakari Ailus * - __u16 Width 126e6a47023SSakari Ailus - Width in pixels 127e6a47023SSakari Ailus * - __u16 Height 128e6a47023SSakari Ailus - Height in pixels 129e6a47023SSakari Ailus * - __u16 Framerate 130e6a47023SSakari Ailus - Requested frame rate per second 131e6a47023SSakari Ailus * - __u16 Trigger 132e6a47023SSakari Ailus - Byte 0: bit 0: depth and RGB are synchronised, bit 1: external trigger 133e7f61113SDmitry Perchanov * - __u16 Calibration count (v3 only) 134e7f61113SDmitry Perchanov - Calibration counter, see [4_] below 135e7f61113SDmitry Perchanov * - __u8 GPIO input data (v3 only) 136e7f61113SDmitry Perchanov - GPIO readout, see [4_] below (Supported from FW 5.12.7.0) 137e7f61113SDmitry Perchanov * - __u32 Sub-preset info (v3 only) 138e7f61113SDmitry Perchanov - Sub-preset choice information, see [4_] below 139e7f61113SDmitry Perchanov * - __u8 reserved (v3 only) 140e7f61113SDmitry Perchanov - RFU byte. 141e6a47023SSakari Ailus 142e6a47023SSakari Ailus.. _1: 143e6a47023SSakari Ailus 144e6a47023SSakari Ailus[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5 145e6a47023SSakari Ailus 146e6a47023SSakari Ailus.. _2: 147e6a47023SSakari Ailus 148e6a47023SSakari Ailus[2] Depth Control flags specify which fields are valid: :: 149e6a47023SSakari Ailus 150e6a47023SSakari Ailus 0x00000001 Gain 151e6a47023SSakari Ailus 0x00000002 Exposure 152e6a47023SSakari Ailus 0x00000004 Laser power 153e6a47023SSakari Ailus 0x00000008 AE mode 154e6a47023SSakari Ailus 0x00000010 Exposure priority 155e6a47023SSakari Ailus 0x00000020 AE ROI 156e6a47023SSakari Ailus 0x00000040 Preset 157e7f61113SDmitry Perchanov 0x00000080 Emitter mode 158e7f61113SDmitry Perchanov 0x00000100 LED Power 159e6a47023SSakari Ailus 160e6a47023SSakari Ailus.. _3: 161e6a47023SSakari Ailus 162e6a47023SSakari Ailus[3] Capture Timing flags specify which fields are valid: :: 163e6a47023SSakari Ailus 164e6a47023SSakari Ailus 0x00000001 Frame counter 165e6a47023SSakari Ailus 0x00000002 Optical time 166e6a47023SSakari Ailus 0x00000004 Readout time 167e6a47023SSakari Ailus 0x00000008 Exposure time 168e6a47023SSakari Ailus 0x00000010 Frame interval 169e6a47023SSakari Ailus 0x00000020 Pipe latency 170e6a47023SSakari Ailus 171e6a47023SSakari Ailus.. _4: 172e6a47023SSakari Ailus 173e6a47023SSakari Ailus[4] Configuration flags specify which fields are valid: :: 174e6a47023SSakari Ailus 175e6a47023SSakari Ailus 0x00000001 Hardware type 176e6a47023SSakari Ailus 0x00000002 SKU ID 177e6a47023SSakari Ailus 0x00000004 Cookie 178e6a47023SSakari Ailus 0x00000008 Format 179e6a47023SSakari Ailus 0x00000010 Width 180e6a47023SSakari Ailus 0x00000020 Height 181e6a47023SSakari Ailus 0x00000040 Framerate 182e6a47023SSakari Ailus 0x00000080 Trigger 183e6a47023SSakari Ailus 0x00000100 Cal count 184e7f61113SDmitry Perchanov 0x00000200 GPIO Input Data 185e7f61113SDmitry Perchanov 0x00000400 Sub-preset Info 186e6a47023SSakari Ailus 187e6a47023SSakari Ailus.. _5: 188e6a47023SSakari Ailus 189e6a47023SSakari Ailus[5] Camera model: :: 190e6a47023SSakari Ailus 191e6a47023SSakari Ailus 0 DS5 192e6a47023SSakari Ailus 1 IVCAM2 193e6a47023SSakari Ailus 194e6a47023SSakari Ailus.. _6: 195e6a47023SSakari Ailus 196e6a47023SSakari Ailus[6] 8-bit camera hardware configuration bitfield: :: 197e6a47023SSakari Ailus 198e6a47023SSakari Ailus [1:0] depthCamera 199e6a47023SSakari Ailus 00: no depth 200e6a47023SSakari Ailus 01: standard depth 201e6a47023SSakari Ailus 10: wide depth 202e6a47023SSakari Ailus 11: reserved 203e6a47023SSakari Ailus [2] depthIsActive - has a laser projector 204e6a47023SSakari Ailus [3] RGB presence 205e6a47023SSakari Ailus [4] Inertial Measurement Unit (IMU) presence 206e6a47023SSakari Ailus [5] projectorType 207e6a47023SSakari Ailus 0: HPTG 208e6a47023SSakari Ailus 1: Princeton 209e6a47023SSakari Ailus [6] 0: a projector, 1: an LED 210e6a47023SSakari Ailus [7] reserved 211e6a47023SSakari Ailus 212e6a47023SSakari Ailus.. _7: 213e6a47023SSakari Ailus 214e6a47023SSakari Ailus[7] Image format codes per video streaming interface: 215e6a47023SSakari Ailus 216e6a47023SSakari AilusDepth: :: 217e6a47023SSakari Ailus 218e6a47023SSakari Ailus 1 Z16 219e6a47023SSakari Ailus 2 Z 220e6a47023SSakari Ailus 221e6a47023SSakari AilusLeft sensor: :: 222e6a47023SSakari Ailus 223e6a47023SSakari Ailus 1 Y8 224e6a47023SSakari Ailus 2 UYVY 225e6a47023SSakari Ailus 3 R8L8 226e6a47023SSakari Ailus 4 Calibration 227e6a47023SSakari Ailus 5 W10 228e6a47023SSakari Ailus 229e6a47023SSakari AilusFish Eye sensor: :: 230e6a47023SSakari Ailus 231e6a47023SSakari Ailus 1 RAW8 232e7f61113SDmitry Perchanov 233e7f61113SDmitry Perchanov.. _8: 234e7f61113SDmitry Perchanov 235e7f61113SDmitry Perchanov[8] The "Laser mode" has been replaced in version 3 by three different fields. 236e7f61113SDmitry Perchanov"Laser" has been renamed to "Emitter" as there are multiple technologies for 237e7f61113SDmitry Perchanovcamera projectors. As we have another field for "Laser Power" we introduced 238e7f61113SDmitry Perchanov"LED Power" for extra emitter. 239e7f61113SDmitry Perchanov 240*d56b699dSBjorn HelgaasThe "Laser mode" __u32 fields has been split into: :: 241e7f61113SDmitry Perchanov 1 __u8 Emitter mode 242e7f61113SDmitry Perchanov 2 __u8 RFU byte 243e7f61113SDmitry Perchanov 3 __u16 LED Power 244e7f61113SDmitry Perchanov 245e7f61113SDmitry PerchanovThis is a change between versions 1 and 3. All versions 1, 2 and 3 are backward 246e7f61113SDmitry Perchanovcompatible with the same data format and they are supported. See [2_] for which 247e7f61113SDmitry Perchanovattributes are valid. 248e7f61113SDmitry Perchanov 249e7f61113SDmitry Perchanov.. _9: 250e7f61113SDmitry Perchanov 251e7f61113SDmitry Perchanov[9] LibRealSense SDK metadata source: 252e7f61113SDmitry Perchanovhttps://github.com/IntelRealSense/librealsense/blob/master/src/metadata.h 253