diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index 0506bd9cb56..68e0d259c5f 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -1090,13 +1090,25 @@ namespace librealsense // attributes of md_mipi_depth_control structure auto md_prop_offset = offsetof(metadata_mipi_depth_raw, depth_mode); - // optical_timestamp contains value of exposure/2 - depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP, + // timestamp metadata field alignment with FW was implemented on FW version 5.17.0.0 + if ( _fw_version >= firmware_version( "5.17.0.0" ) ) + { + // optical_timestamp contains value of exposure/2 + depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP, make_rs400_sensor_ts_parser(make_uvc_header_parser(&platform::uvc_header::timestamp), make_attribute_parser(&md_mipi_depth_mode::optical_timestamp, md_mipi_depth_control_attributes::optical_timestamp_attribute, md_prop_offset))); + } + else // keep backward compatible with previous behavior + { + depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP, + make_attribute_parser(&md_mipi_depth_mode::hw_timestamp, + md_mipi_depth_control_attributes::hw_timestamp_attribute, + md_prop_offset)); + } + depth_sensor.register_metadata(RS2_FRAME_METADATA_ACTUAL_EXPOSURE, make_attribute_parser(&md_mipi_depth_mode::exposure_time, md_mipi_depth_control_attributes::exposure_time_attribute,