From 0e6dfde1edde77c59542224ccefd4f9f038599fe Mon Sep 17 00:00:00 2001 From: "Bhargav Ram Pranav Mutyalapalli (Temp)" Date: Wed, 18 Jun 2025 17:08:59 +0530 Subject: [PATCH 1/2] Adding Camera RDI validation using YAVTA Test Scripts - Introduced automated test scripts for validating camera RDI dumps using YAVTA and media-ctl - Compatible with Qualcomm Yocto-based Linux systems - Includes run.sh for test execution and README_Camera.md for usage instructions :x --- .../suites/Multimedia/Camera/README_Camera.md | 85 +++++++++++++++++++ .../Camera/v4l2_camera_RDI_dump/run.sh | 75 ++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 Runner/suites/Multimedia/Camera/README_Camera.md create mode 100644 Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh diff --git a/Runner/suites/Multimedia/Camera/README_Camera.md b/Runner/suites/Multimedia/Camera/README_Camera.md new file mode 100644 index 00000000..782bea55 --- /dev/null +++ b/Runner/suites/Multimedia/Camera/README_Camera.md @@ -0,0 +1,85 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + +# Camera RDI dump validation using YAVTA App Test Scripts for Qualcomm Linux based platform (Yocto) + +## Overview + +Camera scripts automates the Camera RDI dump validation using YAVTA App on the Qualcomm Linux based platform running a Yocto-based Linux system.It utilizes yavta and media-ctl binaries which is publicly available +## Features + +- Camera RDI dump validation using YAVTA App +- Compatible with Yocto-based root filesystem + +## Prerequisites + +Ensure the following components are present in the target Yocto build: + +- `yavta and media-ctl` (available in /usr/bin/) +- To find the exact /dev/media node for our camss driver + # media-ctl -p -d /dev/media 'y' | grep camss ['y' has to be replaced with media0 or media1 eg: /dev/media0, /dev/media1] + Output will be # driver qcom-camss [for probed media] +- To find list avaliable device files + #v4l2-ctl --list-devices + Output will be # video0 video1 video2 ... +- /dev/video# linking to RDI port is dynamic not fixed , user need to identify the correct video device file(by trail and error) to use in yavta RDI dump command + 'y' has to be replaced eg: /dev/video0, /dev/video1 depending on RDI port configured.. + #yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video'y' --capture=5 --file='frame-#.bin' +- Write access to root filesystem (for environment setup) + mount -o rw,remount / + mount -o rw,remount /usr + +## Directory Structure + +```bash +Runner/ +├── suites/ +│ ├── Multimedia/ +│ │ ├── Camera/ +│ │ │ ├── v4l2_camera_RDI_dump +│ │ │ │ ├── run.sh +│ │ │ ├── README_Camera.md +│ │ │ │ +``` + +## Usage + +1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to any directory on the target device. + +2. Verify Transfer: Ensure that the repo have been successfully copied to any directory on the target device. + +3. Run Scripts: Navigate to the directory where these files are copied on the target device and execute the scripts as needed. + +Run a specific test using: +--- +Quick Example +``` +git clone +cd +scp -r Runner user@target_device_ip: +ssh user@target_device_ip +cd --> /var/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/ && chmod +x run.sh && ./run.sh +``` +Sample output: +``` +sh-5.2# cd /var/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/ +sh-5.2# ./run.sh +[INFO] 2025-01-09 13:45:22 - ----------------------------------------------------------------------------------------- +[INFO] 2025-01-09 13:45:22 - -------------------Starting v4l2_camera_RDI_dump Testcase---------------------------- +[INFO] 2025-01-09 13:45:22 - === Test Initialization === +[INFO] 2025-01-09 13:45:22 - Checking if dependency binary is available +[INFO] 2025-01-09 13:45:22 - -------------------Camera commands execution start---------------------------- +Device /dev/v4l-subdev0 opened. +Control 0x009f0903 set to 0, is 0 +Device /dev/v4l-subdev0 opened. +Control 0x009f0903 set to 9, is 9 +[PASS] 2025-01-09 13:45:23 - v4l2_camera_RDI_dump : Test Passed +[INFO] 2025-01-09 13:45:23 - -------------------Completed v4l2_camera_RDI_dump Testcase---------------------------- +``` +3. Results will be available in the `Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/` directory under each usecase folder. + +## Notes + +- The script does not take any arguments. +- It validates the presence of required libraries before executing tests. +- If any critical tool is missing, the script exits with an error message. \ No newline at end of file diff --git a/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh b/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh new file mode 100644 index 00000000..6da889c5 --- /dev/null +++ b/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh @@ -0,0 +1,75 @@ +#!/bin/sh + +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + +# --------- Robustly source init_env and functestlib.sh ---------- +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +INIT_ENV="" +SEARCH="$SCRIPT_DIR" +while [ "$SEARCH" != "/" ]; do + if [ -f "$SEARCH/init_env" ]; then + INIT_ENV="$SEARCH/init_env" + break + fi + SEARCH=$(dirname "$SEARCH") +done + +if [ -z "$INIT_ENV" ]; then + echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2 + exit 1 +fi + +if [ -z "$__INIT_ENV_LOADED" ]; then + # shellcheck disable=SC1090 + . "$INIT_ENV" +fi +# shellcheck disable=SC1090,SC1091 +. "$TOOLS/functestlib.sh" +# --------------------------------------------------------------- + +TESTNAME="v4l2_camera_RDI_dump" +test_path=$(find_test_case_by_name "$TESTNAME") +cd "$test_path" || exit 1 +# shellcheck disable=SC2034 +res_file="./$TESTNAME.res" + +log_info "-----------------------------------------------------------------------------------------" +log_info "-------------------Starting $TESTNAME Testcase----------------------------" +log_info "=== Test Initialization ===" + +log_info "Checking if dependency binary is available" +check_dependencies yavta +check_dependencies media-ctl + +log_info "-------------------Camera commands execution start----------------------------" +# Run the test +#adb wait-for-device root +mount -o rw,remount / +mount -o rw,remount /usr/ +media-ctl -d /dev/media0 --reset +yavta --no-query -w '0x009f0903 0' /dev/v4l-subdev0 +media-ctl -d /dev/media0 -V '"msm_tpg0":0[fmt:SRGGB10/1920x1080 field:none]' +media-ctl -d /dev/media0 -V '"msm_csid0":0[fmt:SRGGB10/1920x1080 field:none]' +media-ctl -d /dev/media0 -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/1920x1080 field:none]' +media-ctl -d /dev/media0 -l '"msm_tpg0":1->"msm_csid0":0[1]' +media-ctl -d /dev/media0 -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' + +#Removing previous logs in the device +rm -rf "${test_path}/Camera_RDI_Test.txt" +rm -rf "${test_path}/v4l2_camera_RDI_dump.res" +rm -rf "${test_path}/*.bin" + +yavta --no-query -w '0x009f0903 9' /dev/v4l-subdev0 +yavta -B capture-mplane -n 5 -f SRGGB10P -s 1920x1080 /dev/video1 --capture=10 --file='frame-#.bin' >> "${test_path}/Camera_RDI_Test.txt" + + +if grep -q "Captured 10 frames" "${test_path}/Camera_RDI_Test.txt"; then + log_pass "$TESTNAME : Test Passed" + echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" +else + log_fail "$TESTNAME : Test Failed" + echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" +fi + +log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file From fb24dbbb927e7acc2e02627598520afa63de5918 Mon Sep 17 00:00:00 2001 From: "Bhargav Ram Pranav Mutyalapalli (Temp)" Date: Thu, 19 Jun 2025 11:51:21 +0530 Subject: [PATCH 2/2] Adding YAVTA Test Scripts for Camera RDI dump validation - Introduced automated test scripts for validating camera RDI dumps using YAVTA and media-ctl - Compatible with Qualcomm Yocto-based Linux systems - Includes run.sh for test execution and README_Camera.md for usage instructions Signed-off-by: Bhargav Ram Pranav Mutyalapalli --- Runner/suites/Multimedia/Camera/README_Camera.md | 16 +++++++++++++--- .../Camera/v4l2_camera_RDI_dump/run.sh | 16 ++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Runner/suites/Multimedia/Camera/README_Camera.md b/Runner/suites/Multimedia/Camera/README_Camera.md index 782bea55..05c2dbfb 100644 --- a/Runner/suites/Multimedia/Camera/README_Camera.md +++ b/Runner/suites/Multimedia/Camera/README_Camera.md @@ -17,17 +17,27 @@ Ensure the following components are present in the target Yocto build: - `yavta and media-ctl` (available in /usr/bin/) - To find the exact /dev/media node for our camss driver - # media-ctl -p -d /dev/media 'y' | grep camss ['y' has to be replaced with media0 or media1 eg: /dev/media0, /dev/media1] + ``` + media-ctl -p -d /dev/media 'y' | grep camss ['y' has to be replaced with media0 or media1 eg: /dev/media0, /dev/media1] + Output will be # driver qcom-camss [for probed media] + ``` - To find list avaliable device files - #v4l2-ctl --list-devices + ``` + v4l2-ctl --list-devices + ``` Output will be # video0 video1 video2 ... - /dev/video# linking to RDI port is dynamic not fixed , user need to identify the correct video device file(by trail and error) to use in yavta RDI dump command + 'y' has to be replaced eg: /dev/video0, /dev/video1 depending on RDI port configured.. - #yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video'y' --capture=5 --file='frame-#.bin' + ``` + yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video'y' --capture=5 --file='frame-#.bin' + ``` - Write access to root filesystem (for environment setup) + ``` mount -o rw,remount / mount -o rw,remount /usr + ``` ## Directory Structure diff --git a/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh b/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh index 6da889c5..4d74d1bf 100644 --- a/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh +++ b/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/run.sh @@ -21,30 +21,24 @@ if [ -z "$INIT_ENV" ]; then fi if [ -z "$__INIT_ENV_LOADED" ]; then - # shellcheck disable=SC1090 . "$INIT_ENV" fi -# shellcheck disable=SC1090,SC1091 . "$TOOLS/functestlib.sh" # --------------------------------------------------------------- TESTNAME="v4l2_camera_RDI_dump" test_path=$(find_test_case_by_name "$TESTNAME") cd "$test_path" || exit 1 -# shellcheck disable=SC2034 -res_file="./$TESTNAME.res" log_info "-----------------------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" log_info "=== Test Initialization ===" log_info "Checking if dependency binary is available" -check_dependencies yavta -check_dependencies media-ctl +check_dependencies yavta media-ctl log_info "-------------------Camera commands execution start----------------------------" # Run the test -#adb wait-for-device root mount -o rw,remount / mount -o rw,remount /usr/ media-ctl -d /dev/media0 --reset @@ -56,9 +50,9 @@ media-ctl -d /dev/media0 -l '"msm_tpg0":1->"msm_csid0":0[1]' media-ctl -d /dev/media0 -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' #Removing previous logs in the device -rm -rf "${test_path}/Camera_RDI_Test.txt" -rm -rf "${test_path}/v4l2_camera_RDI_dump.res" -rm -rf "${test_path}/*.bin" +rm -rf "${test_path}"/Camera_RDI_Test.txt +rm -rf "${test_path}"/v4l2_camera_RDI_dump.res +rm -rf "${test_path}"/*.bin yavta --no-query -w '0x009f0903 9' /dev/v4l-subdev0 yavta -B capture-mplane -n 5 -f SRGGB10P -s 1920x1080 /dev/video1 --capture=10 --file='frame-#.bin' >> "${test_path}/Camera_RDI_Test.txt" @@ -66,10 +60,8 @@ yavta -B capture-mplane -n 5 -f SRGGB10P -s 1920x1080 /dev/video1 --capture=10 - if grep -q "Captured 10 frames" "${test_path}/Camera_RDI_Test.txt"; then log_pass "$TESTNAME : Test Passed" - echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" else log_fail "$TESTNAME : Test Failed" - echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" fi log_info "-------------------Completed $TESTNAME Testcase----------------------------" \ No newline at end of file