Mercurial > mplayer.hg
annotate TVout/matroxtv @ 9851:6a348d3ed626
A new control called upon stream reset.
author | albeu |
---|---|
date | Sun, 06 Apr 2003 16:34:26 +0000 |
parents | ab635db0c549 |
children | 649f1089d94d |
rev | line source |
---|---|
2487 | 1 #!/bin/sh |
7376 | 2 # |
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else. | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
4 # v2.5 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
5 # This script has been tested and configured on a Matrox G400DH, a PAL TV, |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
6 # a 14" analog and a 15" digital monitor. |
7376 | 7 # |
8 # INSTALLATION: | |
9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION! | |
10 # 2. Edit 'defaultmode', 'TVdefaultmode', and 'SetTVstandard' functions | |
11 # below to fit your needs. | |
12 # 3. Remove 'exit 1' safety check. | |
13 # | |
14 | |
15 function defaultmode { | |
16 # You can choose the mode to use in monitor-only mode | |
17 # 640x480 60Hz 32bpp (14" monitors) | |
9839 | 18 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 |
7376 | 19 # 768x576 60Hz 32bpp (14" monitors) |
9839 | 20 # 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 |
7376 | 21 # 800x600 76Hz 32bpp (15" monitors) |
9839 | 22 # 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 |
7376 | 23 # 1024x768 70Hz 32bpp (15" monitors) |
9839 | 24 # 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 |
7376 | 25 } |
26 | |
27 function TVdefaultmode { | |
2487 | 28 |
7376 | 29 ## |
30 ## PAL modes | |
31 ## | |
32 | |
33 # 640x512 80Hz 32bpp | |
9839 | 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 |
7376 | 35 # 640x528 83Hz 32bpp |
9839 | 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 |
7376 | 37 # 720x576 78Hz 32bpp |
9839 | 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 |
7376 | 39 |
40 ## | |
41 ## NTSC modes | |
42 ## | |
2487 | 43 |
7376 | 44 # 640x240 non-interlaced 32bpp |
9839 | 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 |
7376 | 46 # 640x480 interlaced 32bpp |
9839 | 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 |
7376 | 48 } |
49 | |
50 function SetTVstandard { | |
9838 | 51 matroxset 1 # PAL |
7376 | 52 # matroxset 2 # NTSC |
53 } | |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
54 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
55 function SetMonitorMode { |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
56 matroxset 128 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
57 } |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
58 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
59 function mappingreset { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
60 matroxset -f /dev/fb0 -m 0 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
61 matroxset -f /dev/fb1 -m 0 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
62 matroxset -f /dev/fb0 -m 1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
63 con2fb /dev/fb0 /dev/tty1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
64 con2fb /dev/fb0 /dev/tty2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
65 SetMonitorMode |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
66 defaultmode |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
67 } |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
68 |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
69 function warn { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
70 clear |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
71 echo "Display routing is about to come! Due to certain limitations" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
72 echo "(kernel? driver?), you MUST switch ttys a few times for" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
73 echo "these changes to take effect!!!!! After pressing a key now." |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
74 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
75 echo "I.e.: press alt-f1, alt-f2, alt-f3, then back to alt-f1" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
76 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
77 echo "NOTE: you won't automatically get consoles on the new display." |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
78 echo " To achieve that, use the con2fb utility:" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
79 echo " $ con2fb /dev/fb1 /dev/tty1" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
80 echo " (and don't forget to change ttys a few times...)" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
81 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
82 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
83 echo "If you read this, PRESS ANY KEY TO CONTINUE" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
84 read |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
85 } |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
86 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
87 function warn2 { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
88 clear |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
89 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
90 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
91 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
92 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
93 echo Routing done! |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
94 echo Change consoles! |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
95 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
96 echo Then PRESS ANY KEY TO RETURN to menu |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
97 read |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
98 } |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
99 |
7376 | 100 echo |
101 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." | |
103 echo | |
9487 | 104 exit 1 |
2487 | 105 |
106 while [ 1 ]; do | |
107 | |
108 clear | |
109 | |
7524 | 110 echo " [ 0 ] Clear & blank screen" |
7376 | 111 echo " [ 1 ] Monitor only" |
112 echo " /---> Monitor" | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
113 echo " [ 2 ] Cloning - CRTC1" |
7376 | 114 echo " \\---> TV" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
115 echo |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
116 echo " /---> Monitor1" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
117 echo " [ 3 ] Cloning - CRTC1" |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
118 echo " \\---> Monitor2" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
119 echo |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
120 echo " CRTC1 ---> Monitor1" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
121 echo " [ 4 ] DualHead -" |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
122 echo " CRTC2 ---> Monitor2" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
123 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
124 echo " CRTC1 ---> Monitor2" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
125 echo " [ 5 ] DualHead - SWAP!" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
126 echo " CRTC2 ---> Monitor1" |
2487 | 127 |
128 echo | |
129 | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
130 echo -- TV MODES |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
131 echo |
7376 | 132 echo " [ A ] 640x512 PAL" |
133 echo " [ S ] 640x528 PAL" | |
134 echo " [ D ] 720x576 PAL" | |
135 echo " [ F ] 640x240 NTSC" | |
136 echo " [ G ] 640x480 NTSC, Interlaced" | |
2487 | 137 |
138 read ABC | |
139 | |
140 case "$ABC" in | |
7524 | 141 0) |
142 clear | |
143 setterm -cursor off | |
144 setterm -blank 0 | |
145 read | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
146 setterm -cursor on |
7524 | 147 ;; |
148 | |
2487 | 149 1) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
150 mappingreset |
2487 | 151 echo |
152 ;; | |
153 | |
154 2) | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
155 mappingreset |
2487 | 156 matroxset -f /dev/fb0 -m 3 |
7376 | 157 SetTVstandard |
158 TVdefaultmode | |
2487 | 159 ;; |
160 | |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
161 3) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
162 mappingreset |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
163 matroxset -f /dev/fb0 -m 3 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
164 ;; |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
165 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
166 4) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
167 warn |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
168 mappingreset |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
169 matroxset -f /dev/fb0 -m 1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
170 matroxset -f /dev/fb1 -m 2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
171 warn2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
172 ;; |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
173 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
174 5) |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
175 warn |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
176 mappingreset |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
177 matroxset -f /dev/fb0 -m 2 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
178 matroxset -f /dev/fb1 -m 1 |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
179 warn2 |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
180 ;; |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
181 |
2487 | 182 a) |
7376 | 183 # 640x512 80Hz 32bpp |
9839 | 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 |
2487 | 185 ;; |
186 | |
187 s) | |
7376 | 188 # 640x528 83Hz 32bpp |
9839 | 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 |
2487 | 190 ;; |
191 | |
192 d) | |
7376 | 193 # 720x576 78Hz 32bpp |
9839 | 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 |
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 | |
2487 | 196 ;; |
197 | |
7376 | 198 f) |
199 # 640x240 non-interlaced 32bpp | |
9839 | 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 |
7376 | 201 ;; |
202 | |
203 g) | |
204 # 640x480 interlaced 32bpp | |
9839 | 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 |
7376 | 206 ;; |
2487 | 207 esac |
208 | |
209 done |