# How can I open GOG (Linux) games?



## myshkin (Jan 13, 2020)

I try to open GOG (Linux) games via FreeBSD but I always get this error: 

```
Found path: /home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64
Mono path[0] = '/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Managed'
Mono path[1] = '/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono'
Mono config path = '/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/etc'
*** Error in `/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64': free(): invalid pointer: 0x00000008070aeba0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81679)[0x804a81679]
/lib64/libpthread.so.0(pthread_attr_destroy+0xd)[0x80260965d]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/x86_64/libmono.so(+0xd9b97)[0x806cd9b97]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/x86_64/libmono.so(+0x34cae)[0x806c34cae]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64[0x8089ce]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64[0xe998bd]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64[0x464bb6]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x804a22505]
/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64[0x46e9d9]
======= Memory map: ========
Abort trap (core dumped)
```

The packages linux-c7-dri and linux_base-c7 are both installed. The linux-c7-libGLU package is not installed but I do not think this is necessary when linux-c7-dri is already present. Linux support (for 32-bit & 64-bit) is of course enabled. The installation of Kona and Oxenfree is both completed without problems. But opening the games is not possible.


----------



## Sevendogsbsd (Jan 13, 2020)

I have never had any luck running games this way. If I want to game on FreeBSD, I use the windows game version and use emulators/1386-wine.


----------



## myshkin (Jan 13, 2020)

Sevendogsbsd said:


> I have never had any luck running games this way. If I want to game on FreeBSD, I use the windows game version and use emulators/1386-wine.


I use Homura for steam games and that works perfectly: https://github.com/the-homura-project/homura I also have a collection (Linux) games that I purchased through GOG. According to this topic, these should also work on FreeBSD: https://www.gog.com/forum/general/playing_linux_games_on_freebsdpcbsd I have now also seen that Homura has a GOG Galaxy launcher so I will give this a try. Tips to make it work without Homura are always welcome.


----------



## Sevendogsbsd (Jan 13, 2020)

Looks like Homura is just a wine frontend? I normally run all games via the wine command line although I have had good luck with "PlayonBSD", which is another wine frontend. I have never played a Linux only game though on FreeBSD.


----------



## myshkin (Jan 13, 2020)

I have installed the GOG Galaxy launcher (via Homura) and only the windows versions work. The intention is of course to use the Linux version because OpenGL gives much better performance than a translation from DX11 to OpenGL. If anyone has got the GOG Linux versions (OpenGL) working on FreeBSD, then I would like to hear how this works.


----------



## myshkin (Jan 13, 2020)

Sevendogsbsd said:


> Looks like Homura is just a wine frontend? I normally run all games via the wine command line although I have had good luck with "PlayonBSD", which is another wine frontend. I have never played a Linux only game though on FreeBSD.


It does indeed use wine but it is time saving and it has a custom steam interface. As you can see in this link, there are people who have made the GOG Linux versions work: https://www.gog.com/forum/general/playing_linux_games_on_freebsdpcbsd This is what I am trying to do.


----------



## CraigHB (Jan 14, 2020)

I have a few old Windows games I like to play once in while.  In my ultimate goal to kick the Windows habit I'll be having a go with wine to see if I can run them on FreeBSD once I get my new machine put together .  Good to see it's something that should work.  Now Widevine is a whole other showstopper.  May have to limit my Netflix viewing to the TV box.


----------



## Sevendogsbsd (Jan 14, 2020)

Wine (i386) works well for most of the older games I play. Some don’t work at all or the graphics are broken. I don’t use a front end, just `wine <path to game exe>`. Winetricks is helpful also.


----------



## myshkin (Jan 14, 2020)

CraigHB said:


> I have a few old Windows games I like to play once in while.  In my ultimate goal to kick the Windows habit I'll be having a go with wine to see if I can run them on FreeBSD once I get my new machine put together .  Good to see it's something that should work.  Now Widevine is a whole other showstopper.  May have to limit my Netflix viewing to the TV box.


On Linux you can simply watch Netflix via Firefox. I think it will work the same way on FreeBSD by enabling DRM in Firefox: https://itsfoss.com/netflix-firefox-linux/


Sevendogsbsd said:


> Wine (i386) works well for most of the older games I play. Some don’t work at all or the graphics are broken. I don’t use a front end, just `wine <path to game exe>`. Winetricks is helpful also.


It works but it is very inefficient because it translates DirectX to OpenGL and this means that you will achieve much lower performance than on native DirectX. Since I have weak hardware, I try to make the GOG OpenGL Linux games work, then it should not do this translation from DirectX, and then the performance will be much higher in percentage terms, very important for people with weak hardware.

I have now come to the conclusion that it might only be the 32-bit GOG Linux games that should work. And that is why I have now used Grim Fandango as a test. Then it seems to get even further, but it still faces a problem: 

```
Command line arg: ./GrimFandango
Absolute executable path: /usr/home/ezio/Documents/GOGGames/GrimFandango/game/bin/GrimFandango
Leaving working directory as: /usr/home/ezio/Documents/GOGGames/GrimFandango/game/bin
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  97
  Current serial number in output stream:  9
