How to get Trine2 sound working on 64-bit Linux

For discussion about Trine 2, released in December 2011 on Windows, Mac, Xbox, PlayStation Network and later on Linux and Wii U.
Posts: 1
Joined: Thu May 03, 2012 11:14 pm

How to get Trine2 sound working on 64-bit Linux

Postby Cobold » Thu May 03, 2012 11:42 pm

I just had an adventure in gettings-things-working that I want to share with you. Are you familiar with this problem?: You want to run the Linux version of Trine 2 on a 64-bit Linux operating system within the ALSA sound environment. In my case, I am using openSUSE 12.1 x86_64 in the Openbox desktop environment. But there is no sound anywhere in the game and the volume control programs don't even register Trine2 as an application that has sound output.

I installed all the required libraries mentioned in the official openSUSE readme that ships with the game, yet since I switched to a 64 bit system I couldn't get the sound to work. It had previously worked when I still used the 32-bit version of openSUSE 12.1. So where is the problem at? Following the instructions further down in the readme, I executed Trine2 from Konsole to get a good view of the bash output. I had to look really fast, since the entire bash was filled up with "Cannot open stream" messages. The key error was that the game failed to open "/dev/dsp".

Code: Select all

AL lib: oss.c:169: Could not open /dev/dsp: No such file or directory

What's /dev/dsp ? It's the sound device that is used by OSS, the Open Sound System. OSS is deprecated, here's the story on Wikipedia:

The project was initially free software, but following the project's success, Savolainen was contracted by the company 4Front Technologies and made his support for newer sound devices and improvements proprietary. In response, eventually the Linux community abandoned the OSS/free implementation included in the kernel and development effort switched to the replacement Advanced Linux Sound Architecture (ALSA). Linux distributions, such as Ubuntu, have chosen to disable OSS support in their kernels and ignore any bugs filed against OSS4 packages.[3] (while this may be re-enabled [4]).

Major distributions no longer use OSS and instead rely on ALSA. However, you still want to be able to play old applications that rely on OSS. To achieve this, the command "padsp" is used, a compability mechanism for running OSS applications within the ALSA environment. So why is that not working when running Trine2 on a 64-Bit system?

Because a 64-bit system will only come with padsp support for 64-bit applications, but Trine2 is a 32-bit application.

When I ran Trine2 from the command prompt adding the crucial padsp in front of the binary like this:

Code: Select all

LD_LIBRARY_PATH=./lib/lib32 padsp bin/trine2_linux_32bit

I will now get the problem that the required binary for OSS emulation is not found:

Code: Select all

ERROR: object '/usr/lib64/' from LD_PRELOAD cannot be preloaded: ignored.

What's LD_PRELOAD? Basically, the code of padsp boils down to locating on your system and preloading it before the application starts. I found the relevant information explaining this here:

padsp will search for the in your /usr/lib folder if you're on a 32 bit system and in /usr/lib64 if you have a 64 bit system. And indeed, if I kick off Dolphin and search through my /usr folder, I only find in my /usr/lib64 folder, it is absent from /usr/lib where the 32 bit libraries are held. But Trine2 is 32 bit and depends on the 32 bit version of the library. Time to install it.

Or so it seems. It is not possible to install from YaST - it doesn't simply come in a separate "libpulsedsp-32bit" package that you could install easily. It is part of the "pulseaudio" package and that can only be installed in one architecture at one time - either you're going full 32 bit or full 64 bit. I couldn't accept that and found a solution: Download the .rpm for the 32-bit package of PulseAudio from the homepage of your distribution (NEVER INSTALL PACKAGES FROM DISTRIBUTIONS THAT ARE NOT YOUR OWN).

If you're using openSUSE just like me, find the "pulseaudio" package in SUSE's web package search: Download the RPM for the 32 bit version that you need, but don't open it with YaST or the KDE package kit, but rather with an archiving tool like KDE Ark or Gnome File-Roller. In the archive, navigate to /usr/lib and extract the to somewhere in your /home directory. Then open the terminal and enter:

Code: Select all

$ sudo cp /home/path/to/file/ /usr/lib/

Now you can enjoy Trine2 with sound!

If you're interested on who is to blame for this error, a blog comment over here might interest you:
I just had a similar problem, and padsp almost solved the problem:

In my case it was an old 32bit game, and I do have a 64bit system.
Now padsp doesn't do much more than LD_PRELOADing
Just that there is no 32bit version of in the libpulse0-32bit
package (or anywhere else).

I had to manually fetch the i586 pulseaudio package, extract the lib and place
it in /usr/lib/ After that, the game ran with sound using padsp

This wouldn't be so annoying if this were not an error that is present since
(at least) OS 11.1 (that was what one of the google hits talked about). From
the bug list I conclude that the bug is reported every new OS release, pushed
to the PA maintainer - and obviously ignored!?

Isn't this what a distribution should take care of? At least if they decide
to have this package installed and used by default?

Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: How to get Trine2 sound working on 64-bit Linux

Postby alt_turo » Fri May 04, 2012 10:53 am

You might have hit this one:


If you're using PulseAudio, alsa tries to look for PA plugin and fails. The game then tries to fall back to OSS and that fails too. At least I think this might happen, I don't use PulseAudio.
Turo Lamminen
Alternative Games

Posts: 2
Joined: Sun Jun 03, 2012 7:26 pm

Re: How to get Trine2 sound working on 64-bit Linux

Postby lovenemesis » Sun Jun 03, 2012 7:31 pm

Well, it's actually a common problem for 32bit game running on 64bit Linux.
The solution is to install the 32bit sound library.
In almost all the modern Linux distributions it means installing 32bit alsa to pulseaudio plugin.

For Fedora, run the follow command in terminal as root:

Code: Select all

yum install alsa-plugins-pulseaudio.i686

Return to “Trine 2”

Who is online

Users browsing this forum: Google [Bot] and 5 guests