Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam does not support alsa 1.1.0, no audio #4139

Closed
kvbev opened this issue Nov 18, 2015 · 52 comments
Closed

Steam does not support alsa 1.1.0, no audio #4139

kvbev opened this issue Nov 18, 2015 · 52 comments
Assignees
Labels

Comments

@kvbev
Copy link

kvbev commented Nov 18, 2015

No description provided.

@ZeXx86
Copy link

ZeXx86 commented Nov 19, 2015

Same problem here.

@fafryd1125
Copy link

Deleting/renaming alsa-lib folde and libasound.so.* in the steam-runtime folder should fix the problem.

~/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/
~/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/
RELATED: #3376

@ryanpcmcquen
Copy link

You can also just launch steam like this:

EDIT (2015.11.23, added 64-bit version of lib):

LD_PRELOAD="/usr/lib/libasound.so.2:/usr/lib64/libasound.so.2" steam

And not need to delete files that will come back each time steam updates. 🎉

@ryanpcmcquen
Copy link

You could also create a wrapper for steam using that LD_PRELOAD method:

EDIT (2015.11.23, added 64-bit version of lib):

#!/bin/sh
LD_PRELOAD="/usr/lib/libasound.so.2:/usr/lib64/libasound.so.2" /usr/bin/steam

Call it /usr/local/bin/steam (so you don't overwrite the one in /usr/bin).

@ismaelgv
Copy link

Same problem here, I've downgraded to 1.0.29 because it was causing crashes. Additionally, Transistor game stopped working when you launched it on Steam due to this problem.

Edit: I've got PulseAudio installed too.

@ryanpcmcquen
Copy link

@ChuckDaniels87 have you tried launching steam like this (from the command line)?

LD_PRELOAD="/usr/lib/libasound.so.2:/usr/lib64/libasound.so.2" steam

@ismaelgv
Copy link

@ryanpcmcquen It works launching steam that way (both Steam audio and Transistor game).

@ryanpcmcquen
Copy link

@ChuckDaniels87 to make it permanent, create a file named /usr/local/bin/steam (that should take precedence over /usr/bin/steam on most Linux systems.

Put this in it:

#!/bin/sh
LD_PRELOAD="/usr/lib/libasound.so.2:/usr/lib64/libasound.so.2" /usr/bin/steam

UPDATE (2015.12.02):
An even better, and shorter way to write this is:

#!/bin/sh
LD_PRELOAD='/usr/$LIB/libasound.so.2' /usr/bin/steam

P.S. The single quotes are important!

@ismaelgv
Copy link

Thanks for the tip but this bug should be fixed sooner or later. I don't like to make this kind of fixes permanent because I always forgot that I did it in a couple of days (making it really permanent 😜). Thank you for the fix anyways! 👍

@ghost
Copy link

ghost commented Dec 2, 2015

@ryanpcmcquen When I try launching Steam with LD_PRELOAD="/usr/lib/libasound.so.2:/usr/lib64/libasound.so.2" steam, it says that they can't be preloaded, and says (wrong ELF class: ELFCLASS64): ignored. twice. Similar things happen with the other suggestions here,

@ryanpcmcquen
Copy link

@Zekario, did you actually see if sound was working?

Here is the thing. Steam is 32-bit, some games (like XCOM: Enemy Unknown), are 64-bit, therefore you need both libraries. That 'error' is innocuous, sound will work. Don't just assume it won't because of that output.

@ryanpcmcquen
Copy link

@ikokostya the problem with that fix, is that any Steam update is going to bring those files back. The LD_PRELOAD forces the same behavior by loading your system ALSA lib instead of the one bundled with Steam.

@ghost
Copy link

ghost commented Dec 2, 2015

I assumed it didn't work because nothing happened after I tried it in the terminal. It went back to the prompt and didn't open Steam.

@ryanpcmcquen
Copy link

Try launching it like this:

LD_PRELOAD='/usr/$LIB/libasound.so.2' /usr/bin/steam &

@ivan-kolmychek
Copy link

Just in case someone will get the same issue: the "delete *asound*.so* and alsa-related folders from ~/.steam/root/" way worked for me for a week or so, but today CS:GO suddenly started to crash whenever I try to join the game, right before the level is loaded (tried casual mode only, not sure if it affect any other).

Launching steam as @ryanpcmcquen said (LD_PRELOAD='/usr/$LIB/libasound.so.2' /usr/bin/steam &) works OK.

Alsa 1.1.0, Arch Linux rolling x86_64.

@ghost
Copy link

ghost commented Dec 2, 2015

@ryanpcmcquen That seems to have worked after a restart, I think I already had Steam running. Thanks!

@ryanpcmcquen
Copy link

@Zekario @ivan-kolmychek 👍

@xhsdf
Copy link

xhsdf commented Dec 8, 2015

Is there any way to get sound while streaming to Arch working without downgrading alsa-lib? Doesn't seem like this bug will get fixed anytime soon. Setting LD_PRELOAD only works for local games.

Okay, this is strange:
alsa-lib < 1.1.0 without lib32-alsa-lib: works
alsa-lib = 1.1.0 without lib32-alsa-lib: does not work
alsa-lib = 1.1.0 with lib32-alsa-lib: works with LD_PRELOAD='/usr/lib32/libasound.so.2:/usr/lib64/libasound.so.2'

@ghost
Copy link

ghost commented Dec 12, 2015

The fix seems to have stopped working, at least on my laptop. Sound doesn't work, despite launching it via the above methods. There was a pretty big Arch update recently, and Steam updated as well.

@ghost
Copy link

ghost commented Dec 12, 2015

@ryanpcmcquen now steam doesn't want to launch at all :/

EDIT: It launches after a restart, still no sound.

@ryanpcmcquen
Copy link

@Zekario I still have sound after the Steam update, but I am on Slackware. Do you have pulseaudio installed?

On a side note, export'ing the LD_PRELOAD is even better than just calling it on the same line as launching steam, here is my /usr/local/bin/steam:

#!/bin/sh
export LD_PRELOAD='/usr/$LIB/libasound.so.2'
/usr/bin/steam

@ghost
Copy link

ghost commented Dec 12, 2015

@ryanpcmcquen I don't have pulseaudio installed. Is it better with Steam? If I switch to it I'll have to change a few key bindings, but probably not too much.

@ryanpcmcquen
Copy link

ryanpcmcquen commented Dec 12, 2015 via email

@ghost
Copy link

ghost commented Dec 12, 2015

@ryanpcmcquen I changed my steam to export libasound.so.2 like you did a few comments above, then ran steam in a terminal. It gave this, then stopped (went back to command line input):

$ steam
Running Steam on arch rolling 64-bit
STEAM_RUNTIME is enabled automatically
ERROR: ld.so: object '/usr/$LIB/libasound.so.2' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

@xhsdf
Copy link

xhsdf commented Dec 12, 2015

I tried installing pulseaudio, rebooted and found my headphones not working properly anymore.
After some more testing I found switching between headphones and speaker didn't work properly after a reboot. But after a shutdown everything was fine again until the next reboot. Then I uninstalled pulseaudio, rebooted and had the same problem. So it wasn't pulseaudio's fault, but Alsa's. After downgrading liba-alsa everything was fine again. With or without pulseaudio.

So I think the best "solution" might be to downgrade lib-alsa since Alsa 1.1.0 seems buggy.
sudo pacman -U /var/cache/pacman/pkg/alsa-lib-1.0.29-1-x86_64.pkg.tar.xz
Doesn't really matter if you use pulseaudio or not.

/ btw: Can someone confirm the headphones bug? Can't seem to find a working bugtracker for Alsa

@ivan-kolmychek
Copy link

@Zekario I use ArchLinux and still got sound after both Steam and CS:GO updated recently. But I've not updated system for a while.

I'm launching steam as @ryanpcmcquen said (LD_PRELOAD='/usr/$LIB/libasound.so.2' /usr/bin/steam &).

@Plagman
Copy link
Member

Plagman commented Feb 19, 2016

When this problem happens (with an unmodified runtime), are any alsa libraries accidentally loaded from the host system? The output of "info shared" in GDB after a crash occurs, or the output of /proc/$pid/smaps during execution of a game that doesn't have sound are both useful data to help us understand this problem.

@RealGrep
Copy link

We just traced my friend's Borderlands 2 and Borderlands: The PreSequel not starting, and the workaround with this:

LD_PRELOAD='/usr/$LIB/libasound.so.2' ${LD_PRELOAD} steam

got it working again. He's using Pulseaudio on a fully up to date Arch Linux.

@MrSchism MrSchism assigned stefan-valve and thomaskoehler and unassigned ghost and stefan-valve Feb 21, 2016
@ismaelgv
Copy link

Is it fixed with this update?

@xhsdf
Copy link

xhsdf commented Feb 24, 2016

Is it fixed with this update?

I just tested 3 games (with pulseaudio):
Steredenn - Stopped crashing on startup. No sound
Cities: Skylines - Still no sound
Shovel Knight - Still crashes on startup

So... it got a little better.

@ismaelgv
Copy link

Transistor starts now but still no sound.

@javiercantero
Copy link

The source of the problem is a Steam Runtime leak into the system configuration related to the ALSA sound system.

I've found in one of the affected 32-bit games (Broken Age) that it was reading system's /usr/share/alsa/alsa.conf instead of $STEAM_RUNTIME/i386/usr/share/alsa/alsa.conf. See this relevant fragment from a strace -e trace=open:

open("/home/user/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libasound.so.2", O_RDONLY|O_CLOEXEC) = 16
open("/usr/share/alsa/alsa.conf", O_RDONLY) = 16
open("/home/user/.steam/ubuntu12_32/steam-runtime/i386/home/user/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libasound.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/user/.steam/ubuntu12_32/steam-runtime/i386/home/user/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libasound.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/user/.steam/ubuntu12_32/steam-runtime/i386/home/user/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libasound.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/alsa/alsa.conf.d//50-pulseaudio.conf", O_RDONLY) = 16
open("/usr/share/alsa/alsa.conf.d//pulse.conf", O_RDONLY) = 16
open("/home/user/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/alsa-lib/libasound_module_conf_pulse.so", O_RDONLY|O_CLOEXEC) = 16

(A few system calls later was when the process crashed with a SIGABRT or SIGSEGV)

The problem in this case is that the version of the linker loaded libasond.so.2 is the 1.0.25 from Steam Runtime, but the /usr/share/alsa/alsa.conf is from alsa-lib 1.1.0. The prior version of /usr/share/alsa/alsa.conf(the one from alsa-lib 1.0.29) was almost the same that the one shipped with Steam Runtime (minus certain patch), but the new one from 1.1.0 has got some new lines (see this patch: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=434f2f021f00045abcf79c9048b808c5dccfc930 ) and one or more of those lines are the cause of the crash. Changing the file to the previous one fixes the crashes in my system. I've even been able to narrow it to one line, and simply by commenting that sole line out, all works again. The line is this (patch format):

--- /usr/share/alsa/alsa.conf-1.1.0 2016-02-01 23:59:59.000000000 +0100
+++ /usr/share/alsa/alsa.conf   2016-02-25 11:46:36.099062833 +0100
@@ -367,7 +367,7 @@
    }
    type hw
    card $CARD
-   hint.description "Direct control device"
+###STEAM BUG###    hint.description "Direct control device"
 }

 ctl.shm {

You can try patch that file and see if it fixes the problem for you, instead of the LD_PRELOAD workaround (that preloads the 1.1.0 version of libasound.so.2 1.1.0 before Steam has a chance of loading 1.0.25)

@ismaelgv
Copy link

ismaelgv commented Jun 5, 2016

Not crashing now but there is still no sound in some games. I think this issue should stay open.

@joost-van-weenen
Copy link

I agree. The patch did nog solve the problem. The crash is gone but so is my audio.

@cqcallaw
Copy link

cqcallaw commented Aug 2, 2016

+1 for re-opening this issue: I'm still affected by it when running latest Steam on 64bit Ubuntu 16.04.1

@gdrewb-valve gdrewb-valve reopened this Aug 2, 2016
@Chiitoo
Copy link

Chiitoo commented Aug 2, 2016

I suspect that might be a different issue, especially if it's only affecting /some/ games. I'm not familiar with Ubuntu and the likes though (Gentoo Linux here), nor am I familiar with PulseAudio, so I could be completely wrong.

In short though: which games?

Longer version:

Applications that use FMOD tend to behave in unexpected ways with set-ups that have more than one audio device available for use. They don't seem to care about a user's configuration, and rather pick whatever seems 'default' to them instead. It may be that the FMOD developers intended that the ones implementing FMOD in their applications would do what's necessary to make it play nice with ALSA.

While I've had this issue for years with Outlast and the one streaming video that I bought before I realised it's a stream (grrr), I bumped to it with several more recently. A complete list of which I have experienced issues like this with:

  • Angry Video Game Nerd: The Movie (Not sure FMOD is used for these.)
  • Day of the Tentacle Remastered
  • Divinity: Original Sin Enhanced Edition
  • NEON STRUCT
  • Outlast

Day of the Tentacle Remastered is what made me finally actually look into this issue. While doing some testing for Cheeseness (the AWESOME! person doing the porting of Day of the Tentacle Remastered to Linux), I noticed that all of the applications were actually making sounds, it was just that they were ignoring my configuration, and used an incorrect device!

I've been doing some testing with the FMOD recording example program, and while it seems it might be possible to make FMOD use a user-specified device via the least(?) work (adding a command-line switch for the application), it has issues with parsing some of the '.asoundrc' sections (for example, at least some years ago, it would not parse 'hint' at all).

Most notably perhaps it sees '!default' as a device name, which it of course fails to find.

This is probably something that should be fixed in FMOD itself, as it seems completely wrong to ignore a user's configuration. The most annoying part might be that even 'dmix' in a common ',asoundrc' seems to be ignored as well, so the applications will not be sharing the device at all.

I do have some hope left in me, however, that with a particular syntax it could be possible to make FMOD do what a user wants, because 'dmix' for example does seem to work when ALSA defaults is used (empty or no ',asoundrc' at all, or something like 'defaults.pcm.card 0' defined in it).

One simple way to confirm which device is being used, and by what: 'fuser -v /dev/snd/*'

Like I said, though, I could be completely wrong, but I felt it was worth mentioning this here. :]