```


I searched for this problem and found this page: https://askubuntu.com/questions/541343/problems-with-libgl-fbconfigs-swrast-through-each-update  That's why I deleted /compat/linux/lib/libGL.so.1 

But it seems that it needs this file. So I got stuck here. Is there anyone who knows how to resolve the above error message on FreeBSD using the proprietary nvidia drivers?


----------



## CraigHB (Jan 14, 2020)

myshkin said:


> On Linux you can simply watch Netflix via Firefox. I think it will work the same way on FreeBSD by enabling DRM in Firefox: https://itsfoss.com/netflix-firefox-linux/



That's good to hear on the Netflix DRM stuff.

The machine I'll be using should be plenty powerful enough to make up for any inefficiency.  The games I want to run are old and don't need much power, probably wine will do the job well enough.  Though hopefully you'll get an answer to running the Linux versions.  I do have a program or two I run under the Linux compat layer and it's good when you can use it.


----------



## shkhln (Jan 14, 2020)

myshkin said:


> I have now come to the conclusion that it might only be the 32-bit GOG Linux games that should work.



That's not true.
"GOG games" is not a valid category as far as the implementation technology is concerned. You can't make any predictions from that.



myshkin said:


> That's why I deleted /compat/linux/lib/libGL.so.1



Don't mess with the installed files.



myshkin said:


> Is there anyone who knows how to resolve the above error message on FreeBSD using the proprietary nvidia drivers?



`pkg install linux-nvidia-libs`
(Substitute the appropriate package name here if you are using a legacy driver.)


----------



## myshkin (Jan 14, 2020)

shkhln said:


> That's not true.
> "GOG games" is not a valid category as far as the implementation technology is concerned. You can't make any predictions from that.


With that statement I was only talking about GOG Linux games. It was not my own thought but something that I had read here: https://www.gog.com/forum/general/playing_linux_games_on_freebsdpcbsd But it seems that 64-bit Linux GOG game support has become possible in the meantime.



shkhln said:


> Don't mess with the installed files.


I had made a backup of that file and put it back.


shkhln said:


> `pkg install linux-nvidia-libs`


I have now installed linux-nvidia-libs-390, because I also use the 390 version on freebsd. The 440 version does not yet have a patch for wine. And the problem now seems resolved. But I have one last problem:

```
Command line arg: ./GrimFandango
Absolute executable path: /usr/home/ezio/Documents/GOGGames/GrimFandango/game/bin/GrimFandango
Leaving working directory as: /usr/home/ezio/Documents/GOGGames/GrimFandango/game/bin
setsockopt(SOL_SOCKET, SO_PASSCRED): Protocol not available
Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:106, function pa_mutex_unlock(). Aborting.
Abort trap (core dumped)
```

I have installed these packages:

```
alsa-lib-1.1.2_2               ALSA compatibility library
alsa-plugins-1.1.1_6           ALSA compatibility library plugins
alsa-utils-1.1.2               ALSA compatibility utils
linux-c7-alsa-lib-1.1.8        Advanced Linux Sound Architecture libraries (Linux CentOS 7.7.1908)
linux-c7-alsa-plugins-oss-1.1.6_3 OSS plugin for ALSA (Linux CentOS 7.7.1908)
linux-c7-alsa-plugins-pulseaudio-1.1.6 PulseAudio plugin for ALSA (Linux CentOS 7.7.1908)
linux-c7-alsa-utils-1.1.8      Advanced Linux Sound Architecture utilities (Linux CentOS 7.7.1908)
linux-c7-pulseaudio-libs-10.0_2 Libraries for PulseAudio clients (Linux CentOS 7.7.1908)
pulseaudio-13.0                Sound server for UNIX
```

I have seen that someone has had exactly the same problem: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240043#c13  The first part of the solution is this workaround: https://gist.github.com/shkhln/3f4756770182d406b0a9968509f6711e And the second part of the solution is this code: 

```
% mkdir noalsa
% ln -s /dev/null noalsa/libasound.so.2
% LD_LIBRARY_PATH=noalsa
```

But I don't understand anything about the first part of the solution (the workaround). How do you do this workaround?


----------



## shkhln (Jan 14, 2020)

myshkin said:


> I have seen that someone has had exactly the same problem: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240043#c13  The first part of the solution is this workaround: https://gist.github.com/shkhln/3f4756770182d406b0a9968509f6711e And the second part of the solution is this code:
> 
> ```
> % mkdir noalsa
> ...



