-
Notifications
You must be signed in to change notification settings - Fork 17
Adding Camera RDI validation using YAVTA Test Scripts #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# 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] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not coming properly in Markdown language. Can you check this once |
||
``` | ||
- 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 <this-repo> | ||
cd <this-repo> | ||
scp -r Runner user@target_device_ip:<Path in device> | ||
ssh user@target_device_ip | ||
cd <Path in device> --> /var/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/ && chmod +x run.sh && ./run.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not to use /var in the documentation. In place of /var use like #69 line. |
||
``` | ||
Sample output: | ||
``` | ||
sh-5.2# cd /var/Runner/suites/Multimedia/Camera/v4l2_camera_RDI_dump/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here also.. you can refactor this line |
||
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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/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 | ||
. "$INIT_ENV" | ||
fi | ||
. "$TOOLS/functestlib.sh" | ||
# --------------------------------------------------------------- | ||
|
||
TESTNAME="v4l2_camera_RDI_dump" | ||
test_path=$(find_test_case_by_name "$TESTNAME") | ||
cd "$test_path" || exit 1 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. res_file is not used anywhere in the script |
||
log_info "-----------------------------------------------------------------------------------------" | ||
log_info "-------------------Starting $TESTNAME Testcase----------------------------" | ||
log_info "=== Test Initialization ===" | ||
|
||
log_info "Checking if dependency binary is available" | ||
check_dependencies yavta media-ctl | ||
|
||
log_info "-------------------Camera commands execution start----------------------------" | ||
# Run the test | ||
mount -o rw,remount / | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by default it will be rw. any reason why remount is required? |
||
mount -o rw,remount /usr/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't see any operations are being performed under |
||
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]' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it is |
||
|
||
#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 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this working. |
||
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
||
if grep -q "Captured 10 frames" "${test_path}/Camera_RDI_Test.txt"; then | ||
log_pass "$TESTNAME : Test Passed" | ||
else | ||
log_fail "$TESTNAME : Test Failed" | ||
fi | ||
|
||
log_info "-------------------Completed $TESTNAME Testcase----------------------------" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make sure run.sh have executable permission (chmod 755 ) |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove comments for the Copyright. Also move this file under
v4l2_camera_RDI_dump
folder.