Posts mit dem Label arch werden angezeigt. Alle Posts anzeigen
Posts mit dem Label arch werden angezeigt. Alle Posts anzeigen

Sonntag, 8. September 2013

[Steam][SDL][OpenAL] Stuttering sound in many Linux games

Hello folks.
On my Linux system (up-to-date Arch Linux) I was having trouble with several open-al based games, namely Psyschonauts, Super Hexagon and FTL/Faster Than Light. All games were purchased via Steam. The problem was, that the games' sounds came out somehow garbled - stuttering to be more precise. All I could do was restarting the game once or twice and hope that it would finally do as intended. As there are several components involved and common to the stuttering sound (SDL, OpenAL, Steam, Pulse Audio, Linux), it was not easy for me to put the problem into words google could understand.

After doing a lot of research with no results of which none of them solved my problems, I finally stumbled about a small, german  forum post, that seemed somehow to be connected to this issue. It also mentioned high cpu load when these problems occur, which I could confirm espacially while playing FTL. The post was suggesting that it might help to go into Mixer/ Pavu Control, take the particular audio stream of the game (for steam games it is usually a steam-connected strem), and turn it down a little - from 100% to let's say 90%. And voilà: After following this advice I seem to have no troubles left with those games.
If you don't have a program calles "Pavu control" or Pulse audio Mixer yet, it is almost certain that you will find it in your distribution's repository.
And that's it!

But wait - what happened? As the mentioned post suggests, it is a problem of the sound overmodulating. I guess, there is an (artificial) limit set to the physical outgoing sound volume, that causes sounds which are too loud to be filtered. Since this is probably an expensive operation, intercepting the audio stream, filter it and continue to play it again, this will presumably cause the high cpu usage noticed before. I don't know why, but openAL seems to cause a lot of those too-high sounds to be generated (at least the version used by steam).
Now, by setting the limit of the virtual stream lower than before, this problem gets solved.

Happy playing!

Donnerstag, 29. August 2013

Linux dual monitor: Don't stretch fullscreen over all monitors in SDL games (psychonauts, ftl, superhexagon)

[EDIT] Some time after I wrote this, I also found this article:
http://www.maketecheasier.com/run-fullscreen-games-in-linux-with-dual-monitors/
which is a lot nicer written.

Hello everybody!

I'm using two monitors on my Linux machine: The 13" 1366x768px inbuilt one of my laptop and my 24" full hd monitor. I don't need to say, that those do not really match to display one application over both of them. Unfortunately though, many games based on the well known sdl library try to do exactly this: When in fullscreen, they only offer me resolutions like "3286x1080" after the notebook's resolution (nothing in between). When opening in windowed mode, they calculate the middle of the screen by taking both screens into consideration, thus opening between them.
All I want to do, though, is having fullscreen games opening with full hd resolution on my external monitor, and windowed games in the middle of just this monitor.

I was quite happy lately, when I discovered that wine/crossover will open all windows on the external monitor if I tell xrandr, that it is my "--primary" screen, using "xrandr --output HDMI-0 --primary". This doesn't work for native, sdl-based games of course, although it kind of fits in here, so I thought to mention it.

So, today I got my bluetooth controller and I really wanted to play psychonauts with it. It, too, featured the said issue, and this time I just didn't want to give up. After some heavy googling, I finally came up with the SDL_VIDEO_FULLSCREEN_HEAD variable mentioned HERE (archwiki ftw!), and -thank god- it worked as expected. So for you it is:
$: SDL_VIDEO_FULLSCREEN_HEAD=0 ~/.steam/root/SteamApps/common/Psychonauts/Psychonauts

I hope this helps someone out there. I wish happy gaming.
Sincerely

suluke

Related: 
A topic on a mailing list also discussing a similar solution can be found here: http://icculus.org/pipermail/psychonauts/2012-June/000000.html

Donnerstag, 18. Juli 2013

[Steam 4 Linux]: Game not starting, only Error message is "SteamAPI_init() failed"

Hello there, reader!

It's summer and this means it is steam sale! This is the good news :) But when you are on linux and you just bought some really cool game, you may still encounter problems due to linux only having received a lot of attention by game developers just for the past couple of months.

So did I, namely with the game "Osmos" by the Hemisphere game studios. I had bought it when it was cheap some days ago, installed it but couldn't get it to start. Clicking on the "play" button within steam would only pop up the "Steam news" dialog - at most.

Commandline debugging
So I started steam from commandline and dug into all the funny warnings it throws during runtime. But the only error I found in connection with my attempts to launch Osmos was 
"SteamAPI_init() failed" - following startup messages of Osmos.bin32 (Unfortunately steam only offers the 32 bit version of the game, although there is a 64 bit version available I think, google for Osmos.bin64)

Missing libs?
I recently switched to arch linux, so of course I thought of missing 32 bit libs at first.
Indeed I was missing lib32-intel-dri (the 32 bit intel driver for mesa) and I think lib32-openal too, but none of them fixed the problem - although the 32 bit graphics driver dramatically increased the performance of half life 1. You may still want to look at the aur package "osmos" to have a look at the immediate dependencies here. I also used the handy command "ldd" on Osmos.bin32 to find out about all libs used by the binary.

Exit: The solution
After a long time I grew more and more desperate searching the internet unsuccessfully, when finally I had the lucky thought to try out something I stumbled upon earlier without giving it too much attention: I did not exit steam via right click on the tray icon but via the "steam" entry in the menu bar of the program. It's funny, but it seems like this is the only way to make steam apply certain updates on shutdown. At least some additional lines in the console output mentioning "package updates" suggest that - and really: After starting Steam again Osmos would finally launch!

Résumé
So I thought I might share this little piece of info with you - namely that you should use the menu button to exit steam from time to time to make sure your installation stays up to date.

If you have some other game making trouble, have a look at the arch wiki's "specific troubleshooting" section here.

I hope this helps. If you liked this, I would be happy if you left me a comment.

See you later, yours
suluke

Montag, 1. Juli 2013

XFCE suddenly not applying any themes any more

Hello people out there!

Recently I faced some strange behaviour with my Xfce 4 (.10) after I had plugged in a beamer. On first login after startup it wouldn't apply the window theme I set, nor would it use my preferred icon theme.
Also, setting the theme again with the xfce settings dialog (xfce4-appearance-settings) would not have any effect. Logging out and logging in again solved the issue temporarily, though.

Usually I already use a dual monitor setup and the beamer just switched place with my desktop monitor. So this was obviously a dual or multi monitor problem, and the first place I looked in for error messages was ~/.xsession-errors. There I encountered a line saying:
"The program 'xfsettingsd' received an X Window System error"

So the error occured in xfsettingsd, which also explained why using the settings dialogs hadn't had any effect later on.
Luckily, google would directly lead me to https://bugzilla.redhat.com/show_bug.cgi?id=867455 when searching for this error message, where I found the solution:
By simply deleting
.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
I was able to fix the error. As mentioned in the bug report, the file was recreated. Nevertheless I recommend to backup the file, since one never knows if such a file contains additional configuration markup you would maybe want to have access to later.

I hope this information can help somebody. If you want to thank me or want me to add something or maybe have any suggestions for improvements, I would be glad if you left me a comment.

Until then, see you soon

suluke