Mercurial > mplayer.hg
annotate DOCS/DGA @ 1085:f764455442f4
*** empty log message ***
author | acki2 |
---|---|
date | Sun, 10 Jun 2001 21:34:39 +0000 |
parents | b194061e3f03 |
children | 5bbe4be92507 |
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 | |
15 | |
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 | |
1085 | 26 DGA is short for Direct Graphics Access and is a means for a programm to |
27 bypass the X-Server and directly modifying the framebuffer memory. | |
827 | 28 Technically spoken this happens by mapping the framebuffer memory into |
1085 | 29 the memory range of your process. This is just allowed by the kernel |
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 |
1085 | 31 as root or by setting the suid bit on the mplayer excecutable. |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
32 |
1085 | 33 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
|
34 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
|
35 |
1085 | 36 DGA1 just provides 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
|
37 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
|
38 XVidMode extension. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
39 |
1085 | 40 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
|
41 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
|
42 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
|
43 versa. |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
44 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 |
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 3. Resolution switching |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
51 ~~~~~~~~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
52 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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 /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
|
58 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
|
59 of your video hardware. The XServer scans this config file on startup and |
1085 | 60 disables those 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
|
61 out which modes survive with the X11 log file. It can be found at: |
1085 | 62 /var/log/XFree86.0.log (on Debian systems ... :-) ) |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
63 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
|
64 |
1085 | 65 4. DGA & MPLayer |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
66 ~~~~~~~~~~~~~~~~ |
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 DGA is used in two places with MPlayer: The SDL driver can be made to make |
837 | 69 use of it (-vo sdl -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
|
70 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
|
71 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
|
72 |
827 | 73 |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
74 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
|
75 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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 The DGA driver is invoked by specifying -vo dga at the command line. |
1085 | 78 The default behaviour is to switch to a resolution matching the original |
79 resolution of the video as close as possible. It deliberately ignores the | |
80 -vm and -fs switches (enabling of video mode switching and fullscreen) - | |
81 it always tries to cover as much area of your screen as possible by switching | |
82 the video mode, thus refraining to use a single additional cycle of your CPU | |
83 to scale the image. | |
84 If you don't like the mode it chooses you may force it to choose the mode | |
85 matching closest the resolution you specify by -x and -y. | |
86 By providing the -v option, the DGA driver will print, among a lot of other | |
87 things, a list of all resolutions supported by your current XF86-Config | |
88 file. | |
89 Having DGA2 you may also force it to use a certain depth by using the -bpp | |
90 option. Valid depths are 15, 16, 24 and 32. It depends on your hardware | |
91 whether these depths are natively supported or if a (possibly slow) | |
92 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
|
93 |
1085 | 94 If you should be lucky enough to have enough offscreen memory left to |
95 put a whole image there, the DGA driver will use doublebuffering, which | |
96 results in much smoother movie replaying. It will tell you whether double- | |
97 buffering is enabled or not. | |
98 | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
99 |
1085 | 100 6. Speed issues |
101 ~~~~~~~~~~~~~~~ | |
102 Generally spoken, DGA framebuffer access should be at least as fast as using | |
103 the X11 driver with the additional benefit of getting a fullscreen image. | |
104 The percentage speed values printed by mplayer have to be interpreted with | |
105 some care, as for example, with the X11 driver they do not include the time | |
106 used by the X-Server needed for the actual drawing. Hook a terminal to a | |
107 serial line of your box and start top to see what is really going on in your | |
108 box ... | |
109 | |
110 Generally spoken, the speedup done by using DGA against 'normal' use of X11 | |
111 highly depends on your graphics card and how well the X-Server module for it | |
112 is optimized. | |
113 | |
114 If you have a slow system, better use 15 or 16bit depth since they require | |
115 only half the memory bandwidth of a 32 bit display. | |
116 | |
117 Using a depth of 24bit is even a good idea if your card natively just supports | |
118 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
|
119 |
1085 | 120 I've seen some avi files already be replayed on a Pentium MMX 266. AMD K6-2 |
121 CPUs might work at 400 MHZ and above. | |
122 | |
123 7. Known Bugs | |
124 ~~~~~~~~~~~~~ | |
125 | |
126 Well, according to some developpers of XFree, DGA is quite a beast. They | |
127 tell you better not to use it. Its implementation is not always flawless | |
128 with every chipset driver for XFree out there. | |
129 | |
130 o with XFree 4.0.3 and nv.o there is a bug resulting in strange colors | |
131 o ATI driver requires to switch mode back more than once after finishing | |
132 using of DGA | |
133 o some drivers simply fail to switch back to normal resolution (use | |
134 Ctrl-Alt-Keypad +, - to switch back manually) | |
135 o some drivers simply display strange colors | |
136 o some drivers lie about the amount of memory they map into the process's | |
137 address spacei, thus vo_dga won't use doublebuffering (SIS?) | |
138 o some drivers seem to fail to report even a single valid mode. In this | |
139 case the DGA driver will crash telling you about a nonsense mode of | |
140 100000x100000 or the like ... | |
141 o OSD only works with doublebuffering enabled | |
142 | |
143 8. Future work | |
144 ~~~~~~~~~~~~~~ | |
145 | |
146 o use of the new X11 render interface for OSD | |
147 o where is my TODO list ???? :-((( | |
148 | |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
149 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
150 A. Sample modelines |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
151 ~~~~~~~~~~~~~~~~~~~ |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
152 Section "Modes" |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
153 Identifier "Modes[0]" |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
154 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
|
155 Modeline "640x480" 25.175 640 664 760 800 480 491 493 525 |
1085 | 156 Modeline "352x240" 15.750 352 368 416 432 240 244 246 262 Doublescan |
157 # 800x600 @ 60 Hz, 37.8 kHz hsync | |
158 Modeline "800x600" 40 800 840 968 1056 600 601 605 628 | |
907 | 159 Modeline "352x288" 25.10 352 368 416 432 288 296 290 310 |
832
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
160 EndSection |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
161 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
162 |
369697a87773
- some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents:
827
diff
changeset
|
163 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
|
164 module. |
827 | 165 |
166 Acki (acki@acki-netz.de, www.acki-netz.de) 17.5.2001 | |
167 | |
168 |