# SDL apps not working with ATI Radeon 9250



## Juanitou (Feb 24, 2013)

Hi!

I have installed a plain vanilla FreeBSD 9.1-RELEASE (I have tried both i386 and amd64 versions) on an old box with an ATI Radeon 9250 video card (128 Mb), recognized by the xf86-video-ati driver. All ports are up to date.

All SDL applications (games) I have tried block the computer with high CPU usage, mouse stuttering and no keyboard reaction, so I have to force reboot the box, even if X server works perfectly with several desktop and windows managers (now using Openbox), video files can be played in full screen, GIMP and Inkscape work quite well, etc.

I have tried for days a lot of xorg.conf options: EXA/XAA acceleration, AGP modes... but the only way to actually have some graphics displayed is by turning acceleration off (Option "NoAccel"). Looking at Xorg log files does not show errors.

It seems a problem exclusively related to SDL, but I have not found how to debug it. I will be most grateful if a knowledgeable person could help me, at least to stop losing time and forget about SDL games.

Thanks in advance!


----------



## wblock@ (Feb 24, 2013)

Please post your xorg.conf.  Including it in the post is fine.  Also, put /var/log/Xorg.0.log on pastebin.com or some other public site and post a link to it.


----------



## Juanitou (Feb 24, 2013)

Thanks for your attention. This is my xorg.conf (automatically generated):

```
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "dri"
	Load  "dri2"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option      "XkbLayout" "fr"
	Option      "XkbVariant" "latin9"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	#DisplaySize	  320   240	# mm
	Identifier   "Monitor0"
	VendorName   "VSC"
	ModelName    "E70-3"
	HorizSync    30.0 - 70.0
	VertRefresh  50.0 - 120.0
	Option	    "DPMS"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "Dac6Bit"            	# [<bool>]
        #Option     "Dac8Bit"            	# [<bool>]
        #Option     "BusType"            	# [<str>]
        #Option     "CPPIOMode"          	# [<bool>]
        #Option     "CPusecTimeout"      	# <i>
        #Option     "AGPMode"            	# <i>
        #Option     "AGPFastWrite"       	# [<bool>]
        #Option     "AGPSize"            	# <i>
        #Option     "GARTSize"           	# <i>
        #Option     "RingSize"           	# <i>
        #Option     "BufferSize"         	# <i>
        #Option     "EnableDepthMoves"   	# [<bool>]
        #Option     "EnablePageFlip"     	# [<bool>]
        #Option     "NoBackBuffer"       	# [<bool>]
        #Option     "DMAForXv"           	# [<bool>]
        #Option     "FBTexPercent"       	# <i>
        #Option     "DepthBits"          	# <i>
        #Option     "PCIAPERSize"        	# <i>
        #Option     "AccelDFS"           	# [<bool>]
        #Option     "IgnoreEDID"         	# [<bool>]
        #Option     "CustomEDID"         	# [<str>]
        #Option     "DisplayPriority"    	# [<str>]
        #Option     "PanelSize"          	# [<str>]
        #Option     "ForceMinDotClock"   	# <freq>
        #Option     "ColorTiling"        	# [<bool>]
        #Option     "VideoKey"           	# <i>
        #Option     "RageTheatreCrystal" 	# <i>
        #Option     "RageTheatreTunerPort" 	# <i>
        #Option     "RageTheatreCompositePort" 	# <i>
        #Option     "RageTheatreSVideoPort" 	# <i>
        #Option     "TunerType"          	# <i>
        #Option     "RageTheatreMicrocPath" 	# <str>
        #Option     "RageTheatreMicrocType" 	# <str>
        #Option     "ScalerWidth"        	# <i>
        #Option     "RenderAccel"        	# [<bool>]
        #Option     "SubPixelOrder"      	# [<str>]
        #Option     "ClockGating"        	# [<bool>]
        #Option     "VGAAccess"          	# [<bool>]
        #Option     "ReverseDDC"         	# [<bool>]
        #Option     "LVDSProbePLL"       	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "DRI"                	# [<bool>]
        #Option     "ConnectorTable"     	# <str>
        #Option     "DefaultConnectorTable" 	# [<bool>]
        #Option     "DefaultTMDSPLL"     	# [<bool>]
        #Option     "TVDACLoadDetect"    	# [<bool>]
        #Option     "ForceTVOut"         	# [<bool>]
        #Option     "TVStandard"         	# <str>
        #Option     "IgnoreLidStatus"    	# [<bool>]
        #Option     "DefaultTVDACAdj"    	# [<bool>]
        #Option     "Int10"              	# [<bool>]
        #Option     "EXAVSync"           	# [<bool>]
        #Option     "ATOMTVOut"          	# [<bool>]
        #Option     "R4xxATOM"           	# [<bool>]
        #Option     "ForceLowPowerMode"  	# [<bool>]
        #Option     "DynamicPM"          	# [<bool>]
        #Option     "NewPLL"             	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
	Identifier  "Card0"
	Driver      "radeon"
	VendorName  "Advanced Micro Devices [AMD] nee ATI"
	BoardName   "RV280 [Radeon 9200 PRO]"
	BusID       "PCI:1:0:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	DefaultDepth 24
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
```

