Support us on Patreon to keep GamingOnLinux alive. This ensures we have no timed articles and no paywalls. Just good, fresh content! Alternatively, you can donate through PayPal, Flattr, Liberapay or Buy us a Coffee. You can also buy games using our partner links for GOG and Humble Store.

A look at the Penumbra Collection on Linux with Mesa in 2020

By - | Views: 12,714

When I switched to using Linux full time in the spring of 2007, my first recourse for gaming was either emulation or playing many of my old ported favourites from id Software. It did not take me long to start looking further afield in search of other quality Linux native titles, but in a time when digital distribution was in its infancy, and the Indie revolution that it would bring had not quite started yet, new games were few and far between.

At the same time, a small startup in Sweden was hard at work trying to expand their original Penumbra tech demo into a series of full fledged episodic horror games. The Penumbra Collection would be the ultimate result of that effort, with Linux support being provided by Edward Rudd. It would even go on to have its first instalment included as part of the original Humble Indie Bundle. The game soon caught my eye due to its strong graphics and advanced physics engine.

I have never been one to be frightened by video games, but thanks to its skilful environmental storytelling, strong writing, and accomplished vocal talent, the Penumbra Collection got its hooks into me all the same. Frictional Games would go on to even greater acclaim with the release of Amnesia: The Dark Descent only a few months after I first played, but it is the Penumbra Collection that is always going to hold a special place in my heart.

It pains me to say then, in spite of the still excellent support that Frictional Games gives to our platform, that the state of the Penumbra Collection for a number of Linux users has become such a mess. Ten years on I found myself with little option other than running my old copy of the Penumbra Collection from the now defunct Desura service; the closure of the company’s own storefront leaving no other recourse for those wishing to avoid the use of Steam.

Regardless, the version of the game that I have (1.1.1 released on December 4, 2014) appears even now to be the most recent release of the Penumbra Collection. This includes a number of much appreciated quality of life improvements over earlier versions such as offering support for more modern display resolutions, better audio handling through the use of an improved OALWrapper, and everything being reworked to run on top of SDL2.

 

At first blush the game installed and ran great, right up until I tried to leave the fishing boat at the start of the first episode in the series Penumbra: Overture. Upon attempting to load the next level the game would immediately crash to the desktop; a similar problem occurred upon using the vice at the start of the second episode Penumbra: Black Plague. It did not take long for me to discover that the solution was to build a custom Mesa package yet again.

For whatever reason, the Penumbra Collection will crash when Mesa is built with compiler optimizations applied. This can be mitigated by Arch Linux users through the use of the Arch Build System, or by generating your own Mesa build manually. Either option is far from ideal of course, and while officially the game does only support proprietary vendor drivers, almost all users of both AMD and Intel graphics hardware on Linux will now run into this issue.

Also alarming is that while trying to diagnose the problem I uncovered a separate bug that causes the game to crash when using modern versions of the libvorbis library. My copy of the Penumbra Collection came bundled with an older "libvorbis.so.0" file included in the the game's various "lib" directories, so I was able to sidestep this issue, but it is always a bad sign when a game refuses to run off the libraries that come supplied with your Linux distribution.

Ten years on the Penumbra Collection plays as strong as ever, even if my appreciation for Overture has increased as my over familiarity with Black Plague has lessened its impact. More than any other game, I wish I could go back to 2010 and play these titles with a fresh pair of eyes, especially since solving puzzles in the wrong order can on occasion confuse the narrative. What need do I have for the severed hand of Dr. Eminiss when I already have one in my bag?

Frictional Games are hard at work on their next Amnesia title, and while I know that keeping old games updated can become an aggravating support burden, I do still hope that the developers can come back to the Penumbra Collection, fix up these issues that will continue to plague a growing number of Linux users, and then spread the game to even more stores. To be left with creaking binaries from a shuttered distribution service is disheartening for a game that remains so dear to me.

Article taken from GamingOnLinux.com.
20 Likes, Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG, Humble Store and Paradox Interactive. See more here.
About the author -
author picture
Hamish Paul Wilson is a free software developer, game critic, amateur writer, and farm labourer living in Alberta, Canada. He is an advocate of both DRM free Linux gaming and the free software movement alongside his other causes, and more information on him can be found at his icculus.org homepage where he lists everything he is currently involved in: http://icculus.org/~hamish
See more from me
34 comments
Page: «3/4»
  Go to:

erolmatei 26 May
Sorry to break it to you but you are all wrong about the cause. It has nothing to do with OpenGL binding wrong textures. The reason why the game breaks on Linux with the most recent Mesa drivers is because the game uses AngelScript which can cause stack misalignments. When loading some functions from within AngelScript (for example, load an OGG file or a 2D texture) the stack gets misaligned and loses the 16-byte boundary, and since both Mesa (the video driver) and libogg use SSE instructions, stack misalignment causes CPU exceptions.

