#!/sbin/runscript # Initialization script for multiple PVR350 cards # will run on Gentoo GNU/Linux - by jaromil PATH=$PATH:/sbin:/usr/local/bin # set this to an existing mpeg2 file for splash MOVIE=/usr/share/montevideo.mpg start() { ebegin "Setting up video syncstarter devices, please wait..." modprobe ivtv result=$? sync for i in 1 2 3 4; do DEV="/dev/video`bc<<<$i+15`" if [ -w "$DEV" ]; then # kick the output devices cat $MOVIE > "$DEV" & \ > /dev/null 2>&1 fi done sync sleep 1 sync for pids in `ps ax|grep "$MOVIE"|awk '{print $1}'`; do kill $pids > /dev/null 2>&1 sync done sync sleep 3 sync # blank the screens ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha -alpha 0 sync sleep 1 sync # play test mpeg2 for i in 1 2 3 4; do DEV="/dev/video`bc<<<$i+15`" if [ -w "$DEV" ]; then echo " Video syncstarter device $i initialized" chmod 666 "$DEV" cat $MOVIE > "$DEV" & fi done sync sleep 3 sync # setup input encoding ### echo "Setting up video in devices 0, 1 & 2..." # -u 0x3000: NTSC, -u 0xff: PAL # -f width=720,height=576(PAL)480(NTSC) # -p 8: s-vhs, 0: composite # -c bitrate=8000000,bitrate_peak=16000000 # -c stream_type=<#> # see ivtv.h IVTV_STREAM_* types (try 10 for DVD, or 0 for PS) for i in 1 2 3 4; do DEV="/dev/video`bc<<<$i-1`" if [ -w "$DEV" ]; then sync test_ioctl -d "$DEV" -u 0xff -p 8 -f width=720,height=576 \ -c bitrate=8000000,bitrate_peak=9000000,stream_type=10 \ > /dev/null 2>&1 sync test_ioctl -d "$DEV" -u 0xff -p 0 -f width=720,height=576 \ -c bitrate=8000000,bitrate_peak=9000000,stream_type=10 \ > /dev/null 2>&1 sync test_ioctl -d "$DEV" -u 0xff -p 8 -f width=720,height=576 \ -c bitrate=8000000,bitrate_peak=9000000,stream_type=10 \ > /dev/null 2>&1 sync fi done echo " Done setting up video devices." eend $result }