@cqcallaw
Copy link

cqcallaw commented Aug 3, 2016

@Chiitoo Fair enough; I will say that the symptoms I'm experiencing are remarkably similar, and the LD_PRELOAD work-arounds resolve it (see this forum post for the the exact command line I'm using).

The game in question is Planetary Annihilation: Titans.

@Chiitoo
Copy link

Chiitoo commented Aug 3, 2016

Ah. If LD_PRELOAD helps, it does seem more likely to be a library issue still. Was hoping my guess would strike true, as I've not needed any such workarounds for a while now.

I'm on 'alsa-lib-1.1.1' now, but I'm fairly sure things worked with 1.1.0 as well. Should probably test that to make sure...

Thanks!

@RussianNeuroMancer
Copy link

I came here from Uberent forum too. Hopefully this will get fixed eventually.
For me Planetary Annihilation: Titans crash under Steam, and works without it. LD_PRELOAD workaround helps.

@jkarnesPerfectCube
Copy link

Factorio is currently not launching on my system with or without LD_PRELOADs

@therealromster
Copy link

alsa-lib 1.1.5 wine 3.0 is working fine for sound. This seems like a distro issue? Pretty sure this bug can be closed report can be closed. @jkarnesPerfectCube open a new bug for that. Check appdb

@kisak-valve
Copy link
Member

Hello, a while back Steam's handling of the steam runtime changed to prefer system libraries over the steam runtime if they are newer, which should have resolved this scenario for most users. The more recent Factorio comment appears to be unrelated to the opening post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests