Plartform:ISP6s/ISP7/ISP7S/ISP7SP/ISP8
Key words:Cold Launch(冷启动)、Warm Launch(热启动)、Camera Switch(相机切换)、Mode Switch(模式切换)
本篇主要解释相机启动及切换的流程拆解。其中,App Delay部分耗时需要从Camera APP角度分析,Camera Delay部分耗时需要CameraHal平台部分分析。
-
- Camera launch(相机启动)
- Cold launch(冷启动)
- Breakdown Stage(阶段拆解)
- Cold launch(冷启动)
- Camera launch(相机启动)
-
-
-
- Stage Systrace Event
-
-
- Touch Up
- Activity Start
- Open → Open Done
- Configure Streams → Configure Streams Done
- Set Repeating Request
- 1st Frame out
Camera HAL:
Find the first " Cam:X:Usage:GPU_TEXTURE" (X could be any number, following example is 0) of ACbAdaptor:CbCo after "Set Repeating Request".
Camera Framework:
You also could find the "Stream X: first full buffer" (X could be any number, following example is 0), it is AOSP default systace tag to prove camera hal output first frame.
- 1st Frame Show on Panel
Surface View
Please find the first falling edge in SufaceView thread SufaceFlinger process after HAL/FWK output 1st frame.
Surface Texture
Normal Case:
Please find the first rising edge of SufaceTexture in camera APP process after HAL/FWK output 1st frame.
The rising edge means APP has received preview buffer from HAL/FWK, and the falling edge means APP has get buffer from SurfaceTexture and started to draw frame by RenderThread.
After "DrawFrame", please find the first falling edge in camera APP thread of SufaceFlinger process(Such as: com.mediatek.camera).
We can observe the frame in buffer and out buffer as follow
Sometimes, the pulse of 1st frame has twice height than 2nd frame and 3rd frame, that was because camera APP thread of SufaceFlinger process has receive 2 frames in that time, so it has to draw 2 frame, just focus on falling edge, do not care about the pulse height in SufaceFlinger.
After "falling edge", please find the first "onMessageReceived" in surfaceflinger thread of SufaceFlinger process.
-
-
- 2 Warm launch(热启动)
- Breakdown Stage(阶段拆解)
- 2 Warm launch(热启动)
-
Stage like 1.1 Cold launch
-
-
-
- Stage Systrace Event
-
-
Breakdown method like 1.1 Cold launch
-
- Camera switch
- Camera switch(相机切换)
- Breakdown Stage(阶段拆解)
- Camera switch(相机切换)
- Camera switch
-
-
-
- Stage Systrace Event
-
-
只补充该小节独有或不一样的部分,剩余部分参照1.1 Cold launch.
Only add the parts that are unique or different from this section. For the rest, see 1.1 Cold Launch
- Close → Close Done
- Open → Open Done
-
-
- Mode switch(模式切换)
- Breakdown Stage(阶段拆解)
- Mode switch(模式切换)
-
只补充该小节独有或不一样的部分,剩余部分参照1.1 Cold launch.
Only add the parts that are unique or different from this section; refer to 1.1 Cold Launch for the rest.
-
-
-
- Stage Systrace Event
-
-
- Abort Capture → Abort Capture Done