There are multiple issues discussed in that thread. Neither of these workarounds would work for GrimFandango. I suggest deinstalling linux-c7-pulseaudio-libs.


----------



## myshkin (Jan 14, 2020)

Thank you for the answer. I have removed linux-c7-pulse audio libs as you suggest. If I do 'pkg autoremove' then it wants to remove these packages:


```
linux-c7-dbus-libs-1.10.24_1
linux-c7-elfutils-libs-0.176
linux-c7-systemd-libs-219_3
linux-c7-libsndfile-1.0.25_3
linux-c7-flac-libs-1.3.0_2
linux-c7-libasyncns-0.8_1
linux-c7-libgcrypt-1.5.3_4
linux-c7-libgpg-error-1.12_2
linux-c7-libvorbis-1.3.3_2
linux-c7-libogg-1.3.0_1
linux-c7-lz4-1.7.5_1
linux-c7-tcp_wrappers-libs-7.6_2
```

Can these also be deleted? GrimFandango still displays the same error message after removing linux-c7-pulse. And which GOG games give the least problems?

Kona gives this error message: 

```
Running Kona
Set current directory to /usr/home/ezio/Documents/GOGGames/Kona/game
Found path: /usr/home/ezio/Documents/GOGGames/Kona/game/Kona.x86_64
Mono path[0] = '/usr/home/ezio/Documents/GOGGames/Kona/game/Kona_Data/Managed'
Mono path[1] = '/usr/home/ezio/Documents/GOGGames/Kona/game/Kona_Data/Mono'
Mono config path = '/usr/home/ezio/Documents/GOGGames/Kona/game/Kona_Data/Mono/etc'
*** Error in `./Kona.x86_64': free(): invalid pointer: 0x000000082baafbb0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81679)[0x803e81679]
/lib64/libpthread.so.0(pthread_attr_destroy+0xd)[0x802a0965d]
/usr/home/ezio/Documents/GOGGames/Kona/game/Kona_Data/Mono/x86_64/libmono.so(+0xda303)[0x82b6da303]
/usr/home/ezio/Documents/GOGGames/Kona/game/Kona_Data/Mono/x86_64/libmono.so(+0x34dee)[0x82b634dee]
./Kona.x86_64[0x9f7d86]
./Kona.x86_64[0x124f033]
./Kona.x86_64[0x45410a]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x803e22505]
./Kona.x86_64[0x45de99]
======= Memory map: ========
/home/ezio/Documents/GOGGames/Kona/start.sh: line 16: 79074 Abort trap              (core dumped) ./"Kona.x86_64"
```
Oxenfree gives this error message: 

```
Running Oxenfree
Set current directory to /usr/home/ezio/Documents/GOGGames/Oxenfree/game
Found path: /usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86
Mono path[0] = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Managed'
Mono path[1] = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono'
Mono config path = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/etc'
support/gog_com.shlib: line 94: 91435 Segmentation fault      (core dumped) ./"${bin_32}"
```
Do you have an idea what the problem might be?


----------



## shkhln (Jan 14, 2020)

myshkin said:


> GrimFandango still displays the same error message after removing linux-c7-pulse.



It really shouldn't, since it's a libpulse message. Although, to be fair, there might be another libpulse copy bundled with the game, I don't remember if that is the case. Try `env SDL_AUDIODRIVER=alsa ./GrimFandango`.



myshkin said:


> Oxenfree gives this error message:
> 
> ```
> Running Oxenfree
> ...



