SDL sound subsystem: Pulse audio forks a process on Linux

When I make just a tiny SDL hello world program with INIT_EVERYTHING, then a new process is spawned by that program, which I have traced to the Pulse Audio library.

My worry here is that this fork copies the entire virtual memory of the main process, which contains lots of dynamic allocations. While the original process cleans up properly, the forked audio process does not.

Does SDL have anything to do with that, or any way of influencing how Pulse Audio is used? Is this even a problem, or should I just ignore the spawned process? Is there a reason that the audio processing cannot simply run in an ordinary thread?

A little update:

I don’t actually have a pulse server running, or even installed. Apparently SDL falls back on ALSA in my situation.

Nonetheless, a new process remains forked, apparently originating from within libpulse.

Does that still happen if you set:

SDL_AUDIODRIVER=alsa

in your environment?On 01/09/2012 06:46 PM, louisdx wrote:

When I make just a tiny SDL hello world program with INIT_EVERYTHING,
then a new process is spawned by that program, which I have traced to
the Pulse Audio library.