PulseAudio playback in Blender corrupts sound in other applications
As I have written on the mailing list already:
I've developed a PulseAudio backend [1] for Blender which is going to be released with Blender 3.0 and should be the default audio backend on Linux.
I've developed the backend based on the documentation [2] and looking at some code of other implementations [3,4], but I'm not sure if I did everything correctly. It works on my end, but some users are reporting that it now distorts audio playback on their system [5].
Basically I create a stream that I cork while there is no playback. I'm using a pa_mainloop object that is iterated in an own thread, to avoid deadlocks with the locking mechanism of the underlying audio device/backend code.
I hoped someone could have a quick look at my implementation [1] and check if I made a mistake using the API. Or maybe there is another reason for the issues that some people are experiencing? Thanks for your help already in advance!
I discussed the issue on IRC with @arun who told me that my implementation should be fine. However, the issue still persists and more users seem to be affected [6]. As discussed on IRC, I asked the user to provide a log and I got one at the bottom of the first bug report [5], but I'll also attach it here: pulse.log. Searching for Blender brings one to the important bits I guess. It would be great if we could get this sorted! Thanks already for your help!
- [1] https://github.com/neXyon/audaspace/blob/master/plugins/pulseaudio/PulseAudioDevice.cpp
- [2] https://freedesktop.org/software/pulseaudio/doxygen/
- [3] https://github.com/kcat/openal-soft/blob/master/alc/backends/pulseaudio.cpp
- [4] https://source.chromium.org/chromium/chromium/src/+/main:media/audio/pulse/pulse_output.cc
- [5] https://developer.blender.org/T88089
- [6] https://developer.blender.org/T88876