jump to navigation

The PulseAudio Pain January 8, 2010

Posted by audaspace in General.
comments closed

(If you’re only here to get a solution, scroll down to the heading “The solution”.)

Well, first of all: I didn’t want to do a blog post about this, but there have been so many people having a problem with PulseAudio in connection with OpenAL that I want to place a description of the problem and several ways to solve the issue here now.

What’s the problem with PulseAudio? Well, most audio developers and pro audio users know that PulseAudio actually is crap. It adds unnecessary execution layers to the audio processing with the disadvantage of getting a higher latency and unnecessary waste of CPU cycles (and as such energy and time in the end). PulseAudio is an audio server like ESD and aRts in the older days of Gnome and KDE. The reason for those sound serversĀ  was the fact that with the old linux kernel audio drivers of OSS (Open Sound System) only one application could use sound, except you had a sound card that supported hardware mixing what users rarely had. This was also the reason for sound problems with blender versions before 2.5, they used two different audio libraries (SDL and OpenAL) at the same time and only one could get the device, so either game engine or sequencer audio didn’t work. Back to the sound servers job: They opened the device and all applications played to the sound servers which then mixed the audio and played it. Well as OSS is history now and there is ALSA in the kernel for a long time already which has software mixing, the sound servers job hasn’t to be done anymore and so you don’t need one anymore. KDE was intelligent enough to understand this and removed aRts, while the Gnome project after some time added a new sound server: PulseAudio. Some people might argue now that PulseAudio also brings new features that you normally don’t have like: You can play sounds over the network, set a volume for every application and can connect several sound cards to be presented as one. But the fact is: no typical PC users needs this! Most applications have their own volume setting. ALSA already can present more sound cards as one. And who really needs network over audio should be cute enough to set that up himself (for example by installing PulseAudio if he really needs that, for a terminal server and clients for example). Pro audio users won’t user PulseAudio too, as they will use Jack. Jack is another sound server, but has a different job. With jack you have a lot more control over the audio flow, it also supports MIDI, is realtime suitable (VERY low latency!) and provides other cool things like Jack Transport, with which you are able to start/pause/stop/seek in one application, letting all others do the same.

And now what’s the problem with blender? The problem is not in blender itself, otherwise I could have fixed the issue already for a long time. The problem is in Linux’ OpenAL library (OpenAL soft) that on systems with PulseAudio plays through Pulse. I’ve already talked to Chris (the developer of OpenAL soft, who is a really cool guy, thank you Chris for doing such a great job!) in IRC and he told me that the API of PulseAudio sucks too. He tried to fix the problems that arise with pulse in Version 1.10 and still remaining were fixed in OpenAL soft SVN, but even that one may give you trouble as it seems that it is impossible to prevent race conditions with PulseAudio.

The solution

There are several possible solutions to fix the problem:

1) [My personal recommendation] Uninstall PulseAudio. I won’t tell you any details on how this works, because every distribution has a different package system, but I’m sure you’ll quickly find a step-by-step tutorial with google for your distro.

2) Update OpenAL soft to version 1.11 or compile it yourself from GIT. This might be a bit difficult for beginners and also people who don’t like custom packages on their systems where the distribution doesn’t provide an actual package yet, but still is might be a wanted solution.

3) Configure blender to not use OpenAL. In the user preferences set SDL or None and then save the changes with Ctrl+Alt+U. You might want to restart blender, although with changing the sound device the new setting applies immediately.

Advertisements

Blender Audio Visualisation January 2, 2010

Posted by audaspace in General.
comments closed

As promised, here the longer news to what I’ve committed and written about Yesterday.

Now after fixing the quickly reported bugs, I’ve been able to do some example videos.

But first of all, I am happy that I can delete two of the TODO list points that were on the List, when opening the Blog:

  • Float should be the default sample format for audio samples.
  • Render sound waves to f-curves to use them in animations.

Quickly some comments to the first point: I’ve been supporting other sample formats than float, like the commonly used S16 format in the internals of audaspace, mainly for the reason that the realtime use shouldn’t suffer from a speed loss. But I found out that in the cases where that could apply, there isn’t much difference in performance and many times when you want to use effects, you have to do floating point operations anyway. So in the end it’s more likely that NOT using float might result in a performance loss, so I removed that programming overhead. Other sample formats for output devices for example are still supported though, as SDL for example only supports the U8 and S16 sample format.

Now to the promised videos. The sound to f-curve operator supports nearly the same options the soundtracker script from technoestupido does (http://technoestupido.musiclood.com/soundtracker.py) .

So as a first try I used the loop he used for his soundtracker example Video (http://www.youtube.com/watch?v=O10lWfH4TWQ) and made similar to him two cubes, where the left one has a highpass filter and the right one a lowpass and higher attack/release values:

The second video is a little more advanced, where I used the pink panther theme song I’ve made with lmms. I animated the count of an array modifier on a cube with different lowpass/highpass values in the operator to get an equalizer.

The Suzannes to the left and right are scaling up with a low pass left and a high pass right and accumulate and additive enabled. Just enjoy:

Happy new year! January 1, 2010

Posted by audaspace in General.
comments closed

I wish all blender users a happy new year 2010!

I’ve just committed a huge changeset which also includes a first implementation of the 2.5 sound to f-curve operator, more to come on that tomorrow, as I really need to go to bed now.

Good night!

Donation December 28, 2009

Posted by audaspace in Donation.
comments closed

I’ve added a donation link and a sponsors page, so if you like my work and want to support me, please consider a donation.

If there’s a specific audio related feature you would like to have, please mention that and I’ll also concentrate on that more, before doing other things.

The names of the generous people that donate will be published on the sponsors page.

Welcome December 28, 2009

Posted by audaspace in General.
comments closed

Hello and welcome to my Blender Audio Development Blog!

I’ll post the development status and updates of the blender audio system here so that you can always be up to date, however I probably won’t be able to post to often, as I better spend my spare time on developing, right?