Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: Crécerelle on June 15, 2008, 04:52:24 pm

Title: Sound problem on Linux
Post by: Crécerelle on June 15, 2008, 04:52:24 pm
Hiya, and thanks for your work on the SCP :-) I'd installed FS2 a few months ago and got it all working, sound included, but now that I've returned to the game, it just doesn't work like it used to (famous words, eh?). Neither the 3.6.9 binary build nor my own builds can run the game with any kind of sound, even though I don't have any problem in other games.

The 3.6.9 build produces the following error message but otherwise runs fine (if soundlessly): '(null): "DirectSound could not be initialized.  If you are running any applications playing sound in the background, you should stop them before continuing."' My old build (SVN checkout 20071028) and today's SVN both segfault if run without the -nosound option.

My system is Debian Unstable, though I haven't updated it in the last few months. I cannot think of any recent change that would cause my perfectly-fine build to stop working, and I can't see what the problem might be. If it's any help, I've attached the strace output I get when I run today's SVN client, and I'd be happy to run other tests if more information is needed.

Thanks for any light you might shed on this problem. :)

[attachment deleted by admin]
Title: Re: Sound problem on Linux
Post by: CaptJosh on June 15, 2008, 04:56:12 pm
Make sure your OpenAL install is up to date. As for Direct sound, you're in Linux. that shouldn't even be referenced. And that's without looking at the attachment.
Title: Re: Sound problem on Linux
Post by: Crécerelle on June 15, 2008, 05:13:13 pm
I'd thought of blaming OpenAL, but it seems the library was last updated in December 2006, so I doubt it's the problem (my libraries are up-to-date, so it might have been a bad case of being too much on the bleeding edge).

On closer inspection, there does seem to be a difference between my libopenal.so.0 and the one that ships with the 3.6.9 binary build; the DirectSound message only occurs when I use the library from the binary. (That combination should work out of the box, anyway, so I suspect my sound problem comes from elsewhere)
Title: Re: Sound problem on Linux
Post by: CaptJosh on June 15, 2008, 05:14:58 pm
Um...maybe make sure you have all your SDL components installed?
Title: Re: Sound problem on Linux
Post by: Crécerelle on June 16, 2008, 03:31:18 am
I have everything SDL-related installed; fs2_open only seems to use part of SDL according to a quick ldd check, but other games that rely more on SDL work without a glitch. I've tried several of the various libsdl1.2-debian packages (ALSA only, OSS only, and all), but it didn't help either.
Title: Re: Sound problem on Linux
Post by: CaptJosh on June 16, 2008, 03:43:14 am
I think FS2 takes over your sound card outside of aRts and the like. Do you have any sounds going on when you start it up?
Title: Re: Sound problem on Linux
Post by: Crécerelle on June 16, 2008, 04:19:13 am
I don't get any sound whatsoever in-game with the 3.6.9 binary build, but I do get the usual 'crack' sound in my headphones when a program starts accessing the sound system. I don't get that sound with my own builds, even when I'm not using -nosound to get past the segfault.

Ya, I think FS2 bypasses the higher-level sound layers à la aRts, though probably not OSS/ALSA, if only for access to /dev/dsp. By the way, if I try running the game when the sound is *not* available, I get the expected error messages. So, it's apparently not a problem with the device being locked up.

("ALSA lib pcm_dmix.c:996:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
open /dev/[sound/]dsp: Device or resource busy", repeated several times, and the DirectSound message once near the end)

On another note, I've taken another look at the few Google hits for the DirectSound message; while nobody seems to have found a solution, it appears that all the other folks with that problem are running Debian/Ubuntu. It might just be a coincidence, but I might try to get my Fedora Core up and running again to check that it's not a problem specific to a Debian package somewhere...

Ya, I'm running out of ideas there :-) Thanks for your time for trying to help me out!
Title: Re: Sound problem on Linux
Post by: Androgeos Exeunt on June 16, 2008, 09:13:33 am
You're welcome. Charging USilv...

:welcomesilver:
Title: Re: Sound problem on Linux
Post by: castor on June 16, 2008, 11:12:35 am
Tried running it as root?
Title: Re: Sound problem on Linux
Post by: CaptJosh on June 16, 2008, 12:21:47 pm
Ok, the "device or resource busy" indicates that the sound card is indeed occupied. The only thing I can think of is running the app via artsdsp. If it works, it'll force the fs2 exe to use aRts. THis of course assumes you are running it in X using KDE.
Title: Re: Sound problem on Linux
Post by: Crécerelle on June 16, 2008, 04:10:55 pm
Just to clarify, the device busy message was intended to show that my actual problem was not linked to the device being busy... Erh... Let's just say it was a 'compare and contrast' scenario. :-)

It seems I've stumbled on the root of the problem, though! I had an innocent-looking .openalrc file that I wrote to fix a stutter problem, but somehow it prevents FS2 from running with sound now. Removing the file fixes the problem... I'll have to check if the stutter problem still occurs, though.

So, long story made short, .openalrc is the culprit. By the way, the contents of the file were as follow (I'm not sure what the problem might be here):
 
(define devices '(alsa native))                                                         
(define alsa-device "dmix")                                                             
(define speaker-num 2)

Thanks everyone for the help :)