Author Topic: Sound problem on Linux  (Read 3112 times)

0 Members and 1 Guest are viewing this topic.

Sound problem on Linux
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]

 

Offline CaptJosh

  • 210
Re: Sound problem on Linux
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.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: Sound problem on Linux
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)

 

Offline CaptJosh

  • 210
Re: Sound problem on Linux
Um...maybe make sure you have all your SDL components installed?
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: Sound problem on Linux
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.

 

Offline CaptJosh

  • 210
Re: Sound problem on Linux
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?
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: Sound problem on Linux
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!

 

Offline Androgeos Exeunt

  • Captain Oblivious
  • 212
  • Prevents attraction.
    • Wordpress.com Blog
Re: Sound problem on Linux
You're welcome. Charging USilv...

:welcomesilver:
My blog

Quote: Tuesday, 3 October 2023 0133 UTC +8, #general
MP-Ryan
Oh you still believe in fairy tales like Santa, the Easter Bunny, and free market competition principles?

 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
Re: Sound problem on Linux
Tried running it as root?

 

Offline CaptJosh

  • 210
Re: Sound problem on Linux
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.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: Sound problem on Linux
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 :)