project-navigation
Personal tools

Author Topic: No sound with 2.2.1 stable  (Read 3470 times)

phaze

  • Guest
No sound with 2.2.1 stable
« on: June 10, 2009, 08:21:49 pm »
Hi all,

I've compiled version 2.2.1 from svn, it seems to work just fine but I can't for the life of me get it to output any sound. During startup, I get a "Unable to open audio!" message during the sound initialization. Running it with strace reveals several "Cannot allocate memory" (ENOMEM) errors that seem to be the cause of the problem. Changing the SDL_AUDIODRIVER from alsa to dsp didn't help (strace ouput changes since we open different devices, etc, but it still fails with ENOMEM). Just to confirm, I hacked src/client/cl_sound.c to add a perror() statement right after the call to Mix_OpenAudio() and the error returned was indeed "Cannot allocate memory".

Now comes the weird part. Sound works fine in other apps, so I figured it might've been an issue with my SDL installation or configuration, etc. I found an example test program here: http://www.kekkai.org/roger/sdl/mixer/ (specifically mixer1.c). Surprisingly, it works just fine, which seems to indicate a working SDL install. The SDL function calls in that program are almost identical to that in cl_sound.c, so I can't imagine what might be going wrong. I even tried editing cl_sound.c to call Mix_OpenAudio with exactly the same arguments as that in the test program, no dice.

Any thoughts/suggestions would be most appreciated. Thanks!


Some stuff about my system:

Distro: Gentoo
Arch: x86 (Core 2 Duo @ 2.0Ghz, 4GB Ram)
Kernel: 2.6.29-gentoo-r5, alsa drivers compiled in w/ oss emulation support
SDL module versions: Mixer (1.2.8), Sound (1.0.3), TTF (2.0.9), libSDL (1.2.13-r1)
Graphics: Nvidia Quadro NVS 140m w/ binary Nvidia driver


p.s. I tried installing with the Gentoo ebuild in case there were some Gentoo-specific customizations that needed to be made, but I still get the same error.


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: No sound with 2.2.1 stable
« Reply #1 on: June 10, 2009, 10:02:04 pm »
maybe some sound server is running in the background already?

Offline BAM

  • Rookie
  • ***
  • Posts: 79
    • View Profile
Re: No sound with 2.2.1 stable
« Reply #2 on: June 10, 2009, 11:19:41 pm »
I would try both the ALSA and the emulated OSS sound server; I have seen some Linux systems that had issues playing sound through either server, but not with the other.

phaze

  • Guest
Re: No sound with 2.2.1 stable
« Reply #3 on: June 14, 2009, 03:19:37 pm »
I've tried both alsa and emulated oss, no luck. I made sure there aren't any other sound servers running, too. It's strange, the classic sound problem with Linux is usually some program locking the sound device, but that isn't the case here. Also, every other SDL app seems to have no problem at all with playing sound, but I can't see what ufo-ai is doing differently.