Features:
 - hopefully finally works out-of-the-box after ./modules (report if not)
 - nice Display Identifier, as in Windows (big "1" and "2" letters on heads :)

TODO:
 - autodetect if fbset, matroxset, con2fb are installed


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10238 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
gabucino 2003-06-01 23:00:37 +00:00
parent cc1edea30e
commit fe5e2c052b
1 changed files with 151 additions and 46 deletions

View File

@ -1,14 +1,15 @@
#!/bin/sh
#
# Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
# v2.5
# v3.0
# This script has been tested and configured on a Matrox G400DH, a PAL TV,
# a 14" analog and a 15" digital monitor.
#
# INSTALLATION:
# 1. READ MPLAYER'S TVOUT DOCUMENTATION!
# 2. Edit 'defaultmode', 'TVdefaultmode', and 'SetTVstandard' functions
# below to fit your needs.
# 2. Choose proper mode at 'defaultmode', 'TVdefaultmode',
# and 'SetTVstandard' functions to fit your needs.
# You normally shouldn't touch anything else.
# 3. Remove 'exit 1' safety check.
#
@ -31,20 +32,20 @@ function TVdefaultmode {
##
# 640x512 80Hz 32bpp
fbset -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
fbset -fb $1 -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
# 640x528 83Hz 32bpp
# fbset -a -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
# fbset -fb $1 -a -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
# 720x576 78Hz 32bpp
# fbset -a -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
# fbset -fb $1 -a -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
##
## NTSC modes
##
# 640x240 non-interlaced 32bpp
# fbset -a -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
# fbset -fb $1 -a -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
# 640x480 interlaced 32bpp
# fbset -a -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
# fbset -fb $1 -a -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
}
function SetTVstandard {
@ -68,16 +69,11 @@ function mappingreset {
function warn {
clear
echo "Display routing is about to come! Due to certain limitations"
echo "(kernel? driver?), you MUST switch ttys a few times for"
echo "these changes to take effect!!!!! After pressing a key now."
echo "tty2 will be automatically transferred to fb1 using the con2fb utility."
echo
echo "I.e.: press alt-f1, alt-f2, alt-f3, then back to alt-f1"
echo
echo "NOTE: you won't automatically get consoles on the new display."
echo " To achieve that, use the con2fb utility:"
echo " $ con2fb /dev/fb1 /dev/tty1"
echo " (and don't forget to change ttys a few times...)"
echo "A big \"1\" letter will be displayed on tty1 after the change."
echo "A big \"2\" letter will be displayed on tty2 after the change."
echo
echo
echo "If you read this, PRESS ANY KEY TO CONTINUE"
@ -85,17 +81,73 @@ function warn {
}
function warn2 {
id1 > /dev/tty1 &
id2 > /dev/tty2 &
}
function id1 {
sleep 1
clear
echo
echo
echo
echo
echo Routing done!
echo Change consoles!
echo
echo Then PRESS ANY KEY TO RETURN to menu
read
}
echo
echo
echo
echo
echo
echo
echo " ****"
echo " *****"
echo " ******"
echo " *******"
echo " ***"
echo " ***"
echo " ***"
echo " ***"
echo " ***"
echo " *****"
echo
echo
echo " FAST console"
echo
echo
echo " Press ALT-F1 to change here"
}
function id2 {
sleep 1
clear
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo " *****"
echo " ** **"
echo " * **"
echo " **"
echo " **"
echo " **"
echo " **"
echo " **"
echo " ** **"
echo " *******"
echo
echo
echo " SLOW console"
echo
echo
echo " Press ALT-F2 to change here"
}
echo
echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'."
@ -109,31 +161,36 @@ clear
echo " [ 0 ] Clear & blank screen"
echo " [ 1 ] Monitor only"
echo " /---> Monitor"
echo " [ 2 ] Cloning - CRTC1"
echo " \\---> TV"
echo
echo " /---> Monitor1"
echo " [ 3 ] Cloning - CRTC1"
echo " \\---> Monitor2"
echo " [ 2 ] Cloning - CRTC1 -> Monitor"
echo " CRTC2 -> TV"
echo
echo " CRTC1 ---> Monitor1"
echo " [ 4 ] DualHead -"
echo " CRTC2 ---> Monitor2"
echo " [ 3 ] Cloning - CRTC1 -> Monitor1"
echo " CRTC2 -> Monitor2"
echo
echo " CRTC1 ---> Monitor2"
echo " [ 5 ] DualHead - SWAP!"
echo " CRTC2 ---> Monitor1"
echo " [ 4 ] DualHead - CRTC1 -> Monitor1"
echo " CRTC2 -> Monitor2"
echo
echo " [ 5 ] DualHead - CRTC1 -> Monitor2 (SWAP!)"
echo " CRTC2 -> Monitor1"
echo
echo " [ 6 ] DualHead - CRTC1 -> Monitor1"
echo " CRTC2 -> TV"
echo
echo " [ 7 ] DualHead - CRTC1 -> TV (SWAP!)"
echo " CRTC2 -> Monitor1"
echo
echo -- TV MODES
echo "-- TV MODES on /dev/fb0 -- TV MODES on /dev/fb1"
echo
echo " [ A ] 640x512 PAL"
echo " [ S ] 640x528 PAL"
echo " [ D ] 720x576 PAL"
echo " [ F ] 640x240 NTSC"
echo " [ G ] 640x480 NTSC, Interlaced"
echo " [ a ] 640x512 PAL [ A ] 640x512 PAL"
echo " [ s ] 640x528 PAL [ S ] 640x528 PAL"
echo " [ d ] 720x576 PAL [ D ] 720x576 PAL"
echo " [ f ] 640x240 NTSC [ F ] 640x240 NTSC"
echo " [ g ] 640x480 NTSC, interlaced [ G ] 640x480 NTSCl"
echo
echo " (Warning, fb0 and fb1 tend to change RANDOMLY with these mode changers..)"
read ABC
@ -155,7 +212,7 @@ case "$ABC" in
mappingreset
matroxset -f /dev/fb0 -m 3
SetTVstandard
TVdefaultmode
TVdefaultmode /dev/fb0
;;
3)
@ -179,30 +236,78 @@ case "$ABC" in
warn2
;;
6)
warn
mappingreset
con2fb /dev/fb1 /dev/tty2
matroxset -f /dev/fb0 -m 1
matroxset -f /dev/fb1 -m 2
SetTVstandard
TVdefaultmode /dev/fb1
warn2
;;
7)
warn
mappingreset
con2fb /dev/fb1 /dev/tty2
matroxset -f /dev/fb0 -m 2
matroxset -f /dev/fb1 -m 1
SetTVstandard
TVdefaultmode /dev/fb0
warn2
;;
a)
# 640x512 80Hz 32bpp
fbset -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
;;
A)
# 640x512 80Hz 32bpp
fbset -fb /dev/fb1 -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
;;
s)
# 640x528 83Hz 32bpp
fbset -a -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
fbset -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
;;
S)
# 640x528 83Hz 32bpp
fbset -fb /dev/fb1 -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
;;
d)
# 720x576 78Hz 32bpp
# fbset -a -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
fbset -a -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
# fbset -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
fbset -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
;;
D)
# 720x576 78Hz 32bpp
# fbset -fb /dev/fb1 -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
fbset -fb /dev/fb1 -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
;;
f)
# 640x240 non-interlaced 32bpp
fbset -a -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
fbset -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
;;
F)
# 640x240 non-interlaced 32bpp
fbset -fb /dev/fb1 -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
;;
g)
# 640x480 interlaced 32bpp
fbset -a -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
fbset -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
;;
G)
# 640x480 interlaced 32bpp
fbset -fb /dev/fb1 -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
;;
esac