Author Topic: Solution to fix OpenaL (sound) problems (READ THIS)  (Read 20267 times)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Solution to fix OpenaL (sound) problems (READ THIS)
« on: 25 March 2010, 19:13:26 »
There is a well known bug with OpenAL causing multiple sound drivers to fight with each other when playing sound in Linux.

For details see:

http://sourceforge.net/tracker/?func=detail&aid=2792509&group_id=127297&atid=709610
https://bugs.launchpad.net/ubuntu/+source/openal-soft/+bug/503780

While there are newer versions of OpenaL that "claim" to fix this, I have fixed glest and all of my other sound problems in Ubutnu by doing this:

#1 Edit the Open AL config:

sudo gedit /etc/openal/alsoft.conf

#2: Ensure you have a line with (at least) the following:

drivers = pulse,alsa,oss

(make sure the first character is NOT # or it means its commented out)
Save the file.

#3: kill pulse audio by running:

pulseaudio -k

#4: restart pulse audio via:

pulseaudio --start

Thats it!

Edit: Here is a bash script to automate it:

#!/bin/sh

# now deal with the openal library [libopenal.so.0]
hasdrivers=`grep  "^[d]rivers" /etc/openal/alsoft.conf`
echo "openal drivers = [$hasdrivers]"
if [ -n "$hasdrivers" ]; then
  echo "openal drivers was found = [$hasdrivers]"
else
  echo "openal drivers is missing, attempting to setup a working configuration"

  sudo cp /etc/openal/alsoft.conf /etc/openal/alsoft.conf.bkp
  sudo sh -c 'echo "drivers = pulse,alsa,oss" >> /etc/openal/alsoft.conf'
  pulseaudio -k
  pulseaudio --start

  echo "openal re-configured, try out your sound now!"
fi

« Last Edit: 25 March 2010, 20:15:21 by softcoder »

narcisgarcia

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #1 on: 15 April 2010, 06:48:56 »
Thanks, but this doesn't work for me.
The problem I feel is that Glest begins with sound, but after a while the sound disappears as if you were walking with a radio (the sound doesn't cut: disappears slowly).

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #2 on: 15 April 2010, 08:57:52 »
Do other games work fine for you, or do you have similar problems with them?

Is this still your system?:
Software environment:
- Ubuntu GNU/Linux 9.10 (32-bit)
- Glest 3.2.2 (from system's repositories)

« Last Edit: 15 April 2010, 09:00:54 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

narcisgarcia

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #3 on: 15 April 2010, 11:38:09 »
I the only 3D game I have installed, and the only with sound. Other that I still have in the (same) system are Chess, Gnometris and Breakout.

VLC media player, Totem, Kdenlive, Moovida, work well with audio.

(yes, the same software environment)

narcisgarcia

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #4 on: 15 April 2010, 12:23:40 »
I can install another game you ask for, if you want I make some testing.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #5 on: 15 April 2010, 14:36:07 »
One of these? They all use OpenAL the soundsystem used by glest.

http://connect.creativelabs.com/openal/OpenAL%20Wiki/Games.aspx
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

narcisgarcia

  • Guest
Testing other games with OpenAL
« Reply #6 on: 16 April 2010, 06:34:52 »
- Eternal Lands doesn't connect to the server
- FlightGear has similar problems with sound as Glest (since the begin)
- OpenArena has similar problems with sound as Glest (some times)
- Trigger rally souns well all the time
- supertux-stable has a bug for Ubuntu 9.10 and doesn't start.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #7 on: 16 April 2010, 12:06:04 »
I think this is a driver problem of your soundcard/chip :( . I think we cannot help you in this case.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

wasiliy

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #8 on: 5 June 2010, 12:20:35 »
Quote
#2: Ensure you have a line with (at least) the following:

drivers = pulse,alsa,oss

At this step make sure only "oss" is left in that line, so that you have "drivers = oss" ... works fine for me then.

Domorus

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #9 on: 13 July 2010, 12:04:07 »
Maybe OpenAL doesn´t work correctly with Pulseaudio.
If you use Ubuntu:
Quote
gksudo gedit /etc/openal/alsoft.conf
and replace "default" in section "device" with "alsa". (without " " ).

Regards

« Last Edit: 13 July 2010, 12:08:23 by Domorus »

winterequinox

  • Guest
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #10 on: 24 August 2010, 22:04:37 »
I downloaded and built from the glest-source-3.2.1.tar.bz2 tarball on an old ubuntu system, hardy heron, the last long term release, and it worked fine.  This is my sandbox system.  I moved over the directory with the data and glest executable I had just built to a lucid lynx (the latest ubuntu as of this posting) system.  These are both 64 bit machines BTW.  I was curious to see if the executable would work, and it didn't.  I got the openal.so.0 problem.  Sooo, I followed down this thread and edited /etc/openal/alsoft.conf and still no dice.  So decided to try the oldest linux trick in the world.  I went into /usr/lib.  There was no libopenal.so.0 but there was a libopenal.so symbolic link to libopenal.so.1 which was symbolically linked to libopenal.so.1.12.854.  I just did the following:

ln -s libopenal.so libopenal.so.0

I was superuser but 'sudo ln -s libopenal.so libopenal.so.0' should have the same effect.  You should be in the /usr/lib directory
when you do this.

Anyway, it solved the problem for me.  glest came up with sound.


softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Solution to fix OpenaL (sound) problems (READ THIS)
« Reply #11 on: 24 August 2010, 23:53:56 »
The mega-glest startup script already does this for you (for mega-glest users). The problem here is more related to bad versions of openal and bad bad bad PULSE AUDIO.