Wadjet Eye Games

Author Topic: Resolution Issues on Linux Version  (Read 9145 times)

Offline nevadinova

  • Newbie
  • *
  • Posts: 3
    • View Profile
Resolution Issues on Linux Version
« on: December 20, 2013, 07:24:00 PM »
Hi there,
I'm having some troubles running Gemini Rue on Ubuntu 13.10 properly. I tried the standalone version but have the same problems in the steam version aswell (Humble bundle with steam key). In my case, the game won't adjust it's resolution to the native screen resolution (1366x786), so I can only see the upper left quarter of the game. I tried messing around in the acsetup.cfg but couldn't find a way to make it work. The only thing that works almost flawlessly, is the window mode. But it appears to run pretty laggy and there are some serious sound glitches in the menu.
Help would be appreciated...
Thanks

Offline RealNC

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #1 on: December 21, 2013, 08:43:25 AM »
Unfortunately, the game's engine is somewhat lacking and it only supports pixel doubling for the game's original resolution, which is 320x200. So you only get support for 320x200, 640x400, 960x600 and 1280x800.

That means you need to introduce support for one of these resolutions in your X11 configuration. 1280x800 is just outside the range of your display (as it only goes up to 786). So your next bet should be 960x600 and 640x400.

In the acsetup.cfg file, these resolutions are selected by adjusting the scaler:

gfxfilter=StdScale2 -> 640x400
gfxfilter=StdScale3 -> 960x600
gfxfilter=StdScale4 -> 1280x800

If your X11 configuration doesn't  support these, you must add them yourself. Unfortunately, there's no way in X11 to add new resolution to the already existing ones. If you want to specify your own resolutions, you need to specify *all* resolutions you want to use, including your current one (1366x786). *And* you need to also specify details about your display (like its frequency range and synchronization clocks.) Yes, it sucks.

(Try the below only if none of the StdScale values listed above is working.)

On my system, in order to get more resolutions, I created the following file:

/etc/X11/xorg.conf.d/modelines.conf

