Skip to content

Conversation

@smuppand
Copy link
Contributor

This PR modernizes the Libcamera_cam test suite for reliability and performance on constrained systems (BusyBox, limited RAM). It introduces a fast, grep-based DT gating, modular camera helpers, safer validation, and clear operator documentation.

What’s changed

  • DT search (perf & robustness)
  • Replace heavy find traversals with low-cost, boundary-aware scans over /proc/device-tree.
  • Print per-pattern matches in a stable, human-readable format.

Runner refactor

  • Keep run.sh minimal; source camera helpers from Runner/utils/camera/lib_camera.sh.
  • Support --index auto|all|CSV, per-camera PASS/FAIL, and an overall verdict.
  • Treat noise from cam -l/cam -I as non-fatal if sensors enumerate.

Docs

  • Add libcamera_test_README.md with usage, deps, options, artifacts, and troubleshooting.

- Replace heavy find-based traversal with low-cost grep scans over
  /proc/device-tree for both node names and compatible strings.
- Add boundary-aware matching:
  * node: ^<pattern>(@|$)
  * compatible: token-prefix with clear labeling of the hit.
- Print results as: "<pattern>: ./<relpath>[:<compatible>]" for readability.
- Avoid subshell state loss; fix quoting (SC2295) and expansion issues.
- Ensure portability to BusyBox grep/ash; no GNU-only flags.
- Greatly reduces latency and avoids OOM on constrained devices.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
- Add IPA fallback workaround (move simple/uncalibrated.yaml → .bk) to
  prevent buffer allocation failures.
- Make all checks BusyBox-friendly:
  * Drop GNU-only options (find -printf, od -A).
  * Use dd | tr | cut for sampling and lightweight uniqueness/entropy checks.
- Improve BIN/PPM validation:
  * Contiguous sequence check from cam log and files.
  * bytesused tolerance check and duplicate-frame bucketing.
  * Constant/near-constant frame heuristics (warn only).
- Noise-tolerant error scanning: suppress known benign WARN/ERROR lines
  from cam -l and cam -I; only fail on fatal terms after suppression.
- Sensor enumeration & index resolution helpers (auto/all/CSV).
- Hashing: prefer sha256sum, fall back to md5sum when missing.
- ShellCheck cleanups: direct command checks (no `$?`), no subshell
  mutation pitfalls, consistent quoting and logging.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
- Document prerequisites, known BusyBox constraints, and IPA workaround.
- Provide command-line options, examples (single/multi camera), and
  artifact layout.
- Include guidance for DT gating output, common libcamera WARN/ERROR
  messages, and how the runner interprets them (fatal vs informational).

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
- Source camera utils; keep main script small and readable.
- Fast DT gating: print per-pattern matches; skip only when none found.
- Treat cam -l/-I WARN/ERROR noise as non-fatal when cameras enumerate.
- Support indices: auto | all | comma-separated; per-camera PASS/FAIL
  with an overall verdict and summary file.
- Use --file correctly for directory or explicit filename targets.
- ShellCheck fixes (SC1090/SC2015): dynamic source directives and
  proper if/else usage.
- Add structured logging and stable, deterministic exit codes.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Copy link
Contributor

@abbajaj806 abbajaj806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abbajaj806 abbajaj806 merged commit 12577b9 into qualcomm-linux:main Oct 29, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants