Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jan 2003 13:09:45 -0800
From:      Andy Sparrow <spadger@best.com>
To:        Bjarne Wichmann Petersen <freebsd.nospam@mekanix.dk>
Cc:        freebsd-multimedia@FreeBSD.ORG, freebsd-mobile@FreeBSD.ORG
Subject:   Re: ATI Rage Mobility and XVideo 
Message-ID:  <20030127210945.5DBE3ED@CRWdog.demon.co.uk>
In-Reply-To: Message from Bjarne Wichmann Petersen  <freebsd.nospam@mekanix.dk> of "Mon, 27 Jan 2003 13:44:20 %2B0100." <200301271344.20485.freebsd.nospam@mekanix.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
--==_Exmh_-1761214438P
Content-Type: text/plain; charset=us-ascii


> > > I've got a ATI 3D Rage Mobility (Mach64), which I'd like to enable XVideo
> > > support. How do I do that?
> >
> > Use the enhanced ATI drivers from gatos.sourceforge.net. Thanks to the
> > XFree platform-independant loader mechanism (for like CPU platforms
> > only), you can simply install the Linux binary drivers directly without
> > even needing Linux emulation.
> 
> Thx... works... sort of... does XVideo need extra RAM? I'm usually running my 
> laptop in 1024x768-24, but XVideo chokes on that. But if I run in 16-bit 
> depth it's ok (but doesn't look so nice).

Well, I tend to run in 16 bit anyway as I can rarely tell the difference 
(especially on a TFT), and 16 bit mode is faster.

I seem to recall that XV might be restricted to 16 bit, but I might be 
mistaken on that. I know it doesn't work on extremely large resolutions, 
and there may well be issues with depth at higher resolutions (I tend to 
use 1024x768 even when docked, as otherwise my window placements get 
kinda funky when I undock).

> And what do you do to enable DGA? My setup barks even if I run as root.

i)	Check it's enabled in the server:

	xdpyinfo | grep DGA

	    XFree86-DGA

	If not, check for it being disabled in whichever config file you're 
	using for XFree86, and comment it out (I seem to recall the loading of
	DGA is disabled by default):

	# This loads the miscellaneous extensions module, and disables
	# initialisation of the XFree86-DGA extension within that module.
    	SubSection  "extmod"
     	   #Option    "omit xfree86-dga"   # don't initialise the DGA 
extension
   	EndSubSection

	You'll need to re-start X at this point, naturally.

ii)	Run 'mplayer' and tell it to use DGA for output, e.g.:

	mplayer -vo dga

	You'll need permissions to write /dev/mem, with default permissions 
you'll
	need 'root' privs.

	This gives you a full-screen DGA output, with a "postage stamp" video 
	window.

	Check for output like the following:

vo: X11 running at 1024x768 with depth 16 and 16 bpp (":0.0" => local 
display)
vo_dga: Mode: depth=15, bpp=16, r=007c00, g=0003e0, b=00001f, native 
(fast),     (-bpp 15)
vo_dga: Mode: depth=16, bpp=16, r=00f800, g=0007e0, b=00001f, native 
(fast),     (-bpp 16)
vo_dga: Mode: depth=24, bpp=24, r=ff0000, g=00ff00, b=0000ff, native 
(fast),     (-bpp 24)
vo_dga: Mode: depth=24, bpp=32, r=ff0000, g=00ff00, b=0000ff, native 
(fast),     (-bpp 32)


iii)	Sort out the "root permissions" issue. I generally set '/dev/mem' 
0664,
	leave the default group 'kmem', and make the 'mplayer' executable SGID
	kmem, e.g. (as 'root'):

		chgrp kmem `which mplayer`
		chmod 02555 `which mplayer`

	I happen to feel that this is appropriate for a single-user laptop with 
a
	firewall, YMMV...

iv)	Provide some "special" video modes for DGA, so that when DGA wants 
to
	select a video mode/depth to switch to for full-screen, it actually has
	some available other than the auto-calculated/built-in XFree modes.

	I use some of the following for common AVI/MPEG sizes:

