Previous Thread
Next Thread
Print Thread
Joined: Mar 2009
Posts: 69
Likes: 1
M
Member
OP Offline
Member
M
Joined: Mar 2009
Posts: 69
Likes: 1
For many years I had this same desktop setup with an Nvidia GTX 1060 card and two monitors. Usually I run with just the one primary monitor but sometimes I connect the second monitor using "TwinView" which is Nvidia's way of extending the desktop to the second monitor (as opposed to screen mirroring). I just updated this system to Xubuntu 22.10 and using Mame 0.250 and I get some X Error now. Xubuntu is still using X11 not Wayland, so I don't know if that has anything to do with it since this used to just work flawlessly for many years. Any help would be appreciated.


X Error of failed request: BadRRCrtc (invalid Crtc parameter)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 20 (RRGetCrtcInfo)
Crtc id in failed request: 0x0
Serial number of failed request: 243
Current serial number in output stream: 243

Below is the full output. I also tried with -noreadconfig and get the same result.


Code
$ mame -screen screen1 -video opengl -bgfx_backend none -bgfx_screen_chains none -effect none -verbose
Attempting load of mame.ini
Parsing mame.ini
Attempting load of mame.ini
Parsing mame.ini
Loading translation file /usr/share/games/mame/language/English/strings.mo
Reading translation file: 1 strings, original table at word offset 7, translated table at word offset 9
Loaded 0 translated string from file
Starting plugin data...
Starting plugin timer...
Starting plugin cheat...
Starting plugin layout...
Attempting load of mame.ini
Parsing mame.ini
Attempting load of mame.ini
Parsing mame.ini
Available videodrivers: x11 wayland KMSDRM dummy evdev 
Current Videodriver: x11
	Display #0
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
	Display #1
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
Available audio drivers: 
	pulseaudio          
	alsa                
	sndio               
	pipewire            
	dsp                 
	disk                
	dummy               
Build version:      0.250 (unknown)
Build architecure:  
Build defines 1:    SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 
Build defines 1:    LSB_FIRST=1 PTR64=1 
SDL/OpenGL defines: SDL_COMPILEDVERSION=4400 USE_OPENGL=1 
Compiler defines A: __GNUC__=12 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=0 __VERSION__="12.2.0" 
Compiler defines B: __amd64__=1 __x86_64__=1 __unix__=1 
Compiler defines C: __USE_FORTIFY_LEVEL=0 
Enter init_monitors
Adding monitor screen0 (1920 x 1080)
Adding monitor screen1 (1920 x 1080)
Leave init_monitors
Enter sdlwindow_init
Using SDL multi-window OpenGL driver (SDL 2.0+)

Hints:
	SDL_FRAMEBUFFER_ACCELERATION             (NULL)
	SDL_RENDER_DRIVER                        (NULL)
	SDL_RENDER_OPENGL_SHADERS                (NULL)
	SDL_RENDER_SCALE_QUALITY                 (NULL)
	SDL_RENDER_VSYNC                         (NULL)
	SDL_VIDEO_X11_XVIDMODE                   (NULL)
	SDL_VIDEO_X11_XINERAMA                   (NULL)
	SDL_VIDEO_X11_XRANDR                     (NULL)
	SDL_GRAB_KEYBOARD                        (NULL)
	SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS         (NULL)
	SDL_IOS_IDLE_TIMER_DISABLED              (NULL)
	SDL_IOS_ORIENTATIONS                     (NULL)
	SDL_XINPUT_ENABLED                       (NULL)
	SDL_GAMECONTROLLERCONFIG                 (NULL)
	SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS     (NULL)
	SDL_ALLOW_TOPMOST                        (NULL)
	SDL_TIMER_RESOLUTION                     (NULL)
	SDL_RENDER_DIRECT3D_THREADSAFE           (NULL)
	SDL_VIDEO_ALLOW_SCREENSAVER              (NULL)
	SDL_ACCELEROMETER_AS_JOYSTICK            (NULL)
	SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK   (NULL)
	SDL_VIDEO_WIN_D3DCOMPILER                (NULL)
	SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT      (NULL)
	SDL_VIDEO_MAC_FULLSCREEN_SPACES          (NULL)
	SDL_MOUSE_RELATIVE_MODE_WARP             (NULL)
	SDL_RENDER_DIRECT3D11_DEBUG              (NULL)
	SDL_VIDEO_HIGHDPI_DISABLED               (NULL)
	SDL_WINRT_PRIVACY_POLICY_URL             (NULL)
	SDL_WINRT_PRIVACY_POLICY_LABEL           (NULL)
	SDL_WINRT_HANDLE_BACK_BUTTON             (NULL)
