Mercurial > mplayer.hg
comparison TOOLS/TVout/matroxtv @ 12940:b205f8ca892a
Moved to the TOOLS directory.
author | diego |
---|---|
date | Tue, 03 Aug 2004 00:45:55 +0000 |
parents | TVout/matroxtv@649f1089d94d |
children |
comparison
equal
deleted
inserted
replaced
12939:9b44f32dae3f | 12940:b205f8ca892a |
---|---|
1 #!/bin/sh | |
2 # | |
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else. | |
4 # v3.0 | |
5 # This script has been tested and configured on a Matrox G400DH, a PAL TV, | |
6 # a 14" analog and a 15" digital monitor. | |
7 # | |
8 # INSTALLATION: | |
9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION! | |
10 # 2. Choose proper mode at 'defaultmode', 'TVdefaultmode', | |
11 # and 'SetTVstandard' functions to fit your needs. | |
12 # You normally shouldn't touch anything else. | |
13 # 3. Remove 'exit 1' safety check. | |
14 # | |
15 | |
16 function defaultmode { | |
17 # You can choose the mode to use in monitor-only mode | |
18 # 640x480 60Hz 32bpp (14" monitors) | |
19 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 -laced false | |
20 # 768x576 60Hz 32bpp (14" monitors) | |
21 # 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 -laced false | |
22 # 800x600 76Hz 32bpp (15" monitors) | |
23 # 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 -laced false | |
24 # 1024x768 70Hz 32bpp (15" monitors) | |
25 # 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 -laced false | |
26 } | |
27 | |
28 function TVdefaultmode { | |
29 | |
30 ## | |
31 ## PAL modes | |
32 ## | |
33 | |
34 # 640x512 80Hz 32bpp | |
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 | |
36 # 640x528 83Hz 32bpp | |
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 | |
38 # 720x576 78Hz 32bpp | |
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 | |
40 | |
41 ## | |
42 ## NTSC modes | |
43 ## | |
44 | |
45 # 640x240 non-interlaced 32bpp | |
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 | |
47 # 640x480 interlaced 32bpp | |
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 | |
49 } | |
50 | |
51 function SetTVstandard { | |
52 matroxset 1 # PAL | |
53 # matroxset 2 # NTSC | |
54 } | |
55 | |
56 function SetMonitorMode { | |
57 matroxset 128 | |
58 } | |
59 | |
60 function mappingreset { | |
61 matroxset -f /dev/fb0 -m 0 | |
62 matroxset -f /dev/fb1 -m 0 | |
63 matroxset -f /dev/fb0 -m 1 | |
64 con2fb /dev/fb0 /dev/tty1 | |
65 con2fb /dev/fb0 /dev/tty2 | |
66 SetMonitorMode | |
67 defaultmode | |
68 } | |
69 | |
70 function warn { | |
71 clear | |
72 echo "tty2 will be automatically transferred to fb1 using the con2fb utility." | |
73 echo | |
74 echo | |
75 echo "A big \"1\" letter will be displayed on tty1 after the change." | |
76 echo "A big \"2\" letter will be displayed on tty2 after the change." | |
77 echo | |
78 echo | |
79 echo "If you read this, PRESS ANY KEY TO CONTINUE" | |
80 read | |
81 } | |
82 | |
83 function warn2 { | |
84 id1 > /dev/tty1 & | |
85 id2 > /dev/tty2 & | |
86 } | |
87 | |
88 function id1 { | |
89 sleep 1 | |
90 clear | |
91 echo | |
92 echo | |
93 echo | |
94 echo | |
95 echo | |
96 echo | |
97 echo | |
98 echo | |
99 echo | |
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 } | |
151 | |
152 echo | |
153 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'." | |
154 echo "Then edit this script to suit your monitor+TV set." | |
155 echo | |
156 exit 1 | |
157 | |
158 while [ 1 ]; do | |
159 | |
160 clear | |
161 | |
162 echo " [ 0 ] Clear & blank screen" | |
163 echo " [ 1 ] Monitor only" | |
164 echo | |
165 echo " [ 2 ] Cloning - CRTC1 -> Monitor" | |
166 echo " CRTC2 -> TV" | |
167 echo | |
168 echo " [ 3 ] Cloning - CRTC1 -> Monitor1" | |
169 echo " CRTC2 -> Monitor2" | |
170 echo | |
171 echo " [ 4 ] DualHead - CRTC1 -> Monitor1" | |
172 echo " CRTC2 -> Monitor2" | |
173 echo | |
174 echo " [ 5 ] DualHead - CRTC1 -> Monitor2 (SWAP!)" | |
175 echo " CRTC2 -> Monitor1" | |
176 echo | |
177 echo " [ 6 ] DualHead - CRTC1 -> Monitor1" | |
178 echo " CRTC2 -> TV" | |
179 echo | |
180 echo " [ 7 ] DualHead - CRTC1 -> TV (SWAP!)" | |
181 echo " CRTC2 -> Monitor1" | |
182 | |
183 echo | |
184 | |
185 echo "-- TV MODES on /dev/fb0 -- TV MODES on /dev/fb1" | |
186 echo | |
187 echo " [ a ] 640x512 PAL [ A ] 640x512 PAL" | |
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..)" | |
194 | |
195 read ABC | |
196 | |
197 case "$ABC" in | |
198 0) | |
199 clear | |
200 setterm -cursor off | |
201 setterm -blank 0 | |
202 read | |
203 setterm -cursor on | |
204 ;; | |
205 | |
206 1) | |
207 mappingreset | |
208 echo | |
209 ;; | |
210 | |
211 2) | |
212 mappingreset | |
213 matroxset -f /dev/fb0 -m 3 | |
214 SetTVstandard | |
215 TVdefaultmode /dev/fb0 | |
216 ;; | |
217 | |
218 3) | |
219 mappingreset | |
220 matroxset -f /dev/fb0 -m 3 | |
221 ;; | |
222 | |
223 4) | |
224 warn | |
225 mappingreset | |
226 matroxset -f /dev/fb0 -m 1 | |
227 matroxset -f /dev/fb1 -m 2 | |
228 warn2 | |
229 ;; | |
230 | |
231 5) | |
232 warn | |
233 mappingreset | |
234 matroxset -f /dev/fb0 -m 2 | |
235 matroxset -f /dev/fb1 -m 1 | |
236 warn2 | |
237 ;; | |
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 | |
261 a) | |
262 # 640x512 80Hz 32bpp | |
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 | |
269 ;; | |
270 | |
271 s) | |
272 # 640x528 83Hz 32bpp | |
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 | |
279 ;; | |
280 | |
281 d) | |
282 # 720x576 78Hz 32bpp | |
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 | |
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 | |
291 ;; | |
292 | |
293 f) | |
294 # 640x240 non-interlaced 32bpp | |
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 | |
301 ;; | |
302 | |
303 g) | |
304 # 640x480 interlaced 32bpp | |
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 | |
311 ;; | |
312 esac | |
313 | |
314 done |