1. Enable Debug Logs
QIM SDK uses the standard GStreamer debug system. Pass--gst-debug=<level> to gst-launch-1.0, or set the GST_DEBUG environment variable for Python/C++ apps.
Debug Levels
Global Level
Per-Element Level
Override the global level for a specific plugin — useful for isolating one stage without drowning in output from everything else:Common Starting Points
Python / C++ Apps
Redirect to File
2. Measure Pipeline KPIs (Latency per Stage)
Use the built-in GStreamer latency tracer to get per-element mean/min/max processing time for every stage — no custom instrumentation required.Enable Tracing
Parse Results
Reading the Output
At 30 fps (33 ms budget per frame), the typical AI pipeline uses ~37% of the frame budget, leaving headroom for additional stages.
Measure FPS Live (On-Screen)
Addfpsdisplaysink in place of waylandsink to see FPS on the display in real time:
3. Measure Inference Performance
GST_TRACER (inferences/sec)
From the tracer output, calculate inferences/sec:mean = 5.71 ms → 1 / 0.00571 ≈ 175 inferences/sec
pidstat (CPU/Memory alongside inference)
%usr, %sys) and memory (RSS, VSZ) for the pipeline process.
4. Debug Performance Issues
Frame Drops
Frame drops manifest as:- Stuttering on the display
queueelements reporting overflows in debug logs (--gst-debug=4)- Tracer showing high
maxlatency on inference (stage_01_inference)
max-size-time=0 max-size-bytes=0 max-size-buffers=3 to queues around inference:
Slow Throughput
If end-to-end latency is higher than expected:- Run the latency tracer to find which stage is the bottleneck.
- Check if the inference delegate is correct — GPU delegate is much slower than HTP (NPU):
- Check model quantization — W8A8 (quantized) is significantly faster on the NPU than float32.
Memory Copies
Unnecessary buffer copies add latency. To detect them, enable memory tracing:capture-io-mode=4 output-io-mode=4 on decoder/encoder elements to enable zero-copy DMA buffer passing:
5. Trace Buffers
Buffer tracing lets you follow a specific buffer through the pipeline to diagnose where it is dropped, delayed, or corrupted.Enable Buffer Tracing
PTS (presentation timestamp), DTS, size, and which pad it passed through.
Check for PTS Discontinuities
If frames are out of order or the pipeline stalls, look for timestamp jumps:Use the Dot Graph (Pipeline Visualization)
Dump the pipeline as a.dot file to visually inspect element connections:
6. Debug Camera Issues
Common Errors
QMMF Recorder StartCamera Failed:gst-launch-1.0 invocation.
Enable Camera Server Debug Logs
Camera Not Detected
ISP Camera (Config #2 / qticamsrc)
To switch from libcamera (Config #1) toqticamsrc (Config #2), write "camx" to the EFI variable:
Verify Camera Stream is Running
7. Quick Diagnostic Checklist
Run this sequence when a pipeline doesn’t work:8. Report an Issue
When filing a bug or asking for help, include:- Platform — Device model (e.g. RB3 Gen 2), OS (Ubuntu / Qualcomm Linux), QIM SDK version
- Full pipeline command — the exact
gst-launch-1.0or Python script - Debug log — captured with
--gst-debug=5 2> debug.log - Tracer output — from
gst-stats-1.0if a performance issue - Error message — the exact error line from the log
- Expected vs actual behaviour

