Ubuntu sound in BGE == dead silence

I’ve been searching around and getting lost in different variations of this problem, so thouht I’d ask.

Games Engine, running on Linux, Ubuntu 8.04

Sound file inserted (as WAV… I’m following the original “Blender Gamekit” to learn to make simple games)

…why can’t I hear anything? No errors on console.

Umm, have you checked that your sound works and is turned up?

do you have the libsox-fmt-all and the w32codecs packages installed?

Or check whether you’re using alsa or pulse audio. I can’t say for certain I’ve had any trouble because of this, but I know somebody who has (though not blender related). Do blender sounds work outside of the GE?

I also have a similar problem, sound doesn’t work in the game engine or in the sounds panel. However in the sequence editor I can add audio tracks if I use the hard drive version rather than the RAM version.

(by the way, I’m using Ubuntu 8.10 and Blender 2.48a)

MinceMeat: Perhaps I should have written that I usually have no problem with sound.

Aloyr: I did not have libsox-fmt-all but obtaining these has not fixed the problem.

I got the .blend file of my game and put it into a Windows machine to see if it was something I did bad in linking the sound. Sound works fine on the Windows machine with no changes to the file whatsoever, so I’m thinking it must be an Ubuntu specific Blender configuration error.

Here’s my .blend file for you to see for yourself. It’s an early exercise from the original Blender Gamekit course: lancer_pumpkin09.blend

http://img217.imageshack.us/img217/5996/pumpkincb1.jpg

I seem to remember something a while back about having to enable / disable things to get “scrub” working for lipsync… that was some time ago and I’m struggling to remember what it was… something about Blender needing to “hog” the sound all-or-nothing. I’m not sure whether scrub would be working at the moment or not?

JO9: I was thinking it might be something like that. Having switched drivers, there seems to be no difference (unless I’m switching in the wrong place?). Could it be that Blender needs command-line options to specify something? Both BGE and resulting “compiled” applications (stand alone) have no sound in Ubuntu. Not sure if failed BGE would cause failed output files or whether there is sound, but the OS isn’t playing them.

Flanjygo: Nice to know i’m not the only one.

Flanjygo: Confirming that the scrub feature in sequence editor works (I can use it to lipsync with an animation) but again, the Game Engine sounds do not.

Hey Ubuntu, welcome to the club!

Last I’ve checked, Mac hasn’t had any sound support in Blender since… around 2.37? Or was it 2.40? Well, either way, it’s been too long.

Lancer Mac, Ubuntu or PC?

alienkid: My problem is happening on Ubuntu on a PC. It’s happening both with my Dell laptop and also my much larger IBM IntelliStation computer.

I’m now submitting it as BugTracker#18232

From i have read in the net I think is due to problem with the OpenAL package in Ubuntu.

You can try to compile OpenAl-Soft (http://kcat.strangesoft.net/openal-releases/openal-soft-1.6.372.tar.bz2) to replace the buggy Openal package. Perhaps, additionally to cmake, make and make install commands you will have to make a link (from libopenal.so.0 to libopenal.so.1, I can’t remember exactly)

In the case of the mac-intel platform the problem is that Apple doesn’t have OpenAl library for this platform yet (only for PPC). You also can try to compile OpenAL-Soft (in this case from SVN-Git repository due a new SDL backend) but I think it will be a bit more complicated.

Thanks. I downloaded OpenAL-Soft from here: http://kcat.strangesoft.net/openal.html but it didn’t seem to make any difference.

I hope I did it right. After untarring, I moved the directory of the package to /usr/share/cmake-2.4/Templates/openal/ and then issued a cmake … from there. I then went to the parent directory and issued a make then make install. The make install seemed to be doing something, but even after rebooting the computer…
…still no sound in Blender Game Engine.

Unless you need 3d sound (or are afraid of a little bit of Python :slight_smile: ), I’d say to just use PyGame for sounds. Even when the BGE’s sound does “work” it can be buggy and choppy. Or, at least it was the last time I checked, but I think that was 2.45. There’s a thread somewhere in the resources section that explains how to use PyGame sounds in the BGE.

Thanks Moguri for your suggestion. I’d like to get the actual BGE sounds to work if possible, but will use PyGame if I can figure it out.

It annoys me (a little) that BGE sound isn’t working in the first place. It’s not consistent when sound samples work in the Video Sequence Editor, but not in the Games Engine.

For the purpose of demo-reeling game samples, if I were to use PyGame sound, would that mean I’d have to tell end users of my standalone Blender files that they’re going to have to download PyGame before my game will work?

I have installed the Python-PyGame package (1.7 is the latest available for Ubuntu 8.04), though could someone please point me to some “plain English, never used it before” examples of how to use PyGame sounds in Blender? For example, here is how I would create noise if BGE sound were working…

  • Hit F10 to go into the Scene(F10) panel
  • Hit the wavy icon on the right (sound block buttons)
  • Under the first “sound” tab, hit the button to OPEN NEW sample… direct this to the correct WAV.
  • In the player options, have appropriate sensors / controllers leading to a new SOUND actuator. Use the drop down list inside to select your sound file.
  • Choose “play end” if you want the whole sound to play.

…if do use PyGame, could someone please show me where I can get similar easy to follow steps?

Here’s the link to the thread I mentioned earlier:
http://blenderartists.org/forum/showthread.php?t=108466

Also, by following those steps, the end-user will not need PyGame, but they will need Python.

Another thing, I think the sequencer and BGE audio use two different audio systems. I believe the sequencer uses ffmpeg while the BGE uses OpenAl + SDL. However, I could be wrong.

Hi,
Could you show me the output of that console command?:

In these 3 directories:
/usr/lib/
/usr/lib32/
/usr/local/lib/

you have to do:
ls -la libopenal.*

I think is a problem with a link

lancer@lance-laptop:~$ cd /usr/lib
lancer@lance-laptop:/usr/lib$ ls -la libopenal.
lrwxrwxrwx 1 root root 18 2008-08-19 02:02 libopenal.so.0 -> libopenal.so.0.0.0
-rw-r–r-- 1 root root 225448 2007-12-04 12:32 libopenal.so.0.0.0
lancer@lance-laptop:/usr/lib$ cd /usr/lib32/
lancer@lance-laptop:/usr/lib32$ ls -la libopenal.
ls: cannot access libopenal.: No such file or directory
lancer@lance-laptop:/usr/lib32$ cd /usr/local/lib/
lancer@lance-laptop:/usr/local/lib$ ls -la libopenal.

ls: cannot access libopenal.*: No such file or directory

The openAl-soft is not installed in these directories.
When you did “make install” in openal-soft directory did you perform this operation as root or as lancer user?

Another thing more :).
In your openal-soft directory (in /usr/share/cmake-2.4/Templates/openal/), do you have the file libopenal.so.1.6.372?

