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
|
7376
|
64 echo " [ 1 ] Monitor only"
|
|
65 echo " /---> Monitor"
|
|
66 echo " [ 2 ] DualHead - CRTC1"
|
|
67 echo " \\---> TV"
|
2487
|
68
|
|
69 echo
|
|
70
|
7376
|
71 echo " [ A ] 640x512 PAL"
|
|
72 echo " [ S ] 640x528 PAL"
|
|
73 echo " [ D ] 720x576 PAL"
|
|
74 echo " [ F ] 640x240 NTSC"
|
|
75 echo " [ G ] 640x480 NTSC, Interlaced"
|
2487
|
76
|
|
77 read ABC
|
|
78
|
|
79 case "$ABC" in
|
|
80 1)
|
|
81 matroxset -f /dev/fb1 -m 0
|
|
82 matroxset -f /dev/fb0 -m 1
|
7376
|
83 defaultmode
|
2487
|
84 echo
|
|
85 ;;
|
|
86
|
|
87 2)
|
|
88 matroxset -f /dev/fb1 -m 0
|
|
89 matroxset -f /dev/fb0 -m 3
|
7376
|
90 SetTVstandard
|
|
91 TVdefaultmode
|
2487
|
92 ;;
|
|
93
|
|
94 a)
|
7376
|
95 # 640x512 80Hz 32bpp
|
|
96 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true
|
2487
|
97 ;;
|
|
98
|
|
99 s)
|
7376
|
100 # 640x528 83Hz 32bpp
|
|
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
|
2487
|
102 ;;
|
|
103
|
|
104 d)
|
7376
|
105 # 720x576 78Hz 32bpp
|
|
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
|
2487
|
107 ;;
|
|
108
|
7376
|
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 ;;
|
2487
|
118 esac
|
|
119
|
|
120 done
|