(If the /etc/X11/xorg.conf.d/ directory doesn't exist, create it.)

The contents of that file for my system are:


Section "Monitor"
    Identifier    "Samsung XL2370"
    Option        "UseEdidFreqs" "False"
    Option        "ExactModeTimingsDVI" "True"
    ModeLine      "1920x1080@60"  148.50 1920 2008 2052 2200  1080 1084 1089 1125  +hsync +vsync
    ModeLine      "1920x1080@50"  141.45 1920 2032 2232 2544  1080 1081 1084 1112  +HSync +Vsync
    ModeLine      "1920x1080@48"  135.54 1920 2032 2232 2544  1080 1081 1084 1110  +HSync +Vsync
    ModeLine      "1680x1050"     146.25 1680 1784 1960 2240  1050 1053 1059 1089  +hsync +vsync
    ModeLine      "1600x1200"     162.00 1600 1664 1856 2160  1200 1201 1204 1250  +hsync +vsync
    ModeLine      "1440x900"      106.50 1440 1520 1672 1904   900  903  909  934  -hsync +vsync
    ModeLine      "1280x1024"     108.00 1280 1328 1440 1688  1024 1025 1028 1066  +hsync +vsync
    ModeLine      "1280x960"      108.00 1280 1376 1488 1800   960  961  964 1000  +hsync +vsync
    ModeLine      "1280x800"       83.50 1280 1352 1480 1680   800  803  809  831  -hsync +vsync
    ModeLine      "1024x768"       65.00 1024 1048 1184 1344   768  771  777  806  -hsync -vsync
    ModeLine      "800x600"        40.00  800  840  968 1056   600  601  605  628  +hsync +vsync
    ModeLine      "640x480"        25.18  640  656  752  800   480  490  492  525  -hsync -vsync
    HorizSync     30-67.6
    VertRefresh   46-60
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "NVidia GeForce GTX 780"
    Monitor        "Samsung XL2370"
    DefaultDepth    24
    Option         "TwinView" "0"
    SubSection     "Display"
        Depth  24
        Modes  "1920x1080@60"
    EndSubSection
EndSection


The "Device" entry is system specific; you also need to figure out what your driver uses as the device name. You can do that by looking at your existing /var/log/Xorg.0.log file. Look for a line that contains the word "Device". Here for example, it says:

[    10.826] (**) |   |-->Device "NVidia GeForce GTX 780"

So that means that in the "Screen" section of my modelines.conf file, I use:

Device         "NVidia GeForce GTX 780"

I have a modeline in there for 1280x800, which is what I'm using for this game. You should remove the modelines for resolutions you don't want (like the 1920x1080 ones.)

In order to get 640x400 or 960x600, you can use this site:

http://www.arachnoid.com/modelines/

and compute the modelines you need. For 960x600 at 60Hz, you would insert this into the list of modelines:

Modeline "960x600_60.00" 45.98 960 1000 1096 1232 600 601 604 622 -HSync +Vsync

Do not forget to also insert a modeline for your native resolution! 1366x786 at 60Hz:

Modeline "1368x786_60.00" 87.91 1368 1440 1584 1800 786 787 790 814 -HSync +Vsync

If it turns out that this doesn't work for you and your desktop is messed up in the end, just delete the file /etc/X11/xorg.conf.d/modelines.conf again and reboot. You'll be back to your original settings.

This whole procedure sucks and it might not even work at all. For example if you're using a laptop that has two graphics cards in it (integrated and discreet one, like on NVidia Optimus systems), then this procedure will probably not work at all. Why the game's engine is unable to just use your native resolution and then scale the game to it is totally beyond me. I suspect it might have something to do with how old the engine is and no one is updating it for modern systems.
« Last Edit: December 21, 2013, 08:58:41 AM by RealNC »

Offline nevadinova

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #2 on: December 21, 2013, 08:23:01 PM »
Hi RealNC,

first I'd like to thank you for your detailed reply.
I gave the gfxfilter settings anther try and used 3 and 4. Running in terminal it gave me this error:

AGS: Attempt to switch gfx mode to 426 x 240 (15-bit)
AGS: Failed, resolution not supported
AGS: Attempt to switch gfx mode to 320 x 240 (15-bit)
AGS: Failed, resolution not supported
There was a problem initializing graphics mode 960 x 720 (16-bit).
(Problem: 'This graphics mode is not supported')
Try to correct the problem, or seek help from the AGS homepage.

So I concluded that the problem was exactly what you suggested. Following your guide I tried to figure out the Device name used in the Xorg.0.log file so that I could create the modelines.conf. That's where the next problem occured.
The only passage I could find that appeared somehow usefull (and included "Device") was this:

16.071] (==) No Layout section.  Using the first Screen section.
[    16.071] (==) No screen section available. Using defaults.
[    16.071] (**) |-->Screen "Default Screen Section" (0)
[    16.071] (**) |   |-->Monitor "<default monitor>"
[    16.072] (==) No monitor specified for screen "Default Screen Section".
   Using a default monitor configuration.
[    16.072] (==) Automatically adding devices
[    16.072] (==) Automatically enabling devices
[    16.072] (==) Automatically adding GPU devices

