Hi Jacopo, On 16/09/2020 16:55, Jacopo Mondi wrote: > Add script to capture from RDACM21 on Eagle V3-M. > > Signed-off-by: Jacopo Mondi <jacopo@xxxxxxxxxx> Can we make this generic in any way with-in gmsl-yavta.sh? Am I right in thinking only the frame size has changed in this script against the original? Perhaps can we read the configuration of the sensor and just propagate it forwards? -- Kieran > --- > gmsl-rdacm21-yavta.sh | 104 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 104 insertions(+) > create mode 100755 gmsl-rdacm21-yavta.sh > > diff --git a/gmsl-rdacm21-yavta.sh b/gmsl-rdacm21-yavta.sh > new file mode 100755 > index 0000000..36ba024 > --- /dev/null > +++ b/gmsl-rdacm21-yavta.sh > @@ -0,0 +1,104 @@ > +#!/bin/bash > + > +base=$(dirname $(readlink -f $0)) > + > +source $base/scripts/vin-tests.sh > +source $base/scripts/boards.sh > + > +mdev=$(mc_get_mdev) > + > +out=$base/output > +rm -fr $out > +mkdir $out > + > +function conf() { > + CSI="$1" > + IDX="$2" > + VIN="$3" > + > + media-ctl -d $mdev -V "'$CSI':$IDX [fmt:YUYV8_1X16/1280x1080 field:none]" > + mc_set_link "$CSI" $IDX "$VIN" 1 > +} > + > +function conf_gmsl() { > + set -x > + MAX9286="max9286 3-0048" > + > + for pad in `seq 0 3`; do > + media-ctl -d $mdev -V "'$MAX9286':$pad [fmt:YUYV8_1X16/1280x1080 field:none colorspace:srgb xfer:none ycbcr:601 quantization:full-range]" > + done > + > + set +x > +} > + > +function capture() { > + VID="$1" > + vid=$(eval echo \$$VID) > + echo $vid > + > + yavta -f YUYV -s 1280x1080 -c10 --skip 7 --file="$out/$VID-#.bin" /dev/$vid & > +} > + > +mc_reset > + > +# Need to configure all formats going through each MAX9286 > +conf1234=0 > +conf5678=0 > + > +for cam in "$@"; do > + case $cam in > + 1|2|3|4) > + if [[ $conf1234 -ne 1 ]]; then > + conf "$csi40name" 1 "$vinname0" > + conf "$csi40name" 2 "$vinname1" > + conf "$csi40name" 3 "$vinname2" > + conf "$csi40name" 4 "$vinname3" > + conf1234=1 > + fi > + ;; > + 5|6|7|8) > + if [[ $conf5678 -ne 1 ]]; then > + conf "$csi41name" 1 "$vinname4" > + conf "$csi41name" 2 "$vinname5" > + conf "$csi41name" 3 "$vinname6" > + conf "$csi41name" 4 "$vinname7" > + conf5678=1 > + fi > + ;; > + *) > + echo "Unrecognised camera $cam" > + ;; > + esac > +done > + > +conf_gmsl > + > +for cam in "$@" > +do > + echo "Capturing camera $cam" > + case $cam in > + 1) capture vin0 ;; > + 2) capture vin1 ;; > + 3) capture vin2 ;; > + 4) capture vin3 ;; > + > + 5) capture vin4 ;; > + 6) capture vin5 ;; > + 7) capture vin6 ;; > + 8) capture vin7 ;; > + > + *) > + echo "Unrecognised camera $cam" > + ;; > + esac > +done; > + > +wait > + > +for f in $out/*bin; do > + name=$(basename $f .bin) > + raw2rgbpnm -f YUYV -s 1280x1080 $out/$name.bin $out/$name.ppm > + convert $out/$name.ppm $out/$name.png > +done > + > +convert $out/vin*-000007.png -background white -append $out/collage.png > -- > 2.28.0 >