I had these issues myself when playing the game, and my solution was to compile the game on my own and set AngelScript to preserve stack alignment. For more details, see https://www.frictionalgames.com/forum/thread-56758.html

That said, yes, to fix the issue you need to build Mesa so that it does not use optimized SSE instruction (one of the effects of the -O0 flag btw). This is, imho, not a clean solution. The problem is, on the forum people complained about stack misalignment and devs did not integrate the AngelScript modification (literally just define a simple macro) into the newest Linux builds. Penumbra is still a sold game, it is unaccepta
Hamish 26 May
erolmateiThat said, yes, to fix the issue you need to build Mesa so that it does not use optimized SSE instruction (one of the effects of the -O0 flag btw). This is, imho, not a clean solution.
I am sure it is like swatting a mosquito with a sledge hammer, but it worked for me.

I do wonder if a complete Penumbra source port could be constructed from the Overture code.
erolmatei 27 May
> I am sure it is like swatting a mosquito with a sledge hammer, but it worked for me.

Yeah yeah, I mainly meant "unacceptable to the end user", as the end user should not meddle with system drivers. If needs must, one can still keep the unoptimized library in a separate folder and source them with the LIBGL_DRIVERS_PATH environment variable.

I guess that having stack alignment issues

To add pain to the injury, trying to run Penumbra with Proton results to a dark screen during the game, probably nvidia-cg does not like wine.

> I do wonder if a complete Penumbra source port could be constructed from the Overture code.

Overture and Black Plague are very alike, at least this is what I can tell judging from the function signature (they did not get stripped from the linux binary, wow). I think that at this stage not opensourcing Black Plague is not very wise.

But frankly, I do not see much interest in the developers to maintain the old Penumbra saga. The forum looks dead, and there are some pending PRs in the engine/openal wrapper that have completely been ignored for the last few years. It is quite understandable as the developers moved on to other spicier projects like Amnesia, then SOMA. See https://github.com/FrictionalGames/HPL1Engine/issues/15 (mine)
Hamish 27 May
Turns out I still have my old Desura receipt:
https://postimg.cc/4mQyC4Jb

I have got my ten dollars worth I have to say.
Hamish 28 May
So my lovely little Gigabyte Radeon RX 460 arrived last night. I can now confirm that on this card using AMDGPU I am getting crashes not only when I flatten the coin in the vice at the start of Black Plague but also when I leave the fishing boat at the start of Overture once again.


Last edited by Hamish on 28 May 2020 at 5:58 pm UTC
Hamish 24 Jun
For what it is worth, I found with Requiem that the game will crash when you pick up the first audio log from Eloff Carpenter.
Hamish 5 days ago
Attempting to build the lib32-mesa package as described before now just results in this error:
Build started at 2020-07-05T10:15:07.706677
Main binary: /usr/bin/python
Build Options: -Db_lto=true -Db_pie=true -Db_ndebug=true -Dplatforms=x11,wayland,drm,surfaceless -Ddri-drivers=i915,i965,r100,r200,nouveau -Dgallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris -Dvulkan-drivers=amd,intel -Dvulkan-overlay-layer=true -Dvulkan-device-select-layer=true -Dswr-arches=avx,avx2 -Ddri3=true -Degl=true -Dgallium-extra-hud=true -Dgallium-nine=true -Dgallium-omx=disabled -Dgallium-opencl=icd -Dgallium-va=true -Dgallium-vdpau=true -Dgallium-xa=true -Dgallium-xvmc=false -Dgbm=true -Dgles1=false -Dgles2=true -Dglvnd=true -Dglx=dri -Dlibunwind=true -Dllvm=true -Dlmsensors=true -Dosmesa=gallium -Dshared-glapi=true -Dvalgrind=false -Dprefix=/usr -Dlibdir=/usr/lib32 -Dlibexecdir=lib -Dsbindir=bin -Dauto_features=enabled -Dbuildtype=plain -Dwrap_mode=nodownload '--native-file crossfile.ini'
Python system: Linux
The Meson build system
Version: 0.54.3
Source dir: /home/hamish/Downloads/lib32-mesa/src/mesa-20.1.2
Build dir: /home/hamish/Downloads/lib32-mesa/src/build
Build type: native build
Program python found: YES (/usr/bin/python)
Running command: /usr/bin/python bin/meson_get_version.py
--- stdout ---
20.1.2
--- stderr ---


None of 'PKG_CONFIG_PATH' are defined in the environment, not changing global flags.
None of 'PKG_CONFIG_PATH' are defined in the environment, not changing global flags.
Project name: mesa
Project version: 20.1.2
Using 'CFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O3 -pipe -fno-plt -g -fvar-tracking-assignment -O0 -fdebug-prefix-map=/home/hamish/Downloads/lib32-mesa/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'

mesa-20.1.2/meson.build:21:0: ERROR: Unable to determine dynamic linker


Which is kind of annoying as I never got around to completing Requiem yet.


