2487
|
1 #!/bin/sh
|
7376
|
2 #
|
|
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
|
|
4 # v2.0
|
|
5 # This script has been tested and configured on a Matrox G400DH and a PAL TV.
|
|
6 #
|
|
7 # INSTALLATION:
|
|
8 # 1. READ MPLAYER'S TVOUT DOCUMENTATION!
|
|
9 # 2. Edit 'defaultmode', 'TVdefaultmode', and 'SetTVstandard' functions
|
|
10 # below to fit your needs.
|
|
11 # 3. Remove 'exit 1' safety check.
|
|
12 #
|
|
13
|
|
14 function defaultmode {
|
|
15 # You can choose the mode to use in monitor-only mode
|
|
16 # 640x480 60Hz 32bpp (14" monitors)
|
|
17 fbset -a -xres 640 -yres 480 -vxres 640 -vyres 480 -depth 32 -pixclock 39721 -left 48 -right 16 -upper 33 -lower 10 -hslen 96 -vslen 2 -hsync high -accel true
|
|
18 # 768x576 60Hz 32bpp (14" monitors)
|
|
19 # fbset -a -xres 768 -yres 576 -vxres 768 -vyres 5460 -depth 32 -pixclock 26101 -left 144 -right 16 -upper 28 -lower 6 -hslen 112 -vslen 4 -accel true
|
|
20 # 800x600 76Hz 32bpp (15" monitors)
|
|
21 # fbset -a -xres 800 -yres 600 -vxres 800 -vyres 1440 -depth 32 -pixclock 20000 -left 128 -right 16 -upper 24 -lower 2 -hslen 96 -vslen 6
|
|
22 # 1024x768 70Hz 32bpp (15" monitors)
|
|
23 # fbset -a -xres 1024 -yres 768 -vxres 1024 -vyres 1440 -depth 32 -pixclock 12500 -left 144 -right 32 -upper 30 -lower 2 -hslen 192 -vslen 6
|
|
24 }
|
|
25
|
|
26 function TVdefaultmode {
|
2487
|
27
|
7376
|
28 ##
|
|
29 ## PAL modes
|
|
30 ##
|
|
31
|
|
32 # 640x512 80Hz 32bpp
|
|
33 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true
|
|
34 # 640x528 83Hz 32bpp
|
|
35 # 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
|
|
36 # 720x576 78Hz 32bpp
|
|
37 # 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
|
|
38
|
|
39 ##
|
|
40 ## NTSC modes
|
|
41 ##
|
2487
|
42
|
7376
|
43 # 640x240 non-interlaced 32bpp
|
|
44 # 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
|
|
45 # 640x480 interlaced 32bpp
|
|
46 # 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
|
|
47 }
|
|
48
|
|
49 function SetTVstandard {
|
|
50 matroxset 1 # PAL
|
|
51 # matroxset 2 # NTSC
|
|
52 }
|
|
53
|
|
54 echo
|
|
55 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'."
|
|
56 echo "Then edit this script to suit your monitor+TV set."
|
|
57 echo
|
2488
|
58 exit 1
|
2487
|
59
|
|
60 while [ 1 ]; do
|
|
61
|
|
62 clear
|
|
63
|
7524
|
64 echo " [ 0 ] Clear & blank screen"
|
7376
|
65 echo " [ 1 ] Monitor only"
|
|
66 echo " /---> Monitor"
|
|
67 echo " [ 2 ] DualHead - CRTC1"
|
|
68 echo " \\---> TV"
|
2487
|
69
|
|
70 echo
|
|
71
|
7376
|
72 echo " [ A ] 640x512 PAL"
|
|
73 echo " [ S ] 640x528 PAL"
|
|
74 echo " [ D ] 720x576 PAL"
|
|
75 echo " [ F ] 640x240 NTSC"
|
|
76 echo " [ G ] 640x480 NTSC, Interlaced"
|
2487
|
77
|
|
78 read ABC
|
|
79
|
|
80 case "$ABC" in
|
7524
|
81 0)
|
|
82 clear
|
|
83 setterm -cursor off
|
|
84 setterm -blank 0
|
|
85 read
|
|
86 ;;
|
|
87
|
2487
|
88 1)
|
|
89 matroxset -f /dev/fb1 -m 0
|
|
90 matroxset -f /dev/fb0 -m 1
|
7376
|
91 defaultmode
|
2487
|
92 echo
|
|
93 ;;
|
|
94
|
|
95 2)
|
|
96 matroxset -f /dev/fb1 -m 0
|
|
97 matroxset -f /dev/fb0 -m 3
|
7376
|
98 SetTVstandard
|
|
99 TVdefaultmode
|
2487
|
100 ;;
|
|
101
|
|
102 a)
|
7376
|
103 # 640x512 80Hz 32bpp
|
|
104 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true
|
2487
|
105 ;;
|
|
106
|
|
107 s)
|
7376
|
108 # 640x528 83Hz 32bpp
|
|
109 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
|
2487
|
110 ;;
|
|
111
|
|
112 d)
|
7376
|
113 # 720x576 78Hz 32bpp
|
|
114 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
|
2487
|
115 ;;
|
|
116
|
7376
|
117 f)
|
|
118 # 640x240 non-interlaced 32bpp
|
|
119 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
|
|
120 ;;
|
|
121
|
|
122 g)
|
|
123 # 640x480 interlaced 32bpp
|
|
124 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
|
|
125 ;;
|
2487
|
126 esac
|
|
127
|
|
128 done
|