I was pretty sure I’d issued a sudo command to install. Here’s are repeat of the process I used…

lancer@lance-laptop:~$ cd /usr/share/cmake-2.4/Templates/openal/
lancer@lance-laptop:/usr/share/cmake-2.4/Templates/openal$ sudo make install …
[sudo] password for lancer: *****
Install the project…
– Install configuration: “”
– Installing /usr/local/Templates/CPackConfig.cmake.in
– Installing /usr/local/Templates/TestDriver.cxx.in
– Installing /usr/local/Templates/CTestScript.cmake.in
– Installing /usr/local/Templates/CPack.GenericDescription.txt
– Installing /usr/local/Templates/CPack.GenericLicense.txt
– Installing /usr/local/Templates/CMakeLists.txt
– Installing /usr/local/Templates/CPack.GenericWelcome.txt
– Installing /usr/local/Templates/CMakeWindowsSystemConfig.cmake
– Installing /usr/local/Templates/CMakeVisualStudio6Configurations.cmake
– Installing /usr/local/Templates/DLLFooter.dsptemplate
– Installing /usr/local/Templates/UtilityHeader.dsptemplate
– Installing /usr/local/Templates/UtilityFooter.dsptemplate
– Installing /usr/local/Templates/EXEHeader.dsptemplate
– Installing /usr/local/Templates/staticLibHeader.dsptemplate
– Installing /usr/local/Templates/staticLibFooter.dsptemplate
– Installing /usr/local/Templates/DLLHeader.dsptemplate
– Installing /usr/local/Templates/EXEWinHeader.dsptemplate
– Installing /usr/local/Templates/EXEFooter.dsptemplate
lancer@lance-laptop:/usr/share/cmake-2.4/Templates/openal$ cd /usr/lib
lancer@lance-laptop:/usr/lib$ ls -la libopenal.
lrwxrwxrwx 1 root root 18 2008-08-19 02:02 libopenal.so.0 -> libopenal.so.0.0.0
-rw-r–r-- 1 root root 225448 2007-12-04 12:32 libopenal.so.0.0.0
lancer@lance-laptop:/usr/lib$ cd /usr/lib32/
lancer@lance-laptop:/usr/lib32$ ls -la libopenal.
ls: cannot access libopenal.: No such file or directory
lancer@lance-laptop:/usr/lib32$ cd /usr/local/lib/
lancer@lance-laptop:/usr/local/lib$ ls -la libopenal.
ls: cannot access libopenal.: No such file or directory

For your other question about libopenal.so.1.6.372…

lancer@lance-laptop:/usr/local/lib$ locate libopenal.so.1.6.372
lancer@lance-laptop:/usr/local/lib$ cd /usr/share/cmake-2.4/Templates/openal/
lancer@lance-laptop:/usr/share/cmake-2.4/Templates/openal$ ls openal-soft*
openal-soft-1.6.372.tar.bz2

openal-soft-1.6.372:
admin alsoftrc.sample CMakeLists.txt COPYING include
Alc CMakeConf config.h.in examples OpenAL32
lancer@lance-laptop:/usr/share/cmake-2.4/Templates/openal$

The locate command gave no feedback, and the files I’ve just found in /usr/share/cmake-2.4/Templates/openal look like I need to make something in there?