Personal website of Christian Dannie Storgaard

Howto: Deus Ex: Human Revolution in Ubuntu/Linux

January 07, 2012

I just bought Deus Ex: Human Revolution, and if you did too, or are contemplating it, don't let the bad rating on WineHQ scare you off - it runs near perfectly.
Now, the in-game tutorials are a bit wonky, but if you can live without those (I know I didn't have much of a problem without them), here's how you can install and run DE:HR in Ubuntu/Linux.

You are going to need Vineyard, so install that first if you haven't already, also we are going to use the terminal a bit, but don't worry, it's not scary, just quicker.

First off, let's install the game.

Do whatever you would normally do; run the installer from the DVD or download it from Steam - just make sure you do it in a new prefix in Vineyard.

Secondly, install a custom version of Wine (with rawinput2 patch).

We're going to use one provided by PlayOnLinux, so if you have PlayOnLinux installed, just install Wine 1.3.34 rawinput2 from there, otherwise, either go to http://www.playonlinux.com/wine/binaries/linux-x86/, download the one called PlayOnLinux-wine-1.3.34-rawinput2-linux-x86.pol, rename it to have a .tar.bz2 ending and then extract from it the folder called "wineversion/1.3.34-rawinput2" to $HOME/.local/share/wineversions/1.3.34-rawinput2 - or run the following command:

mkdir $HOME/.local/share/wineversions && wget -q -O - 'http://www.playonlinux.com/wine/binaries/linux-x86/PlayOnLinux-wine-1.3.34-rawinput2-linux-x86.pol' | tar --wildcards --transform 's/wineversion\///' --bzip2 -xvf - -C $HOME/.local/share/wineversions/ 'wineversion/*'

Setup Vineyard to use it

Now we need to edit the prefix configuration so Vineyard knows to run this version of Wine, so if you know where that directory is, just go and open the file wrapper.cfg, otherwise open Vineyard Preferences, select the prefix and under "Tools", click "Open Main Drive" and then navigate one directory up, there's your wrapper.cfg.

Add the following lines to this file:

ww_wine="$HOME/.local/share/wineversions/1.3.34-rawinput2/bin/wine"
ww_wineloader="$HOME/.local/share/wineversions/1.3.34-rawinput2/bin/wine"
ww_wineserver="$HOME/.local/share/wineversions/1.3.34-rawinput2/bin/wineserver"
ww_winedllpath="$HOME/.local/share/wineversions/1.3.34-rawinput2/lib/wine"

Or, if you installed the Wine version through PlayOnLinux:

ww_wine="$HOME/.PlayOnLinux/wine/linux-x86/1.3.34-rawinput2/bin/wine"
ww_wineloader="$HOME/.PlayOnLinux/wine/linux-x86/1.3.34-rawinput2/bin/wine"
ww_wineserver="$HOME/.PlayOnLinux/wine/linux-x86/1.3.34-rawinput2/bin/wineserver"
ww_winedllpath="$HOME/.PlayOnLinux/wine/linux-x86/1.3.34-rawinput2/lib/wine"

Done! (or do you have sound?)

Now you actually might be able to run Deus Ex: Human Revolution just fine! For me though, I needed to go to Vineyard Preferences again and make sure the Deus Ex: Human Revolution launcher had "Disable PulseAudio whilst running" checked on, and then it was smooth sailing.

Hope this little guide was helpful, comments are very welcome.

Christian Dannie Storgaard | 0 comments

GStreamer, MIDI (and Ubuntu)

April 26, 2011

So, you have all your old MIDI files lying around and you decide to play them through Totem or another GStreamer based player. What happens? They sound... flat.

Ah, no problem you think, I'll just set up Timidity to use the neat soundfont I have lying around that sounds like my old SoundBlaster card and everything will be peachy, but no, GStreamer doesn't support soundfonts cause it doesn't use timidity but wildmidi - what to do?

Or: How to convert soundfonts to GUS patches for use in wildmidi/gstreamer.

There's a neat little tool called Unsf included in Greg Lee's gt - a stripped down version of Timidity - that can convert a soundfont to a GUS patch usable by wildmidi and therefore GStreamer, so let's get started with the conversion!

First, go to where you want the GUS patch (and its files) - this path shouldn't contain spaces - then download the latest version of gt (I hear there's a version 1.0, but 0.4 is the latest I can find):

