From ab3b394850d172ac217adcefb22f281614e1b891 Mon Sep 17 00:00:00 2001 From: nitinn Date: Sun, 7 Jun 2026 19:17:25 +0530 Subject: [PATCH 1/2] gstreamer: enhance helper utilities for camera tests Signed-off-by: nitinn --- Runner/utils/lib_gstreamer.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Runner/utils/lib_gstreamer.sh b/Runner/utils/lib_gstreamer.sh index 8796469a..d852bbf4 100755 --- a/Runner/utils/lib_gstreamer.sh +++ b/Runner/utils/lib_gstreamer.sh @@ -515,6 +515,9 @@ gstreamer_backend_evidence_sampled() { # -------------------- Single runner: gst-launch with timeout -------------------- # gstreamer_run_gstlaunch_timeout # Returns gst-launch rc. +# +# Sends SIGINT (not SIGTERM) to trigger proper EOS handling via -e flag. +# This ensures pipelines with muxers (mp4mux, etc.) can finalize output files. gstreamer_run_gstlaunch_timeout() { secs="$1" pipe="$2" @@ -525,16 +528,13 @@ gstreamer_run_gstlaunch_timeout() { gstreamer_print_cmd_multiline "$pipe" if [ "$secs" -gt 0 ] 2>/dev/null; then - if command -v audio_timeout_run >/dev/null 2>&1; then - # shellcheck disable=SC2086 - audio_timeout_run "${secs}s" "$GSTBIN" $GSTLAUNCHFLAGS $pipe - return $? - elif command -v timeout >/dev/null 2>&1; then + if command -v timeout >/dev/null 2>&1; then # shellcheck disable=SC2086 - timeout "$secs" "$GSTBIN" $GSTLAUNCHFLAGS $pipe + # Send SIGINT instead of SIGTERM to trigger EOS via -e flag + timeout --signal=INT "$secs" "$GSTBIN" $GSTLAUNCHFLAGS $pipe return $? else - log_warn "No timeout command available (audio_timeout_run or timeout), running without timeout" + log_warn "No timeout command available, running without timeout" fi fi @@ -675,6 +675,7 @@ gstreamer_check_errors() { if sed \ -e '/gst_video_info_dma_drm_to_caps: assertion .*drm_fourcc != DRM_FORMAT_INVALID/d' \ -e "/gst_structure_remove_field: assertion 'IS_MUTABLE (structure)' failed/d" \ + -e '/WARN.*udmabuf-allocator.*Udmabuf allocator not available.*can'\''t open \/dev\/udmabuf/d' \ "$logfile" >"$filtered_log" 2>/dev/null; then check_log="$filtered_log" fi @@ -770,6 +771,7 @@ gstreamer_validate_log() { if sed \ -e '/gst_video_info_dma_drm_to_caps: assertion .*drm_fourcc != DRM_FORMAT_INVALID/d' \ -e "/gst_structure_remove_field: assertion 'IS_MUTABLE (structure)' failed/d" \ + -e '/WARN.*udmabuf-allocator.*Udmabuf allocator not available.*can'\''t open \/dev\/udmabuf/d' \ "$logfile" >"$filtered_log" 2>/dev/null; then check_log="$filtered_log" fi @@ -1531,7 +1533,7 @@ camera_build_qtiqmmfsrc_snapshot_pipeline() { output_location="$5" max_files="${6:-2}" - printf '%s\n' "qtiqmmfsrc camera=${camera_id} name=camsrc ! capsfilter caps=\"video/x-raw,format=NV12,width=${width},height=${height},framerate=${framerate}/1\" ! jpegenc ! multifilesink location=\"${output_location}\ max-files=${max_files}" + printf '%s\n' "qtiqmmfsrc camera=${camera_id} name=camsrc ! capsfilter caps=\"video/x-raw,format=NV12,width=${width},height=${height},framerate=${framerate}/1\" ! jpegenc ! multifilesink location=\"${output_location}\" max-files=${max_files}" } # -------------------- libcamerasrc pipeline builders -------------------- @@ -1607,7 +1609,7 @@ camera_build_libcamera_snapshot_pipeline() { output_location="$3" max_files="${4:-5}" - printf '%s\n' "libcamerasrc name=camsrc src_1::stream-role=still-capture ! video/x-raw,width=${width},height=${height} ! videoconvert ! jpegenc ! multifilesink location=\"${output_location}\ max-files=${max_files}" + printf '%s\n' "libcamerasrc name=camsrc src_1::stream-role=still-capture ! video/x-raw,width=${width},height=${height} ! videoconvert ! jpegenc ! multifilesink location=\"${output_location}\" max-files=${max_files}" } # -------------------- Wayland/Weston setup helper -------------------- From 6cbc1a7f0dd5191c56a4853504a9b7de26a82431 Mon Sep 17 00:00:00 2001 From: nitinn Date: Sun, 7 Jun 2026 19:18:00 +0530 Subject: [PATCH 2/2] camera-tests: improve run.sh execution and validations wrt snapshots Signed-off-by: nitinn --- .../GSTreamer/Camera/Camera_Tests/run.sh | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Runner/suites/Multimedia/GSTreamer/Camera/Camera_Tests/run.sh b/Runner/suites/Multimedia/GSTreamer/Camera/Camera_Tests/run.sh index 598ec550..5da38175 100755 --- a/Runner/suites/Multimedia/GSTreamer/Camera/Camera_Tests/run.sh +++ b/Runner/suites/Multimedia/GSTreamer/Camera/Camera_Tests/run.sh @@ -789,23 +789,13 @@ export GST_DEBUG_FILE="$GST_LOG" # $1: testname # $2: pipeline # $3: output_file (optional, for encode tests) -# $4: restart_cam_server (optional, "yes" to restart cam-server before test - qtiqmmfsrc only) run_camera_test() { testname="$1" pipeline="$2" output_file="${3:-}" - restart_cam_server="${4:-no}" log_info "=========================================="; log_info "Running: $testname"; log_info "==========================================" - # Restart cam-server if requested (temporary workaround for qtiqmmfsrc only) - # libcamerasrc doesn't use cam-server, so this is skipped for libcamerasrc tests - if [ "$restart_cam_server" = "yes" ] && [ "$camera_source" = "qtiqmmfsrc" ]; then - log_info "Restarting cam-server..." - systemctl restart cam-server >/dev/null 2>&1 || log_warn "Failed to restart cam-server (may not be critical)" - sleep 1 - fi - test_log="$OUTDIR/${testname}.log" : >"$test_log" @@ -865,7 +855,7 @@ run_qtiqmmf_fakesink_test() { log_info "Format: $format_name" pipeline=$(camera_build_qtiqmmfsrc_fakesink_pipeline "$cameraId" "$format" 1280 720 "$framerate") - run_camera_test "$testname" "$pipeline" "" "yes" + run_camera_test "$testname" "$pipeline" } # qtiqmmfsrc Preview test @@ -887,7 +877,7 @@ run_qtiqmmf_preview_test() { log_info "Format: $format_name" pipeline=$(camera_build_qtiqmmfsrc_preview_pipeline "$cameraId" "$format" 3840 2160 "$framerate") - run_camera_test "$testname" "$pipeline" "" "yes" + run_camera_test "$testname" "$pipeline" } # qtiqmmfsrc Encode test @@ -915,7 +905,7 @@ run_qtiqmmf_encode_test() { log_info "Resolution: $resolution (${width}x${height})" pipeline=$(camera_build_qtiqmmfsrc_encode_pipeline "$cameraId" "$format" "$width" "$height" "$framerate" "$output_file") - run_camera_test "$testname" "$pipeline" "$output_file" "yes" + run_camera_test "$testname" "$pipeline" "$output_file" } # qtiqmmfsrc Snapshot test @@ -955,11 +945,6 @@ run_qtiqmmf_snapshot_test() { log_info "=========================================="; log_info "Running: $testname"; log_info "==========================================" - # Restart cam-server before snapshot test (qtiqmmfsrc only) - log_info "Restarting cam-server..." - systemctl restart cam-server >/dev/null 2>&1 || log_warn "Failed to restart cam-server (may not be critical)" - sleep 1 - test_log="$OUTDIR/${testname}.log" : >"$test_log"