So I found out the device name of the monitor, but not of the graphic card. It all went downhill from there...I'm using a notebook with an Radeon HD 6320 graphic chip and because there was no hint for it in the xlog file, I thought that it could be a good idea to install the official drivers from the amd website, which just caused a lot of new trouble. Now I'm back with the open source drivers, but still couldn't find a way to figure out which device name my driver uses.  I could find the entry "Gallium 0.4 on AMD PALM" in the system details.
After checking the etc/X11/ for the xorg.conf file (which wasn't there) I found this in a file named
xorg.conf.fglrx-0

Section "ServerLayout"
   Identifier     "aticonfig Layout"
   Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Module"
EndSection

Section "Monitor"
   Identifier   "aticonfig-Monitor[0]-0"
   Option       "VendorName" "ATI Proprietary Driver"
   Option       "ModelName" "Generic Autodetecting Monitor"
   Option       "DPMS" "true"
EndSection

Section "Device"
   Identifier  "aticonfig-Device[0]-0"
   Driver      "fglrx"
   BusID       "PCI:0:1:0"
EndSection

Section "Screen"
   Identifier "aticonfig-Screen[0]-0"
   Device     "aticonfig-Device[0]-0"
   Monitor    "aticonfig-Monitor[0]-0"
   DefaultDepth     24
   SubSection "Display"
      Viewport   0 0
      Depth     24
   EndSubSection
EndSection

So, I created the modelines file and it looks like this:
Section "Monitor"
    Identifier    "aticonfig-Monitor[0]-0"
    Option       "VendorName" "ATI Proprietary Driver"
    Option       "ModelName" "Generic Autodetecting Monitor"
    Option       "DPMS" "true"
Modeline "1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync
Modeline "960x600_60.00" 45.98 960 1000 1096 1232 600 601 604 622 -HSync +Vsync
Modeline "960x720_60.00" 55.86 960 1008 1104 1248 720 721 724 746 -HSync +Vsync
Modeline "320x200_60.00" 4.19 320 304 328 336 200 201 204 208 -HSync +Vsync
EndSection

Section "Screen"
   Identifier "aticonfig-Screen[0]-0"
   Device     "aticonfig-Device[0]-0"
   Monitor    "aticonfig-Monitor[0]-0"
   DefaultDepth     24
   SubSection "Display"
      Viewport   0 0
      Depth     24
   EndSubSection
EndSection

Is this ok?
Sadly it doesn't change anything as you can see here:
AGS: Switching to graphics mode
AGS: Widescreen side borders: game resolution: 320 x 200; desktop resolution: 1366 x 768
AGS: Widescreen side borders: disabled (not necessary, game and desktop aspect ratios match)
AGS: Attempt to switch gfx mode to 320 x 200 (16-bit)
AGS: Failed, resolution not supported
AGS: Widescreen side borders: game resolution: 320 x 240; desktop resolution: 1366 x 768
AGS: Widescreen side borders: enabled, attempting resolution 426 x 240
AGS: Attempt to switch gfx mode to 426 x 240 (16-bit)
AGS: Failed, resolution not supported
AGS: Attempt to switch gfx mode to 320 x 240 (16-bit)
AGS: Failed, resolution not supported
AGS: Widescreen side borders: game resolution: 320 x 200; desktop resolution: 1366 x 768
AGS: Widescreen side borders: disabled (not necessary, game and desktop aspect ratios match)
AGS: Attempt to switch gfx mode to 320 x 200 (15-bit)
AGS: Failed, resolution not supported
AGS: Widescreen side borders: game resolution: 320 x 240; desktop resolution: 1366 x 768
AGS: Widescreen side borders: enabled, attempting resolution 426 x 240
AGS: Attempt to switch gfx mode to 426 x 240 (15-bit)
AGS: Failed, resolution not supported
AGS: Attempt to switch gfx mode to 320 x 240 (15-bit)
AGS: Failed, resolution not supported
There was a problem initializing graphics mode 960 x 600 (16-bit).
(Problem: 'This graphics mode is not supported')
Try to correct the problem, or seek help from the AGS homepage.





Thanks for your kind help!

« Last Edit: December 22, 2013, 10:02:15 AM by nevadinova »

Offline RealNC

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #3 on: December 22, 2013, 11:37:39 AM »
It seems your setup is using a fully automatic configuration. That's normally a good thing, as you don't need to mess around with xorg.conf stuff. But unfortunately in this case, it's a bad thing because of the game's lack of proper resolution support.

So try manually loading the driver and specifying a device identifier. To do that, create a file:

/etc/X11/xorg.conf.d/10-radeon_oss.conf

These file names are arbitrary, really. All that matters is that they end in ".conf". The "10-" prefix I chose here just makes sure it gets loaded before the "modelines.conf" file, as the conf files are loaded in alphabetical order.

In that file, put this in it:


Section "Device"
    Identifier "Radeon"
    Driver "radeon"
EndSection


The "Identifier" is also arbitrary; you can use whatever you want. It's just a name that you can then use to refer to this "Device" in other sections. The "Driver" name is *not* arbitrary, however. To use the open source Radeon driver, it must be set to "radeon", as that's the name of the driver module. The radeon driver supports "Option" fields as well, but you don't need to use them; it's best to let it choose default settings. If you think you need or want to tweak something, type "man radeon" in a terminal and the manual page of the radeon driver will be displayed, giving you documentation about the option you can use inside the "Device" section of the radeon driver.

Btw, make sure you uninstalled the AMD Catalyst for Linux ("fglrx") driver first. It replaces the default OpenGL library of the system if you install it, so uninstall it again to get the Gallium3D/Mesa implementation of OpenGL. The open source "radeon" driver won't work correctly otherwise.

Now, in order to keep things simple and test it quickly, just use a modelines.conf file that only has this in it:


Section "Monitor"
    Identifier "My laptop screen"
    Option "UseEdidFreqs" "False"
    Option "ExactModeTimingsDVI" "True"
    Modeline "1368x786" 87.91 1368 1440 1584 1800 786 787 790 814 -HSync +Vsync
    HorizSync     30-49
    VertRefresh   50-60
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Radeon"
    Monitor        "My laptop screen"
    DefaultDepth    24
    SubSection     "Display"
        Depth  24
        Modes  "1368x786"
    EndSubSection
EndSection


If it now works for you, then simply try to add more "Modeline" lines for resolutions you want to add, as calculated in http://www.arachnoid.com/modelines.

The 1368x786 modeline I used above is from that site. I recommend however to use the auto-detected modelines; that means, in your default setup, with no files in the xorg.conf.d directory, open a terminal and type "xvidtune -show". This will give you the list of resolution modelines that your display reported to the driver. So instead of my modeline above, simply copy&paste the output of xvidtune into the modelines.conf file, and then add your own to extend that list. If the xvidtune program is not found, then install the "x11-xserver-utils" package ("sudo apt-get install x11-xserver-utils").

Note that the options UseEdidFreqs and ExactModeTimingsDVI might be NVidia specific; to know for sure, you can inspect the /var/log/Xorg.0.log file. If it says something like "UseEdidFreqs: unknown option", then you can simply delete the lines with those options.

Hope that helps.
« Last Edit: December 22, 2013, 12:00:46 PM by RealNC »

Offline nevadinova

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #4 on: December 22, 2013, 05:09:48 PM »
Alright, I got it running in fullscreen in 960x600. That's a huge improvement, so far. So thank you, it took me a while  (not the sharpest tool in the shed). Anyhow, the game runs really laggy (mouse and sound) except when I set the gfxfilter=StdScale to 1. I tried to add a modeline with an 320x200 resolution to run it in fullscreen, but it's not appearing in the display settings menu. Is it even possible to add such a low resolution? 2nd question would be if i always have to change the resolution through system settings before running the game?

edit:
could this be the reason for the occuring sound errors?it starts fine but at least when the first conversations take places it starts to sound really bad (robostyle)

Checking sound inits.
AGS: Initialize sound drivers
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
« Last Edit: December 22, 2013, 08:22:45 PM by nevadinova »

Offline RealNC

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #5 on: December 23, 2013, 10:04:09 AM »
Alright, I got it running in fullscreen in 960x600. That's a huge improvement, so far. So thank you, it took me a while  (not the sharpest tool in the shed). Anyhow, the game runs really laggy (mouse and sound) except when I set the gfxfilter=StdScale to 1. I tried to add a modeline with an 320x200 resolution to run it in fullscreen, but it's not appearing in the display settings menu. Is it even possible to add such a low resolution?
Probably not, but you can try a 640x400 modeline and use StdScale2 to make the game use that resolution.

Quote
2nd question would be if i always have to change the resolution through system settings before running the game?
If the modeline is present, the game changes the resolution on its own when you start it. The resolution it changes to depends on the StdScale value. StdScale1 is 320x200, StdScale2 doubles each dimension (640x400), StdScale3 triples (960x600), and so on.

Quote
edit:
could this be the reason for the occuring sound errors?it starts fine but at least when the first conversations take places it starts to sound really bad (robostyle)

Checking sound inits.
AGS: Initialize sound drivers
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
No, has nothing to do with it. This game doesn't use MIDI music. No idea what's causing your problem :-| Does the same thing happen when you run the game in a window but with StdScale3?

windowed=1
gfxfilter=StdScale3

Offline DaveGilbert

  • Administrator
  • Hero Member
  • *****
  • Posts: 2215
    • View Profile
Re: Resolution Issues on Linux Version
« Reply #6 on: December 29, 2013, 08:30:06 AM »
If you are having trouble, I would recommend emailing support@humblebundle.com. They are the ones who made the port, and are best equipped to help you.