cd /where/you/want/the/GUS/files
wget ftp://ling.lll.hawaii.edu/pub/greg/gt-0.4.tar.gz

Now, let's extract it somewhere and build it:

tar -xzf gt-0.4.tar.gz
cd gt-0.4
./configure
cd utils
make

Now, let's convert the soundfont to a GUS patch (remember to replace /path/to/your/soundfont.sf2 with the actual path to your soundfont):

cd ../../GUS
../utils/unsf -F /path/to/your/soundfont.sf2

Now we need to fix the config file that unsf wrote to include the path to where your GUS patch is:

echo -e "dir $PWD\n" > wildmidi; cat *.cfg >> wildmidi

Now let's "install" that config file:

sudo cp wildmidi /etc/wildmidi.cfg

There! You're done!

For a nice athentic old school midi sound, I recommend the following soundfont (you need to register to download though): http://www.sf2midi.com/soundfonts/file-detail/roland-sc-55-sf2-3033.html

Christian Dannie Storgaard | 0 comments

Find the 32bit deb package from your 64bit system

January 13, 2011

I'm sure I'm not the only one that has had to install a 32bit version of some package to get a game or other program not designed for 64bit to work in 64bit Linux/Ubuntu/Debian and I'm sure others will nod in agreement at how difficult it can be to find the 32bit version, especially if you need a bunch and don't really have the time to wade through packages.ubuntu.com (or packages.debian.org for that matter), so I've cooked up a little Python script to find the URL for the 32bit version of a package for you.

It's here.

You just run it with the name of the package you want to find as the first argument, like so:

$ ./apt-get-i386-package.py libpulse0
http://ppa.launchpad.net/ubuntu-audio-dev/ppa/ubuntu/pool/main/p/pulseaudio/libpulse0_0.9.22-0ubuntu1_i386.deb

See? Easy.

Also note that it found it in a PPA - it uses your package database, so everything you can theoretically install can be found in a 32bit version.

Christian Dannie Storgaard | 0 comments

Switch to bottom pane plugin for GEdit

December 09, 2010

So, I've been reconsidering GEdit as a quick development environment, but I was really missing a way to switch to the bottom pane and back (for using the embedded terminal).

I couldn't find an existing plugin to do this, so I took a look at Elia Sarti's TabSwitch plugin - that uses Ctrl+Tab to switch tabs - and edited it to switch back and forth between the bottom pane and the editor view and I must say that GEdit has a rather comfortable work flow now :)

Plugin is here.

Christian Dannie Storgaard | 0 comments

How to get sound in Shadowgrounds in Ubuntu Maverick x64

October 01, 2010

Yeah, so here we go, my third issue with the Linux port of Shadowgrounds... anyway, it turned out to not be that difficult to fix.

Shadowgrounds only really plays well with OSS, so you should run it through aoss, but that won't work in 64 bit. So here's the solution:

First, install alsa-oss (sudo apt-get install alsa-oss), then download this archive, extract it your game directory and run shadowgrounds-x64 from now on - easy as that. Download me

If you prefer to do this by hand, first download the alsa-oss package for i386 (from here), extract it (dpkg --extract alsa-oss_1.0.17-4_i386.deb alsa-oss) and copy the files in usr/lib/ to /usr/lib32/ (sudo cp alsa-oss/usr/lib/* /usr/lib32/). Now when you want to run the game, you should run it as: LD_PRELOAD="/usr/lib32/libaoss.so" aoss ./shadowgrounds-bin

Christian Dannie Storgaard | 0 comments