[Bf-committers] Experiences with the engine and sound on linux

Alexander Ewering blender at instinctive.de
Thu Dec 23 13:16:39 CET 2004


On Thu, 23 Dec 2004, Ton Roosendaal wrote:

> Hi,
>
> I think a lot of people, including me, will agree on this. :)
>
> Kent Mein mentioned (on irc) a while ago he liked to look into this for a 
> next release, fixing up the Soundsystem module to have it run without openAL 
> (optional or default). This is very welcome work for a developer to do, we 
> really need to cleanup the two mixed audio systems in Blender.

Yes. And I like SDL, too. It's much cleaner, not that bloated, it
actually works, has nice documentation, AND I have experience with it ;)

>
> From my humble ignorant perspective, a recode can just do this;
>
> - kick out openAL completely and only use SDL; but first check if there's 
> issues with supported audio formats
> - remove all weird dependencies with audio we have in blender/src and 
> blender/blenkernel. There's highly confusing code that mixes up loading sound 
> (.wav) files with initializing the audio system. Initializing sound should 
> not be related to loading files.
> - make sure audio is only initialized and closed once, and can be omitted 
> with "-noaudio" commandline option.
> - code a simple SDL version for the "listener" to fade out sound on certain 
> distances

I completely agree.

Considering the supported audio formats.. I haven't looked into that ever,
because I hardly use anything else than simple raw WAVs... but for game
development, I agree it should be possible to include at least MP3s for
size's sake.

The SDL version of the listener would look like this:

The same loop (or a copy of it) that currently gets run while in ALT-A 
would be running in the game engine, keeping the mixing buffer filled.

Then, simple panning (based on direction of sound actuators relative to
the listener) and attenuation (based on the "loudness" value of an
object and the distance) could be done. The code for this is already
there and used for the sequencer.

Basically, the "loudness" of a sound decides how quickly it attenuates
with distance. The louder the sound, the less it attenuates.

One thing that someone else would have to do/prepare for this is inclusion
of SDL and the mixing loop inside the game engine and exported runtimes.

If I should be able to do anything for this, it would of course have to
be in C :)


>
> -Ton-
>
>
> On 23 Dec, 2004, at 12:30, Alexander Ewering wrote:
>
>> 
>> Hello,
>> 
>> I've recently tried to get sound working in the game engine on linux
>> (from a user perspective), and it was a total failure.
>> 
>> The only occasion when I could get sound to be heard AT ALL was when
>> I set it to one of the Looping modes, non-looped sounds just don't
>> work. This is the same behaviour as in 2.25, btw (it got introduced
>> in 2.25, too).
>> 
>> I thought I had seen a commit that fixed this, but appearently I've
>> been wrong.
>> 
>> Even then, the looped sound (which is unusable because it's an
>> event sound) came with about half a second latency. I guess that
>> can be fixed with a smaller mixing buffer size, though.
>> 
>> On the whole, I would like to say the following about OpenAL:
>> 
>> In my opinion, it's a library of questionable quality. It has terrible docs 
>> (try
>> to google for any of the functions, you won't find a lot of useful
>> hits), there is no command reference anywhere (anywhere = what I
>> could find in 5 minutes (5 minutes is a lot for me)), the packages
>> that come with various distributions are unstable or strangely
>> linked.
>> 
>> On the whole, wouldn't it be an option to move to SDL and SDL_mixer?
>> 
>> I'm not sure if we can get all the funky spacial doppler effects
>> then, but at least we can get it *basically* working :) For me,
>> directional panning and attenuation with an adjustable rolloff
>> factor would be far enough. And that's even possible without SDL_mixer
>> by simple reusage of, for example, the sequencer audio code...
>> 
>> Of course, I wouldn't know how to deal with all this if it should
>> work in exported runtimes, etc., nor in the plugin...
>> 
>> Well, maybe some people can give opinions or flame me :)
>> 
>> Oh, and is it possible to switch to the old (pre-2.25) audio system? (I 
>> think it was FMOD)
>> 
>> | alexander ewering              instinctive mediaworks
>> | ae[@]instinctive[.]de   http://www[.]instinctive[.]de
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-committers
>> 
>> 
> --------------------------------------------------------------------------
> Ton Roosendaal  Blender Foundation ton at blender.org http://www.blender.org
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>


| alexander ewering              instinctive mediaworks
| ae[@]instinctive[.]de   http://www[.]instinctive[.]de


More information about the Bf-committers mailing list