Commit ecfef02e authored by Dafna Hirschfeld's avatar Dafna Hirschfeld

adding all new sh files

parent 976eeadf
mkdir /configfs/vimc/mdev
mkdir /configfs/vimc/mdev/vimc-debayer:deb
mkdir /configfs/vimc/mdev/vimc-debayer:deb/pad:source:0/first
ln -s /configfs/vimc/mdev/vimc-debayer:deb/pad:sink:1 /configfs/vimc/mdev/vimc-debayer:deb/pad:source:0/first
tree /configfs/vimc/
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Find device number in /sys/bus/usb/drivers/drivername
# Edit this file to update the driver numer and name
# Example test for uvcvideo driver
#i=0
# while :; do
# i=$((i+1))
# echo 1-5:1.0 > /sys/bus/usb/drivers/uvcvideo/unbind;
# echo 1-5:1.0 > /sys/bus/usb/drivers/uvcvideo/bind;
# clear
# echo $i
#done
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Find device number in /sys/bus/usb/drivers/drivername
# Edit this file to update the driver numer and name
# Example test for uvcvideo driver
function bind_unbind_vimc {
i=0
while :; do
i=$((i+1))
echo vimc.0 > /sys/bus/platform/drivers/vimc/unbind;
echo vimc.0 > /sys/bus/platform/drivers/vimc/bind;
sleep 3
#clear
#echo $i
done
}
bind_unbind_vimc
#./media_device_test -d /dev/media0 &
while [ 1 ]; do
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video0 2>/dev/null
done
#inotifywait -e create /dev |
#while read path action file; do
# if [[ "$file" =~ media.* ]]; then # Does the file end with .xml?
# echo "media file" # If so, do your thing here!
# fi
#dlink Debayer A from Scaler
#media-ctl -d platform:vimc -l "5:1->21:0[0]"
#link RGB/YUV to Scaler
#media-ctl -d platform:vimc -l "19:0->21:0[1]"
# v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video0
#echo $file
#done
while [ 1 ]; do
v4l2-ctl --list-ctrls -d /dev/v4l-subdev0 2>/dev/null
done
#!/bin/bash
#echo 15 > /proc/sys/kernel/printk
echo "file drivers/media/platform/vimc/* +p" > /sys/kernel/debug/dynamic_debug/control
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81
#v4l2-ctl --stream-mmap --stream-count=10 -d0
#!/bin/bash
source ./functions.sh
while true
do
./unit-tests.sh $(( ( RANDOM % 15 ) + 1 )) &
sleep $(( ( RANDOM % 3 ) + 1 ))
done
#!/bin/bash
modprobe vimc
gcc v4l-open.c -o v4l-open
for ((i=1;i<=1000000000000000;i++));
do
for ((j=0;j<=5;j++));
do
./v4l-open /dev/v4l-subdev$j > /dev/null 2>&1 &
done
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind &
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/bind &
done
#!/bin/bash
# Display commands and their arguments as they are executed.
set -x
function reinstall_vimc {
rmdir /configfs/vimc/mdev/entities/*
rmdir /configfs/vimc/mdev/links/*
rmdir /configfs/vimc/mdev
modprobe -vr vimc
umount /configfs
modprobe -v vimc
mount -t configfs none /configfs
# This produce to much debugs when streaming on debayer and scaler
# echo "file drivers/media/platform/vimc/* +p" > /sys/kernel/debug/dynamic_debug/control
# echo "file drivers/media/mc/* +p" > /sys/kernel/debug/dynamic_debug/control
}
# we set all links to be enabled and immutable
# therefore, when streaming we should make sure that
# so, if trying to stream the sensor capture, we should
# still make sure that also the formats in all other links match
VIDSCA=/dev/video2
VIDSEN=/dev/video1
VIDDEB=/dev/video0
STRM_CNT=10
# generates the v4l-ctl streaming output "<<<<<<" ...
STRM_OUT=$(printf '<%.0s' `seq $STRM_CNT`)
function simple_topo {
# Creating the entities
mkdir "/configfs/vimc/mdev"
mkdir "/configfs/vimc/mdev/entities/vimc-sensor:sen"
mkdir "/configfs/vimc/mdev/entities/vimc-debayer:deb"
mkdir "/configfs/vimc/mdev/entities/vimc-scaler:sca"
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-sca" #/dev/video2
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-sen" #/dev/video1
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-deb" #/dev/video0
# Creating the links
mkdir "/configfs/vimc/mdev/links/sen:0->deb:0"
# 1 = enable, 2=immutable, 1|2=3
echo 3 > "/configfs/vimc/mdev/links/sen:0->deb:0/flags"
mkdir "/configfs/vimc/mdev/links/deb:1->sca:0"
echo 3 > "/configfs/vimc/mdev/links/deb:1->sca:0/flags"
mkdir "/configfs/vimc/mdev/links/sen:0->cap-sen:0"
echo 3 > "/configfs/vimc/mdev/links/sen:0->cap-sen:0/flags"
mkdir "/configfs/vimc/mdev/links/deb:1->cap-deb:0"
echo 3 > "/configfs/vimc/mdev/links/deb:1->cap-deb:0/flags"
mkdir "/configfs/vimc/mdev/links/sca:1->cap-sca:0"
echo 3 > "/configfs/vimc/mdev/links/sca:1->cap-sca:0/flags"
}
function configure_all_formats {
media-ctl -d platform:vimc -V '"sen":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"deb":0[fmt:SBGGR8_1X8/640x480]'
# This is actually the default and the only supported format for deb:1
# see `v4l2-ctl -d /dev/v4l-subdev1 --list-subdev-mbus 1`
media-ctl -d platform:vimc -V '"deb":1[fmt:RGB888_1X24/640x480]'
media-ctl -d platform:vimc -V '"sca":0[fmt:RGB888_1X24/640x480]'
media-ctl -d platform:vimc -V '"sca":1[fmt:RGB888_1X24/640x480]'
v4l2-ctl -z platform:vimc -d "cap-sen" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "cap-deb" -v pixelformat=RGB3
#The scaler scales times 3, so need to set its capture accordingly
v4l2-ctl -z platform:vimc -d "cap-sca" -v pixelformat=RGB3,width=1920,height=1440
}
echo 15 > /proc/sys/kernel/printk
test_idx=1
echo "===================================================================================="
echo "Test $test_idx: make sure that the deivce can be plugged and all captures can stream"
echo "===================================================================================="
((test_idx++))
reinstall_vimc
simple_topo || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
configure_all_formats
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSEN 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sen failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDDEB 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming deb failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSCA 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sca failed"; exit; fi
echo "=========================================================================="
echo "Test $test_idx: remove the scaler and see that the device can't be plugged"
echo "=========================================================================="
((test_idx++))
reinstall_vimc
simple_topo || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
rmdir "/configfs/vimc/mdev/entities/vimc-sensor:sen" || exit 1
echo 1 > /configfs/vimc/mdev/hotplug && exit 1
echo "=========================================================================="
echo "Test $test_idx: remove the scaler and the two links [debayer -> scaler],[scaler->vimc-cpature]"
echo "and make sure that the cap-sca can't be streamed and that the the other captures can"
echo "=========================================================================="
((test_idx++))
reinstall_vimc
simple_topo || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
rmdir "/configfs/vimc/mdev/entities/vimc-scaler:sca" || exit 1
rmdir "/configfs/vimc/mdev/links/deb:1->sca:0" || exit 1
rmdir "/configfs/vimc/mdev/links/sca:1->cap-sca:0" || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
configure_all_formats
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSEN 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sen failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDDEB 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming deb failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSCA 2>&1)
if [ "$out" == $STRM_OUT ]; then echo "streaming sca DID NOT fail (it should have)"; exit; fi
echo "=========================================================================="
echo "Test $test_idx: remove the scaler and create it again and make sure the device can be plugged and stream"
echo "=========================================================================="
((test_idx++))
reinstall_vimc
simple_topo || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
rmdir "/configfs/vimc/mdev/entities/vimc-scaler:sca" || exit 1
echo 1 > /configfs/vimc/mdev/hotplug && exit 1
mkdir "/configfs/vimc/mdev/entities/vimc-scaler:sca" || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
configure_all_formats
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSEN 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sen failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDDEB 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming deb failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSCA 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sca failed"; exit; fi
echo "=========================================================================="
echo "Test $test_idx: remove the scaler and the scaler's capture and any link they particpate. Make"
echo "sure that the device can be plug, and the capture nodes of the sensor and the debayer can be streamed."
echo "=========================================================================="
((test_idx++))
reinstall_vimc
simple_topo || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
rmdir "/configfs/vimc/mdev/entities/vimc-scaler:sca" || exit 1
rmdir "/configfs/vimc/mdev/links/deb:1->sca:0" || exit 1
rmdir "/configfs/vimc/mdev/entities/vimc-capture:cap-sca" || exit 1
rmdir "/configfs/vimc/mdev/links/sca:1->cap-sca:0" || exit 1
echo 1 > /configfs/vimc/mdev/hotplug || exit 1
configure_all_formats
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSEN 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming sen failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDDEB 2>&1)
if [ "$out" != $STRM_OUT ]; then echo "streaming deb failed"; exit; fi
out=$(v4l2-ctl --stream-mmap --stream-count=$STRM_CNT -d $VIDSCA 2>&1)
if [ "$out" == $STRM_OUT ]; then echo "streaming sca DID NOT fail (it should have)"; exit; fi
# Creating the entities
mkdir "/configfs/vimc/mdev"
mkdir "/configfs/vimc/mdev/vimc-sensor:sen"
mkdir "/configfs/vimc/mdev/vimc-debayer:deb"
mkdir "/configfs/vimc/mdev/vimc-scaler:sca"
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sca" #/dev/video2
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sen" #/dev/video1
mkdir "/configfs/vimc/mdev/vimc-capture:cap-deb" #/dev/video0
# Creating the links
#sen -> deb
mkdir "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-deb"
ln -s "/configfs/vimc/mdev/vimc-debayer:deb/sink:0" "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-deb"
echo immutable > "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-deb/type"
#deb -> sca
mkdir "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-sca"
ln -s "/configfs/vimc/mdev/vimc-scaler:sca/sink:0" "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-sca"
echo immutable > "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-sca/type"
#sca -> cap-sca
mkdir "/configfs/vimc/mdev/vimc-scaler:sca/source:1/to-cap-sca"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-sca/sink:0" "/configfs/vimc/mdev/vimc-scaler:sca/source:1/to-cap-sca"
echo immutable > "/configfs/vimc/mdev/vimc-scaler:sca/source:1/to-cap-sca/type"
#sen -> cap-sen
mkdir "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-cap-sen"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-sen/sink:0" "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-cap-sen"
echo immutable > "/configfs/vimc/mdev/vimc-sensor:sen/source:0/to-cap-sen/type"
#deb -> cap-deb
mkdir "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-cap-deb"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-deb/sink:0" "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-cap-deb"
echo immutable > "/configfs/vimc/mdev/vimc-debayer:deb/source:1/to-cap-deb/type"
# Creating the entities
mkdir "/configfs/vimc/mdev"
mkdir "/configfs/vimc/mdev/entities/vimc-sensor:sen"
mkdir "/configfs/vimc/mdev/entities/vimc-debayer:deb"
mkdir "/configfs/vimc/mdev/entities/vimc-scaler:sca"
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-sca" #/dev/video2
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-sen" #/dev/video1
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap-deb" #/dev/video0
# Creating the links
mkdir "/configfs/vimc/mdev/links/sen:0->deb:0"
mkdir "/configfs/vimc/mdev/links/deb:1->sca:0"
mkdir "/configfs/vimc/mdev/links/sen:0->cap-sen:0"
mkdir "/configfs/vimc/mdev/links/deb:1->cap-deb:0"
mkdir "/configfs/vimc/mdev/links/sca:1->cap-sca:0"
# Setting all links as enabled and immutable
echo 3 > "/configfs/vimc/mdev/links/sen:0->deb:0/flags"
echo 3 > "/configfs/vimc/mdev/links/deb:1->sca:0/flags"
echo 3 > "/configfs/vimc/mdev/links/sen:0->cap-sen:0/flags"
echo 3 > "/configfs/vimc/mdev/links/deb:1->cap-deb:0/flags"
echo 3 > "/configfs/vimc/mdev/links/sca:1->cap-sca:0/flags"
echo 1 > /configfs/vimc/hotplug
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video2 &
sleep 2
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
#!/bin/bash
set -x
modprobe -v vimc
echo "file drivers/media/platform/vimc/* +p" > /sys/kernel/debug/dynamic_debug/control
echo 15 > /proc/sys/kernel/printk
mount -t configfs none /configfs
mkdir /configfs/vimc/mdev
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap"
echo 1 > /configfs/vimc/mdev/hotplug
v4l2-ctl -d0 --all | grep platform
rmdir "/configfs/vimc/mdev/entities/vimc-capture:cap"
rmdir "/configfs/vimc/mdev/"
modprobe -r vimc
modprobe -v vimc
mkdir /configfs/vimc/mdev
mkdir "/configfs/vimc/mdev/entities/vimc-capture:cap"
echo 1 > /configfs/vimc/mdev/hotplug
v4l2-ctl -d0 --all | grep platform
rmdir "/configfs/vimc/mdev/entities/vimc-capture:cap"
rmdir "/configfs/vimc/mdev/"
modprobe -r vimc
#!/bin/bash
source ./functions.sh
while true
do
./sym-unit-tests-simple-topo.sh
reinstall_vimc
./doc-script.sh
echo 1 > /configfs/vimc/mdev/hotplug
./sym-unit-tests-simple-topo.shreinstall_vimc
done
pkill -9 systemd-udevd
echo gitlab.collabora.com/dafna/scripts/commit/`git rev-parse --short HEAD`
mkdir "/configfs/vimc/mdev/"
mkdir "/configfs/vimc/mdev/vimc-sensor:sen"
mkdir "/configfs/vimc/mdev/vimc-debayer:deb"
mkdir "/configfs/vimc/mdev/vimc-scaler:sca"
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sca" #/dev/video2
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sen" #/dev/video1
mkdir "/configfs/vimc/mdev/vimc-capture:cap-deb" #/dev/video0
stty cols 500
modprobe -r vimc
modprobe vimc
echo "file drivers/media/platform/vimc/vimc-core.c +p" > /sys/kernel/debug/dynamic_debug/control
echo "file drivers/media/platform/vimc/vimc-common.c +p" > /sys/kernel/debug/dynamic_debug/control
echo "file drivers/media/platform/vimc/vimc-sensor.c +p" > /sys/kernel/debug/dynamic_debug/control
echo "file drivers/media/platform/vimc/vimc-capture.c +p" > /sys/kernel/debug/dynamic_debug/control
#echo "file drivers/media/platform/vimc/* +p" > /sys/kernel/debug/dynamic_debug/control
echo 15 > /proc/sys/kernel/printk
mount -t configfs none /configfs
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture post" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81
C=100
v4l2-ctl --stream-mmap --stream-count=$C -d /dev/video0 & v4l2-ctl --stream-mmap --stream-count=$C -d /dev/video1 & v4l2-ctl --stream-mmap --stream-count=$C -d /dev/video2
# This script tests vimc for unbinding the device while it streams.
# enable CONFIG_KASAN to get a report of bugs that it might catch.
modprobe vimc sca_mult=1
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480],"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
#v4l2-ctl -d2 -v width=1920,height=1440
v4l2-ctl -d0 -v pixelformat=BA81
v4l2-ctl -d1 -v pixelformat=BA81
#v4l2-ctl -d7 -v pixelformat=BA81
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video7 &
#sleep 0.25
#echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
#sleep 0.1
#echo -n vimc.0 >/sys/bus/platform/drivers/vimc/bind
#sleep 0.1
#done
i=0
while [ 1 ]; do
echo "=== $i ==="
modprobe vimc
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480],"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480],"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -d2 -v width=1920,height=1440
v4l2-ctl -d0 -v pixelformat=BA81
v4l2-ctl -d1 -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video2 &
v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video1 &
sleep 0.6
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
sleep 0.1
modprobe -r vimc
i=$((i + 1))
done
for ((i=1;i<=1000000000000000;i++)) do
echo "=== $i ==="
modprobe vimc
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video2 &
sleep 1
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
sleep 0.1
modprobe -r vimc
done
i=0
while [ 1 ]; do
echo "=== $i ==="
modprobe vimc
# dislink 'Debyer A' from the scaler
media-ctl -d platform:vimc -l "5:1->21:0[0]" -v
# link 'RGB/YUV Input' to the scaler
media-ctl -d platform:vimc -l "19:0->21:0[1]" -v
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480],"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480],"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"RGB/YUV Input":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Scaler":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -d2 -v width=1920,height=1440,pixelformat=BA81
v4l2-ctl -d0 -v pixelformat=BA81
v4l2-ctl -d1 -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video2 & #no work yet
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video1 &
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video0 &
exit
sleep 0.6
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
sleep 0.1
modprobe -r vimc
i=$((i + 1))
done
#!/bin/bash
modprobe vimc
for ((i=1;i<=1000000000000000;i++));
do
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
echo -n vimc.0 >/sys/bus/platform/drivers/vimc/bind
done
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Scaler":0[fmt:RGB888_1X24/800x1000]'
media-ctl -d platform:vimc -V '"Scaler":0[crop:(744,444)/50x50]'
media-ctl -d platform:vimc --get-v4l2 '"Scaler":0'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=150,height=150
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81,width=800,height=1000
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81,width=800,height=1000
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video5
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video6
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video7 --stream-to vmpath/x
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/800x1000]'
media-ctl -d platform:vimc -V '"Scaler":0[fmt:RGB888_1X24/800x1000]'
media-ctl -d platform:vimc -V '"Scaler":0[crop:(50,70)/750x500]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=2250,height=1500
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81,width=800,height=1000
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81,width=800,height=1000
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video5
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video6
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video7
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=10 -z platfor:vimc -d "Raw Capture 0"
v4l2-ctl --stream-mmap --stream-count=10 -z platfor:vimc -d "Raw Capture 1"
v4l2-ctl --stream-mmap --stream-count=10 -z platfor:vimc -d "RGB/YUV Capture"
media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480],"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
v4l2-ctl -d2 -v width=1920,height=1440
v4l2-ctl -d0 -v pixelformat=BA81
v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video2
while [ 1 ]; do
#v4l2-ctl --stream-mmap -v width=1920,height=1440 -d /dev/video103 2>/dev/null
v4l2-ctl --stream-mmap -d /dev/video${1} 2>/dev/null
#v4l2-ctl --stream-mmap -d /dev/video${1}
# v4l2-ctl --stream-mmap --stream-count=10 -d /dev/video0 2>/dev/null
done
#inotifywait -e create /dev |
#while read path action file; do
# if [[ "$file" =~ media.* ]]; then # Does the file end with .xml?
# echo "media file" # If so, do your thing here!
# fi
#dlink Debayer A from Scaler
#media-ctl -d platform:vimc -l "5:1->21:0[0]"
#link RGB/YUV to Scaler
#media-ctl -d platform:vimc -l "19:0->21:0[1]"
# v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video0
#echo $file
#done
i=0
while [ 1 ]; do
echo "=== $i ==="
modprobe vimc sca_mult=1 &
# dislink 'Debyer A' from the scaler
# media-ctl -d platform:vimc -l "5:1->21:0[0]" -v
# link 'RGB/YUV Input' to the scaler
# media-ctl -d platform:vimc -l "19:0->21:0[1]" -v
#media-ctl -d platform:vimc -V '"Scaler":0[fmt:SBGGR8_1X8/640x480]'
#v4l2-ctl -d2 -v width=1920,height=1440,pixelformat=BA81
#v4l2-ctl -d0 -v pixelformat=BA81
#v4l2-ctl -d1 -v pixelformat=BA81
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video2 & #no work yet
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video1 &
#v4l2-ctl --stream-mmap --stream-count=1000 -d /dev/video0 &
#exit
#sleep 0.6
#echo -n vimc.0 >/sys/bus/platform/drivers/vimc/unbind
#sleep 0.1
modprobe -r vimc
i=$((i + 1))
done
#!/bin/bash
echo "start simple topo"
# Creating the entities
mkdir "/configfs/vimc/mdev"
mkdir "/configfs/vimc/mdev/vimc-sensor:sen"
mkdir "/configfs/vimc/mdev/vimc-debayer:deb"
mkdir "/configfs/vimc/mdev/vimc-scaler:sca"
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sca" #/dev/video2
mkdir "/configfs/vimc/mdev/vimc-capture:cap-sen" #/dev/video1
mkdir "/configfs/vimc/mdev/vimc-capture:cap-deb" #/dev/video0
# Creating the links
#sen -> deb
mkdir "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-deb"
ln -s "/configfs/vimc/mdev/vimc-debayer:deb/pad:sink:0" "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-deb"
echo on > "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-deb/enabled"
echo on > "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-deb/immutable"
#deb -> sca
mkdir "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-sca"
ln -s "/configfs/vimc/mdev/vimc-scaler:sca/pad:sink:0" "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-sca"
echo on > "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-sca/enabled"
echo on > "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-sca/immutable"
#sca -> cap-sca
mkdir "/configfs/vimc/mdev/vimc-scaler:sca/pad:source:1/to-cap"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-sca/pad:sink:0" "/configfs/vimc/mdev/vimc-scaler:sca/pad:source:1/to-cap"
echo on > "/configfs/vimc/mdev/vimc-scaler:sca/pad:source:1/to-cap/enabled"
echo on > "/configfs/vimc/mdev/vimc-scaler:sca/pad:source:1/to-cap/immutable"
#sen -> cap-sen
mkdir "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-sen/pad:sink:0" "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap"
echo on > "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap/enabled"
echo on > "/configfs/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap/immutable"
#deb -> cap-deb
mkdir "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-cap"
ln -s "/configfs/vimc/mdev/vimc-capture:cap-deb/pad:sink:0" "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-cap"
echo on > "/configfs/vimc/mdev/vimc-debayer:deb/pad:source:1/to-cap/enabled"