/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to tests/debug/incomplete.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
function pci {
 
4
    PCILIB_PATH=`which pci`
 
5
    #LD_LIBRARY_PATH="$PCILIB_PATH" 
 
6
    $PCILIB_PATH/pci $*
 
7
}
 
8
 
 
9
rm -f images.raw
 
10
touch images.raw
 
11
 
 
12
echo "Starting the grabber"
 
13
pci --stop-dma
 
14
pci --start-dma dma1
 
15
pci -g -o images.raw --run-time 1000000000 &
 
16
pid=$!
 
17
 
 
18
usleep 1000000
 
19
 
 
20
for i in `seq 1 100000`; do
 
21
    old_size=`ls -la images.raw | cut -d " " -f 5`
 
22
    echo "Trigger $i"
 
23
    pci --trigger
 
24
    usleep 100000
 
25
    new_size=`ls -la images.raw | cut -d " " -f 5`
 
26
    if [ $old_size -eq $new_size ]; then
 
27
        sleep 2
 
28
        new_size=`ls -la images.raw | cut -d " " -f 5`
 
29
        if [ $old_size -eq $new_size ]; then
 
30
            echo "Incomplete frame..."
 
31
            killall -SIGINT pci
 
32
            break
 
33
        fi
 
34
    fi
 
35
done
 
36
 
 
37
echo "Waiting grabber to finish"
 
38
wait $pid