This adds PulseAudio as audio backend for Blender on Linux. PulseAudio is the main audio engine used on most, if not all, Linux distributions today.
Details
Diff Detail
Event Timeline
I like PulseAudio, so this patch certainly is welcome. Before I look at the code changes, can you expand the patch description a bit? Does it change the UI in any way? Will you be able to select things like the sinks & sources? Or is that left to apps like PulseAudio Volume Control?
| CMakeLists.txt | ||
|---|---|---|
| 686 | you can use the set_and_warn_dependency macro for this | |
Thanks! It simply adds PulseAudio as one of the audio devices in the user settings and actually prefers it over SDL and OpenAL. Let me know if you think that should be changed.
Also I haven't added the WITH_PULSEAUDIO flag yet to the various cmake build configs. As I just wrote with @Ray Molenkamp (LazyDodo) in the chat, we might consider PulseAudio for building for the official Linux releases, if you think so?
I haven't added device (=sink) enumeration to the code, like for OpenAL, yet, but that would be a change that I have to make in audaspace anyway. For know it should suffice, since as you said, you can use other apps to redirect the audio if you wish to do so.
With this patch review I'm mostly worried about proper integration in the Blender build system and to discuss inclusion in official releases.
On my CentOS 7 VM it can't find the PulseAudio library:
sybren@buildbot ~/b/l/b/linux_glibc217_x86_64_cmake> cmake -U'*PULSE*' . -- Using pre-compiled LIBDIR: /home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/blender.git/../lib/linux_x86_64 -- Could NOT find Pulse (missing: LIBPULSE_LIBRARY LIBPULSE_INCLUDE_DIR)
I did, however, install the development libraries with sudo yum install pulseaudio-libs-devel. It has installed header files in /usr/include/pulse/ and libraries in /usr/lib64, and even installed some CMake files in /usr/lib64/cmake/PulseAudio.
We should also include a build_files/build_environment/pulseaudio.cmake file to statically build the PulseAudio library (see D10598: Fix T86124: Self-hosting external libraries packages for soon-to-be-committed changes there), and update FindPulse.cmake to find those.
Update: Jack is also linked dynamically (at runtime, even), and not statically. We can do the same for PulseAudio.
I accepted too soon. I sometimes get:
Assertion 'q->length == 0' failed at pulsecore/queue.c:63, function pa_queue_free(). Aborting.