[Linux] Sound is broken on newer ALSA

rkfgrkfg Russia Join Date: 2013-09-03 Member: 187744Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow
After upgrading to libasound2 1.1.7 the sound engine stops working. The game starts but there's no sound at all. In dmesg I see this:
[44637.064360] ns2_linux[21991]: segfault at 0 ip 00007fd795749d4d sp 00007ffed495b410 error 4 in libSpark_Sound.so[7fd79573a000+1c000]
[44637.064365] Code: 00 00 00 00 00 48 8b bb 90 01 00 00 48 85 ff 74 10 e8 17 84 ff ff 48 c7 83 90 01 00 00 00 00 00 00 48 8b 7b 30 be 01 00 00 00 <48> 8b 07 ff 90 98 00 00 00 8b 83 a0 00 00 00 45 31 e4 31 ed 48 c7
Downgrading ALSA to 1.1.6 solves the issue. If possible, I'd very much like NS2 (or FMOD) to support PulseAudio directly, most of the sound issues come from ALSA to PulseAudio workaround (which then outputs sound using ALSA anyway) that's supplied with libasound2-plugins. I can pin this package from updating but for other users this could be a show stopper.

Comments

  • rkfgrkfg Russia Join Date: 2013-09-03 Member: 187744Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow
    This is probably partially fixed by upgrading ALSA again but the microphone is not working on the default input (it works on "pulse" but I prefer it to be on default). Something changed between pulseaudio and ALSA apparently or it could be a distro-specific issue. Anyway, the solution is simple:
    mv /etc/alsa/conf.d/99-pulseaudio-default.conf.example to /etc/alsa/conf.d/99-pulseaudio-default.conf
    
    This config sets pulseaudio input and output as the default ALSA devices. The only downside is that ALSA won't work if you completely shutdown pulseaudio (you'll need to rename this file back if that's required).

    This actually has nothing to do with the game, any ALSA programs stop working after update (if you don't rename that file). Playing sounds is a bit better, right after starting pulseaudio using aplay (for example) results in:
    ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
    aplay: main:828: audio open error: Device or resource busy
    
    But if I just wait for 5 seconds without trying it magically starts working. Could be some device blocking timeout issue. Recording fails each time with:
    ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
    arecord: main:828: audio open error: Device or resource busy
    
    Previously ALSA was able to detect if pulse is running and switch to it dynamically but now it can't for whatever reason. That config file forces it to use pulse every time. Hope it helps someone.
Sign In or Register to comment.