Mercurial > mplayer.hg
comparison TVout/matroxtv @ 7376:c3273d9bc41c
v2.0
author | gabucino |
---|---|
date | Thu, 12 Sep 2002 09:42:00 +0000 |
parents | be3b0871ef6d |
children | 3a9a1530ab2d |
comparison
equal
deleted
inserted
replaced
7375:e3e62e4cd772 | 7376:c3273d9bc41c |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # Gabucino - no warranty | 2 # |
3 # you need fbset, and matroxfb modules loaded | 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 # | |
4 | 13 |
5 # mode to use on the monitor in "1-Monitor only" and "4-Dualhead" mode | 14 function defaultmode { |
6 # (from /etc/fb.modes) | 15 # You can choose the mode to use in monitor-only mode |
7 DEFAULTMODE="768x576-60" | 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 } | |
8 | 25 |
9 echo "You didn't check this file for possible mis-configurations ! :)" | 26 function TVdefaultmode { |
27 | |
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 ## | |
42 | |
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 | |
10 exit 1 | 58 exit 1 |
11 | 59 |
12 while [ 1 ]; do | 60 while [ 1 ]; do |
13 | 61 |
14 clear | 62 clear |
15 | 63 |
16 echo " [ 1 ] Monitor only" | 64 echo " [ 1 ] Monitor only" |
17 echo " [ 2 ] Cloning - CRTC1 to Monitor and TV" | 65 echo " /---> Monitor" |
18 echo " [ 3 ] Dualhead - CRTC1 to Monitor, CRTC2 to TV" | 66 echo " [ 2 ] DualHead - CRTC1" |
19 | 67 echo " \\---> TV" |
20 #echo " [ 4 ] Cloning - CRTC2 to Monitor and TV" | |
21 #echo " [ 5 ] Dualhead - CRTC2 to Monitor, CRTC1 to TV" | |
22 | 68 |
23 echo | 69 echo |
24 | 70 |
25 #echo " [ Q ] All consoles to fb0" | 71 echo " [ A ] 640x512 PAL" |
26 #echo " [ W ] tty3 to fb1" | 72 echo " [ S ] 640x528 PAL" |
27 #echo | 73 echo " [ D ] 720x576 PAL" |
28 | 74 echo " [ F ] 640x240 NTSC" |
29 echo " [ A ] 640x512" | 75 echo " [ G ] 640x480 NTSC, Interlaced" |
30 echo " [ S ] 640x528" | |
31 echo " [ D ] 720x576" | |
32 | 76 |
33 read ABC | 77 read ABC |
34 | 78 |
35 case "$ABC" in | 79 case "$ABC" in |
36 1) | 80 1) |
37 matroxset -f /dev/fb1 -m 0 | 81 matroxset -f /dev/fb1 -m 0 |
38 matroxset -f /dev/fb0 -m 1 | 82 matroxset -f /dev/fb0 -m 1 |
39 fbset -a -fb /dev/fb0 $DEFAULTMODE | 83 defaultmode |
40 echo | 84 echo |
41 ;; | 85 ;; |
42 | 86 |
43 2) | 87 2) |
44 con2fb /dev/fb1 /dev/tty3 # Strange, this eliminates green bars | |
45 matroxset -f /dev/fb1 -m 0 | 88 matroxset -f /dev/fb1 -m 0 |
46 matroxset -f /dev/fb0 -m 3 | 89 matroxset -f /dev/fb0 -m 3 |
47 matroxset 1 | 90 SetTVstandard |
48 # 640x512 | 91 TVdefaultmode |
49 fbset -fb /dev/fb1 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true | |
50 con2fb /dev/fb0 /dev/tty3 # Ok, now we can take it back | |
51 ;; | |
52 | |
53 | |
54 3) | |
55 fbset -a -fb /dev/fb0 $DEFAULTMODE | |
56 echo | |
57 matroxset -f /dev/fb0 -m 0 | |
58 matroxset -f /dev/fb1 -m 2 | |
59 matroxset -f /dev/fb0 -m 1 | |
60 matroxset 1 | |
61 ;; | |
62 | |
63 4) | |
64 matroxset -f /dev/fb0 -m 0 | |
65 matroxset -f /dev/fb1 -m 3 | |
66 matroxset 1 | |
67 ;; | |
68 | |
69 5) | |
70 matroxset -f /dev/fb1 -m 0 | |
71 matroxset -f /dev/fb0 -m 2 | |
72 matroxset -f /dev/fb1 -m 1 | |
73 matroxset 1 | |
74 # 640x512 | |
75 fbset -fb /dev/fb1 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true | |
76 ;; | |
77 | |
78 q) | |
79 con2fb /dev/fb0 /dev/tty1 | |
80 con2fb /dev/fb0 /dev/tty2 | |
81 con2fb /dev/fb0 /dev/tty3 | |
82 con2fb /dev/fb0 /dev/tty4 | |
83 con2fb /dev/fb0 /dev/tty5 | |
84 con2fb /dev/fb0 /dev/tty6 | |
85 ;; | |
86 | |
87 w) | |
88 con2fb /dev/fb1 /dev/tty3 | |
89 ;; | 92 ;; |
90 | 93 |
91 a) | 94 a) |
92 # 640x512 | 95 # 640x512 80Hz 32bpp |
93 fbset -fb /dev/fb1 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true | 96 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true |
94 ;; | 97 ;; |
95 | 98 |
96 s) | 99 s) |
97 # 640x528 | 100 # 640x528 83Hz 32bpp |
98 fbset -fb /dev/fb1 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -depth 32 -laced false -bcast true | 101 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 |
99 ;; | 102 ;; |
100 | 103 |
101 d) | 104 d) |
102 # 720x576 | 105 # 720x576 78Hz 32bpp |
103 fbset -fb /dev/fb1 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -depth 32 -laced false -bcast true | 106 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 |
104 ;; | 107 ;; |
105 | 108 |
109 f) | |
110 # 640x240 non-interlaced 32bpp | |
111 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 | |
112 ;; | |
113 | |
114 g) | |
115 # 640x480 interlaced 32bpp | |
116 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 | |
117 ;; | |
106 esac | 118 esac |
107 | 119 |
108 done | 120 done |