MI LDC DEBUG SOP¶
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.00 | 2024.2.22 |
1. Introduction¶
This document aims to introduce how to perform preliminary investigation when encountering MI LDC-related issues, quickly locate problems, and what information needs to be provided to RD or FAE for analysis after determining it is a SGS SDK issue.
2. Correction Effect Abnormal¶
-
Dump input.
Use command
echo dumpinputtask <chnid> 1 1 <file_dump_path> > /proc/mi_modules/mi_ldc/mi_ldc0to save the input image and check if the input image is abnormal. -
Verify parameters.
When correction effect is not ideal, refer to
in Sigdoc. -
Verify CalibPloy_new.bin file.
LDC requires CalibPloy_new.bin generated by calibration. If this file does not match the lens, the correction effect may also be abnormal.
If there are no issues with the above, provide complete information to RD or FAE for analysis according to the handling method for Other Issues.
3. LDC Stuck¶
When LDC is stuck, frame drops and stream interruption generally occur, and the following logs are printed:
# Case 1: LDC processing thread stuck
[MI WRN] _MI_SYS_Pass_WorkerThreadTimeoutMonitor [mi_sys][5445]: mod23 dev0 pass1 infer timeout for 10 seconds
# Case 2: output task stuck
[MI WRN] MI_SYS_Pass_InternalMainWorkerThread [mi_sys][5941]: [ldc0_P1_MAIN]ROOT mod23 pass1 s64CurTimeInNS[1269250035151] s64TimeToSleepInNS[100000000] no wakeup event for more than 5 seconds!
[MI WRN] _MI_SYS_Pass_TryDequeueOutputTaskNoLock [mi_sys][6066]: [thread:ldc0_P1_MAIN] mod[23] dev[0] pass[1] chn[0] outputtask's fence is not finished more than 10160ms
[MI WRN] _MI_SYS_Pass_DebugDumpOutputTaskFence [mi_sys][367]: [0:c17ac600 c06a3e50] fence1
[MI WRN] _MI_SYS_Pass_DebugDumpOutputTaskFence [mi_sys][367]: [1:c17acb00 c06a3e70] fence2
# Case 3: input task stuck
[MI WRN] _MI_SYS_Pass_TryDequeueInputTaskNoLock [mi_sys][3261]: [thread:ldc0_P1_MAIN] mod[23] dev[0] pass[1] chn[0] inputtask's fence is not finished more than 10520ms
[MI WRN] _MI_SYS_Pass_DebugDumpInputTaskFence [mi_sys][350]: [0:c069e180 c06a3e40] fence1 pulseindex-1
[MI WRN] _MI_SYS_Pass_DebugDumpInputTaskFence [mi_sys][350]: [1:c069e240 c06a3e60] fence2 pulseindex-1
Please capture information for RD or FAE analysis according to the following scenarios and corresponding methods.
# Case 1: LDC processing thread stuck
cat /proc/kmsg; # It is recommended to open a new telnet to capture kmsg
echo show_threads > /proc/mi_modules/mi_sys/mi_sys0;
# Case 2: output task stuck
# Case 3: input task stuck
/customer/riux32_r 0x1038;
/customer/riux32_r 0x1b28;
/customer/riux32_r 0x1b29;
echo 7 > /proc/mi_modules/mi_ldc/debug_level;
find /proc/mi_modules/mi_*/mi_* | xargs cat; # Execute multiple times at intervals
4. CMDQ Timeout¶
When LDC encounters CMDQ Timeout, the following prints occur:
[CMDQ]cmdq(4) ERR: POLLNEQ_TIMEOUT (0x00008100)
[CMDQ]Cmd data = 0x2000 : 0x0000 : 0x0000 : 0xFFFE
[CMDQ]Cmd:WAIT, dbg:0, adr:000000, dat:0000, mask:fffe
[CMDQ]Wait command timeout. Trigger_Bus Bit [0] Event [LDC_FEYE_TRIG0]
Please follow the steps below to capture information for RD or FAE analysis.
-
Disable cmdq reset.
# Add "bEnableCmdqReset":false content to sys node vi /config/modparam.json; # Reboot sync; reboot; -
Re-run app, wait for problem to reproduce, preserve the scene.
Please capture complete serial port log and kmsg information from app start to problem reproduction.
-
Execute the following commands to capture information for RD or FAE analysis.
/customer/riux32_r 0x1038; /customer/riux32_r 0x1b28; /customer/riux32_r 0x1b29; find /proc/mi_modules/mi_ldc/mi_* | xargs cat;
5. Memory Overrun¶
If logs with similar prints and Name=LDC field appear, LDC has encountered memory overrun.
[MI WRN] MI_SYS_Mma_MmuCallback [mi_sys][365]: [MI_SYS_Mma_MmuCallback] Status=0x2, PhyAddr=0x41220000, ClientId=0x15,Name=LDC IsWrite=0
[MI WRN] MI_SYS_Mma_MmuCallback [mi_sys][365]: [MI_SYS_Mma_MmuCallback] Status=0x6, PhyAddr=0x413c0000, ClientId=0x15,Name=LDC IsWrite=1
Configure and capture information according to the following steps for RD or FAE analysis.
-
Enable mmu debug option.
# Add "debugMmu":1,"g_bEnableMiuProtect":0 content to sys node vi /config/modparam.json; # Reboot sync; reboot; -
Open mmu log switch and capture kmsg information.
# Enable mmu log echo debug_mmu debug_log 1 1 1 23 > /proc/mi_modules/mi_sys/mi_sys0; # Capture kmsg during app running, ensure logs with memory overrun are included cat /proc/kmsg;
6. Other Issues¶
For issues not documented in this document, please provide the following information to RD or FAE for analysis.
- Provide pipeline information and background information.
-
Capture logs. High probability issues can improve by increasing MI_LDC debug level for reproduction capture.
echo 7 > /proc/mi_modules/mi_ldc/debug_level; -
Capture register information.
/customer/riux32_r 0x1038; /customer/riux32_r 0x1b28; /customer/riux32_r 0x1b29; -
Capture LDC input, output, and algorithm bin.
echo dumpalgobin <chnid> all <file_dump_path> > /proc/mi_modules/mi_ldc/mi_ldc0 echo dumpinputtask <chnid> 1 1 <file_dump_path> > /proc/mi_modules/mi_ldc/mi_ldc0 echo dumpoutputtask <chnid> 1 1 <file_dump_path> > /proc/mi_modules/mi_ldc/mi_ldc0 -
Provide procfs of all modules in the pipeline.
find /proc/mi_modules/mi_*/mi_* | xargs cat