2

I'm trying to set the resolution and refresh rate of a screen when i launch an application on a new xserver.

The xrandr commands i usually use to get this screen to work are:

 xrandr --newmode 2560x1440 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync
 xrandr --addmode HDMI1 2560x1440
 xrandr --output HDMI1 --mode 2560x1440
 xrandr --output LVDS1 --off

The command i am using to start the xserver is

 xinit /usr/bin/urbanterror $* -- :1

Here is what i have tried so far

I think i need to put these xrandr settings in a xorg config file and pass it in:

 xinit /usr/bin/urbanterror $* -- :1 -xf86config xorg.conf

I'm really unsure on how to do write the conf file to replicate these settings, the closest i have found is at the bottom of this webpage, but i feel that it is incomplete.

I have also tried putting the xrandr commands in a script using that as the program to be started in the new xserver.

 xinit /home/user/.urtrc $* -- :1

with .urtrc containing

 #!/bin/sh

 xrandr --newmode 2560x1440 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync
 xrandr --addmode HDMI1 2560x1440
 xrandr --output HDMI1 --mode 2560x1440
 xrandr --output LVDS1 --off

 exec urbanterror

This worked, but the performance was aweful, i was barely getting 3fps on the lowest settings. I have no idea why.

Any help would be much appreciated.

Update

Running glxgears in the new xserver gives these 2 errors:

 libGL error: failed to open drm device: Permission denied
 libGL error: failed to load driver: i965

So i know it's a permission problem. The script with the xrandr commands runs fine when run from root, and glxgears reports no errors. However i really don't want to have to run this as root for a number of reasons.

Before systemd this problem was solved by adding the user to group video. However after systemd there is no video group.

Any help on fixing those 2 errors would be appreciated.

  • Your .utrc file looks like it would work fine. Maybe OpenGL isn’t getting enabled when you start X this way? – yellowantphil May 2 '15 at 4:05
  • I think you're right. I rendering manager for sure doesn't start, and i think opengl relies on that, not 100% sure. So it's a permissions problem now. – jmoggr May 2 '15 at 18:47
  • Do you have some other way of starting X that works? My impression is that you exit X and then start a new X session with your game as the only client. Also, systemd is my arch nemesis. – yellowantphil May 6 '15 at 19:00
  • My Arch system has a video group and systemd. Maybe try adding the group and see if it does anything? – yellowantphil May 7 '15 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.