Leave sdlwindow_init
Enter sdl_info::create
X Error of failed request:  BadRRCrtc (invalid Crtc parameter)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  20 (RRGetCrtcInfo)
  Crtc id in failed request: 0x0
  Serial number of failed request:  243
  Current serial number in output stream:  243

Joined: Feb 2014
Posts: 1,016
Likes: 110
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,016
Likes: 110
searching around on "BadRRCrtc"

xrandr --output (output name) --primary
may solve this.

https://github.com/lahwaacz/sxlock/issues/4

https://sourceforge.net/p/extremetuxracer/discussion/help/thread/e569ca2104/?limit=25


I have no idea if that'll help since I don't have an nvidia card.



You might try the "-resolution" parameter or even just open in "-window" windowed mode.

-resolution preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'
-resolution0 preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'
-resolution1 preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'
-resolution2 preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'
-resolution3 preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'
-switchres enable resolution switching

./mame -showusage | grep maximize
-maximize default to maximized windows

Joined: Mar 2009
Posts: 69
Likes: 1
M
Member
OP Offline
Member
M
Joined: Mar 2009
Posts: 69
Likes: 1
Thanks for the tips. xrandr reports a primary monitor on my system, but if I experiment the "other" monitor primary (and run mame with -screen screen0) I get a slightly different error!

X Error of failed request: GLXBadDrawable
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 11 (X_GLXSwapBuffers)
Serial number of failed request: 425
Current serial number in output stream: 427

I can start mame with -window and specify the screen and the mame window appears on the screen I tell it, but if I do Alt-Enter during emulation I still get the same error.

X Error of failed request: BadRRCrtc (invalid Crtc parameter)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 20 (RRGetCrtcInfo)
Crtc id in failed request: 0x0
Serial number of failed request: 479
Current serial number in output stream: 479

Joined: Feb 2014
Posts: 1,016
Likes: 110
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,016
Likes: 110
I wonder if it's trying to change/set resolutions when it goes to fullscreen.

(One app that's pretty useful is arandr even though you have the display settings in xubuntu)


You could try specifying the resolution to switch to, does TwinView treat both screens as one big monitor screen? Maybe -resolution 3840x1080

In the mame log it seems to think there's two screens, maybe try -numscreens 2?

What does xrandr report? xrandr --verbose gives you even more info.

You might even try using -video bgfx -bgfx_backend opengl or -video vulkan

Joined: Mar 2009
Posts: 69
Likes: 1
M
Member
OP Offline
Member
M
Joined: Mar 2009
Posts: 69
Likes: 1
OK I figured this out after messing around with other emulators like Mednafen and getting the same results. It's something do to with SDL2. There's was new environment variable that I wasn't aware of

export SDL_VIDEO_X11_XRANDR=0

I need to set that in order to specify the screen. Actually, if this is set, then I don't even need to use "-screen screen**", mame will just start the display on whatever monitor the variable is set to, 0 or 1. Some SDL environment variables that I used in the past were these ones:

SDL_WINDOW_FULLSCREEN_DESKTOP=**
SDL_VIDEO_FULLSCREEN_HEAD=**
SDL_WINDOW_FULLSCREEN=**
SDL_VIDEO_FULLSCREEN_DISPLAY=**

But I don't think these seem to do anything anymore. I'll have to do more experimenting. I have SDL 2.24.0 on Xubuntu 22.10.


Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
2 members (2 invisible), 63 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,239
Posts120,950
Members5,061
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com