And the Xorg.0.log is here.

Best regards,
Juan


----------



## Juanitou (Feb 26, 2013)

*Not SDL after all?*

Some news that seem to clear SDL of responsability (?): I have just installed Wine and I can run graphical applications and games as long as I use a virtual desktop. Any size works, even if it equals that of the X server display. Without the virtual desktop the problem is back: black screen (or window if the application does not use the full size), mouse stuttering and force rebootâ€¦

Does it give a hint of where the problem is?


----------



## wblock@ (Feb 26, 2013)

What do you mean by "virtual desktop"?  The Virtual setting in xorg.conf?  A window manager setting?


----------



## Juanitou (Feb 26, 2013)

Sorry for not being clear, I’m not very knowledgeable on this matters: Wine can be configured to run applications in a virtual desktop (just another window which opens on the actual desktop provided by the window manager), instead of using the full "real" desktop. You can set the resolution to fit your needs. Full screen programs (that’s what they think ) run perfectly inside this virtual desktop but crash outside it.

On the other hand, SDL applications crash whether they run on a window or in full screen.

I guess the driver has something broken with this video card, since when I installed Wine (32 bits) on a FreeBSD amd64 system some days ago I didn’t manage to run any of these games, even inside that virtual desktop, so at least there is some progress!

Thanks for your attention!


----------



## Juanitou (Feb 28, 2013)

I think I'll give up, there's maybe something broken on this old card or mobo, go figure...

Something I have forgotten is that I was using the secondary (VGA) port to test FreeBSD on this box since I had no DVI monitors left. This morning I thought Eureka! and full of hope I tried with the main port, reconfigured Xorg automatically and started the X server without issues. Unfortunately, the result was the same: freezing with SDL games (even as low profile as Dungeon Crawl Stone Soup in tiles mode) at any size, freezing with Wine if the game tries to access the full screen.

Well, I'll try with another card if I find one and in the meantime I'll get some real work done!

Bye,
Juan


----------



## Juanitou (Mar 1, 2013)

Well, I’m stubborn! I’m noting here the (lack of) progress on this issue for future reference. Maybe it will reduce somebody’s else frustration in the future and at the same time I work my English , I haven’t found anything in the Forum Rules against it…

So after much googling around and finding some discussions on freezing issues with this video card, I’ve tried changing some AGP BIOS options without success (AGP aperture size, FastWrites, memory).

I have installed graphics/mesa-demos and got some supplementary information on the card that seems to indicate that it should work with acceleration, little SDL games, etc.:

```
% glxinfo | egrep -i "OpenGL|render"
direct rendering: Yes
OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI R200 (RV280 5960) 20090101 AGP 8x x86/MMX+/3DNow!+/SSE2 TCL
OpenGL version string: 1.3 Mesa 7.6.1
OpenGL extensions:
```

Finally, after several reports of degraded performance I installed the older x11-drivers/xf86-video-ati613 and I got some progress: launching a SDL game completely froze the system instead of letting the mouse to pitifully move around without being able to really click on anything… :\

I’ll report the issue to the maintainer of the port, who knows, even if I understand that those drivers cannot support every feature of every hardware out there.

Best regards,
Juan


----------



## Juanitou (Mar 15, 2013)

Quick update: Using the Xorg provided with PC-BSD (which uses WITH_NEW_XORG and I guess more recent drivers, libdrm, etc.) things go really better, albeit DG Stone Soup is still a PITA to play (at around 25% of CPU usage, with very slow response to keyboard).

So, Radeon support seems to improve with this new Xorg version!


----------

