Mercurial > mplayer.hg
annotate DOCS/DGA @ 1470:2c7b0478db0c
mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
author | arpi |
---|---|
date | Thu, 09 Aug 2001 17:28:06 +0000 |
parents | 570b32414d1a |
children |
rev | line source |
---|---|
827 | 1 |
2 Contents | |
3 ~~~~~~~~ | |
4 | |
5 1. Summary | |
6 2. What is DGA | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
7 3. Resolution switching |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
8 4. DGA & MPlayer |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
9 5. Features of the DGA driver |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
10 6. Speed issues |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
11 7. Known bugs |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
12 8. Future work |
827 | 13 |
14 A. Some modelines | |
1159 | 15 B. Bug Reports |
827 | 16 |
17 | |
18 1. Summary | |
19 ~~~~~~~~~~ | |
20 This document tries to explain in some words what DGA is in general and | |
21 what the DGA video output driver for mplayer can do (and what it can't). | |
22 | |
23 2. What is DGA? | |
24 ~~~~~~~~~~~~~~~ | |
25 | |
1086 | 26 DGA is short for Direct Graphics Access and is a means for a program to |
1085 | 27 bypass the X-Server and directly modifying the framebuffer memory. |
827 | 28 Technically spoken this happens by mapping the framebuffer memory into |
1086 | 29 the memory range of your process. This is allowed by the kernel only |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
30 if you have superuser privileges. You can get these either by logging in |
1086 | 31 as root or by setting the suid bit on the mplayer excecutable (NOT |
32 recommended!). | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
33 |
1086 | 34 There are two versions of DGA: DGA1 is used by XFree 3.x.x and DGA2 was |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
35 introduced with XFree 4.0.1. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
36 |
1086 | 37 DGA1 provides only direct framebuffer access as described above. For |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
38 switching the resolution of the video signal you have to rely on the |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
39 XVidMode extension. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
40 |
1085 | 41 DGA2 incorporates the features of XVidMode extension and also allows |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
42 switching the depth of the display. So you may, although basically |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
43 running a 32 bit depth XServer, switch to a depth of 15 bits and vice |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
44 versa. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
45 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
46 However DGA has some drawbacks. It seems it is somewhat dependent on the |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
47 graphics chip you use and on the implementation of the XServer's video |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
48 driver that controls this chip. So it does not work on every system ... |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
49 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
50 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
51 3. Resolution switching |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
52 ~~~~~~~~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
53 The DGA driver allows for switching the resolution of the output signal. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
54 This avoids the need for doing (slow) software scaling and at the same |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
55 time provides a fullscreen image. Ideally it would switch to the exact |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
56 resolution (except for honouring aspect ratio) of the video data, but the |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
57 XServer only allows switching to resolutions predefined in |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
58 /etc/X11/XF86Config (/etc/X11/XF86Config-4 for XFree 4.0.X respectively). |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
59 Those are defined by so-called modelines and depend on the capabilites |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
60 of your video hardware. The XServer scans this config file on startup and |
1086 | 61 disables the modelines not suitable for your hardware. You can find |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
62 out which modes survive with the X11 log file. It can be found at: |
1086 | 63 /var/log/XFree86.0.log |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
64 See appendix A for some sample modeline definitions. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
65 |
1086 | 66 4. DGA & MPlayer |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
67 ~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
68 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
69 DGA is used in two places with MPlayer: The SDL driver can be made to make |
1208 | 70 use of it (-vo sdl:dga) and within the DGA driver (-vo dga). |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
71 The above said is true for both; in the following sections I'll explain |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
72 how the DGA driver for MPlayer works. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
73 |
827 | 74 |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
75 5. Features of the DGA driver |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
76 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
77 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
78 The DGA driver is invoked by specifying -vo dga at the command line. |
1085 | 79 The default behaviour is to switch to a resolution matching the original |
80 resolution of the video as close as possible. It deliberately ignores the | |
81 -vm and -fs switches (enabling of video mode switching and fullscreen) - | |
82 it always tries to cover as much area of your screen as possible by switching | |
83 the video mode, thus refraining to use a single additional cycle of your CPU | |
84 to scale the image. | |
85 If you don't like the mode it chooses you may force it to choose the mode | |
86 matching closest the resolution you specify by -x and -y. | |
87 By providing the -v option, the DGA driver will print, among a lot of other | |
88 things, a list of all resolutions supported by your current XF86-Config | |
89 file. | |
90 Having DGA2 you may also force it to use a certain depth by using the -bpp | |
91 option. Valid depths are 15, 16, 24 and 32. It depends on your hardware | |
92 whether these depths are natively supported or if a (possibly slow) | |
93 conversion has to be done. | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
94 |
1085 | 95 If you should be lucky enough to have enough offscreen memory left to |
96 put a whole image there, the DGA driver will use doublebuffering, which | |
97 results in much smoother movie replaying. It will tell you whether double- | |
98 buffering is enabled or not. | |
99 | |
1151 | 100 Doublebuffering means that the next frame of your video is being drawn in |
101 some offscreen memory while the current frame is being displayed. When the | |
102 next frame is ready, the graphics chip is just told the location in memory | |
103 of the new frame and simply fetches the data to be displayed from there. | |
104 In the meantime the other buffer in memory will be filled again with new | |
105 video data. | |
106 | |
107 Doublebuffering may be switched on by using the option -double and may be | |
108 disabled with -nodouble. Current default option is to disable | |
109 doublebuffering. When using the DGA driver, onscreen display (OSD) only | |
110 works with doublebuffering enabled. However, enabling doublebuffering may | |
111 result in a big speed penalty (on my K6-II+ 525 it used an additional 20% of | |
112 CPU time!) depending on the implementation of DGA for your hardware. | |
113 | |
114 | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
115 |
1085 | 116 6. Speed issues |
117 ~~~~~~~~~~~~~~~ | |
118 Generally spoken, DGA framebuffer access should be at least as fast as using | |
119 the X11 driver with the additional benefit of getting a fullscreen image. | |
120 The percentage speed values printed by mplayer have to be interpreted with | |
121 some care, as for example, with the X11 driver they do not include the time | |
122 used by the X-Server needed for the actual drawing. Hook a terminal to a | |
123 serial line of your box and start top to see what is really going on in your | |
124 box ... | |
125 | |
126 Generally spoken, the speedup done by using DGA against 'normal' use of X11 | |
127 highly depends on your graphics card and how well the X-Server module for it | |
128 is optimized. | |
129 | |
130 If you have a slow system, better use 15 or 16bit depth since they require | |
131 only half the memory bandwidth of a 32 bit display. | |
132 | |
133 Using a depth of 24bit is even a good idea if your card natively just supports | |
134 32 bit depth since it transfers 25% less data compared to the 32/32 mode. | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
135 |
1085 | 136 I've seen some avi files already be replayed on a Pentium MMX 266. AMD K6-2 |
137 CPUs might work at 400 MHZ and above. | |
138 | |
139 7. Known Bugs | |
140 ~~~~~~~~~~~~~ | |
141 | |
142 Well, according to some developpers of XFree, DGA is quite a beast. They | |
143 tell you better not to use it. Its implementation is not always flawless | |
144 with every chipset driver for XFree out there. | |
145 | |
146 o with XFree 4.0.3 and nv.o there is a bug resulting in strange colors | |
147 o ATI driver requires to switch mode back more than once after finishing | |
148 using of DGA | |
149 o some drivers simply fail to switch back to normal resolution (use | |
150 Ctrl-Alt-Keypad +, - to switch back manually) | |
151 o some drivers simply display strange colors | |
152 o some drivers lie about the amount of memory they map into the process's | |
1106 | 153 address space, thus vo_dga won't use doublebuffering (SIS?) |
1085 | 154 o some drivers seem to fail to report even a single valid mode. In this |
155 case the DGA driver will crash telling you about a nonsense mode of | |
156 100000x100000 or the like ... | |
157 o OSD only works with doublebuffering enabled | |
158 | |
159 8. Future work | |
160 ~~~~~~~~~~~~~~ | |
161 | |
162 o use of the new X11 render interface for OSD | |
163 o where is my TODO list ???? :-((( | |
164 | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
165 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
166 A. Sample modelines |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
167 ~~~~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
168 Section "Modes" |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
169 Identifier "Modes[0]" |
1159 | 170 # 800x600 @ 60 Hz, 37.8 kHz hsync |
1106 | 171 Modeline "800x600" 40 800 840 968 1056 600 601 605 628 |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
172 Modeline "712x600" 35.0 712 740 850 900 400 410 412 425 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
173 Modeline "640x480" 25.175 640 664 760 800 480 491 493 525 |
1159 | 174 Modeline "400x300" 20 400 416 480 528 300 301 303 314 Doublescan |
1106 | 175 Modeline "352x288" 25.10 352 368 416 432 288 296 290 310 |
1085 | 176 Modeline "352x240" 15.750 352 368 416 432 240 244 246 262 Doublescan |
1159 | 177 Modeline "320x240" 12.588 320 336 384 400 240 245 246 262 Doublescan |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
178 EndSection |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
179 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
180 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
181 These entries work fine with my Riva128 chip, using nv.o XServer driver |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
182 module. |
827 | 183 |
1159 | 184 B. Bug Reports |
185 ~~~~~~~~~~~~~~ | |
186 | |
187 If you experience troubles with the DGA driver please feel free to file | |
188 a bug report to me (e-mail address below). Please start mplayer with the | |
189 -v option and include all lines in the bug report that start with vo_dga: | |
190 | |
191 Please do also include the version of X11 you are using, the graphics card | |
192 and your CPU type. The X11 driver module (defined in XF86-Config) might | |
193 also help. Thanks! | |
827 | 194 |
195 | |
1159 | 196 Acki (acki@acki-netz.de, www.acki-netz.de) 18.06.2001 |
197 | |
198 |