Would you mind running it with `truss`?


----------



## myshkin (Jan 15, 2020)

shkhln said:


> It really shouldn't, since it's a libpulse message. Although, to be fair, there might be another libpulse copy bundled with the game, I don't remember if that is the case. Try `env SDL_AUDIODRIVER=alsa ./GrimFandango`.



This now worked thanks to your tip. It doesn't work anymore at the moment, but that's probably because I placed DEFAULT_VERSIONS=linux=c7_64 in /etc/make.conf. And then I reinstalled linux_base-c7.



shkhln said:


> Would you mind running it with `truss`?




```
truss ./Oxenfree.x86_64
Set current directory to /usr/home/ezio/Documents/GOGGames/Oxenfree/game
Found path: /usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree.x86_64
Mono path[0] = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Managed'
Mono path[1] = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono'
Mono config path = '/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/etc'
*** Error in `./Oxenfree.x86_64': free(): invalid pointer: 0x00000008070aeba0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81679)[0x804a81679]
/lib64/libpthread.so.0(pthread_attr_destroy+0xd)[0x80260965d]
/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/x86_64/libmono.so(+0xd9b97)[0x806cd9b97]
/usr/home/ezio/Documents/GOGGames/Oxenfree/game/Oxenfree_Data/Mono/x86_64/libmono.so(+0x34cae)[0x806c34cae]
./Oxenfree.x86_64[0x8089ce]
./Oxenfree.x86_64[0xe998bd]
./Oxenfree.x86_64[0x464bb6]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x804a22505]
./Oxenfree.x86_64[0x46e9d9]
======= Memory map: ========
truss: Unable to enable LWP events for pid 6032: No such process
```

I also tried some other games that also had specific problems:


```
env SDL_AUDIODRIVER=alsa ./pillars
./pillars: error while loading shared libraries: libopenal.so: cannot open shared object file: No such file or directory

truss env SDL_AUDIODRIVER=alsa "./Shadow Tactics"
Set current directory to /usr/home/ezio/Documents/GOGGames/Shadow Tactics
Found path: /usr/home/ezio/Documents/GOGGames/Shadow Tactics/Shadow Tactics
Mono path[0] = '/usr/home/ezio/Documents/GOGGames/Shadow Tactics/Shadow Tactics_Data/Managed'
Mono path[1] = '/usr/home/ezio/Documents/GOGGames/Shadow Tactics/Shadow Tactics_Data/Mono'
Mono config path = '/usr/home/ezio/Documents/GOGGames/Shadow Tactics/Shadow Tactics_Data/Mono/etc'
truss: Unable to enable LWP events for pid 19166: No such process

env SDL_AUDIODRIVER=alsa ./witcher2
ELF interpreter /lib/ld-linux.so.2 not found, error 2
Abort trap
```

I have installed linux-c7-openal-soft but ./pillars still gives the same message, even if I open it with `env SDL_AUDIODRIVER=openal ./pillars` I also investigated the error message of The Witcher 2, but the most logical solutions made no difference. I wouldn't mind GrimFandango (32-bit) being sacrificed to make the 64-bit games work.


----------



## shkhln (Jan 15, 2020)

Meh. I think you need to stick to already packaged appications and/or Wine. There is too much random clueless fuckery going on.



myshkin said:


> `env SDL_AUDIODRIVER=openal ./pillars`



SDL output backends: https://wiki.libsdl.org/FAQUsingSDL#How_do_I_choose_a_specific_audio_driver.3F. There is also the fact that most commercial games do not use SDL for sound output. I bet this one doesn't.


----------



## myshkin (Jan 15, 2020)

shkhln said:


> Meh. I think you need to stick to already packaged appications and/or Wine. There is too much random clueless fuckery going on.
> SDL output backends: https://wiki.libsdl.org/FAQUsingSDL#How_do_I_choose_a_specific_audio_driver.3F. There is also the fact that most commercial games do not use SDL for sound output. I bet this one doesn't.



In the end it was not really 'random' because there was a logic in what I tried. And I think 'fuckery' isn't really the right term for what I did either, because it didn't really matter. Clueless was a correct word, but if I were not clueless, then I'd rather write messages at the bug reports. In the end it didn't take that long before I could open GrimFandango thanks to your help. I only have 7 GOG games in my library, so I personally don't mind trying it further. I therefore regret that you no longer want to help me.


----------

