Skip to content

Commit 00d4cf0

Browse files
mj2984ViralBShahclaude
authored
[libsoundio] Update to v2.0.1 with optimized build (#13336)
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 #283). Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 45f608d commit 00d4cf0

File tree

2 files changed

+112
-7
lines changed

2 files changed

+112
-7
lines changed

L/libsoundio/build_tarballs.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@
33
using BinaryBuilder, Pkg
44

55
name = "libsoundio"
6-
version = v"2.0.0"
6+
version = v"2.0.1"
77

88
# Collection of sources required to complete build
99
sources = [
10-
GitSource("https://github.com/andrewrk/libsoundio.git", "5087ef68b9c9014883861832c2f6dd8c6515f8e0")
10+
GitSource("https://github.com/andrewrk/libsoundio.git", "f42a607883101244e2d21168cce8d7f2ec21c588"),
11+
DirectorySource("./bundled"),
1112
]
1213

1314
# Bash recipe for building across all platforms
1415
script = raw"""
1516
cd $WORKSPACE/srcdir/libsoundio
1617
18+
# Fix MinGW GUID redefinition errors (upstream PR #283)
19+
atomic_patch -p1 $WORKSPACE/srcdir/patches/fix-mingw-guid-redefinition.patch
20+
1721
# Initialize flags
18-
CMAKE_FLAGS=("-DCMAKE_INSTALL_PREFIX=$prefix"
19-
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}"
20-
"-DCMAKE_BUILD_TYPE=Release"
22+
CMAKE_FLAGS=("-DCMAKE_INSTALL_PREFIX=$prefix"
23+
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}"
24+
"-DCMAKE_BUILD_TYPE=Release"
25+
"-DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG -funroll-loops -fno-plt"
26+
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
2127
"-DBUILD_STATIC_LIBS=OFF"
22-
"-DBUILD_EXAMPLE_PROGRAMS=OFF"
28+
"-DBUILD_EXAMPLE_PROGRAMS=OFF"
2329
"-DBUILD_TESTS=OFF"
2430
"-DENABLE_JACK=OFF")
2531
@@ -63,4 +69,4 @@ dependencies = [
6369
]
6470

6571
# Build the tarballs
66-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version = v"13.2.0")
72+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version = v"8")
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
diff --git a/src/wasapi.c b/src/wasapi.c
2+
index 3a157eb1..d97b4435 100644
3+
--- a/src/wasapi.c
4+
+++ b/src/wasapi.c
5+
@@ -30,50 +30,83 @@
6+
#define E_NOTFOUND 0x80070490
7+
#endif //E_NOTFOUND
8+
9+
+#ifndef __MMDeviceAPILib_LIBRARY_DEFINED__
10+
+#define __MMDeviceAPILib_LIBRARY_DEFINED__
11+
// And some GUID are never implemented (Ignoring the INITGUID define)
12+
static const CLSID CLSID_MMDeviceEnumerator = {
13+
0xbcde0395, 0xe52f, 0x467c, {0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e}
14+
};
15+
+#endif
16+
+#ifndef __IMMDeviceEnumerator_INTERFACE_DEFINED__
17+
+#define __IMMDeviceEnumerator_INTERFACE_DEFINED__
18+
static const IID IID_IMMDeviceEnumerator = {
19+
//MIDL_INTERFACE("A95664D2-9614-4F35-A746-DE8DB63617E6")
20+
0xa95664d2, 0x9614, 0x4f35, {0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6}
21+
};
22+
+#endif
23+
+#ifndef __IMMNotificationClient_INTERFACE_DEFINED__
24+
+#define __IMMNotificationClient_INTERFACE_DEFINED__
25+
static const IID IID_IMMNotificationClient = {
26+
//MIDL_INTERFACE("7991EEC9-7E89-4D85-8390-6C703CEC60C0")
27+
0x7991eec9, 0x7e89, 0x4d85, {0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0}
28+
};
29+
+#endif
30+
+#ifndef __IAudioClient_INTERFACE_DEFINED__
31+
+#define __IAudioClient_INTERFACE_DEFINED__
32+
static const IID IID_IAudioClient = {
33+
//MIDL_INTERFACE("1CB9AD4C-DBFA-4c32-B178-C2F568A703B2")
34+
0x1cb9ad4c, 0xdbfa, 0x4c32, {0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2}
35+
};
36+
+#endif
37+
+#ifndef __IAudioRenderClient_INTERFACE_DEFINED__
38+
+#define __IAudioRenderClient_INTERFACE_DEFINED__
39+
static const IID IID_IAudioRenderClient = {
40+
//MIDL_INTERFACE("F294ACFC-3146-4483-A7BF-ADDCA7C260E2")
41+
0xf294acfc, 0x3146, 0x4483, {0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2}
42+
};
43+
+#endif
44+
+#ifndef __IAudioSessionControl_INTERFACE_DEFINED__
45+
+#define __IAudioSessionControl_INTERFACE_DEFINED__
46+
static const IID IID_IAudioSessionControl = {
47+
//MIDL_INTERFACE("F4B1A599-7266-4319-A8CA-E70ACB11E8CD")
48+
0xf4b1a599, 0x7266, 0x4319, {0xa8, 0xca, 0xe7, 0x0a, 0xcb, 0x11, 0xe8, 0xcd}
49+
};
50+
+#endif
51+
+#ifndef __IAudioSessionEvents_INTERFACE_DEFINED__
52+
+#define __IAudioSessionEvents_INTERFACE_DEFINED__
53+
static const IID IID_IAudioSessionEvents = {
54+
//MIDL_INTERFACE("24918ACC-64B3-37C1-8CA9-74A66E9957A8")
55+
0x24918acc, 0x64b3, 0x37c1, {0x8c, 0xa9, 0x74, 0xa6, 0x6e, 0x99, 0x57, 0xa8}
56+
};
57+
+#endif
58+
+#ifndef __IMMEndpoint_INTERFACE_DEFINED__
59+
+#define __IMMEndpoint_INTERFACE_DEFINED__
60+
static const IID IID_IMMEndpoint = {
61+
//MIDL_INTERFACE("1BE09788-6894-4089-8586-9A2A6C265AC5")
62+
0x1be09788, 0x6894, 0x4089, {0x85, 0x86, 0x9a, 0x2a, 0x6c, 0x26, 0x5a, 0xc5}
63+
};
64+
+#endif
65+
+#ifndef __IAudioClockAdjustment_INTERFACE_DEFINED__
66+
+#define __IAudioClockAdjustment_INTERFACE_DEFINED__
67+
static const IID IID_IAudioClockAdjustment = {
68+
//MIDL_INTERFACE("f6e4c0a0-46d9-4fb8-be21-57a3ef2b626c")
69+
0xf6e4c0a0, 0x46d9, 0x4fb8, {0xbe, 0x21, 0x57, 0xa3, 0xef, 0x2b, 0x62, 0x6c}
70+
};
71+
+#endif
72+
+#ifndef __IAudioCaptureClient_INTERFACE_DEFINED__
73+
+#define __IAudioCaptureClient_INTERFACE_DEFINED__
74+
static const IID IID_IAudioCaptureClient = {
75+
//MIDL_INTERFACE("C8ADBD64-E71E-48a0-A4DE-185C395CD317")
76+
0xc8adbd64, 0xe71e, 0x48a0, {0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17}
77+
};
78+
+#endif
79+
+#ifndef __ISimpleAudioVolume_INTERFACE_DEFINED__
80+
+#define __ISimpleAudioVolume_INTERFACE_DEFINED__
81+
static const IID IID_ISimpleAudioVolume = {
82+
//MIDL_INTERFACE("87ce5498-68d6-44e5-9215-6da47ef883d8")
83+
0x87ce5498, 0x68d6, 0x44e5,{ 0x92, 0x15, 0x6d, 0xa4, 0x7e, 0xf8, 0x83, 0xd8 }
84+
};
85+
+#endif
86+
87+
#ifdef __cplusplus
88+
// In C++ mode, IsEqualGUID() takes its arguments by reference
89+
@@ -486,8 +519,9 @@ static void deinit_refresh_devices(struct RefreshDevices *rd) {
90+
soundio_destroy_devices_info(rd->devices_info);
91+
soundio_device_unref(rd->device_shared);
92+
soundio_device_unref(rd->device_raw);
93+
- if (rd->mm_device)
94+
+ if (rd->mm_device) {
95+
IMMDevice_Release(rd->mm_device);
96+
+ }
97+
if (rd->default_render_device)
98+
{
99+
IMMDevice_Release(rd->default_render_device);

0 commit comments

Comments
 (0)