comparison TVout/matroxtv @ 10237:649f1089d94d

v3.0 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
author gabucino
date Sun, 01 Jun 2003 23:00:37 +0000
parents ab635db0c549
children
comparison
equal deleted inserted replaced
10236:4640f25fef12 10237:649f1089d94d
1 #!/bin/sh 1 #!/bin/sh
2 # 2 #
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else. 3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
4 # v2.5 4 # v3.0
5 # This script has been tested and configured on a Matrox G400DH, a PAL TV, 5 # This script has been tested and configured on a Matrox G400DH, a PAL TV,
6 # a 14" analog and a 15" digital monitor. 6 # a 14" analog and a 15" digital monitor.
7 # 7 #
8 # INSTALLATION: 8 # INSTALLATION:
9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION! 9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION!
10 # 2. Edit 'defaultmode', 'TVdefaultmode', and 'SetTVstandard' functions 10 # 2. Choose proper mode at 'defaultmode', 'TVdefaultmode',
11 # below to fit your needs. 11 # and 'SetTVstandard' functions to fit your needs.
12 # You normally shouldn't touch anything else.
12 # 3. Remove 'exit 1' safety check. 13 # 3. Remove 'exit 1' safety check.
13 # 14 #
14 15
15 function defaultmode { 16 function defaultmode {
16 # You can choose the mode to use in monitor-only mode 17 # You can choose the mode to use in monitor-only mode
29 ## 30 ##
30 ## PAL modes 31 ## PAL modes
31 ## 32 ##
32 33
33 # 640x512 80Hz 32bpp 34 # 640x512 80Hz 32bpp
34 fbset -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false 35 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
35 # 640x528 83Hz 32bpp 36 # 640x528 83Hz 32bpp
36 # 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 37 # 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
37 # 720x576 78Hz 32bpp 38 # 720x576 78Hz 32bpp
38 # 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 39 # 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
39 40
40 ## 41 ##
41 ## NTSC modes 42 ## NTSC modes
42 ## 43 ##
43 44
44 # 640x240 non-interlaced 32bpp 45 # 640x240 non-interlaced 32bpp
45 # 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 46 # 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
46 # 640x480 interlaced 32bpp 47 # 640x480 interlaced 32bpp
47 # 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 48 # 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
48 } 49 }
49 50
50 function SetTVstandard { 51 function SetTVstandard {
51 matroxset 1 # PAL 52 matroxset 1 # PAL
52 # matroxset 2 # NTSC 53 # matroxset 2 # NTSC
66 defaultmode 67 defaultmode
67 } 68 }
68 69
69 function warn { 70 function warn {
70 clear 71 clear
71 echo "Display routing is about to come! Due to certain limitations" 72 echo "tty2 will be automatically transferred to fb1 using the con2fb utility."
72 echo "(kernel? driver?), you MUST switch ttys a few times for" 73 echo
73 echo "these changes to take effect!!!!! After pressing a key now." 74 echo
74 echo 75 echo "A big \"1\" letter will be displayed on tty1 after the change."
75 echo "I.e.: press alt-f1, alt-f2, alt-f3, then back to alt-f1" 76 echo "A big \"2\" letter will be displayed on tty2 after the change."
76 echo
77 echo "NOTE: you won't automatically get consoles on the new display."
78 echo " To achieve that, use the con2fb utility:"
79 echo " $ con2fb /dev/fb1 /dev/tty1"
80 echo " (and don't forget to change ttys a few times...)"
81 echo 77 echo
82 echo 78 echo
83 echo "If you read this, PRESS ANY KEY TO CONTINUE" 79 echo "If you read this, PRESS ANY KEY TO CONTINUE"
84 read 80 read
85 } 81 }
86 82
87 function warn2 { 83 function warn2 {
84 id1 > /dev/tty1 &
85 id2 > /dev/tty2 &
86 }
87
88 function id1 {
89 sleep 1
88 clear 90 clear
89 echo 91 echo
90 echo 92 echo
91 echo 93 echo
92 echo 94 echo
93 echo Routing done! 95 echo
94 echo Change consoles! 96 echo
95 echo 97 echo
96 echo Then PRESS ANY KEY TO RETURN to menu 98 echo
97 read 99 echo
98 } 100 echo
101 echo
102 echo " ****"
103 echo " *****"
104 echo " ******"
105 echo " *******"
106 echo " ***"
107 echo " ***"
108 echo " ***"
109 echo " ***"
110 echo " ***"
111 echo " *****"
112 echo
113 echo
114 echo " FAST console"
115 echo
116 echo
117 echo " Press ALT-F1 to change here"
118 }
119
120 function id2 {
121 sleep 1
122 clear
123 echo
124 echo
125 echo
126 echo
127 echo
128 echo
129 echo
130 echo
131 echo
132 echo
133 echo
134 echo " *****"
135 echo " ** **"
136 echo " * **"
137 echo " **"
138 echo " **"
139 echo " **"
140 echo " **"
141 echo " **"
142 echo " ** **"
143 echo " *******"
144 echo
145 echo
146 echo " SLOW console"
147 echo
148 echo
149 echo " Press ALT-F2 to change here"
150 }
99 151
100 echo 152 echo
101 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'." 153 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'."
102 echo "Then edit this script to suit your monitor+TV set." 154 echo "Then edit this script to suit your monitor+TV set."
103 echo 155 echo
107 159
108 clear 160 clear
109 161
110 echo " [ 0 ] Clear & blank screen" 162 echo " [ 0 ] Clear & blank screen"
111 echo " [ 1 ] Monitor only" 163 echo " [ 1 ] Monitor only"
112 echo " /---> Monitor" 164 echo
113 echo " [ 2 ] Cloning - CRTC1" 165 echo " [ 2 ] Cloning - CRTC1 -> Monitor"
114 echo " \\---> TV" 166 echo " CRTC2 -> TV"
115 echo 167 echo
116 echo " /---> Monitor1" 168 echo " [ 3 ] Cloning - CRTC1 -> Monitor1"
117 echo " [ 3 ] Cloning - CRTC1" 169 echo " CRTC2 -> Monitor2"
118 echo " \\---> Monitor2" 170 echo
119 echo 171 echo " [ 4 ] DualHead - CRTC1 -> Monitor1"
120 echo " CRTC1 ---> Monitor1" 172 echo " CRTC2 -> Monitor2"
121 echo " [ 4 ] DualHead -" 173 echo
122 echo " CRTC2 ---> Monitor2" 174 echo " [ 5 ] DualHead - CRTC1 -> Monitor2 (SWAP!)"
123 echo 175 echo " CRTC2 -> Monitor1"
124 echo " CRTC1 ---> Monitor2" 176 echo
125 echo " [ 5 ] DualHead - SWAP!" 177 echo " [ 6 ] DualHead - CRTC1 -> Monitor1"
126 echo " CRTC2 ---> Monitor1" 178 echo " CRTC2 -> TV"
127 179 echo
128 echo 180 echo " [ 7 ] DualHead - CRTC1 -> TV (SWAP!)"
129 181 echo " CRTC2 -> Monitor1"
130 echo -- TV MODES 182
131 echo 183 echo
132 echo " [ A ] 640x512 PAL" 184
133 echo " [ S ] 640x528 PAL" 185 echo "-- TV MODES on /dev/fb0 -- TV MODES on /dev/fb1"
134 echo " [ D ] 720x576 PAL" 186 echo
135 echo " [ F ] 640x240 NTSC" 187 echo " [ a ] 640x512 PAL [ A ] 640x512 PAL"
136 echo " [ G ] 640x480 NTSC, Interlaced" 188 echo " [ s ] 640x528 PAL [ S ] 640x528 PAL"
189 echo " [ d ] 720x576 PAL [ D ] 720x576 PAL"
190 echo " [ f ] 640x240 NTSC [ F ] 640x240 NTSC"
191 echo " [ g ] 640x480 NTSC, interlaced [ G ] 640x480 NTSCl"
192 echo
193 echo " (Warning, fb0 and fb1 tend to change RANDOMLY with these mode changers..)"
137 194
138 read ABC 195 read ABC
139 196
140 case "$ABC" in 197 case "$ABC" in
141 0) 198 0)
153 210
154 2) 211 2)
155 mappingreset 212 mappingreset
156 matroxset -f /dev/fb0 -m 3 213 matroxset -f /dev/fb0 -m 3
157 SetTVstandard 214 SetTVstandard
158 TVdefaultmode 215 TVdefaultmode /dev/fb0
159 ;; 216 ;;
160 217
161 3) 218 3)
162 mappingreset 219 mappingreset
163 matroxset -f /dev/fb0 -m 3 220 matroxset -f /dev/fb0 -m 3
177 matroxset -f /dev/fb0 -m 2 234 matroxset -f /dev/fb0 -m 2
178 matroxset -f /dev/fb1 -m 1 235 matroxset -f /dev/fb1 -m 1
179 warn2 236 warn2
180 ;; 237 ;;
181 238
239 6)
240 warn
241 mappingreset
242 con2fb /dev/fb1 /dev/tty2
243 matroxset -f /dev/fb0 -m 1
244 matroxset -f /dev/fb1 -m 2
245 SetTVstandard
246 TVdefaultmode /dev/fb1
247 warn2
248 ;;
249
250 7)
251 warn
252 mappingreset
253 con2fb /dev/fb1 /dev/tty2
254 matroxset -f /dev/fb0 -m 2
255 matroxset -f /dev/fb1 -m 1
256 SetTVstandard
257 TVdefaultmode /dev/fb0
258 warn2
259 ;;
260
182 a) 261 a)
183 # 640x512 80Hz 32bpp 262 # 640x512 80Hz 32bpp
184 fbset -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false 263 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
264 ;;
265
266 A)
267 # 640x512 80Hz 32bpp
268 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
185 ;; 269 ;;
186 270
187 s) 271 s)
188 # 640x528 83Hz 32bpp 272 # 640x528 83Hz 32bpp
189 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 273 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
274 ;;
275
276 S)
277 # 640x528 83Hz 32bpp
278 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
190 ;; 279 ;;
191 280
192 d) 281 d)
193 # 720x576 78Hz 32bpp 282 # 720x576 78Hz 32bpp
194 # 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 283 # 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
195 fbset -a -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true 284 fbset -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
285 ;;
286
287 D)
288 # 720x576 78Hz 32bpp
289 # 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
290 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
196 ;; 291 ;;
197 292
198 f) 293 f)
199 # 640x240 non-interlaced 32bpp 294 # 640x240 non-interlaced 32bpp
200 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 295 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
296 ;;
297
298 F)
299 # 640x240 non-interlaced 32bpp
300 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
201 ;; 301 ;;
202 302
203 g) 303 g)
204 # 640x480 interlaced 32bpp 304 # 640x480 interlaced 32bpp
205 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 305 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
306 ;;
307
308 G)
309 # 640x480 interlaced 32bpp
310 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
206 ;; 311 ;;
207 esac 312 esac
208 313
209 done 314 done