征程 6 VIO Frame 時(shí)間戳介紹
1. 時(shí)間類型
征程 6 內(nèi)部的時(shí)間類型如下
Linux 系統(tǒng)時(shí)間是基于 arm system counter 抽象的,Linux 的基于 arm system counter 抽象了很多種時(shí)間,圖中畫了兩種。CLOCK_MONOTONIC_RAW 是不會(huì)被時(shí)間同步調(diào)整的。
2. Frame 時(shí)間戳
從 VIO 側(cè)獲取的圖像數(shù)據(jù),帶有時(shí)間戳信息,相關(guān)信息如下:
typedef struct image_info_s {
uint16_t sensor_id; /
< sensor id */
** uint32_t pipeline_id; /**
< pipeline id */
uint32_t frame_id; /
< frame id */
** uint64_t time_stamp; /**
< HW time stamp */
struct timeval tv; /
< system time of hal get buf */
** int32_t buf_index; /**
< buffer index */
int32_t img_format; /
< image format */
** int32_t fd[HB_VIO_BUFFER_MAX_PLANES]; /**
< ion buf fd */
uint32_t size[HB_VIO_BUFFER_MAX_PLANES]; /
< buffer size per plane */
** uint32_t planeCount; /**
< image plane count */
uint32_t dynamic_flag; /
< dynamic flag */
** uint32_t water_mark_line; /**
< water mark line value */
VIO_DATA_TYPE_E data_type; /
< buffer data type */
** buffer_state_e state; /**
< buffer state */
uint64_t desc; /
< temp description for isp raw feedback */
** struct timeval trig_tv;/**
< system time of lpwm trigger */
} image_info_t;
time_stamp:代表收到第一行到達(dá)時(shí)刻,獲取的是 system count;
struct timeval tv: 代表收到第一行到達(dá)時(shí)刻,時(shí)間戳來(lái)源有 3 個(gè)地方, 分別代表 RTC 時(shí)戳,wall time,PHC 時(shí)戳,可通過(guò)/sys/devices/platform/soc/soc:globaltime/globaltime 配置;
struct timeval trig_tv: 同 tv,代表 LPWM trigger 時(shí)刻;
GLOBAL_TIME_RTC | 2 | 硬件寄存器鎖存 | Y |
GLOBAL_TIME_PHC | 1 | 依賴 FS ISR 軟件獲取 | Y |
GLOBAL_TIME_SYSTIME | 0 | 依賴 FS ISR 軟件獲取 | N |
RTC、PHC 是可以被時(shí)間同步調(diào)整的,直接調(diào)整的是硬件 counter。
○ RTC 時(shí)間獲?。篊IM 可以通過(guò)讀寄存器直接拿到 RTC 時(shí)間,不建議調(diào)用接口獲取 RTC 時(shí)間
■ RTC 精確到秒的時(shí)間:應(yīng)用層可以獲取
■ RTC 精確到納秒的時(shí)間:
□ 如果時(shí)間同步在同步 RTC,不允許其他應(yīng)用獲取 RTC 時(shí)間,因?yàn)楂@取 RTC 時(shí)間可能 導(dǎo)致 RTC 時(shí)間異常改變,這個(gè)是硬件限制。
□ 如果不做 RTC 的時(shí)間同步,應(yīng)用層可以獲取 RTC 時(shí)間
*博客內(nèi)容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀點(diǎn),如有侵權(quán)請(qǐng)聯(lián)系工作人員刪除。