From 0408a26c145fe2188bdb86314b1f559044cba356 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 3 Feb 2012 18:51:04 +0100 Subject: Add script to debug incomplete frames --- tests/incomplete.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 tests/incomplete.sh diff --git a/tests/incomplete.sh b/tests/incomplete.sh new file mode 100755 index 0000000..5c80198 --- /dev/null +++ b/tests/incomplete.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +function pci { + PCILIB_PATH="/root/pcitool" + LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $* +} + +rm -f images.raw +touch images.raw + +echo "Starting the grabber" +pci --stop-dma +pci --start-dma dma1 +pci -g -o images.raw --run-time 1000000000 & +pid=$! + +usleep 1000000 + +for i in `seq 1 100000`; do + old_size=`ls -la images.raw | cut -d " " -f 5` + echo "Trigger $i" + pci --trigger + usleep 100000 + new_size=`ls -la images.raw | cut -d " " -f 5` + if [ $old_size -eq $new_size ]; then + sleep 2 + new_size=`ls -la images.raw | cut -d " " -f 5` + if [ $old_size -eq $new_size ]; then + echo "Incomplete frame..." + killall -SIGINT pci + break + fi + fi +done + +echo "Waiting grabber to finish" +wait $pid -- cgit v1.2.3