Last edited by Hamish on 6 July 2020 at 12:06 am UTC
x_wing 5 days ago
HamishAttempting to build Mesa as described before now just results in this error:
Build started at 2020-07-05T10:15:07.706677
Main binary: /usr/bin/python
Build Options: -Db_lto=true -Db_pie=true -Db_ndebug=true -Dplatforms=x11,wayland,drm,surfaceless -Ddri-drivers=i915,i965,r100,r200,nouveau -Dgallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris -Dvulkan-drivers=amd,intel -Dvulkan-overlay-layer=true -Dvulkan-device-select-layer=true -Dswr-arches=avx,avx2 -Ddri3=true -Degl=true -Dgallium-extra-hud=true -Dgallium-nine=true -Dgallium-omx=disabled -Dgallium-opencl=icd -Dgallium-va=true -Dgallium-vdpau=true -Dgallium-xa=true -Dgallium-xvmc=false -Dgbm=true -Dgles1=false -Dgles2=true -Dglvnd=true -Dglx=dri -Dlibunwind=true -Dllvm=true -Dlmsensors=true -Dosmesa=gallium -Dshared-glapi=true -Dvalgrind=false -Dprefix=/usr -Dlibdir=/usr/lib32 -Dlibexecdir=lib -Dsbindir=bin -Dauto_features=enabled -Dbuildtype=plain -Dwrap_mode=nodownload '--native-file crossfile.ini'
Python system: Linux
The Meson build system
Version: 0.54.3
Source dir: /home/hamish/Downloads/lib32-mesa/src/mesa-20.1.2
Build dir: /home/hamish/Downloads/lib32-mesa/src/build
Build type: native build
Program python found: YES (/usr/bin/python)
Running command: /usr/bin/python bin/meson_get_version.py
--- stdout ---
20.1.2
--- stderr ---


None of 'PKG_CONFIG_PATH' are defined in the environment, not changing global flags.
None of 'PKG_CONFIG_PATH' are defined in the environment, not changing global flags.
Project name: mesa
Project version: 20.1.2
Using 'CFLAGS' from environment with value: '-march=x86-64 -mtune=generic -O3 -pipe -fno-plt -g -fvar-tracking-assignment -O0 -fdebug-prefix-map=/home/hamish/Downloads/lib32-mesa/src=/usr/src/debug'
Using 'LDFLAGS' from environment with value: '-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2'

mesa-20.1.2/meson.build:21:0: ERROR: Unable to determine dynamic linker


Which is kind of annoying as I never got around to completing Requiem yet.

Can you share the content of "crossfile.ini"? Also, your CFLAGS have -O3 and -O0 at the same time.
Hamish 5 days ago
crossfile.ini is created from the PKGBUILD file of the lib32-mesa Arch package:
https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/lib32-mesa

The contents of crossfile.ini in a generated package are as follows:
[binaries]
llvm-config = '/usr/bin/llvm-config32'


As for the CFLAGS, that is being grabbed from what is defined in makepkg.conf as used by the Arch Build System. Setting the 'debug' option in the PKGBUILD makes its append DEBUG_CFLAGS which is where I was instructed to add the "-O0" flag in the linked Frictional Games forum thread:
https://www.frictionalgames.com/forum/thread-54134-post-363860.html#pid363860

Back in April and May adding the "-O0" flag to DEBUG_CFLAGS in makepkg.conf and toggling the 'debug' and '!strip' options in the lib32-mesa PKGBUILD did do the trick. Now doing so causes it to complain about being unable to determine the dynamic linker.

Here is the relevant parts of my makepkg.conf file:
 #-- Compiler and Linker Flags
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O3 -pipe -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O3 -pipe -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignment -O0"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments -O0"


I have tried exporting my own CFLAGS in the PKGBUILD containing just the "-O0" flag and with that I can get the lib32-mesa package to build, but Penumbra will still crash when using these builds. I have also tried using the Meson c_args option to set the "-O0" flag to no good effect. I have also tried setting the various "-mno-sse" flags which again do nothing.


Last edited by Hamish on 6 July 2020 at 12:09 am UTC
x_wing 5 days ago
HamishI have tried exporting my own CFLAGS in the PKGBUILD containing just the "-O0" flag and with that I can get the lib32-mesa package to build, but Penumbra will still crash when using these builds. I have also tried using the Meson c_args option to set the "-O0" flag to no good effect. I have also tried setting the various "-mno-sse" flags which again do nothing.

But the output of meson configuration shows a mixture of flags (In the output of your first comment you can clearly see that DEBUG_CFLAGS has been appended to CFLAGS). I suggest you to clear your env. variables and start from scratch.
While you're here, please consider supporting GamingOnLinux on Patreon, Liberapay or Paypal. We have no adverts, no paywalls, no timed exclusive articles. Just good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!

You need to Register and Login to comment, submit articles and more.


Or login with...