[libsoundio] Update to 2.0.1-7#13336
Conversation
|
@mj2984 Just curious - Can you share why these optimizations are needed over and above the regular build process? Does this solve a performance issue you have run into? |
|
The library runs frequent callbacks (based on latency set) and the intention is to use it with https://github.com/mj2984/SoundIO.jl. This can be used not just with audio but also with any device that mimics an audio device and can leverage OS level optimizations for audio transport (eg closed loop motor control). I do not have benchmarks to confirm, and the experiments are random (I'm one person working on this), but I feel that the reliability was better with these optimizations (though it could be from other parts of the code I changed later). |
|
@mj2984 I have updated this to be less aggressive on GCC version, but added the performance flags. This should do everything you want - and we can bump things further if necessary - but it would be good to try this out and see how it performs. |
Bump libsoundio from v2.0.0 to v2.0.1 (upstream tag 2.0.1-7). Add -funroll-loops, -fno-plt, and LTO via CMake flags for real-time audio callback performance. Patch MinGW GUID redefinition errors (upstream PR JuliaPackaging#283). Co-Authored-By: mj2984 <92405693+mj2984@users.noreply.github.com> Co-Authored-By: Viral B. Shah <ViralBShah@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for merging the update. I feel the worst-case scenario (callback returning to julia and back) seems to stutter more with the gcc8 version, but the best-case scenario works equally well. I'm unsure how to arrange a benchmark for this particular case. (for personal experiments with extreme scenarios, it looks safer using the custom jll built using the original script). I would personally prefer prioritizing performance and trade off compatibility with older systems, as the task is latency sensitive anyway. |
|
Can you try to build a local JLL with this script and share what diff helps fix the stutter? The only difference here is that I am using GCC 8 instead of GCC 13. The rest of the build options should be the same. If there is an observable improvement from your perspective, we can have a build with GCC 13. Since this is a C codebase, presumably there won't be issues with comptability with the dependencies and such. |
|
GCC = 13.2 (13.2 is the version I was originally suggested through binarybuilder) is more stable. I tried using the latest version of yggdrasil with the suggested changes and patchfixes, and just changing gcc version = 13.2 and it is better for the worst-case scenario (similar to the original commit). Optional: I also ran a second test, by explicitly setting some optimizations (on windows, libsoundio connects to wasapi which is written in C++) just to be safe which also performs fine. This script change would be nice to have if it does not cause any other issues but is fine to skip otherwise. Updated script is: |
|
Is there a way to provide the linker flags through May I request you to create a new PR on top of this one with these changes and the new gcc? The version number doesn't need to change. |
Added optimizations
export CFLAGS="-O3 -funroll-loops -fno-plt -flto"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-Wl,-O1 -flto"