Mode "320x240"
    DotClock   15.75
    HTimings   320 336 384 400
    VTimings   240 244 246 262
    Flags        "Doublescan"
EndMode

Mode "352x240"
    DotClock   15.750
    HTimings   352 368 416 432  
    VTimings   240 244 246 262
    Flags        "Doublescan"
EndMode

Mode "352x280"
    DotClock   15.750
    HTimings   352 368 416 432
    VTimings   280 286 288 302
    Flags        "Doublescan"
EndMode

Mode "352x288"
    DotClock   15.750
    HTimings   352 368 416 432
    VTimings   288 290 296 310
    Flags        "Doublescan"
EndMode
    
Mode "384x288"
    DotClock   15.750
    HTimings   384 400 416 432
    VTimings   288 290 296 310
    Flags        "Doublescan"
EndMode

Mode "480x288"
    DotClock   15.75
    HTimings   480 495 510 525
    VTimings   288 289 293 302
    Flags      "+hsync" "+vsync"
EndMode

Mode "536x344"
    DotClock 31.5
    HTimings    536 556 656 700 
    VTimings    344 345 348 364
    Flags      "+hsync" "+vsync"
EndMode

Mode "544x352"
    DotClock 15.75   
    HTimings    544 560 656 700
    VTimings    352 353 357 372
    Flags      "+hsync" "+vsync"
EndMode

Modeline "544x352"   31.50  544 560 640 680  352 353 354 366 -hsync 
-vsync

Modeline    "800x600"  40     800 840 968 1056  600 601 605 628
Modeline    "712x600"  35.0   712 740 850 900   400 410 412 425
Modeline    "640x480"  25.175 640 664 760 800   480 491 493 525
Modeline    "400x300"  20     400 416 480 528   300 301 303 314 
Doublescan
Modeline    "352x288"  25.10  352 368 416 432   288 296 290 310
Modeline    "352x240"  15.750 352 368 416 432   240 244 246 262 
Doublescan
Modeline    "320x240"  12.588 320 336 384 400   240 245 246 262 
Doublescan

(Some of the above are almost certainly bogus, BTW...)

DGA will pick the best (e.g. "closest") color depth/mode to the native 
size of the video you're playing, and the video window will fill the 
screen. You'll get a black band if the image doesn't exactly fit (e.g. 
like "letterbox" mode, although the bands could be on the sides, or both 
top/bottom and the sides, if it's not listed or standard).

This will use more CPU than XV, but the colors are way more natural, 
IME. If you have excess CPU left over, try using the '-autoq XX' option 
to post-process the video streams.

I find that a PIII 600 doesn't have any grunt left over for 
post-processing at resolutions larger than, say ~352x264 with DGA (e.g. 
VCD is fine, SVCD gives it a hard time), but it depends on the video 
stream - some larger images play better than others. Also, some video 
streams look fine with XV, whilst others look really lurid and 
florescent, with harsh color gradients and are generally unnatural and 
unconvincing.

So, I default to XV in 'mplayer.conf', and use DGA when I can. Note that 
you can't use the 'mplayer' GUI with DGA either (or, if you can, let me 
know /how/ ;-).

Oh, and if 'mplayer' crashes whilst using DGA (much less likely these 
days), it can be awkward to regain control.. Another reason to check 
that 'mplayer' doesn't choke on the video in XV or SDL mode before 
running it with DGA...

'mplayer' rocks. Mucho thanks to everyone working hard on keeping it 
up-to-date in ports, you're doing a fantastic job!

HTH.

Cheers,

AS


--==_Exmh_-1761214438P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
Comment: Exmh version 2.5 07/13/2001

iD8DBQE+NaAZPHh895bDXeQRAnEhAKCHTuQ0YF3jAkKF9JnEyWFhs9m+cwCbBUZI
3X/TNJdu4qwbuMNURFCJSG8=
=sift
-----END PGP SIGNATURE-----

--==_Exmh_-1761214438P--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030127210945.5DBE3ED>