I'm sending this as an RFC for now as there's been some discussion already about how to handle PE dependencies. I think the approach I'm taking here, by including FAudio headers directly in the source and loading it dynamically is the easiest way, and the least disruptive for building and running Wine, if not the cleanest. All the other solutions have higher friction, either on third party packages, or on the system distribution.
Upstream FAudio now has a pure Win32 backend, which makes it much easier to build as PE. This was never a requirement, and this series should work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway to support WMA decoding. Right now, with or without the Win32 backend, this would also introduce a functional regression as although supported by the new FAudio Win32 backend, it also depends on the WMA decoder MF transform to be implemented, which isn't the case yet in Wine.
Cheers,
Rémi Bernon (5): xactengine3_7: Move sources to xaudio2_7. xaudio2_7: Load FAudio dynamically. xaudio2_7: Import FAudio headers for private use. xaudio2_7: Build with msvcrt. xaudio2_7: Use msvcrt allocation functions.
configure.ac | 55 - dlls/x3daudio1_0/Makefile.in | 4 +- dlls/x3daudio1_1/Makefile.in | 4 +- dlls/x3daudio1_2/Makefile.in | 4 +- dlls/x3daudio1_3/Makefile.in | 4 +- dlls/x3daudio1_4/Makefile.in | 4 +- dlls/x3daudio1_5/Makefile.in | 4 +- dlls/x3daudio1_6/Makefile.in | 4 +- dlls/x3daudio1_7/Makefile.in | 4 +- dlls/xactengine2_0/Makefile.in | 6 +- dlls/xactengine2_4/Makefile.in | 6 +- dlls/xactengine2_7/Makefile.in | 6 +- dlls/xactengine2_9/Makefile.in | 6 +- dlls/xactengine3_0/Makefile.in | 6 +- dlls/xactengine3_1/Makefile.in | 6 +- dlls/xactengine3_2/Makefile.in | 6 +- dlls/xactengine3_3/Makefile.in | 6 +- dlls/xactengine3_4/Makefile.in | 6 +- dlls/xactengine3_5/Makefile.in | 6 +- dlls/xactengine3_6/Makefile.in | 6 +- dlls/xactengine3_7/Makefile.in | 5 +- dlls/xapofx1_1/Makefile.in | 4 +- dlls/xapofx1_2/Makefile.in | 4 +- dlls/xapofx1_3/Makefile.in | 4 +- dlls/xapofx1_4/Makefile.in | 4 +- dlls/xapofx1_5/Makefile.in | 4 +- dlls/xaudio2_0/Makefile.in | 4 +- dlls/xaudio2_1/Makefile.in | 4 +- dlls/xaudio2_2/Makefile.in | 4 +- dlls/xaudio2_3/Makefile.in | 4 +- dlls/xaudio2_4/Makefile.in | 4 +- dlls/xaudio2_5/Makefile.in | 4 +- dlls/xaudio2_6/Makefile.in | 4 +- dlls/xaudio2_7/FAudio/F3DAudio.h | 262 ++++ dlls/xaudio2_7/FAudio/FACT.h | 814 ++++++++++ dlls/xaudio2_7/FAudio/FACT3D.h | 127 ++ dlls/xaudio2_7/FAudio/FAPO.h | 207 +++ dlls/xaudio2_7/FAudio/FAPOBase.h | 264 ++++ dlls/xaudio2_7/FAudio/FAPOFX.h | 178 +++ dlls/xaudio2_7/FAudio/FAudio.h | 1322 +++++++++++++++++ dlls/xaudio2_7/FAudio/FAudioFX.h | 308 ++++ dlls/xaudio2_7/Makefile.in | 4 +- dlls/xaudio2_7/compat.c | 92 +- dlls/xaudio2_7/faudio.c | 326 ++++ dlls/xaudio2_7/x3daudio.c | 35 +- .../xact_classes.idl | 0 dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c | 182 ++- dlls/xaudio2_7/xapo.c | 29 +- dlls/xaudio2_7/xapofx.c | 21 +- dlls/xaudio2_7/xaudio_allocator.c | 2 - dlls/xaudio2_7/xaudio_dll.c | 267 ++-- dlls/xaudio2_7/xaudio_private.h | 149 +- dlls/xaudio2_8/Makefile.in | 4 +- dlls/xaudio2_9/Makefile.in | 4 +- 54 files changed, 4298 insertions(+), 505 deletions(-) create mode 100644 dlls/xaudio2_7/FAudio/F3DAudio.h create mode 100644 dlls/xaudio2_7/FAudio/FACT.h create mode 100644 dlls/xaudio2_7/FAudio/FACT3D.h create mode 100644 dlls/xaudio2_7/FAudio/FAPO.h create mode 100644 dlls/xaudio2_7/FAudio/FAPOBase.h create mode 100644 dlls/xaudio2_7/FAudio/FAPOFX.h create mode 100644 dlls/xaudio2_7/FAudio/FAudio.h create mode 100644 dlls/xaudio2_7/FAudio/FAudioFX.h create mode 100644 dlls/xaudio2_7/faudio.c rename dlls/{xactengine3_7 => xaudio2_7}/xact_classes.idl (100%) rename dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c (87%)
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/xactengine2_0/Makefile.in | 2 +- dlls/xactengine2_4/Makefile.in | 2 +- dlls/xactengine2_7/Makefile.in | 2 +- dlls/xactengine2_9/Makefile.in | 2 +- dlls/xactengine3_0/Makefile.in | 2 +- dlls/xactengine3_1/Makefile.in | 2 +- dlls/xactengine3_2/Makefile.in | 2 +- dlls/xactengine3_3/Makefile.in | 2 +- dlls/xactengine3_4/Makefile.in | 2 +- dlls/xactengine3_5/Makefile.in | 2 +- dlls/xactengine3_6/Makefile.in | 2 +- dlls/xactengine3_7/Makefile.in | 1 + dlls/{xactengine3_7 => xaudio2_7}/xact_classes.idl | 0 dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c | 0 14 files changed, 12 insertions(+), 11 deletions(-) rename dlls/{xactengine3_7 => xaudio2_7}/xact_classes.idl (100%) rename dlls/{xactengine3_7 => xaudio2_7}/xact_dll.c (100%)
diff --git a/dlls/xactengine2_0/Makefile.in b/dlls/xactengine2_0/Makefile.in index 3196ecd9b5a..a15eeb03576 100644 --- a/dlls/xactengine2_0/Makefile.in +++ b/dlls/xactengine2_0/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine2_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0200 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine2_4/Makefile.in b/dlls/xactengine2_4/Makefile.in index 51c7e5eb45a..43d394dbb73 100644 --- a/dlls/xactengine2_4/Makefile.in +++ b/dlls/xactengine2_4/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine2_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0204 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine2_7/Makefile.in b/dlls/xactengine2_7/Makefile.in index 8807677e44a..74de611d059 100644 --- a/dlls/xactengine2_7/Makefile.in +++ b/dlls/xactengine2_7/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine2_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0207 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine2_9/Makefile.in b/dlls/xactengine2_9/Makefile.in index eae7c26b9fb..bbf66178aca 100644 --- a/dlls/xactengine2_9/Makefile.in +++ b/dlls/xactengine2_9/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine2_9.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0209 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in index e5c77dcccd7..af23d203776 100644 --- a/dlls/xactengine3_0/Makefile.in +++ b/dlls/xactengine3_0/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0300 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in index f95ea04624c..6e8ff952c5d 100644 --- a/dlls/xactengine3_1/Makefile.in +++ b/dlls/xactengine3_1/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_1.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0301 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in index 911888ec6e5..be054b53801 100644 --- a/dlls/xactengine3_2/Makefile.in +++ b/dlls/xactengine3_2/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_2.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0302 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in index cf0155f1bee..1b232bca8fe 100644 --- a/dlls/xactengine3_3/Makefile.in +++ b/dlls/xactengine3_3/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_3.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0303 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in index f90ca3d32cd..47acf0763d8 100644 --- a/dlls/xactengine3_4/Makefile.in +++ b/dlls/xactengine3_4/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0304 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in index b9f3f09ff37..b171628fcde 100644 --- a/dlls/xactengine3_5/Makefile.in +++ b/dlls/xactengine3_5/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_5.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0305 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in index fad71a2fd57..fb09448023f 100644 --- a/dlls/xactengine3_6/Makefile.in +++ b/dlls/xactengine3_6/Makefile.in @@ -1,7 +1,7 @@ MODULE = xactengine3_6.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0306 -PARENTSRC = ../xactengine3_7 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in index 6d486171622..535b1335087 100644 --- a/dlls/xactengine3_7/Makefile.in +++ b/dlls/xactengine3_7/Makefile.in @@ -1,6 +1,7 @@ MODULE = xactengine3_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0307 +PARENTSRC = ../xaudio2_7 EXTRALIBS = $(FAUDIO_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
diff --git a/dlls/xactengine3_7/xact_classes.idl b/dlls/xaudio2_7/xact_classes.idl similarity index 100% rename from dlls/xactengine3_7/xact_classes.idl rename to dlls/xaudio2_7/xact_classes.idl diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c similarity index 100% rename from dlls/xactengine3_7/xact_dll.c rename to dlls/xaudio2_7/xact_dll.c
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/x3daudio1_0/Makefile.in | 3 +- dlls/x3daudio1_1/Makefile.in | 3 +- dlls/x3daudio1_2/Makefile.in | 3 +- dlls/x3daudio1_3/Makefile.in | 3 +- dlls/x3daudio1_4/Makefile.in | 3 +- dlls/x3daudio1_5/Makefile.in | 3 +- dlls/x3daudio1_6/Makefile.in | 3 +- dlls/x3daudio1_7/Makefile.in | 3 +- dlls/xactengine2_0/Makefile.in | 3 +- dlls/xactengine2_4/Makefile.in | 3 +- dlls/xactengine2_7/Makefile.in | 3 +- dlls/xactengine2_9/Makefile.in | 3 +- dlls/xactengine3_0/Makefile.in | 3 +- dlls/xactengine3_1/Makefile.in | 3 +- dlls/xactengine3_2/Makefile.in | 3 +- dlls/xactengine3_3/Makefile.in | 3 +- dlls/xactengine3_4/Makefile.in | 3 +- dlls/xactengine3_5/Makefile.in | 3 +- dlls/xactengine3_6/Makefile.in | 3 +- dlls/xactengine3_7/Makefile.in | 3 +- dlls/xapofx1_1/Makefile.in | 3 +- dlls/xapofx1_2/Makefile.in | 3 +- dlls/xapofx1_3/Makefile.in | 3 +- dlls/xapofx1_4/Makefile.in | 3 +- dlls/xapofx1_5/Makefile.in | 3 +- dlls/xaudio2_0/Makefile.in | 3 +- dlls/xaudio2_1/Makefile.in | 3 +- dlls/xaudio2_2/Makefile.in | 3 +- dlls/xaudio2_3/Makefile.in | 3 +- dlls/xaudio2_4/Makefile.in | 3 +- dlls/xaudio2_5/Makefile.in | 3 +- dlls/xaudio2_6/Makefile.in | 3 +- dlls/xaudio2_7/Makefile.in | 3 +- dlls/xaudio2_7/compat.c | 32 +-- dlls/xaudio2_7/faudio.c | 345 ++++++++++++++++++++++++++++++++ dlls/xaudio2_7/x3daudio.c | 28 ++- dlls/xaudio2_7/xact_dll.c | 145 +++++++------- dlls/xaudio2_7/xapo.c | 8 +- dlls/xaudio2_7/xapofx.c | 19 ++ dlls/xaudio2_7/xaudio_dll.c | 168 ++++++++-------- dlls/xaudio2_7/xaudio_private.h | 151 +++++++++++++- dlls/xaudio2_8/Makefile.in | 3 +- dlls/xaudio2_9/Makefile.in | 3 +- 43 files changed, 789 insertions(+), 212 deletions(-) create mode 100644 dlls/xaudio2_7/faudio.c
diff --git a/dlls/x3daudio1_0/Makefile.in b/dlls/x3daudio1_0/Makefile.in index d2305be6f17..1fc804116be 100644 --- a/dlls/x3daudio1_0/Makefile.in +++ b/dlls/x3daudio1_0/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=0 -DXAUDIO2_VER=0 MODULE = x3daudio1_0.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_1/Makefile.in b/dlls/x3daudio1_1/Makefile.in index efe8d74539f..75cacbbdb27 100644 --- a/dlls/x3daudio1_1/Makefile.in +++ b/dlls/x3daudio1_1/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=1 -DXAUDIO2_VER=1 MODULE = x3daudio1_1.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_2/Makefile.in b/dlls/x3daudio1_2/Makefile.in index 3b52e063fc0..c621ba9bfe9 100644 --- a/dlls/x3daudio1_2/Makefile.in +++ b/dlls/x3daudio1_2/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=2 -DXAUDIO2_VER=2 MODULE = x3daudio1_2.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_3/Makefile.in b/dlls/x3daudio1_3/Makefile.in index 9afd1e64312..fb678cf19a3 100644 --- a/dlls/x3daudio1_3/Makefile.in +++ b/dlls/x3daudio1_3/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=3 -DXAUDIO2_VER=3 MODULE = x3daudio1_3.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_4/Makefile.in b/dlls/x3daudio1_4/Makefile.in index e481567cce0..66805bfc845 100644 --- a/dlls/x3daudio1_4/Makefile.in +++ b/dlls/x3daudio1_4/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=4 -DXAUDIO2_VER=4 MODULE = x3daudio1_4.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_5/Makefile.in b/dlls/x3daudio1_5/Makefile.in index 0a97959e7eb..3180ac41b17 100644 --- a/dlls/x3daudio1_5/Makefile.in +++ b/dlls/x3daudio1_5/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=5 -DXAUDIO2_VER=5 MODULE = x3daudio1_5.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_6/Makefile.in b/dlls/x3daudio1_6/Makefile.in index c88374a381f..54f46236d62 100644 --- a/dlls/x3daudio1_6/Makefile.in +++ b/dlls/x3daudio1_6/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=6 -DXAUDIO2_VER=6 MODULE = x3daudio1_6.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in index 267a93fd6da..a53a993019e 100644 --- a/dlls/x3daudio1_7/Makefile.in +++ b/dlls/x3daudio1_7/Makefile.in @@ -1,8 +1,9 @@ EXTRADEFS = -DX3DAUDIO1_VER=7 -DXAUDIO2_VER=7 MODULE = x3daudio1_7.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ x3daudio.c diff --git a/dlls/xactengine2_0/Makefile.in b/dlls/xactengine2_0/Makefile.in index a15eeb03576..6a98d4df558 100644 --- a/dlls/xactengine2_0/Makefile.in +++ b/dlls/xactengine2_0/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine2_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0200 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine2_4/Makefile.in b/dlls/xactengine2_4/Makefile.in index 43d394dbb73..eef48ed32ea 100644 --- a/dlls/xactengine2_4/Makefile.in +++ b/dlls/xactengine2_4/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine2_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0204 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine2_7/Makefile.in b/dlls/xactengine2_7/Makefile.in index 74de611d059..bdc0c5565e3 100644 --- a/dlls/xactengine2_7/Makefile.in +++ b/dlls/xactengine2_7/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine2_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0207 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine2_9/Makefile.in b/dlls/xactengine2_9/Makefile.in index bbf66178aca..035b6276e37 100644 --- a/dlls/xactengine2_9/Makefile.in +++ b/dlls/xactengine2_9/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine2_9.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0209 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in index af23d203776..940d33560e2 100644 --- a/dlls/xactengine3_0/Makefile.in +++ b/dlls/xactengine3_0/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0300 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in index 6e8ff952c5d..683be88529e 100644 --- a/dlls/xactengine3_1/Makefile.in +++ b/dlls/xactengine3_1/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_1.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0301 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in index be054b53801..f8c0d9cec89 100644 --- a/dlls/xactengine3_2/Makefile.in +++ b/dlls/xactengine3_2/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_2.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0302 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in index 1b232bca8fe..8a5854a0813 100644 --- a/dlls/xactengine3_3/Makefile.in +++ b/dlls/xactengine3_3/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_3.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0303 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in index 47acf0763d8..024e96c3a17 100644 --- a/dlls/xactengine3_4/Makefile.in +++ b/dlls/xactengine3_4/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0304 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in index b171628fcde..9a1d7813b13 100644 --- a/dlls/xactengine3_5/Makefile.in +++ b/dlls/xactengine3_5/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_5.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0305 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in index fb09448023f..859fb906571 100644 --- a/dlls/xactengine3_6/Makefile.in +++ b/dlls/xactengine3_6/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_6.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0306 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in index 535b1335087..4e606ad5a49 100644 --- a/dlls/xactengine3_7/Makefile.in +++ b/dlls/xactengine3_7/Makefile.in @@ -2,10 +2,11 @@ MODULE = xactengine3_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0307 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xact_dll.c
IDL_SRCS = xact_classes.idl diff --git a/dlls/xapofx1_1/Makefile.in b/dlls/xapofx1_1/Makefile.in index df40978ecde..58e07c94af8 100644 --- a/dlls/xapofx1_1/Makefile.in +++ b/dlls/xapofx1_1/Makefile.in @@ -2,10 +2,11 @@ EXTRADEFS = -DXAPOFX1_VER=1 -DXAUDIO2_VER=2 MODULE = xapofx1_1.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xapo.c \ xapofx.c \ xaudio_allocator.c diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in index 5e70ad2625a..146a679ceff 100644 --- a/dlls/xapofx1_2/Makefile.in +++ b/dlls/xapofx1_2/Makefile.in @@ -2,10 +2,11 @@ EXTRADEFS = -DXAPOFX1_VER=2 -DXAUDIO2_VER=3 MODULE = xapofx1_2.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xapo.c \ xapofx.c \ xaudio_allocator.c diff --git a/dlls/xapofx1_3/Makefile.in b/dlls/xapofx1_3/Makefile.in index 5cf91a7c2c0..c9f4bd80d92 100644 --- a/dlls/xapofx1_3/Makefile.in +++ b/dlls/xapofx1_3/Makefile.in @@ -2,10 +2,11 @@ EXTRADEFS = -DXAPOFX1_VER=3 -DXAUDIO2_VER=4 MODULE = xapofx1_3.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xapo.c \ xapofx.c \ xaudio_allocator.c diff --git a/dlls/xapofx1_4/Makefile.in b/dlls/xapofx1_4/Makefile.in index ab1106fcf65..bd71b614bad 100644 --- a/dlls/xapofx1_4/Makefile.in +++ b/dlls/xapofx1_4/Makefile.in @@ -2,10 +2,11 @@ EXTRADEFS = -DXAPOFX1_VER=4 -DXAUDIO2_VER=6 MODULE = xapofx1_4.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xapo.c \ xapofx.c \ xaudio_allocator.c diff --git a/dlls/xapofx1_5/Makefile.in b/dlls/xapofx1_5/Makefile.in index bda50c04866..42eadd12614 100644 --- a/dlls/xapofx1_5/Makefile.in +++ b/dlls/xapofx1_5/Makefile.in @@ -2,10 +2,11 @@ EXTRADEFS = -DXAPOFX1_VER=5 -DXAUDIO2_VER=7 MODULE = xapofx1_5.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ + faudio.c \ xapo.c \ xapofx.c \ xaudio_allocator.c diff --git a/dlls/xaudio2_0/Makefile.in b/dlls/xaudio2_0/Makefile.in index 4f766b82450..9e981603db4 100644 --- a/dlls/xaudio2_0/Makefile.in +++ b/dlls/xaudio2_0/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=0 MODULE = xaudio2_0.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in index 9e50adfa8e2..fc81d653ab3 100644 --- a/dlls/xaudio2_1/Makefile.in +++ b/dlls/xaudio2_1/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=1 MODULE = xaudio2_1.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_2/Makefile.in b/dlls/xaudio2_2/Makefile.in index b7076fea4e1..f4b0e4578b8 100644 --- a/dlls/xaudio2_2/Makefile.in +++ b/dlls/xaudio2_2/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=2 MODULE = xaudio2_2.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_3/Makefile.in b/dlls/xaudio2_3/Makefile.in index a1140f83363..d9337240350 100644 --- a/dlls/xaudio2_3/Makefile.in +++ b/dlls/xaudio2_3/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=3 MODULE = xaudio2_3.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in index 6d1f5e4e71f..0a8b6277b8e 100644 --- a/dlls/xaudio2_4/Makefile.in +++ b/dlls/xaudio2_4/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=4 MODULE = xaudio2_4.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_5/Makefile.in b/dlls/xaudio2_5/Makefile.in index d65b4bd1ed2..5805a4d7629 100644 --- a/dlls/xaudio2_5/Makefile.in +++ b/dlls/xaudio2_5/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=5 MODULE = xaudio2_5.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_6/Makefile.in b/dlls/xaudio2_6/Makefile.in index 3bcc930e265..3dd582e512e 100644 --- a/dlls/xaudio2_6/Makefile.in +++ b/dlls/xaudio2_6/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=6 MODULE = xaudio2_6.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ xapo.c \ xaudio_allocator.c \ xaudio_dll.c diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in index 294f841b019..26ced808cc6 100644 --- a/dlls/xaudio2_7/Makefile.in +++ b/dlls/xaudio2_7/Makefile.in @@ -1,11 +1,12 @@ EXTRADEFS = -DXAUDIO2_VER=7 MODULE = xaudio2_7.dll IMPORTS = advapi32 ole32 user32 uuid -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ x3daudio.c \ xapo.c \ xapofx.c \ diff --git a/dlls/xaudio2_7/compat.c b/dlls/xaudio2_7/compat.c index c4538ae3677..e756736e23f 100644 --- a/dlls/xaudio2_7/compat.c +++ b/dlls/xaudio2_7/compat.c @@ -2049,7 +2049,7 @@ static HRESULT WINAPI XA20_GetDeviceCount(IXAudio20 *iface, UINT32 *pCount) { IXAudio2Impl *This = impl_from_IXAudio20(iface); TRACE("%p, %p\n", This, pCount); - return FAudio_GetDeviceCount(This->faudio, pCount); + return pFAudio_GetDeviceCount(This->faudio, pCount); }
static HRESULT WINAPI XA20_GetDeviceDetails(IXAudio20 *iface, UINT32 index, @@ -2057,7 +2057,7 @@ static HRESULT WINAPI XA20_GetDeviceDetails(IXAudio20 *iface, UINT32 index, { IXAudio2Impl *This = impl_from_IXAudio20(iface); TRACE("%p, %u, %p\n", This, index, pDeviceDetails); - return FAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); + return pFAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); }
static HRESULT WINAPI XA20_Initialize(IXAudio20 *iface, UINT32 flags, @@ -2170,9 +2170,9 @@ static HRESULT WINAPI XA20_CreateMasteringVoice(IXAudio20 *iface,
pthread_mutex_unlock(&This->mst.engine_lock);
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); + pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
- FAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, + pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
This->mst.in_use = TRUE; @@ -2284,7 +2284,7 @@ static HRESULT WINAPI XA22_GetDeviceCount(IXAudio22 *iface, UINT32 *pCount) { IXAudio2Impl *This = impl_from_IXAudio22(iface); TRACE("%p, %p\n", This, pCount); - return FAudio_GetDeviceCount(This->faudio, pCount); + return pFAudio_GetDeviceCount(This->faudio, pCount); }
static HRESULT WINAPI XA22_GetDeviceDetails(IXAudio22 *iface, UINT32 index, @@ -2292,7 +2292,7 @@ static HRESULT WINAPI XA22_GetDeviceDetails(IXAudio22 *iface, UINT32 index, { IXAudio2Impl *This = impl_from_IXAudio22(iface); TRACE("%p, %u, %p\n", This, index, pDeviceDetails); - return FAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); + return pFAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); }
static HRESULT WINAPI XA22_Initialize(IXAudio22 *iface, UINT32 flags, @@ -2405,9 +2405,9 @@ static HRESULT WINAPI XA22_CreateMasteringVoice(IXAudio22 *iface,
pthread_mutex_unlock(&This->mst.engine_lock);
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); + pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
- FAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, + pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
This->mst.in_use = TRUE; @@ -2518,7 +2518,7 @@ static HRESULT WINAPI XA23_GetDeviceCount(IXAudio23 *iface, UINT32 *pCount) { IXAudio2Impl *This = impl_from_IXAudio23(iface); TRACE("%p, %p\n", This, pCount); - return FAudio_GetDeviceCount(This->faudio, pCount); + return pFAudio_GetDeviceCount(This->faudio, pCount); }
static HRESULT WINAPI XA23_GetDeviceDetails(IXAudio23 *iface, UINT32 index, @@ -2526,7 +2526,7 @@ static HRESULT WINAPI XA23_GetDeviceDetails(IXAudio23 *iface, UINT32 index, { IXAudio2Impl *This = impl_from_IXAudio23(iface); TRACE("%p, %u, %p\n", This, index, pDeviceDetails); - return FAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); + return pFAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); }
static HRESULT WINAPI XA23_Initialize(IXAudio23 *iface, UINT32 flags, @@ -2639,9 +2639,9 @@ static HRESULT WINAPI XA23_CreateMasteringVoice(IXAudio23 *iface,
pthread_mutex_unlock(&This->mst.engine_lock);
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); + pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
- FAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, + pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
This->mst.in_use = TRUE; @@ -2734,7 +2734,7 @@ static HRESULT WINAPI XA27_GetDeviceCount(IXAudio27 *iface, UINT32 *pCount) { IXAudio2Impl *This = impl_from_IXAudio27(iface); TRACE("%p, %p\n", This, pCount); - return FAudio_GetDeviceCount(This->faudio, pCount); + return pFAudio_GetDeviceCount(This->faudio, pCount); }
static HRESULT WINAPI XA27_GetDeviceDetails(IXAudio27 *iface, UINT32 index, @@ -2742,7 +2742,7 @@ static HRESULT WINAPI XA27_GetDeviceDetails(IXAudio27 *iface, UINT32 index, { IXAudio2Impl *This = impl_from_IXAudio27(iface); TRACE("%p, %u, %p\n", This, index, pDeviceDetails); - return FAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); + return pFAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails); }
static HRESULT WINAPI XA27_Initialize(IXAudio27 *iface, UINT32 flags, @@ -2827,9 +2827,9 @@ static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface,
pthread_mutex_unlock(&This->mst.engine_lock);
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); + pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
- FAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, + pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
This->mst.in_use = TRUE; diff --git a/dlls/xaudio2_7/faudio.c b/dlls/xaudio2_7/faudio.c new file mode 100644 index 00000000000..0858b79d973 --- /dev/null +++ b/dlls/xaudio2_7/faudio.c @@ -0,0 +1,345 @@ +/* + * Copyright 2021 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include <stdarg.h> +#include <dlfcn.h> + +#define NONAMELESSUNION +#define COBJMACROS + +#include "xaudio_private.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); + +#define MAKE_FUNCPTR(f) typeof(f) * p##f = NULL; +MAKE_FUNCPTR(FAudio_AddRef) +#ifdef HAVE_FAUDIO_COMMITOPERATIONSET +MAKE_FUNCPTR(FAudio_CommitOperationSet) +#else +MAKE_FUNCPTR(FAudio_CommitChanges) +#endif +MAKE_FUNCPTR(FAudio_CreateMasteringVoice) +MAKE_FUNCPTR(FAudio_CreateMasteringVoice8) +MAKE_FUNCPTR(FAudio_CreateSourceVoice) +MAKE_FUNCPTR(FAudio_CreateSubmixVoice) +MAKE_FUNCPTR(FAudio_GetDeviceCount) +MAKE_FUNCPTR(FAudio_GetDeviceDetails) +MAKE_FUNCPTR(FAudio_GetPerformanceData) +MAKE_FUNCPTR(FAudio_Initialize) +MAKE_FUNCPTR(FAudio_RegisterForCallbacks) +MAKE_FUNCPTR(FAudio_Release) +MAKE_FUNCPTR(FAudio_SetDebugConfiguration) +MAKE_FUNCPTR(FAudio_StartEngine) +MAKE_FUNCPTR(FAudio_StopEngine) + +MAKE_FUNCPTR(FAudioVoice_DestroyVoice) +MAKE_FUNCPTR(FAudioVoice_DisableEffect) +MAKE_FUNCPTR(FAudioVoice_EnableEffect) +MAKE_FUNCPTR(FAudioVoice_GetChannelVolumes) +MAKE_FUNCPTR(FAudioVoice_GetEffectParameters) +MAKE_FUNCPTR(FAudioVoice_GetEffectState) +MAKE_FUNCPTR(FAudioVoice_GetFilterParameters) +MAKE_FUNCPTR(FAudioVoice_GetOutputFilterParameters) +MAKE_FUNCPTR(FAudioVoice_GetOutputMatrix) +MAKE_FUNCPTR(FAudioVoice_GetVoiceDetails) +MAKE_FUNCPTR(FAudioVoice_GetVolume) +MAKE_FUNCPTR(FAudioVoice_SetChannelVolumes) +MAKE_FUNCPTR(FAudioVoice_SetEffectChain) +MAKE_FUNCPTR(FAudioVoice_SetEffectParameters) +MAKE_FUNCPTR(FAudioVoice_SetFilterParameters) +MAKE_FUNCPTR(FAudioVoice_SetOutputFilterParameters) +MAKE_FUNCPTR(FAudioVoice_SetOutputMatrix) +MAKE_FUNCPTR(FAudioVoice_SetOutputVoices) +MAKE_FUNCPTR(FAudioVoice_SetVolume) + +MAKE_FUNCPTR(FAudioSourceVoice_Discontinuity) +MAKE_FUNCPTR(FAudioSourceVoice_ExitLoop) +MAKE_FUNCPTR(FAudioSourceVoice_FlushSourceBuffers) +MAKE_FUNCPTR(FAudioSourceVoice_GetFrequencyRatio) +MAKE_FUNCPTR(FAudioSourceVoice_GetState) +MAKE_FUNCPTR(FAudioSourceVoice_SetFrequencyRatio) +MAKE_FUNCPTR(FAudioSourceVoice_SetSourceSampleRate) +MAKE_FUNCPTR(FAudioSourceVoice_Start) +MAKE_FUNCPTR(FAudioSourceVoice_Stop) +MAKE_FUNCPTR(FAudioSourceVoice_SubmitSourceBuffer) + +MAKE_FUNCPTR(FAudioMasteringVoice_GetChannelMask) + +MAKE_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) +MAKE_FUNCPTR(FAudioCreate) +MAKE_FUNCPTR(FAudioCreateReverb) +MAKE_FUNCPTR(FAudioCreateReverb9) +#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT +MAKE_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) +#endif +MAKE_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) +MAKE_FUNCPTR(FAudioCreateVolumeMeter) +MAKE_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) +#ifdef HAVE_FAUDIOLINKEDVERSION +MAKE_FUNCPTR(FAudioLinkedVersion) +#endif + +MAKE_FUNCPTR(F3DAudioCalculate) +MAKE_FUNCPTR(F3DAudioInitialize) +#ifdef HAVE_F3DAUDIOINITIALIZE8 +MAKE_FUNCPTR(F3DAudioInitialize8) +#endif + +MAKE_FUNCPTR(FACTAudioEngine_AddRef) +MAKE_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) +MAKE_FUNCPTR(FACTAudioEngine_CreateSoundBank) +MAKE_FUNCPTR(FACTAudioEngine_CreateStreamingWaveBank) +MAKE_FUNCPTR(FACTAudioEngine_DoWork) +MAKE_FUNCPTR(FACTAudioEngine_GetCategory) +MAKE_FUNCPTR(FACTAudioEngine_GetFinalMixFormat) +MAKE_FUNCPTR(FACTAudioEngine_GetGlobalVariable) +MAKE_FUNCPTR(FACTAudioEngine_GetGlobalVariableIndex) +MAKE_FUNCPTR(FACTAudioEngine_GetRendererCount) +MAKE_FUNCPTR(FACTAudioEngine_GetRendererDetails) +MAKE_FUNCPTR(FACTAudioEngine_Initialize) +MAKE_FUNCPTR(FACTAudioEngine_Pause) +MAKE_FUNCPTR(FACTAudioEngine_PrepareWave) +MAKE_FUNCPTR(FACTAudioEngine_RegisterNotification) +MAKE_FUNCPTR(FACTAudioEngine_Release) +MAKE_FUNCPTR(FACTAudioEngine_SetGlobalVariable) +MAKE_FUNCPTR(FACTAudioEngine_SetVolume) +MAKE_FUNCPTR(FACTAudioEngine_ShutDown) +MAKE_FUNCPTR(FACTAudioEngine_Stop) +MAKE_FUNCPTR(FACTAudioEngine_UnRegisterNotification) + +MAKE_FUNCPTR(FACTCreateEngineWithCustomAllocatorEXT) + +MAKE_FUNCPTR(FACTCue_Destroy) +MAKE_FUNCPTR(FACTCue_GetProperties) +MAKE_FUNCPTR(FACTCue_GetState) +MAKE_FUNCPTR(FACTCue_GetVariable) +MAKE_FUNCPTR(FACTCue_GetVariableIndex) +MAKE_FUNCPTR(FACTCue_Pause) +MAKE_FUNCPTR(FACTCue_Play) +MAKE_FUNCPTR(FACTCue_SetMatrixCoefficients) +MAKE_FUNCPTR(FACTCue_SetVariable) +MAKE_FUNCPTR(FACTCue_Stop) + +MAKE_FUNCPTR(FACTSoundBank_Destroy) +MAKE_FUNCPTR(FACTSoundBank_GetCueIndex) +MAKE_FUNCPTR(FACTSoundBank_GetCueProperties) +MAKE_FUNCPTR(FACTSoundBank_GetNumCues) +MAKE_FUNCPTR(FACTSoundBank_GetState) +MAKE_FUNCPTR(FACTSoundBank_Play) +MAKE_FUNCPTR(FACTSoundBank_Prepare) +MAKE_FUNCPTR(FACTSoundBank_Stop) + +MAKE_FUNCPTR(FACTWave_Destroy) +MAKE_FUNCPTR(FACTWave_GetProperties) +MAKE_FUNCPTR(FACTWave_GetState) +MAKE_FUNCPTR(FACTWave_Pause) +MAKE_FUNCPTR(FACTWave_Play) +MAKE_FUNCPTR(FACTWave_SetMatrixCoefficients) +MAKE_FUNCPTR(FACTWave_SetPitch) +MAKE_FUNCPTR(FACTWave_SetVolume) +MAKE_FUNCPTR(FACTWave_Stop) + +MAKE_FUNCPTR(FACTWaveBank_Destroy) +MAKE_FUNCPTR(FACTWaveBank_GetNumWaves) +MAKE_FUNCPTR(FACTWaveBank_GetState) +MAKE_FUNCPTR(FACTWaveBank_GetWaveIndex) +MAKE_FUNCPTR(FACTWaveBank_GetWaveProperties) +MAKE_FUNCPTR(FACTWaveBank_Play) +MAKE_FUNCPTR(FACTWaveBank_Prepare) +MAKE_FUNCPTR(FACTWaveBank_Stop) + +MAKE_FUNCPTR(FAPOFX_CreateFXWithCustomAllocatorEXT) +#undef MAKE_FUNCPTR + +#ifdef SONAME_LIBFAUDIO + +BOOL load_faudio(void) +{ + void *faudio; + + if (!(faudio = dlopen( SONAME_LIBFAUDIO, RTLD_NOW ))) + { + ERR( "FAudio library %s not found.\n", SONAME_LIBFAUDIO ); + return FALSE; + } + +#define LOAD_FUNCPTR(f) \ + if (!(p##f = dlsym( faudio, #f ))) \ + { \ + ERR( "FAudio function %s not found\n", #f ); \ + dlclose( faudio ); \ + return FALSE; \ + } +LOAD_FUNCPTR(FAudio_AddRef) +#ifdef HAVE_FAUDIO_COMMITOPERATIONSET +LOAD_FUNCPTR(FAudio_CommitOperationSet) +#else +LOAD_FUNCPTR(FAudio_CommitChanges) +#endif +LOAD_FUNCPTR(FAudio_CreateMasteringVoice) +LOAD_FUNCPTR(FAudio_CreateMasteringVoice8) +LOAD_FUNCPTR(FAudio_CreateSourceVoice) +LOAD_FUNCPTR(FAudio_CreateSubmixVoice) +LOAD_FUNCPTR(FAudio_GetDeviceCount) +LOAD_FUNCPTR(FAudio_GetDeviceDetails) +LOAD_FUNCPTR(FAudio_GetPerformanceData) +LOAD_FUNCPTR(FAudio_Initialize) +LOAD_FUNCPTR(FAudio_RegisterForCallbacks) +LOAD_FUNCPTR(FAudio_Release) +LOAD_FUNCPTR(FAudio_SetDebugConfiguration) +LOAD_FUNCPTR(FAudio_StartEngine) +LOAD_FUNCPTR(FAudio_StopEngine) + +LOAD_FUNCPTR(FAudioVoice_DestroyVoice) +LOAD_FUNCPTR(FAudioVoice_DisableEffect) +LOAD_FUNCPTR(FAudioVoice_EnableEffect) +LOAD_FUNCPTR(FAudioVoice_GetChannelVolumes) +LOAD_FUNCPTR(FAudioVoice_GetEffectParameters) +LOAD_FUNCPTR(FAudioVoice_GetEffectState) +LOAD_FUNCPTR(FAudioVoice_GetFilterParameters) +LOAD_FUNCPTR(FAudioVoice_GetOutputFilterParameters) +LOAD_FUNCPTR(FAudioVoice_GetOutputMatrix) +LOAD_FUNCPTR(FAudioVoice_GetVoiceDetails) +LOAD_FUNCPTR(FAudioVoice_GetVolume) +LOAD_FUNCPTR(FAudioVoice_SetChannelVolumes) +LOAD_FUNCPTR(FAudioVoice_SetEffectChain) +LOAD_FUNCPTR(FAudioVoice_SetEffectParameters) +LOAD_FUNCPTR(FAudioVoice_SetFilterParameters) +LOAD_FUNCPTR(FAudioVoice_SetOutputFilterParameters) +LOAD_FUNCPTR(FAudioVoice_SetOutputMatrix) +LOAD_FUNCPTR(FAudioVoice_SetOutputVoices) +LOAD_FUNCPTR(FAudioVoice_SetVolume) + +LOAD_FUNCPTR(FAudioSourceVoice_Discontinuity) +LOAD_FUNCPTR(FAudioSourceVoice_ExitLoop) +LOAD_FUNCPTR(FAudioSourceVoice_FlushSourceBuffers) +LOAD_FUNCPTR(FAudioSourceVoice_GetFrequencyRatio) +LOAD_FUNCPTR(FAudioSourceVoice_GetState) +LOAD_FUNCPTR(FAudioSourceVoice_SetFrequencyRatio) +LOAD_FUNCPTR(FAudioSourceVoice_SetSourceSampleRate) +LOAD_FUNCPTR(FAudioSourceVoice_Start) +LOAD_FUNCPTR(FAudioSourceVoice_Stop) +LOAD_FUNCPTR(FAudioSourceVoice_SubmitSourceBuffer) + +LOAD_FUNCPTR(FAudioMasteringVoice_GetChannelMask) + +LOAD_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) +LOAD_FUNCPTR(FAudioCreate) +LOAD_FUNCPTR(FAudioCreateReverb) +LOAD_FUNCPTR(FAudioCreateReverb9) +#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT +LOAD_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) +#endif +LOAD_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) +LOAD_FUNCPTR(FAudioCreateVolumeMeter) +LOAD_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) +#ifdef HAVE_FAUDIOLINKEDVERSION +LOAD_FUNCPTR(FAudioLinkedVersion) +#endif + +LOAD_FUNCPTR(F3DAudioCalculate) +LOAD_FUNCPTR(F3DAudioInitialize) +#ifdef HAVE_F3DAUDIOINITIALIZE8 +LOAD_FUNCPTR(F3DAudioInitialize8) +#endif + +LOAD_FUNCPTR(FACTAudioEngine_AddRef) +LOAD_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) +LOAD_FUNCPTR(FACTAudioEngine_CreateSoundBank) +LOAD_FUNCPTR(FACTAudioEngine_CreateStreamingWaveBank) +LOAD_FUNCPTR(FACTAudioEngine_DoWork) +LOAD_FUNCPTR(FACTAudioEngine_GetCategory) +LOAD_FUNCPTR(FACTAudioEngine_GetFinalMixFormat) +LOAD_FUNCPTR(FACTAudioEngine_GetGlobalVariable) +LOAD_FUNCPTR(FACTAudioEngine_GetGlobalVariableIndex) +LOAD_FUNCPTR(FACTAudioEngine_GetRendererCount) +LOAD_FUNCPTR(FACTAudioEngine_GetRendererDetails) +LOAD_FUNCPTR(FACTAudioEngine_Initialize) +LOAD_FUNCPTR(FACTAudioEngine_Pause) +LOAD_FUNCPTR(FACTAudioEngine_PrepareWave) +LOAD_FUNCPTR(FACTAudioEngine_RegisterNotification) +LOAD_FUNCPTR(FACTAudioEngine_Release) +LOAD_FUNCPTR(FACTAudioEngine_SetGlobalVariable) +LOAD_FUNCPTR(FACTAudioEngine_SetVolume) +LOAD_FUNCPTR(FACTAudioEngine_ShutDown) +LOAD_FUNCPTR(FACTAudioEngine_Stop) +LOAD_FUNCPTR(FACTAudioEngine_UnRegisterNotification) + +LOAD_FUNCPTR(FACTCreateEngineWithCustomAllocatorEXT) + +LOAD_FUNCPTR(FACTCue_Destroy) +LOAD_FUNCPTR(FACTCue_GetProperties) +LOAD_FUNCPTR(FACTCue_GetState) +LOAD_FUNCPTR(FACTCue_GetVariable) +LOAD_FUNCPTR(FACTCue_GetVariableIndex) +LOAD_FUNCPTR(FACTCue_Pause) +LOAD_FUNCPTR(FACTCue_Play) +LOAD_FUNCPTR(FACTCue_SetMatrixCoefficients) +LOAD_FUNCPTR(FACTCue_SetVariable) +LOAD_FUNCPTR(FACTCue_Stop) + +LOAD_FUNCPTR(FACTSoundBank_Destroy) +LOAD_FUNCPTR(FACTSoundBank_GetCueIndex) +LOAD_FUNCPTR(FACTSoundBank_GetCueProperties) +LOAD_FUNCPTR(FACTSoundBank_GetNumCues) +LOAD_FUNCPTR(FACTSoundBank_GetState) +LOAD_FUNCPTR(FACTSoundBank_Play) +LOAD_FUNCPTR(FACTSoundBank_Prepare) +LOAD_FUNCPTR(FACTSoundBank_Stop) + +LOAD_FUNCPTR(FACTWave_Destroy) +LOAD_FUNCPTR(FACTWave_GetProperties) +LOAD_FUNCPTR(FACTWave_GetState) +LOAD_FUNCPTR(FACTWave_Pause) +LOAD_FUNCPTR(FACTWave_Play) +LOAD_FUNCPTR(FACTWave_SetMatrixCoefficients) +LOAD_FUNCPTR(FACTWave_SetPitch) +LOAD_FUNCPTR(FACTWave_SetVolume) +LOAD_FUNCPTR(FACTWave_Stop) + +LOAD_FUNCPTR(FACTWaveBank_Destroy) +LOAD_FUNCPTR(FACTWaveBank_GetNumWaves) +LOAD_FUNCPTR(FACTWaveBank_GetState) +LOAD_FUNCPTR(FACTWaveBank_GetWaveIndex) +LOAD_FUNCPTR(FACTWaveBank_GetWaveProperties) +LOAD_FUNCPTR(FACTWaveBank_Play) +LOAD_FUNCPTR(FACTWaveBank_Prepare) +LOAD_FUNCPTR(FACTWaveBank_Stop) + +LOAD_FUNCPTR(FAPOFX_CreateFXWithCustomAllocatorEXT) +#undef LOAD_FUNCPTR + + return TRUE; +} + +#else /* SONAME_LIBFAUDIO */ + +BOOL load_faudio(void) +{ + ERR( "FAudio support not compiled in.\n" ); + return FALSE; +} + +#endif /* SONAME_LIBFAUDIO */ + +void unload_faudio(void) +{ +} diff --git a/dlls/xaudio2_7/x3daudio.c b/dlls/xaudio2_7/x3daudio.c index e0a0280c3cd..f07a1282150 100644 --- a/dlls/xaudio2_7/x3daudio.c +++ b/dlls/xaudio2_7/x3daudio.c @@ -24,6 +24,7 @@ #include "windef.h" #include "winbase.h" #include "x3daudio.h" +#include "xaudio_private.h"
#include "wine/debug.h"
@@ -33,15 +34,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); #endif
+#ifdef X3DAUDIO1_VER +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +{ + TRACE("inst %p, reason %d, reserved %p.\n", inst, reason, reserved ); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(inst); + if (!load_faudio()) return FALSE; + break; + case DLL_PROCESS_DETACH: + unload_faudio(); + break; + } + return TRUE; +} +#endif /* X3DAUDIO1_VER */ + #if XAUDIO2_VER >= 8 HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound, X3DAUDIO_HANDLE handle) { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle); #ifdef HAVE_F3DAUDIOINITIALIZE8 - return F3DAudioInitialize8(chanmask, speedofsound, handle); + return pF3DAudioInitialize8(chanmask, speedofsound, handle); #else - F3DAudioInitialize(chanmask, speedofsound, handle); + pF3DAudioInitialize(chanmask, speedofsound, handle); return S_OK; #endif } @@ -57,7 +77,7 @@ void CDECL LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, #endif { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle); - F3DAudioInitialize(chanmask, speedofsound, handle); + pF3DAudioInitialize(chanmask, speedofsound, handle); } #endif /* X3DAUDIO1_VER */
@@ -73,7 +93,7 @@ void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle, #endif { TRACE("%p, %p, %p, 0x%x, %p\n", handle, listener, emitter, flags, out); - F3DAudioCalculate( + pF3DAudioCalculate( handle, (const F3DAUDIO_LISTENER*) listener, (const F3DAUDIO_EMITTER*) emitter, diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c index 231ef753f22..229980216f7 100644 --- a/dlls/xaudio2_7/xact_dll.c +++ b/dlls/xaudio2_7/xact_dll.c @@ -25,6 +25,7 @@ #define COBJMACROS
#include "initguid.h" +#include "xaudio_private.h" #if XACT3_VER < 0x0300 #include "xact.h" #else @@ -66,7 +67,7 @@ static HRESULT WINAPI IXACT3CueImpl_Play(IXACT3Cue *iface)
TRACE("(%p)\n", iface);
- return FACTCue_Play(This->fact_cue); + return pFACTCue_Play(This->fact_cue); }
static HRESULT WINAPI IXACT3CueImpl_Stop(IXACT3Cue *iface, DWORD dwFlags) @@ -75,7 +76,7 @@ static HRESULT WINAPI IXACT3CueImpl_Stop(IXACT3Cue *iface, DWORD dwFlags)
TRACE("(%p)->(%u)\n", iface, dwFlags);
- return FACTCue_Stop(This->fact_cue, dwFlags); + return pFACTCue_Stop(This->fact_cue, dwFlags); }
static HRESULT WINAPI IXACT3CueImpl_GetState(IXACT3Cue *iface, DWORD *pdwState) @@ -84,7 +85,7 @@ static HRESULT WINAPI IXACT3CueImpl_GetState(IXACT3Cue *iface, DWORD *pdwState)
TRACE("(%p)->(%p)\n", iface, pdwState);
- return FACTCue_GetState(This->fact_cue, pdwState); + return pFACTCue_GetState(This->fact_cue, pdwState); }
static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface) @@ -94,9 +95,9 @@ static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface)
TRACE("(%p)\n", iface);
- ret = FACTCue_Destroy(This->fact_cue); + ret = pFACTCue_Destroy(This->fact_cue); if (ret != 0) - WARN("FACTCue_Destroy returned %d\n", ret); + WARN("pFACTCue_Destroy returned %d\n", ret); HeapFree(GetProcessHeap(), 0, This); return S_OK; } @@ -143,7 +144,7 @@ static HRESULT WINAPI IXACT3CueImpl_SetMatrixCoefficients(IXACT3Cue *iface, TRACE("(%p)->(%u, %u, %p)\n", iface, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
- return FACTCue_SetMatrixCoefficients(This->fact_cue, uSrcChannelCount, + return pFACTCue_SetMatrixCoefficients(This->fact_cue, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); }
@@ -154,7 +155,7 @@ static XACTVARIABLEINDEX WINAPI IXACT3CueImpl_GetVariableIndex(IXACT3Cue *iface,
TRACE("(%p)->(%s)\n", iface, szFriendlyName);
- return FACTCue_GetVariableIndex(This->fact_cue, szFriendlyName); + return pFACTCue_GetVariableIndex(This->fact_cue, szFriendlyName); }
static HRESULT WINAPI IXACT3CueImpl_SetVariable(IXACT3Cue *iface, @@ -164,7 +165,7 @@ static HRESULT WINAPI IXACT3CueImpl_SetVariable(IXACT3Cue *iface,
TRACE("(%p)->(%u, %f)\n", iface, nIndex, nValue);
- return FACTCue_SetVariable(This->fact_cue, nIndex, nValue); + return pFACTCue_SetVariable(This->fact_cue, nIndex, nValue); }
static HRESULT WINAPI IXACT3CueImpl_GetVariable(IXACT3Cue *iface, @@ -174,7 +175,7 @@ static HRESULT WINAPI IXACT3CueImpl_GetVariable(IXACT3Cue *iface,
TRACE("(%p)->(%u, %p)\n", iface, nIndex, nValue);
- return FACTCue_GetVariable(This->fact_cue, nIndex, nValue); + return pFACTCue_GetVariable(This->fact_cue, nIndex, nValue); }
static HRESULT WINAPI IXACT3CueImpl_Pause(IXACT3Cue *iface, BOOL fPause) @@ -183,7 +184,7 @@ static HRESULT WINAPI IXACT3CueImpl_Pause(IXACT3Cue *iface, BOOL fPause)
TRACE("(%p)->(%u)\n", iface, fPause);
- return FACTCue_Pause(This->fact_cue, fPause); + return pFACTCue_Pause(This->fact_cue, fPause); }
#if XACT3_VER >= 0x0205 @@ -196,7 +197,7 @@ static HRESULT WINAPI IXACT3CueImpl_GetProperties(IXACT3Cue *iface,
TRACE("(%p)->(%p)\n", iface, ppProperties);
- hr = FACTCue_GetProperties(This->fact_cue, &fProps); + hr = pFACTCue_GetProperties(This->fact_cue, &fProps); if(FAILED(hr)) return hr;
@@ -269,7 +270,7 @@ static XACTINDEX WINAPI IXACT3SoundBankImpl_GetCueIndex(IXACT3SoundBank *iface,
TRACE("(%p)->(%s)\n", This, szFriendlyName);
- return FACTSoundBank_GetCueIndex(This->fact_soundbank, szFriendlyName); + return pFACTSoundBank_GetCueIndex(This->fact_soundbank, szFriendlyName); }
#if XACT3_VER >= 0x0205 @@ -280,7 +281,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_GetNumCues(IXACT3SoundBank *iface,
TRACE("(%p)->(%p)\n", This, pnNumCues);
- return FACTSoundBank_GetNumCues(This->fact_soundbank, pnNumCues); + return pFACTSoundBank_GetNumCues(This->fact_soundbank, pnNumCues); }
static HRESULT WINAPI IXACT3SoundBankImpl_GetCueProperties(IXACT3SoundBank *iface, @@ -290,7 +291,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_GetCueProperties(IXACT3SoundBank *ifac
TRACE("(%p)->(%u, %p)\n", This, nCueIndex, pProperties);
- return FACTSoundBank_GetCueProperties(This->fact_soundbank, nCueIndex, + return pFACTSoundBank_GetCueProperties(This->fact_soundbank, nCueIndex, (FACTCueProperties*) pProperties); } #endif @@ -307,7 +308,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface, TRACE("(%p)->(%u, 0x%x, %u, %p)\n", This, nCueIndex, dwFlags, timeOffset, ppCue);
- ret = FACTSoundBank_Prepare(This->fact_soundbank, nCueIndex, dwFlags, + ret = pFACTSoundBank_Prepare(This->fact_soundbank, nCueIndex, dwFlags, timeOffset, &fcue); if(ret != 0) { @@ -318,7 +319,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface, cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); if (!cue) { - FACTCue_Destroy(fcue); + pFACTCue_Destroy(fcue); ERR("Failed to allocate XACT3CueImpl!\n"); return E_OUTOFMEMORY; } @@ -349,10 +350,10 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, * -flibit */ if (ppCue == NULL){ - hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, + hr = pFACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, timeOffset, NULL); }else{ - hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, + hr = pFACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, timeOffset, &fcue); if(FAILED(hr)) return hr; @@ -360,7 +361,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); if (!cue) { - FACTCue_Destroy(fcue); + pFACTCue_Destroy(fcue); ERR("Failed to allocate XACT3CueImpl!\n"); return E_OUTOFMEMORY; } @@ -380,7 +381,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Stop(IXACT3SoundBank *iface,
TRACE("(%p)->(%u)\n", This, dwFlags);
- return FACTSoundBank_Stop(This->fact_soundbank, nCueIndex, dwFlags); + return pFACTSoundBank_Stop(This->fact_soundbank, nCueIndex, dwFlags); }
static HRESULT WINAPI IXACT3SoundBankImpl_Destroy(IXACT3SoundBank *iface) @@ -390,7 +391,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Destroy(IXACT3SoundBank *iface)
TRACE("(%p)\n", This);
- hr = FACTSoundBank_Destroy(This->fact_soundbank); + hr = pFACTSoundBank_Destroy(This->fact_soundbank); HeapFree(GetProcessHeap(), 0, This); return hr; } @@ -402,7 +403,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_GetState(IXACT3SoundBank *iface,
TRACE("(%p)->(%p)\n", This, pdwState);
- return FACTSoundBank_GetState(This->fact_soundbank, pdwState); + return pFACTSoundBank_GetState(This->fact_soundbank, pdwState); }
static const IXACT3SoundBankVtbl XACT3SoundBank_Vtbl = @@ -439,7 +440,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Destroy(IXACT3Wave *iface)
TRACE("(%p)\n", This);
- hr = FACTWave_Destroy(This->fact_wave); + hr = pFACTWave_Destroy(This->fact_wave); HeapFree(GetProcessHeap(), 0, This); return hr; } @@ -450,7 +451,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Play(IXACT3Wave *iface)
TRACE("(%p)\n", This);
- return FACTWave_Play(This->fact_wave); + return pFACTWave_Play(This->fact_wave); }
static HRESULT WINAPI IXACT3WaveImpl_Stop(IXACT3Wave *iface, DWORD dwFlags) @@ -459,7 +460,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Stop(IXACT3Wave *iface, DWORD dwFlags)
TRACE("(%p)->(0x%x)\n", This, dwFlags);
- return FACTWave_Stop(This->fact_wave, dwFlags); + return pFACTWave_Stop(This->fact_wave, dwFlags); }
static HRESULT WINAPI IXACT3WaveImpl_Pause(IXACT3Wave *iface, BOOL fPause) @@ -468,7 +469,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Pause(IXACT3Wave *iface, BOOL fPause)
TRACE("(%p)->(%u)\n", This, fPause);
- return FACTWave_Pause(This->fact_wave, fPause); + return pFACTWave_Pause(This->fact_wave, fPause); }
static HRESULT WINAPI IXACT3WaveImpl_GetState(IXACT3Wave *iface, DWORD *pdwState) @@ -477,7 +478,7 @@ static HRESULT WINAPI IXACT3WaveImpl_GetState(IXACT3Wave *iface, DWORD *pdwState
TRACE("(%p)->(%p)\n", This, pdwState);
- return FACTWave_GetState(This->fact_wave, pdwState); + return pFACTWave_GetState(This->fact_wave, pdwState); }
static HRESULT WINAPI IXACT3WaveImpl_SetPitch(IXACT3Wave *iface, XACTPITCH pitch) @@ -486,7 +487,7 @@ static HRESULT WINAPI IXACT3WaveImpl_SetPitch(IXACT3Wave *iface, XACTPITCH pitch
TRACE("(%p)->(%d)\n", This, pitch);
- return FACTWave_SetPitch(This->fact_wave, pitch); + return pFACTWave_SetPitch(This->fact_wave, pitch); }
static HRESULT WINAPI IXACT3WaveImpl_SetVolume(IXACT3Wave *iface, XACTVOLUME volume) @@ -495,7 +496,7 @@ static HRESULT WINAPI IXACT3WaveImpl_SetVolume(IXACT3Wave *iface, XACTVOLUME vol
TRACE("(%p)->(%f)\n", This, volume);
- return FACTWave_SetVolume(This->fact_wave, volume); + return pFACTWave_SetVolume(This->fact_wave, volume); }
static HRESULT WINAPI IXACT3WaveImpl_SetMatrixCoefficients(IXACT3Wave *iface, @@ -507,7 +508,7 @@ static HRESULT WINAPI IXACT3WaveImpl_SetMatrixCoefficients(IXACT3Wave *iface, TRACE("(%p)->(%u, %u, %p)\n", This, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
- return FACTWave_SetMatrixCoefficients(This->fact_wave, uSrcChannelCount, + return pFACTWave_SetMatrixCoefficients(This->fact_wave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); }
@@ -518,7 +519,7 @@ static HRESULT WINAPI IXACT3WaveImpl_GetProperties(IXACT3Wave *iface,
TRACE("(%p)->(%p)\n", This, pProperties);
- return FACTWave_GetProperties(This->fact_wave, + return pFACTWave_GetProperties(This->fact_wave, (FACTWaveInstanceProperties*) pProperties); }
@@ -555,7 +556,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Destroy(IXACT3WaveBank *iface)
TRACE("(%p)\n", This);
- hr = FACTWaveBank_Destroy(This->fact_wavebank); + hr = pFACTWaveBank_Destroy(This->fact_wavebank); HeapFree(GetProcessHeap(), 0, This); return hr; } @@ -569,7 +570,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_GetNumWaves(IXACT3WaveBank *iface,
TRACE("(%p)->(%p)\n", This, pnNumWaves);
- return FACTWaveBank_GetNumWaves(This->fact_wavebank, pnNumWaves); + return pFACTWaveBank_GetNumWaves(This->fact_wavebank, pnNumWaves); }
static XACTINDEX WINAPI IXACT3WaveBankImpl_GetWaveIndex(IXACT3WaveBank *iface, @@ -579,7 +580,7 @@ static XACTINDEX WINAPI IXACT3WaveBankImpl_GetWaveIndex(IXACT3WaveBank *iface,
TRACE("(%p)->(%s)\n", This, szFriendlyName);
- return FACTWaveBank_GetWaveIndex(This->fact_wavebank, szFriendlyName); + return pFACTWaveBank_GetWaveIndex(This->fact_wavebank, szFriendlyName); }
static HRESULT WINAPI IXACT3WaveBankImpl_GetWaveProperties(IXACT3WaveBank *iface, @@ -589,7 +590,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_GetWaveProperties(IXACT3WaveBank *iface
TRACE("(%p)->(%u, %p)\n", This, nWaveIndex, pWaveProperties);
- return FACTWaveBank_GetWaveProperties(This->fact_wavebank, nWaveIndex, + return pFACTWaveBank_GetWaveProperties(This->fact_wavebank, nWaveIndex, (FACTWaveProperties*) pWaveProperties); }
@@ -605,7 +606,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface, TRACE("(%p)->(0x%x, %u, 0x%x, %u, %p)\n", This, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
- ret = FACTWaveBank_Prepare(This->fact_wavebank, nWaveIndex, dwFlags, + ret = pFACTWaveBank_Prepare(This->fact_wavebank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, &fwave); if(ret != 0) { @@ -616,7 +617,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface, wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); if (!wave) { - FACTWave_Destroy(fwave); + pFACTWave_Destroy(fwave); ERR("Failed to allocate XACT3WaveImpl!\n"); return E_OUTOFMEMORY; } @@ -647,10 +648,10 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Play(IXACT3WaveBank *iface, * -flibit */ if (ppWave == NULL){ - hr = FACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, + hr = pFACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, NULL); }else{ - hr = FACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, + hr = pFACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, &fwave); if(FAILED(hr)) return hr; @@ -658,7 +659,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Play(IXACT3WaveBank *iface, wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); if (!wave) { - FACTWave_Destroy(fwave); + pFACTWave_Destroy(fwave); ERR("Failed to allocate XACT3WaveImpl!\n"); return E_OUTOFMEMORY; } @@ -678,7 +679,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Stop(IXACT3WaveBank *iface,
TRACE("(%p)->(%u, %u)\n", This, nWaveIndex, dwFlags);
- return FACTWaveBank_Stop(This->fact_wavebank, nWaveIndex, dwFlags); + return pFACTWaveBank_Stop(This->fact_wavebank, nWaveIndex, dwFlags); }
#endif @@ -690,7 +691,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_GetState(IXACT3WaveBank *iface,
TRACE("(%p)->(%p)\n", This, pdwState);
- return FACTWaveBank_GetState(This->fact_wavebank, pdwState); + return pFACTWaveBank_GetState(This->fact_wavebank, pdwState); }
static const IXACT3WaveBankVtbl XACT3WaveBank_Vtbl = @@ -777,7 +778,7 @@ static HRESULT WINAPI IXACT3EngineImpl_QueryInterface(IXACT3Engine *iface, static ULONG WINAPI IXACT3EngineImpl_AddRef(IXACT3Engine *iface) { XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); - ULONG ref = FACTAudioEngine_AddRef(This->fact_engine); + ULONG ref = pFACTAudioEngine_AddRef(This->fact_engine); TRACE("(%p)->(): Refcount now %u\n", This, ref); return ref; } @@ -785,7 +786,7 @@ static ULONG WINAPI IXACT3EngineImpl_AddRef(IXACT3Engine *iface) static ULONG WINAPI IXACT3EngineImpl_Release(IXACT3Engine *iface) { XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); - ULONG ref = FACTAudioEngine_Release(This->fact_engine); + ULONG ref = pFACTAudioEngine_Release(This->fact_engine);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
@@ -801,7 +802,7 @@ static HRESULT WINAPI IXACT3EngineImpl_GetRendererCount(IXACT3Engine *iface,
TRACE("(%p)->(%p)\n", This, pnRendererCount);
- return FACTAudioEngine_GetRendererCount(This->fact_engine, pnRendererCount); + return pFACTAudioEngine_GetRendererCount(This->fact_engine, pnRendererCount); }
static HRESULT WINAPI IXACT3EngineImpl_GetRendererDetails(IXACT3Engine *iface, @@ -811,7 +812,7 @@ static HRESULT WINAPI IXACT3EngineImpl_GetRendererDetails(IXACT3Engine *iface,
TRACE("(%p)->(%d, %p)\n", This, nRendererIndex, pRendererDetails);
- return FACTAudioEngine_GetRendererDetails(This->fact_engine, + return pFACTAudioEngine_GetRendererDetails(This->fact_engine, nRendererIndex, (FACTRendererDetails*) pRendererDetails); }
@@ -824,7 +825,7 @@ static HRESULT WINAPI IXACT3EngineImpl_GetFinalMixFormat(IXACT3Engine *iface,
TRACE("(%p)->(%p)\n", This, pFinalMixFormat);
- return FACTAudioEngine_GetFinalMixFormat(This->fact_engine, + return pFACTAudioEngine_GetFinalMixFormat(This->fact_engine, (FAudioWaveFormatExtensible*) pFinalMixFormat); }
@@ -900,9 +901,9 @@ static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface,
This->notification_callback = (XACT_NOTIFICATION_CALLBACK)pParams->fnNotificationCallback;
- ret = FACTAudioEngine_Initialize(This->fact_engine, ¶ms); + ret = pFACTAudioEngine_Initialize(This->fact_engine, ¶ms); if (ret != 0) - WARN("FACTAudioEngine_Initialize returned %d\n", ret); + WARN("pFACTAudioEngine_Initialize returned %d\n", ret);
return !ret ? S_OK : E_FAIL; } @@ -913,7 +914,7 @@ static HRESULT WINAPI IXACT3EngineImpl_ShutDown(IXACT3Engine *iface)
TRACE("(%p)\n", This);
- return FACTAudioEngine_ShutDown(This->fact_engine); + return pFACTAudioEngine_ShutDown(This->fact_engine); }
static HRESULT WINAPI IXACT3EngineImpl_DoWork(IXACT3Engine *iface) @@ -922,7 +923,7 @@ static HRESULT WINAPI IXACT3EngineImpl_DoWork(IXACT3Engine *iface)
TRACE("(%p)\n", This);
- return FACTAudioEngine_DoWork(This->fact_engine); + return pFACTAudioEngine_DoWork(This->fact_engine); }
static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, @@ -937,7 +938,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p): stub!\n", This, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank);
- ret = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize, + ret = pFACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, &fsb); if(ret != 0) { @@ -948,7 +949,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sb)); if (!sb) { - FACTSoundBank_Destroy(fsb); + pFACTSoundBank_Destroy(fsb); ERR("Failed to allocate XACT3SoundBankImpl!\n"); return E_OUTOFMEMORY; } @@ -974,7 +975,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank);
- ret = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer, + ret = pFACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, &fwb); if(ret != 0) { @@ -985,7 +986,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); if (!wb) { - FACTWaveBank_Destroy(fwb); + pFACTWaveBank_Destroy(fwb); ERR("Failed to allocate XACT3WaveBankImpl!\n"); return E_OUTOFMEMORY; } @@ -1022,7 +1023,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa fakeParms.offset = pParms->offset; fakeParms.packetSize = pParms->packetSize;
- ret = FACTAudioEngine_CreateStreamingWaveBank(This->fact_engine, &fakeParms, + ret = pFACTAudioEngine_CreateStreamingWaveBank(This->fact_engine, &fakeParms, &fwb); if(ret != 0) { @@ -1033,7 +1034,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); if (!wb) { - FACTWaveBank_Destroy(fwb); + pFACTWaveBank_Destroy(fwb); ERR("Failed to allocate XACT3WaveBankImpl!\n"); return E_OUTOFMEMORY; } @@ -1083,7 +1084,7 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface, TRACE("(%p)->(0x%08x, %s, %d, %d, %d, %d, %p)\n", This, dwFlags, debugstr_a(szWavePath), wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave);
- ret = FACTAudioEngine_PrepareWave(This->fact_engine, dwFlags, szWavePath, wStreamingPacketSize, + ret = pFACTAudioEngine_PrepareWave(This->fact_engine, dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, &fwave); if(ret != 0 || !fwave) { @@ -1094,7 +1095,7 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface, wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); if (!wave) { - FACTWave_Destroy(fwave); + pFACTWave_Destroy(fwave); return E_OUTOFMEMORY; }
@@ -1245,7 +1246,7 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface,
unwrap_notificationdesc(&fdesc, pNotificationDesc); fdesc.pvContext = This; - return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); + return pFACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); }
static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *iface, @@ -1258,7 +1259,7 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac
unwrap_notificationdesc(&fdesc, pNotificationDesc); fdesc.pvContext = This; - return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); + return pFACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); }
static XACTCATEGORY WINAPI IXACT3EngineImpl_GetCategory(IXACT3Engine *iface, @@ -1268,7 +1269,7 @@ static XACTCATEGORY WINAPI IXACT3EngineImpl_GetCategory(IXACT3Engine *iface,
TRACE("(%p)->(%s)\n", This, szFriendlyName);
- return FACTAudioEngine_GetCategory(This->fact_engine, szFriendlyName); + return pFACTAudioEngine_GetCategory(This->fact_engine, szFriendlyName); }
static HRESULT WINAPI IXACT3EngineImpl_Stop(IXACT3Engine *iface, @@ -1278,7 +1279,7 @@ static HRESULT WINAPI IXACT3EngineImpl_Stop(IXACT3Engine *iface,
TRACE("(%p)->(%u, 0x%x)\n", This, nCategory, dwFlags);
- return FACTAudioEngine_Stop(This->fact_engine, nCategory, dwFlags); + return pFACTAudioEngine_Stop(This->fact_engine, nCategory, dwFlags); }
static HRESULT WINAPI IXACT3EngineImpl_SetVolume(IXACT3Engine *iface, @@ -1288,7 +1289,7 @@ static HRESULT WINAPI IXACT3EngineImpl_SetVolume(IXACT3Engine *iface,
TRACE("(%p)->(%u, %f)\n", This, nCategory, nVolume);
- return FACTAudioEngine_SetVolume(This->fact_engine, nCategory, nVolume); + return pFACTAudioEngine_SetVolume(This->fact_engine, nCategory, nVolume); }
static HRESULT WINAPI IXACT3EngineImpl_Pause(IXACT3Engine *iface, @@ -1298,7 +1299,7 @@ static HRESULT WINAPI IXACT3EngineImpl_Pause(IXACT3Engine *iface,
TRACE("(%p)->(%u, %u)\n", This, nCategory, fPause);
- return FACTAudioEngine_Pause(This->fact_engine, nCategory, fPause); + return pFACTAudioEngine_Pause(This->fact_engine, nCategory, fPause); }
static XACTVARIABLEINDEX WINAPI IXACT3EngineImpl_GetGlobalVariableIndex( @@ -1308,7 +1309,7 @@ static XACTVARIABLEINDEX WINAPI IXACT3EngineImpl_GetGlobalVariableIndex(
TRACE("(%p)->(%s)\n", This, szFriendlyName);
- return FACTAudioEngine_GetGlobalVariableIndex(This->fact_engine, + return pFACTAudioEngine_GetGlobalVariableIndex(This->fact_engine, szFriendlyName); }
@@ -1319,7 +1320,7 @@ static HRESULT WINAPI IXACT3EngineImpl_SetGlobalVariable(IXACT3Engine *iface,
TRACE("(%p)->(%u, %f)\n", This, nIndex, nValue);
- return FACTAudioEngine_SetGlobalVariable(This->fact_engine, nIndex, nValue); + return pFACTAudioEngine_SetGlobalVariable(This->fact_engine, nIndex, nValue); }
static HRESULT WINAPI IXACT3EngineImpl_GetGlobalVariable(IXACT3Engine *iface, @@ -1329,7 +1330,7 @@ static HRESULT WINAPI IXACT3EngineImpl_GetGlobalVariable(IXACT3Engine *iface,
TRACE("(%p)->(%u, %p)\n", This, nIndex, nValue);
- return FACTAudioEngine_GetGlobalVariable(This->fact_engine, nIndex, nValue); + return pFACTAudioEngine_GetGlobalVariable(This->fact_engine, nIndex, nValue); }
static const IXACT3EngineVtbl XACT3Engine_Vtbl = @@ -1422,7 +1423,7 @@ static HRESULT WINAPI XACT3CF_CreateInstance(IClassFactory *iface, IUnknown *pOu
object->IXACT3Engine_iface.lpVtbl = &XACT3Engine_Vtbl;
- FACTCreateEngineWithCustomAllocatorEXT( + pFACTCreateEngineWithCustomAllocatorEXT( 0, &object->fact_engine, XACT_Internal_Malloc, @@ -1464,11 +1465,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); + if (!load_faudio()) return FALSE;
#ifdef HAVE_FAUDIOLINKEDVERSION - TRACE("Using FAudio version %d\n", FAudioLinkedVersion() ); + TRACE("Using FAudio version %d\n", pFAudioLinkedVersion() ); #endif
+ break; + case DLL_PROCESS_DETACH: + unload_faudio(); break; } return TRUE; diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c index e47442959d3..7972f01a994 100644 --- a/dlls/xaudio2_7/xapo.c +++ b/dlls/xaudio2_7/xapo.c @@ -306,7 +306,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo) { #ifndef XAPOFX1_VER if(IsEqualGUID(clsid, &CLSID_AudioVolumeMeter27)) - return FAudioCreateVolumeMeterWithCustomAllocatorEXT( + return pFAudioCreateVolumeMeterWithCustomAllocatorEXT( fapo, 0, XAudio_Internal_Malloc, @@ -315,7 +315,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo) ); #if XAUDIO2_VER >= 9 && HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT if(IsEqualGUID(clsid, &CLSID_AudioReverb27)) - return FAudioCreateReverb9WithCustomAllocatorEXT( + return pFAudioCreateReverb9WithCustomAllocatorEXT( fapo, 0, XAudio_Internal_Malloc, @@ -324,7 +324,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo) ); #else if(IsEqualGUID(clsid, &CLSID_AudioReverb27)) - return FAudioCreateReverbWithCustomAllocatorEXT( + return pFAudioCreateReverbWithCustomAllocatorEXT( fapo, 0, XAudio_Internal_Malloc, @@ -338,7 +338,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo) IsEqualGUID(clsid, &CLSID_FXEQ) || IsEqualGUID(clsid, &CLSID_FXEcho) || IsEqualGUID(clsid, &CLSID_FXMasteringLimiter)) - return FAPOFX_CreateFXWithCustomAllocatorEXT( + return pFAPOFX_CreateFXWithCustomAllocatorEXT( (const FAudioGUID*) clsid, fapo, NULL, diff --git a/dlls/xaudio2_7/xapofx.c b/dlls/xaudio2_7/xapofx.c index 4dcdaa2ca5f..4cbc2816bc8 100644 --- a/dlls/xaudio2_7/xapofx.c +++ b/dlls/xaudio2_7/xapofx.c @@ -36,6 +36,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); #endif
+#ifdef XAPOFX1_VER +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +{ + TRACE("inst %p, reason %d, reserved %p.\n", inst, reason, reserved ); + + switch (reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(inst); + if (!load_faudio()) return FALSE; + break; + case DLL_PROCESS_DETACH: + unload_faudio(); + break; + } + return TRUE; +} +#endif /* XAPOFX1_VER */ + #if XAUDIO2_VER >= 8 HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 initdata_bytes) { diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index c9f5dd2f48e..eb3cae7ad62 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -87,10 +87,14 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); + if (!load_faudio()) return FALSE; #ifdef HAVE_FAUDIOLINKEDVERSION - TRACE("Using FAudio version %d\n", FAudioLinkedVersion() ); + TRACE("Using FAudio version %d\n", pFAudioLinkedVersion() ); #endif break; + case DLL_PROCESS_DETACH: + unload_faudio(); + break; } return TRUE; } @@ -494,7 +498,7 @@ static const FAudioEngineCallback FAudioEngineCallback_Vtbl = {
static inline void destroy_voice(XA2VoiceImpl *This) { - FAudioVoice_DestroyVoice(This->faudio_voice); + pFAudioVoice_DestroyVoice(This->faudio_voice); free_effect_chain(This->effect_chain); This->effect_chain = NULL; This->in_use = FALSE; @@ -512,7 +516,7 @@ static void WINAPI XA2SRC_GetVoiceDetails(IXAudio2SourceVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %p\n", This, pVoiceDetails); - FAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); + pFAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); }
static HRESULT WINAPI XA2SRC_SetOutputVoices(IXAudio2SourceVoice *iface, @@ -526,7 +530,7 @@ static HRESULT WINAPI XA2SRC_SetOutputVoices(IXAudio2SourceVoice *iface,
faudio_sends = wrap_voice_sends(pSendList);
- hr = FAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends); + hr = pFAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends);
free_voice_sends(faudio_sends);
@@ -544,7 +548,7 @@ static HRESULT WINAPI XA2SRC_SetEffectChain(IXAudio2SourceVoice *iface, free_effect_chain(This->effect_chain); This->effect_chain = wrap_effect_chain(pEffectChain);
- hr = FAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain); + hr = pFAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain);
return hr; } @@ -554,7 +558,7 @@ static HRESULT WINAPI XA2SRC_EnableEffect(IXAudio2SourceVoice *iface, UINT32 Eff { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static HRESULT WINAPI XA2SRC_DisableEffect(IXAudio2SourceVoice *iface, UINT32 EffectIndex, @@ -562,7 +566,7 @@ static HRESULT WINAPI XA2SRC_DisableEffect(IXAudio2SourceVoice *iface, UINT32 Ef { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static void WINAPI XA2SRC_GetEffectState(IXAudio2SourceVoice *iface, UINT32 EffectIndex, @@ -570,7 +574,7 @@ static void WINAPI XA2SRC_GetEffectState(IXAudio2SourceVoice *iface, UINT32 Effe { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, %p\n", This, EffectIndex, pEnabled); - FAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); + pFAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); }
static HRESULT WINAPI XA2SRC_SetEffectParameters(IXAudio2SourceVoice *iface, @@ -580,7 +584,7 @@ static HRESULT WINAPI XA2SRC_SetEffectParameters(IXAudio2SourceVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, %p, 0x%x, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize, OperationSet); - return FAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize, OperationSet); }
@@ -590,7 +594,7 @@ static HRESULT WINAPI XA2SRC_GetEffectParameters(IXAudio2SourceVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize); - return FAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize); }
@@ -599,7 +603,7 @@ static HRESULT WINAPI XA2SRC_SetFilterParameters(IXAudio2SourceVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %p, 0x%x\n", This, pParameters, OperationSet); - return FAudioVoice_SetFilterParameters(This->faudio_voice, + return pFAudioVoice_SetFilterParameters(This->faudio_voice, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -608,7 +612,7 @@ static void WINAPI XA2SRC_GetFilterParameters(IXAudio2SourceVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %p\n", This, pParameters); - FAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); + pFAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); }
static HRESULT WINAPI XA2SRC_SetOutputFilterParameters(IXAudio2SourceVoice *iface, @@ -620,7 +624,7 @@ static HRESULT WINAPI XA2SRC_SetOutputFilterParameters(IXAudio2SourceVoice *ifac
TRACE("%p, %p, %p, 0x%x\n", This, pDestinationVoice, pParameters, OperationSet);
- return FAudioVoice_SetOutputFilterParameters(This->faudio_voice, + return pFAudioVoice_SetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -633,7 +637,7 @@ static void WINAPI XA2SRC_GetOutputFilterParameters(IXAudio2SourceVoice *iface,
TRACE("%p, %p, %p\n", This, pDestinationVoice, pParameters);
- FAudioVoice_GetOutputFilterParameters(This->faudio_voice, + pFAudioVoice_GetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (FAudioFilterParameters *)pParameters); }
@@ -642,14 +646,14 @@ static HRESULT WINAPI XA2SRC_SetVolume(IXAudio2SourceVoice *iface, float Volume, { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); - return FAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); + return pFAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); }
static void WINAPI XA2SRC_GetVolume(IXAudio2SourceVoice *iface, float *pVolume) { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %p\n", This, pVolume); - return FAudioVoice_GetVolume(This->faudio_voice, pVolume); + return pFAudioVoice_GetVolume(This->faudio_voice, pVolume); }
static HRESULT WINAPI XA2SRC_SetChannelVolumes(IXAudio2SourceVoice *iface, UINT32 Channels, @@ -657,7 +661,7 @@ static HRESULT WINAPI XA2SRC_SetChannelVolumes(IXAudio2SourceVoice *iface, UINT3 { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, Channels, pVolumes, OperationSet); - return FAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, pVolumes, OperationSet); }
@@ -666,7 +670,7 @@ static void WINAPI XA2SRC_GetChannelVolumes(IXAudio2SourceVoice *iface, UINT32 C { XA2VoiceImpl *This = impl_from_IXAudio2SourceVoice(iface); TRACE("%p, %u, %p\n", This, Channels, pVolumes); - return FAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, pVolumes); }
@@ -681,7 +685,7 @@ static HRESULT WINAPI XA2SRC_SetOutputMatrix(IXAudio2SourceVoice *iface, TRACE("%p, %p, %u, %u, %p, 0x%x\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet);
- return FAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + return pFAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet); }
@@ -695,7 +699,7 @@ static void WINAPI XA2SRC_GetOutputMatrix(IXAudio2SourceVoice *iface, TRACE("%p, %p, %u, %u, %p\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix);
- FAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + pFAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix); }
@@ -719,7 +723,7 @@ static HRESULT WINAPI XA2SRC_Start(IXAudio2SourceVoice *iface, UINT32 Flags,
TRACE("%p, 0x%x, 0x%x\n", This, Flags, OperationSet);
- return FAudioSourceVoice_Start(This->faudio_voice, Flags, OperationSet); + return pFAudioSourceVoice_Start(This->faudio_voice, Flags, OperationSet); }
static HRESULT WINAPI XA2SRC_Stop(IXAudio2SourceVoice *iface, UINT32 Flags, @@ -729,7 +733,7 @@ static HRESULT WINAPI XA2SRC_Stop(IXAudio2SourceVoice *iface, UINT32 Flags,
TRACE("%p, 0x%x, 0x%x\n", This, Flags, OperationSet);
- return FAudioSourceVoice_Stop(This->faudio_voice, Flags, OperationSet); + return pFAudioSourceVoice_Stop(This->faudio_voice, Flags, OperationSet); }
static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface, @@ -739,7 +743,7 @@ static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface,
TRACE("%p, %p, %p\n", This, pBuffer, pBufferWMA);
- return FAudioSourceVoice_SubmitSourceBuffer(This->faudio_voice, (FAudioBuffer*)pBuffer, (FAudioBufferWMA*)pBufferWMA); + return pFAudioSourceVoice_SubmitSourceBuffer(This->faudio_voice, (FAudioBuffer*)pBuffer, (FAudioBufferWMA*)pBufferWMA); }
static HRESULT WINAPI XA2SRC_FlushSourceBuffers(IXAudio2SourceVoice *iface) @@ -748,7 +752,7 @@ static HRESULT WINAPI XA2SRC_FlushSourceBuffers(IXAudio2SourceVoice *iface)
TRACE("%p\n", This);
- return FAudioSourceVoice_FlushSourceBuffers(This->faudio_voice); + return pFAudioSourceVoice_FlushSourceBuffers(This->faudio_voice); }
static HRESULT WINAPI XA2SRC_Discontinuity(IXAudio2SourceVoice *iface) @@ -757,7 +761,7 @@ static HRESULT WINAPI XA2SRC_Discontinuity(IXAudio2SourceVoice *iface)
TRACE("%p\n", This);
- return FAudioSourceVoice_Discontinuity(This->faudio_voice); + return pFAudioSourceVoice_Discontinuity(This->faudio_voice); }
static HRESULT WINAPI XA2SRC_ExitLoop(IXAudio2SourceVoice *iface, UINT32 OperationSet) @@ -766,7 +770,7 @@ static HRESULT WINAPI XA2SRC_ExitLoop(IXAudio2SourceVoice *iface, UINT32 Operati
TRACE("%p, 0x%x\n", This, OperationSet);
- return FAudioSourceVoice_ExitLoop(This->faudio_voice, OperationSet); + return pFAudioSourceVoice_ExitLoop(This->faudio_voice, OperationSet); }
static void WINAPI XA2SRC_GetState(IXAudio2SourceVoice *iface, @@ -776,7 +780,7 @@ static void WINAPI XA2SRC_GetState(IXAudio2SourceVoice *iface,
TRACE("%p, %p, 0x%x\n", This, pVoiceState, Flags);
- return FAudioSourceVoice_GetState(This->faudio_voice, (FAudioVoiceState*)pVoiceState, Flags); + return pFAudioSourceVoice_GetState(This->faudio_voice, (FAudioVoiceState*)pVoiceState, Flags); }
static HRESULT WINAPI XA2SRC_SetFrequencyRatio(IXAudio2SourceVoice *iface, @@ -786,7 +790,7 @@ static HRESULT WINAPI XA2SRC_SetFrequencyRatio(IXAudio2SourceVoice *iface,
TRACE("%p, %f, 0x%x\n", This, Ratio, OperationSet);
- return FAudioSourceVoice_SetFrequencyRatio(This->faudio_voice, Ratio, OperationSet); + return pFAudioSourceVoice_SetFrequencyRatio(This->faudio_voice, Ratio, OperationSet); }
static void WINAPI XA2SRC_GetFrequencyRatio(IXAudio2SourceVoice *iface, float *pRatio) @@ -795,7 +799,7 @@ static void WINAPI XA2SRC_GetFrequencyRatio(IXAudio2SourceVoice *iface, float *p
TRACE("%p, %p\n", This, pRatio);
- return FAudioSourceVoice_GetFrequencyRatio(This->faudio_voice, pRatio); + return pFAudioSourceVoice_GetFrequencyRatio(This->faudio_voice, pRatio); }
static HRESULT WINAPI XA2SRC_SetSourceSampleRate( @@ -806,7 +810,7 @@ static HRESULT WINAPI XA2SRC_SetSourceSampleRate(
TRACE("%p, %u\n", This, NewSourceSampleRate);
- return FAudioSourceVoice_SetSourceSampleRate(This->faudio_voice, NewSourceSampleRate); + return pFAudioSourceVoice_SetSourceSampleRate(This->faudio_voice, NewSourceSampleRate); }
static const IXAudio2SourceVoiceVtbl XAudio2SourceVoice_Vtbl = { @@ -853,7 +857,7 @@ static void WINAPI XA2SUB_GetVoiceDetails(IXAudio2SubmixVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pVoiceDetails); - FAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); + pFAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); }
static HRESULT WINAPI XA2SUB_SetOutputVoices(IXAudio2SubmixVoice *iface, @@ -867,7 +871,7 @@ static HRESULT WINAPI XA2SUB_SetOutputVoices(IXAudio2SubmixVoice *iface,
faudio_sends = wrap_voice_sends(pSendList);
- hr = FAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends); + hr = pFAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends);
free_voice_sends(faudio_sends);
@@ -885,7 +889,7 @@ static HRESULT WINAPI XA2SUB_SetEffectChain(IXAudio2SubmixVoice *iface, free_effect_chain(This->effect_chain); This->effect_chain = wrap_effect_chain(pEffectChain);
- hr = FAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain); + hr = pFAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain);
return hr; } @@ -895,7 +899,7 @@ static HRESULT WINAPI XA2SUB_EnableEffect(IXAudio2SubmixVoice *iface, UINT32 Eff { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static HRESULT WINAPI XA2SUB_DisableEffect(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, @@ -903,7 +907,7 @@ static HRESULT WINAPI XA2SUB_DisableEffect(IXAudio2SubmixVoice *iface, UINT32 Ef { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static void WINAPI XA2SUB_GetEffectState(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, @@ -911,7 +915,7 @@ static void WINAPI XA2SUB_GetEffectState(IXAudio2SubmixVoice *iface, UINT32 Effe { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p\n", This, EffectIndex, pEnabled); - FAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); + pFAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); }
static HRESULT WINAPI XA2SUB_SetEffectParameters(IXAudio2SubmixVoice *iface, @@ -921,7 +925,7 @@ static HRESULT WINAPI XA2SUB_SetEffectParameters(IXAudio2SubmixVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize, OperationSet); - return FAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize, OperationSet); }
@@ -931,7 +935,7 @@ static HRESULT WINAPI XA2SUB_GetEffectParameters(IXAudio2SubmixVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize); - return FAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize); }
@@ -940,7 +944,7 @@ static HRESULT WINAPI XA2SUB_SetFilterParameters(IXAudio2SubmixVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, 0x%x\n", This, pParameters, OperationSet); - return FAudioVoice_SetFilterParameters(This->faudio_voice, (const FAudioFilterParameters *)pParameters, + return pFAudioVoice_SetFilterParameters(This->faudio_voice, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -949,7 +953,7 @@ static void WINAPI XA2SUB_GetFilterParameters(IXAudio2SubmixVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pParameters); - FAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); + pFAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); }
static HRESULT WINAPI XA2SUB_SetOutputFilterParameters(IXAudio2SubmixVoice *iface, @@ -961,7 +965,7 @@ static HRESULT WINAPI XA2SUB_SetOutputFilterParameters(IXAudio2SubmixVoice *ifac
TRACE("%p, %p, %p, 0x%x\n", This, pDestinationVoice, pParameters, OperationSet);
- return FAudioVoice_SetOutputFilterParameters(This->faudio_voice, + return pFAudioVoice_SetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -974,7 +978,7 @@ static void WINAPI XA2SUB_GetOutputFilterParameters(IXAudio2SubmixVoice *iface,
TRACE("%p, %p, %p\n", This, pDestinationVoice, pParameters);
- FAudioVoice_GetOutputFilterParameters(This->faudio_voice, + pFAudioVoice_GetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (FAudioFilterParameters *)pParameters); }
@@ -983,14 +987,14 @@ static HRESULT WINAPI XA2SUB_SetVolume(IXAudio2SubmixVoice *iface, float Volume, { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); - return FAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); + return pFAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); }
static void WINAPI XA2SUB_GetVolume(IXAudio2SubmixVoice *iface, float *pVolume) { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pVolume); - return FAudioVoice_GetVolume(This->faudio_voice, pVolume); + return pFAudioVoice_GetVolume(This->faudio_voice, pVolume); }
static HRESULT WINAPI XA2SUB_SetChannelVolumes(IXAudio2SubmixVoice *iface, UINT32 Channels, @@ -998,7 +1002,7 @@ static HRESULT WINAPI XA2SUB_SetChannelVolumes(IXAudio2SubmixVoice *iface, UINT3 { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, Channels, pVolumes, OperationSet); - return FAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, pVolumes, OperationSet); }
@@ -1007,7 +1011,7 @@ static void WINAPI XA2SUB_GetChannelVolumes(IXAudio2SubmixVoice *iface, UINT32 C { XA2VoiceImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p\n", This, Channels, pVolumes); - return FAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, pVolumes); }
@@ -1022,7 +1026,7 @@ static HRESULT WINAPI XA2SUB_SetOutputMatrix(IXAudio2SubmixVoice *iface, TRACE("%p, %p, %u, %u, %p, 0x%x\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet);
- return FAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + return pFAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet); }
@@ -1036,7 +1040,7 @@ static void WINAPI XA2SUB_GetOutputMatrix(IXAudio2SubmixVoice *iface, TRACE("%p, %p, %u, %u, %p\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix);
- FAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + pFAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix); }
@@ -1087,7 +1091,7 @@ static void WINAPI XA2M_GetVoiceDetails(IXAudio2MasteringVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %p\n", This, pVoiceDetails); - FAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); + pFAudioVoice_GetVoiceDetails(This->faudio_voice, (FAudioVoiceDetails *)pVoiceDetails); }
static HRESULT WINAPI XA2M_SetOutputVoices(IXAudio2MasteringVoice *iface, @@ -1101,7 +1105,7 @@ static HRESULT WINAPI XA2M_SetOutputVoices(IXAudio2MasteringVoice *iface,
faudio_sends = wrap_voice_sends(pSendList);
- hr = FAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends); + hr = pFAudioVoice_SetOutputVoices(This->faudio_voice, faudio_sends);
free_voice_sends(faudio_sends);
@@ -1119,7 +1123,7 @@ static HRESULT WINAPI XA2M_SetEffectChain(IXAudio2MasteringVoice *iface, free_effect_chain(This->effect_chain); This->effect_chain = wrap_effect_chain(pEffectChain);
- hr = FAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain); + hr = pFAudioVoice_SetEffectChain(This->faudio_voice, This->effect_chain);
return hr; } @@ -1129,7 +1133,7 @@ static HRESULT WINAPI XA2M_EnableEffect(IXAudio2MasteringVoice *iface, UINT32 Ef { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_EnableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static HRESULT WINAPI XA2M_DisableEffect(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, @@ -1137,7 +1141,7 @@ static HRESULT WINAPI XA2M_DisableEffect(IXAudio2MasteringVoice *iface, UINT32 E { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); - return FAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); + return pFAudioVoice_DisableEffect(This->faudio_voice, EffectIndex, OperationSet); }
static void WINAPI XA2M_GetEffectState(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, @@ -1145,7 +1149,7 @@ static void WINAPI XA2M_GetEffectState(IXAudio2MasteringVoice *iface, UINT32 Eff { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, %p\n", This, EffectIndex, pEnabled); - FAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); + pFAudioVoice_GetEffectState(This->faudio_voice, EffectIndex, (int32_t*)pEnabled); }
static HRESULT WINAPI XA2M_SetEffectParameters(IXAudio2MasteringVoice *iface, @@ -1155,7 +1159,7 @@ static HRESULT WINAPI XA2M_SetEffectParameters(IXAudio2MasteringVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, %p, 0x%x, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize, OperationSet); - return FAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_SetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize, OperationSet); }
@@ -1165,7 +1169,7 @@ static HRESULT WINAPI XA2M_GetEffectParameters(IXAudio2MasteringVoice *iface, XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize); - return FAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, + return pFAudioVoice_GetEffectParameters(This->faudio_voice, EffectIndex, pParameters, ParametersByteSize); }
@@ -1174,7 +1178,7 @@ static HRESULT WINAPI XA2M_SetFilterParameters(IXAudio2MasteringVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %p, 0x%x\n", This, pParameters, OperationSet); - return FAudioVoice_SetFilterParameters(This->faudio_voice, (const FAudioFilterParameters *)pParameters, + return pFAudioVoice_SetFilterParameters(This->faudio_voice, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -1183,7 +1187,7 @@ static void WINAPI XA2M_GetFilterParameters(IXAudio2MasteringVoice *iface, { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %p\n", This, pParameters); - FAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); + pFAudioVoice_GetFilterParameters(This->faudio_voice, (FAudioFilterParameters *)pParameters); }
static HRESULT WINAPI XA2M_SetOutputFilterParameters(IXAudio2MasteringVoice *iface, @@ -1195,7 +1199,7 @@ static HRESULT WINAPI XA2M_SetOutputFilterParameters(IXAudio2MasteringVoice *ifa
TRACE("%p, %p, %p, 0x%x\n", This, pDestinationVoice, pParameters, OperationSet);
- return FAudioVoice_SetOutputFilterParameters(This->faudio_voice, + return pFAudioVoice_SetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (const FAudioFilterParameters *)pParameters, OperationSet); }
@@ -1208,7 +1212,7 @@ static void WINAPI XA2M_GetOutputFilterParameters(IXAudio2MasteringVoice *iface,
TRACE("%p, %p, %p\n", This, pDestinationVoice, pParameters);
- FAudioVoice_GetOutputFilterParameters(This->faudio_voice, + pFAudioVoice_GetOutputFilterParameters(This->faudio_voice, dst ? dst->faudio_voice : NULL, (FAudioFilterParameters *)pParameters); }
@@ -1217,14 +1221,14 @@ static HRESULT WINAPI XA2M_SetVolume(IXAudio2MasteringVoice *iface, float Volume { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); - return FAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); + return pFAudioVoice_SetVolume(This->faudio_voice, Volume, OperationSet); }
static void WINAPI XA2M_GetVolume(IXAudio2MasteringVoice *iface, float *pVolume) { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %p\n", This, pVolume); - return FAudioVoice_GetVolume(This->faudio_voice, pVolume); + return pFAudioVoice_GetVolume(This->faudio_voice, pVolume); }
static HRESULT WINAPI XA2M_SetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 Channels, @@ -1232,7 +1236,7 @@ static HRESULT WINAPI XA2M_SetChannelVolumes(IXAudio2MasteringVoice *iface, UINT { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, Channels, pVolumes, OperationSet); - return FAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_SetChannelVolumes(This->faudio_voice, Channels, pVolumes, OperationSet); }
@@ -1241,7 +1245,7 @@ static void WINAPI XA2M_GetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 { XA2VoiceImpl *This = impl_from_IXAudio2MasteringVoice(iface); TRACE("%p, %u, %p\n", This, Channels, pVolumes); - return FAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, + return pFAudioVoice_GetChannelVolumes(This->faudio_voice, Channels, pVolumes); }
@@ -1256,7 +1260,7 @@ static HRESULT WINAPI XA2M_SetOutputMatrix(IXAudio2MasteringVoice *iface, TRACE("%p, %p, %u, %u, %p, 0x%x\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet);
- return FAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + return pFAudioVoice_SetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet); }
@@ -1270,7 +1274,7 @@ static void WINAPI XA2M_GetOutputMatrix(IXAudio2MasteringVoice *iface, TRACE("%p, %p, %u, %u, %p\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix);
- FAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, + pFAudioVoice_GetOutputMatrix(This->faudio_voice, dst ? dst->faudio_voice : NULL, SourceChannels, DestinationChannels, pLevelMatrix); }
@@ -1301,7 +1305,7 @@ static void WINAPI XA2M_GetChannelMask(IXAudio2MasteringVoice *iface,
TRACE("%p, %p\n", This, pChannelMask);
- FAudioMasteringVoice_GetChannelMask(This->faudio_voice, pChannelMask); + pFAudioMasteringVoice_GetChannelMask(This->faudio_voice, pChannelMask); }
static const struct IXAudio2MasteringVoiceVtbl XAudio2MasteringVoice_Vtbl = { @@ -1412,7 +1416,7 @@ static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, static ULONG WINAPI IXAudio2Impl_AddRef(IXAudio2 *iface) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - ULONG ref = FAudio_AddRef(This->faudio); + ULONG ref = pFAudio_AddRef(This->faudio); TRACE("(%p)->(): Refcount now %u\n", This, ref); return ref; } @@ -1420,7 +1424,7 @@ static ULONG WINAPI IXAudio2Impl_AddRef(IXAudio2 *iface) static ULONG WINAPI IXAudio2Impl_Release(IXAudio2 *iface) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - ULONG ref = FAudio_Release(This->faudio); + ULONG ref = pFAudio_Release(This->faudio);
TRACE("(%p)->(): Refcount now %u\n", This, ref);
@@ -1570,7 +1574,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface, src->effect_chain = wrap_effect_chain(pEffectChain); faudio_sends = wrap_voice_sends(pSendList);
- hr = FAudio_CreateSourceVoice(This->faudio, &src->faudio_voice, + hr = pFAudio_CreateSourceVoice(This->faudio, &src->faudio_voice, (FAudioWaveFormatEx*)pSourceFormat, flags, maxFrequencyRatio, &src->FAudioVoiceCallback_vtbl, faudio_sends, src->effect_chain); @@ -1633,7 +1637,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface, sub->effect_chain = wrap_effect_chain(pEffectChain); faudio_sends = wrap_voice_sends(pSendList);
- hr = FAudio_CreateSubmixVoice(This->faudio, &sub->faudio_voice, inputChannels, + hr = pFAudio_CreateSubmixVoice(This->faudio, &sub->faudio_voice, inputChannels, inputSampleRate, flags, processingStage, faudio_sends, sub->effect_chain); free_voice_sends(faudio_sends); @@ -1744,9 +1748,9 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
pthread_mutex_unlock(&This->mst.engine_lock);
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); + pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
- FAudio_CreateMasteringVoice8(This->faudio, &This->mst.faudio_voice, inputChannels, + pFAudio_CreateMasteringVoice8(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, NULL /* TODO: (uint16_t*)deviceId */, This->mst.effect_chain, (FAudioStreamCategory)streamCategory);
@@ -1763,7 +1767,7 @@ static HRESULT WINAPI IXAudio2Impl_StartEngine(IXAudio2 *iface)
TRACE("(%p)->()\n", This);
- return FAudio_StartEngine(This->faudio); + return pFAudio_StartEngine(This->faudio); }
static void WINAPI IXAudio2Impl_StopEngine(IXAudio2 *iface) @@ -1772,7 +1776,7 @@ static void WINAPI IXAudio2Impl_StopEngine(IXAudio2 *iface)
TRACE("(%p)->()\n", This);
- FAudio_StopEngine(This->faudio); + pFAudio_StopEngine(This->faudio); }
static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface, @@ -1783,9 +1787,9 @@ static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface, TRACE("(%p)->(0x%x)\n", This, operationSet);
#ifdef HAVE_FAUDIO_COMMITOPERATIONSET - return FAudio_CommitOperationSet(This->faudio, operationSet); + return pFAudio_CommitOperationSet(This->faudio, operationSet); #else - return FAudio_CommitChanges(This->faudio); + return pFAudio_CommitChanges(This->faudio); #endif }
@@ -1796,7 +1800,7 @@ static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface,
TRACE("(%p)->(%p)\n", This, pPerfData);
- FAudio_GetPerformanceData(This->faudio, (FAudioPerformanceData *)pPerfData); + pFAudio_GetPerformanceData(This->faudio, (FAudioPerformanceData *)pPerfData); }
static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface, @@ -1807,7 +1811,7 @@ static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface,
TRACE("(%p)->(%p, %p)\n", This, pDebugConfiguration, pReserved);
- FAudio_SetDebugConfiguration(This->faudio, (FAudioDebugConfiguration *)pDebugConfiguration, pReserved); + pFAudio_SetDebugConfiguration(This->faudio, (FAudioDebugConfiguration *)pDebugConfiguration, pReserved); }
/* XAudio2 2.8 */ @@ -1927,7 +1931,7 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p pthread_cond_init(&object->mst.engine_done, NULL); pthread_cond_init(&object->mst.engine_ready, NULL);
- FAudioCOMConstructWithCustomAllocatorEXT( + pFAudioCOMConstructWithCustomAllocatorEXT( &object->faudio, XAUDIO2_VER, XAudio_Internal_Malloc, @@ -1935,7 +1939,7 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p XAudio_Internal_Realloc );
- FAudio_RegisterForCallbacks(object->faudio, &object->FAudioEngineCallback_vtbl); + pFAudio_RegisterForCallbacks(object->faudio, &object->FAudioEngineCallback_vtbl);
hr = IXAudio2_QueryInterface(&object->IXAudio2_iface, riid, ppobj); IXAudio2_Release(&object->IXAudio2_iface); @@ -1982,7 +1986,7 @@ HRESULT xaudio2_initialize(IXAudio2Impl *This, UINT32 flags, XAUDIO2_PROCESSOR p { if(proc != XAUDIO2_ANY_PROCESSOR) WARN("Processor affinity not implemented in FAudio\n"); - return FAudio_Initialize(This->faudio, flags, FAUDIO_DEFAULT_PROCESSOR); + return pFAudio_Initialize(This->faudio, flags, FAUDIO_DEFAULT_PROCESSOR); }
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) diff --git a/dlls/xaudio2_7/xaudio_private.h b/dlls/xaudio2_7/xaudio_private.h index 46d842bf4c1..35d0410f60f 100644 --- a/dlls/xaudio2_7/xaudio_private.h +++ b/dlls/xaudio2_7/xaudio_private.h @@ -23,11 +23,160 @@ #include "xaudio2.h" #include "xapo.h"
-#include <FAudio.h> +#include <F3DAudio.h> +#include <FACT.h> +#include <FACT3D.h> #include <FAPO.h> +#include <FAPOBase.h> +#include <FAPOFX.h> +#include <FAudio.h> +#include <FAudioFX.h>
#include <pthread.h>
+#define MAKE_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN; +MAKE_FUNCPTR(FAudio_AddRef) +#ifdef HAVE_FAUDIO_COMMITOPERATIONSET +MAKE_FUNCPTR(FAudio_CommitOperationSet) +#else +MAKE_FUNCPTR(FAudio_CommitChanges) +#endif +MAKE_FUNCPTR(FAudio_CreateMasteringVoice) +MAKE_FUNCPTR(FAudio_CreateMasteringVoice8) +MAKE_FUNCPTR(FAudio_CreateSourceVoice) +MAKE_FUNCPTR(FAudio_CreateSubmixVoice) +MAKE_FUNCPTR(FAudio_GetDeviceCount) +MAKE_FUNCPTR(FAudio_GetDeviceDetails) +MAKE_FUNCPTR(FAudio_GetPerformanceData) +MAKE_FUNCPTR(FAudio_Initialize) +MAKE_FUNCPTR(FAudio_RegisterForCallbacks) +MAKE_FUNCPTR(FAudio_Release) +MAKE_FUNCPTR(FAudio_SetDebugConfiguration) +MAKE_FUNCPTR(FAudio_StartEngine) +MAKE_FUNCPTR(FAudio_StopEngine) + +MAKE_FUNCPTR(FAudioVoice_DestroyVoice) +MAKE_FUNCPTR(FAudioVoice_DisableEffect) +MAKE_FUNCPTR(FAudioVoice_EnableEffect) +MAKE_FUNCPTR(FAudioVoice_GetChannelVolumes) +MAKE_FUNCPTR(FAudioVoice_GetEffectParameters) +MAKE_FUNCPTR(FAudioVoice_GetEffectState) +MAKE_FUNCPTR(FAudioVoice_GetFilterParameters) +MAKE_FUNCPTR(FAudioVoice_GetOutputFilterParameters) +MAKE_FUNCPTR(FAudioVoice_GetOutputMatrix) +MAKE_FUNCPTR(FAudioVoice_GetVoiceDetails) +MAKE_FUNCPTR(FAudioVoice_GetVolume) +MAKE_FUNCPTR(FAudioVoice_SetChannelVolumes) +MAKE_FUNCPTR(FAudioVoice_SetEffectChain) +MAKE_FUNCPTR(FAudioVoice_SetEffectParameters) +MAKE_FUNCPTR(FAudioVoice_SetFilterParameters) +MAKE_FUNCPTR(FAudioVoice_SetOutputFilterParameters) +MAKE_FUNCPTR(FAudioVoice_SetOutputMatrix) +MAKE_FUNCPTR(FAudioVoice_SetOutputVoices) +MAKE_FUNCPTR(FAudioVoice_SetVolume) + +MAKE_FUNCPTR(FAudioSourceVoice_Discontinuity) +MAKE_FUNCPTR(FAudioSourceVoice_ExitLoop) +MAKE_FUNCPTR(FAudioSourceVoice_FlushSourceBuffers) +MAKE_FUNCPTR(FAudioSourceVoice_GetFrequencyRatio) +MAKE_FUNCPTR(FAudioSourceVoice_GetState) +MAKE_FUNCPTR(FAudioSourceVoice_SetFrequencyRatio) +MAKE_FUNCPTR(FAudioSourceVoice_SetSourceSampleRate) +MAKE_FUNCPTR(FAudioSourceVoice_Start) +MAKE_FUNCPTR(FAudioSourceVoice_Stop) +MAKE_FUNCPTR(FAudioSourceVoice_SubmitSourceBuffer) + +MAKE_FUNCPTR(FAudioMasteringVoice_GetChannelMask) + +MAKE_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) +MAKE_FUNCPTR(FAudioCreate) +MAKE_FUNCPTR(FAudioCreateReverb) +MAKE_FUNCPTR(FAudioCreateReverb9) +#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT +MAKE_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) +#endif +MAKE_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) +MAKE_FUNCPTR(FAudioCreateVolumeMeter) +MAKE_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) +#ifdef HAVE_FAUDIOLINKEDVERSION +MAKE_FUNCPTR(FAudioLinkedVersion) +#endif + +MAKE_FUNCPTR(F3DAudioCalculate) +MAKE_FUNCPTR(F3DAudioInitialize) +#ifdef HAVE_F3DAUDIOINITIALIZE8 +MAKE_FUNCPTR(F3DAudioInitialize8) +#endif + +MAKE_FUNCPTR(FACTAudioEngine_AddRef) +MAKE_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) +MAKE_FUNCPTR(FACTAudioEngine_CreateSoundBank) +MAKE_FUNCPTR(FACTAudioEngine_CreateStreamingWaveBank) +MAKE_FUNCPTR(FACTAudioEngine_DoWork) +MAKE_FUNCPTR(FACTAudioEngine_GetCategory) +MAKE_FUNCPTR(FACTAudioEngine_GetFinalMixFormat) +MAKE_FUNCPTR(FACTAudioEngine_GetGlobalVariable) +MAKE_FUNCPTR(FACTAudioEngine_GetGlobalVariableIndex) +MAKE_FUNCPTR(FACTAudioEngine_GetRendererCount) +MAKE_FUNCPTR(FACTAudioEngine_GetRendererDetails) +MAKE_FUNCPTR(FACTAudioEngine_Initialize) +MAKE_FUNCPTR(FACTAudioEngine_Pause) +MAKE_FUNCPTR(FACTAudioEngine_PrepareWave) +MAKE_FUNCPTR(FACTAudioEngine_RegisterNotification) +MAKE_FUNCPTR(FACTAudioEngine_Release) +MAKE_FUNCPTR(FACTAudioEngine_SetGlobalVariable) +MAKE_FUNCPTR(FACTAudioEngine_SetVolume) +MAKE_FUNCPTR(FACTAudioEngine_ShutDown) +MAKE_FUNCPTR(FACTAudioEngine_Stop) +MAKE_FUNCPTR(FACTAudioEngine_UnRegisterNotification) + +MAKE_FUNCPTR(FACTCreateEngineWithCustomAllocatorEXT) + +MAKE_FUNCPTR(FACTCue_Destroy) +MAKE_FUNCPTR(FACTCue_GetProperties) +MAKE_FUNCPTR(FACTCue_GetState) +MAKE_FUNCPTR(FACTCue_GetVariable) +MAKE_FUNCPTR(FACTCue_GetVariableIndex) +MAKE_FUNCPTR(FACTCue_Pause) +MAKE_FUNCPTR(FACTCue_Play) +MAKE_FUNCPTR(FACTCue_SetMatrixCoefficients) +MAKE_FUNCPTR(FACTCue_SetVariable) +MAKE_FUNCPTR(FACTCue_Stop) + +MAKE_FUNCPTR(FACTSoundBank_Destroy) +MAKE_FUNCPTR(FACTSoundBank_GetCueIndex) +MAKE_FUNCPTR(FACTSoundBank_GetCueProperties) +MAKE_FUNCPTR(FACTSoundBank_GetNumCues) +MAKE_FUNCPTR(FACTSoundBank_GetState) +MAKE_FUNCPTR(FACTSoundBank_Play) +MAKE_FUNCPTR(FACTSoundBank_Prepare) +MAKE_FUNCPTR(FACTSoundBank_Stop) + +MAKE_FUNCPTR(FACTWave_Destroy) +MAKE_FUNCPTR(FACTWave_GetProperties) +MAKE_FUNCPTR(FACTWave_GetState) +MAKE_FUNCPTR(FACTWave_Pause) +MAKE_FUNCPTR(FACTWave_Play) +MAKE_FUNCPTR(FACTWave_SetMatrixCoefficients) +MAKE_FUNCPTR(FACTWave_SetPitch) +MAKE_FUNCPTR(FACTWave_SetVolume) +MAKE_FUNCPTR(FACTWave_Stop) + +MAKE_FUNCPTR(FACTWaveBank_Destroy) +MAKE_FUNCPTR(FACTWaveBank_GetNumWaves) +MAKE_FUNCPTR(FACTWaveBank_GetState) +MAKE_FUNCPTR(FACTWaveBank_GetWaveIndex) +MAKE_FUNCPTR(FACTWaveBank_GetWaveProperties) +MAKE_FUNCPTR(FACTWaveBank_Play) +MAKE_FUNCPTR(FACTWaveBank_Prepare) +MAKE_FUNCPTR(FACTWaveBank_Stop) + +MAKE_FUNCPTR(FAPOFX_CreateFXWithCustomAllocatorEXT) +#undef MAKE_FUNCPTR + +extern BOOL load_faudio(void) DECLSPEC_HIDDEN; +extern void unload_faudio(void) DECLSPEC_HIDDEN; + #if XAUDIO2_VER == 0 #define COMPAT_E_INVALID_CALL E_INVALIDARG #define COMPAT_E_DEVICE_INVALIDATED XAUDIO20_E_DEVICE_INVALIDATED diff --git a/dlls/xaudio2_8/Makefile.in b/dlls/xaudio2_8/Makefile.in index 566ddb6b3f1..69aa0d42b81 100644 --- a/dlls/xaudio2_8/Makefile.in +++ b/dlls/xaudio2_8/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=8 MODULE = xaudio2_8.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ x3daudio.c \ xapo.c \ xapofx.c \ diff --git a/dlls/xaudio2_9/Makefile.in b/dlls/xaudio2_9/Makefile.in index 86f7b99e5eb..b3256636f4d 100644 --- a/dlls/xaudio2_9/Makefile.in +++ b/dlls/xaudio2_9/Makefile.in @@ -2,11 +2,12 @@ EXTRADEFS = -DXAUDIO2_VER=9 MODULE = xaudio2_9.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(FAUDIO_LIBS) +EXTRALIBS = $(DL_LIBS) EXTRAINCL = $(FAUDIO_CFLAGS)
C_SRCS = \ compat.c \ + faudio.c \ x3daudio.c \ xapo.c \ xapofx.c \
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92981
Your paranoid android.
=== debiant2 (build log) ===
/home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2173: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' /usr/bin/ld: collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2642: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2830: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2830: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status Task: The win32 Wine build failed
=== debiant2 (build log) ===
/home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2173: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2642: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status Task: The wow64 Wine build failed
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/xaudio2_7/FAudio/F3DAudio.h | 262 ++++++ dlls/xaudio2_7/FAudio/FACT.h | 814 ++++++++++++++++++ dlls/xaudio2_7/FAudio/FACT3D.h | 127 +++ dlls/xaudio2_7/FAudio/FAPO.h | 207 +++++ dlls/xaudio2_7/FAudio/FAPOBase.h | 264 ++++++ dlls/xaudio2_7/FAudio/FAPOFX.h | 178 ++++ dlls/xaudio2_7/FAudio/FAudio.h | 1322 ++++++++++++++++++++++++++++++ dlls/xaudio2_7/FAudio/FAudioFX.h | 308 +++++++ 8 files changed, 3482 insertions(+) create mode 100644 dlls/xaudio2_7/FAudio/F3DAudio.h create mode 100644 dlls/xaudio2_7/FAudio/FACT.h create mode 100644 dlls/xaudio2_7/FAudio/FACT3D.h create mode 100644 dlls/xaudio2_7/FAudio/FAPO.h create mode 100644 dlls/xaudio2_7/FAudio/FAPOBase.h create mode 100644 dlls/xaudio2_7/FAudio/FAPOFX.h create mode 100644 dlls/xaudio2_7/FAudio/FAudio.h create mode 100644 dlls/xaudio2_7/FAudio/FAudioFX.h
diff --git a/dlls/xaudio2_7/FAudio/F3DAudio.h b/dlls/xaudio2_7/FAudio/F3DAudio.h new file mode 100644 index 00000000000..5fbb618243c --- /dev/null +++ b/dlls/xaudio2_7/FAudio/F3DAudio.h @@ -0,0 +1,262 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since the MSDN docs are still perfectly fine: + * https://docs.microsoft.com/en-us/windows/desktop/api/x3daudio/ + */ + +#ifndef F3DAUDIO_H +#define F3DAUDIO_H + +#ifdef _WIN32 +#define F3DAUDIOAPI __declspec(dllexport) +#else +#define F3DAUDIOAPI +#endif + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Constants */ + +#ifndef _SPEAKER_POSITIONS_ +#define SPEAKER_FRONT_LEFT 0x00000001 +#define SPEAKER_FRONT_RIGHT 0x00000002 +#define SPEAKER_FRONT_CENTER 0x00000004 +#define SPEAKER_LOW_FREQUENCY 0x00000008 +#define SPEAKER_BACK_LEFT 0x00000010 +#define SPEAKER_BACK_RIGHT 0x00000020 +#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 +#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 +#define SPEAKER_BACK_CENTER 0x00000100 +#define SPEAKER_SIDE_LEFT 0x00000200 +#define SPEAKER_SIDE_RIGHT 0x00000400 +#define SPEAKER_TOP_CENTER 0x00000800 +#define SPEAKER_TOP_FRONT_LEFT 0x00001000 +#define SPEAKER_TOP_FRONT_CENTER 0x00002000 +#define SPEAKER_TOP_FRONT_RIGHT 0x00004000 +#define SPEAKER_TOP_BACK_LEFT 0x00008000 +#define SPEAKER_TOP_BACK_CENTER 0x00010000 +#define SPEAKER_TOP_BACK_RIGHT 0x00020000 +#define _SPEAKER_POSITIONS_ +#endif + +#ifndef SPEAKER_MONO +#define SPEAKER_MONO SPEAKER_FRONT_CENTER +#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) +#define SPEAKER_2POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_LOW_FREQUENCY ) +#define SPEAKER_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_BACK_CENTER ) +#define SPEAKER_QUAD \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_4POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_5POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_7POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT | \ + SPEAKER_FRONT_LEFT_OF_CENTER | \ + SPEAKER_FRONT_RIGHT_OF_CENTER ) +#define SPEAKER_5POINT1_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_SIDE_LEFT | \ + SPEAKER_SIDE_RIGHT ) +#define SPEAKER_7POINT1_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT | \ + SPEAKER_SIDE_LEFT | \ + SPEAKER_SIDE_RIGHT ) +#define SPEAKER_XBOX SPEAKER_5POINT1 +#endif + +#define F3DAUDIO_PI 3.141592654f +#define F3DAUDIO_2PI 6.283185307f + +#define F3DAUDIO_CALCULATE_MATRIX 0x00000001 +#define F3DAUDIO_CALCULATE_DELAY 0x00000002 +#define F3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 +#define F3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 +#define F3DAUDIO_CALCULATE_REVERB 0x00000010 +#define F3DAUDIO_CALCULATE_DOPPLER 0x00000020 +#define F3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 +#define F3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 +#define F3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 + +/* Type Declarations */ + +#define F3DAUDIO_HANDLE_BYTESIZE 20 +typedef uint8_t F3DAUDIO_HANDLE[F3DAUDIO_HANDLE_BYTESIZE]; + +/* Structures */ + +#pragma pack(push, 1) + +typedef struct F3DAUDIO_VECTOR +{ + float x; + float y; + float z; +} F3DAUDIO_VECTOR; + +typedef struct F3DAUDIO_DISTANCE_CURVE_POINT +{ + float Distance; + float DSPSetting; +} F3DAUDIO_DISTANCE_CURVE_POINT; + +typedef struct F3DAUDIO_DISTANCE_CURVE +{ + F3DAUDIO_DISTANCE_CURVE_POINT *pPoints; + uint32_t PointCount; +} F3DAUDIO_DISTANCE_CURVE; + +typedef struct F3DAUDIO_CONE +{ + float InnerAngle; + float OuterAngle; + float InnerVolume; + float OuterVolume; + float InnerLPF; + float OuterLPF; + float InnerReverb; + float OuterReverb; +} F3DAUDIO_CONE; + +typedef struct F3DAUDIO_LISTENER +{ + F3DAUDIO_VECTOR OrientFront; + F3DAUDIO_VECTOR OrientTop; + F3DAUDIO_VECTOR Position; + F3DAUDIO_VECTOR Velocity; + F3DAUDIO_CONE *pCone; +} F3DAUDIO_LISTENER; + +typedef struct F3DAUDIO_EMITTER +{ + F3DAUDIO_CONE *pCone; + F3DAUDIO_VECTOR OrientFront; + F3DAUDIO_VECTOR OrientTop; + F3DAUDIO_VECTOR Position; + F3DAUDIO_VECTOR Velocity; + float InnerRadius; + float InnerRadiusAngle; + uint32_t ChannelCount; + float ChannelRadius; + float *pChannelAzimuths; + F3DAUDIO_DISTANCE_CURVE *pVolumeCurve; + F3DAUDIO_DISTANCE_CURVE *pLFECurve; + F3DAUDIO_DISTANCE_CURVE *pLPFDirectCurve; + F3DAUDIO_DISTANCE_CURVE *pLPFReverbCurve; + F3DAUDIO_DISTANCE_CURVE *pReverbCurve; + float CurveDistanceScaler; + float DopplerScaler; +} F3DAUDIO_EMITTER; + +#ifndef F3DAUDIO_DSP_SETTINGS_DECL +#define F3DAUDIO_DSP_SETTINGS_DECL +typedef struct F3DAUDIO_DSP_SETTINGS F3DAUDIO_DSP_SETTINGS; +#endif /* F3DAUDIO_DSP_SETTINGS_DECL */ + +struct F3DAUDIO_DSP_SETTINGS +{ + float *pMatrixCoefficients; + float *pDelayTimes; + uint32_t SrcChannelCount; + uint32_t DstChannelCount; + float LPFDirectCoefficient; + float LPFReverbCoefficient; + float ReverbLevel; + float DopplerFactor; + float EmitterToListenerAngle; + float EmitterToListenerDistance; + float EmitterVelocityComponent; + float ListenerVelocityComponent; +}; + +#pragma pack(pop) + +/* Functions */ + +F3DAUDIOAPI void F3DAudioInitialize( + uint32_t SpeakerChannelMask, + float SpeedOfSound, + F3DAUDIO_HANDLE Instance +); + +F3DAUDIOAPI uint32_t F3DAudioInitialize8( + uint32_t SpeakerChannelMask, + float SpeedOfSound, + F3DAUDIO_HANDLE Instance +); + +F3DAUDIOAPI void F3DAudioCalculate( + const F3DAUDIO_HANDLE Instance, + const F3DAUDIO_LISTENER *pListener, + const F3DAUDIO_EMITTER *pEmitter, + uint32_t Flags, + F3DAUDIO_DSP_SETTINGS *pDSPSettings +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* F3DAUDIO_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FACT.h b/dlls/xaudio2_7/FAudio/FACT.h new file mode 100644 index 00000000000..579b7168812 --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FACT.h @@ -0,0 +1,814 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since you are expected to already know how + * XACT works if you are still using these APIs! + */ + +#ifndef FACT_H +#define FACT_H + +#include "FAudio.h" + +#define FACTAPI FAUDIOAPI +#ifdef _WIN32 +#define FACTCALL __stdcall +#else +#define FACTCALL +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct FACTAudioEngine FACTAudioEngine; +typedef struct FACTSoundBank FACTSoundBank; +typedef struct FACTWaveBank FACTWaveBank; +typedef struct FACTWave FACTWave; +typedef struct FACTCue FACTCue; +typedef struct FACTNotification FACTNotification; + +typedef struct FACTRendererDetails +{ + int16_t rendererID[0xFF]; /* Win32 wchar_t */ + int16_t displayName[0xFF]; /* Win32 wchar_t */ + int32_t defaultDevice; +} FACTRendererDetails; + +typedef struct FACTOverlapped +{ + void *Internal; /* ULONG_PTR */ + void *InternalHigh; /* ULONG_PTR */ + FAUDIONAMELESS union + { + FAUDIONAMELESS struct + { + uint32_t Offset; + uint32_t OffsetHigh; + }; + void *Pointer; + }; + void *hEvent; +} FACTOverlapped; + +typedef int32_t (FACTCALL * FACTReadFileCallback)( + void *hFile, + void *buffer, + uint32_t nNumberOfBytesToRead, + uint32_t *lpNumberOfBytesRead, + FACTOverlapped *lpOverlapped +); + +typedef int32_t (FACTCALL * FACTGetOverlappedResultCallback)( + void *hFile, + FACTOverlapped *lpOverlapped, + uint32_t *lpNumberOfBytesTransferred, + int32_t bWait +); + +typedef struct FACTFileIOCallbacks +{ + FACTReadFileCallback readFileCallback; + FACTGetOverlappedResultCallback getOverlappedResultCallback; +} FACTFileIOCallbacks; + +typedef void (FACTCALL * FACTNotificationCallback)( + const FACTNotification *pNotification +); + +/* FIXME: ABI bug! This should be pack(1) explicitly. Do not memcpy this! */ +typedef struct FACTRuntimeParameters +{ + uint32_t lookAheadTime; + void *pGlobalSettingsBuffer; + uint32_t globalSettingsBufferSize; + uint32_t globalSettingsFlags; + uint32_t globalSettingsAllocAttributes; + FACTFileIOCallbacks fileIOCallbacks; + FACTNotificationCallback fnNotificationCallback; + int16_t *pRendererID; /* Win32 wchar_t* */ + FAudio *pXAudio2; + FAudioMasteringVoice *pMasteringVoice; +} FACTRuntimeParameters; + +typedef struct FACTStreamingParameters +{ + void *file; + uint32_t offset; + uint32_t flags; + uint16_t packetSize; /* Measured in DVD sectors, or 2048 bytes */ +} FACTStreamingParameters; + +#define FACT_WAVEBANK_TYPE_BUFFER 0x00000000 +#define FACT_WAVEBANK_TYPE_STREAMING 0x00000001 +#define FACT_WAVEBANK_TYPE_MASK 0x00000001 + +#define FACT_WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 +#define FACT_WAVEBANK_FLAGS_COMPACT 0x00020000 +#define FACT_WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 +#define FACT_WAVEBANK_FLAGS_SEEKTABLES 0x00080000 +#define FACT_WAVEBANK_FLAGS_MASK 0x000F0000 + +typedef enum FACTWaveBankSegIdx +{ + FACT_WAVEBANK_SEGIDX_BANKDATA = 0, + FACT_WAVEBANK_SEGIDX_ENTRYMETADATA, + FACT_WAVEBANK_SEGIDX_SEEKTABLES, + FACT_WAVEBANK_SEGIDX_ENTRYNAMES, + FACT_WAVEBANK_SEGIDX_ENTRYWAVEDATA, + FACT_WAVEBANK_SEGIDX_COUNT +} FACTWaveBankSegIdx; + +#pragma pack(push, 1) + +typedef struct FACTWaveBankRegion +{ + uint32_t dwOffset; + uint32_t dwLength; +} FACTWaveBankRegion; + +typedef struct FACTWaveBankSampleRegion +{ + uint32_t dwStartSample; + uint32_t dwTotalSamples; +} FACTWaveBankSampleRegion; + +typedef struct FACTWaveBankHeader +{ + uint32_t dwSignature; + uint32_t dwVersion; + uint32_t dwHeaderVersion; + FACTWaveBankRegion Segments[FACT_WAVEBANK_SEGIDX_COUNT]; +} FACTWaveBankHeader; + +typedef union FACTWaveBankMiniWaveFormat +{ + FAUDIONAMELESS struct + { + uint32_t wFormatTag : 2; + uint32_t nChannels : 3; + uint32_t nSamplesPerSec : 18; + uint32_t wBlockAlign : 8; + uint32_t wBitsPerSample : 1; + }; + uint32_t dwValue; +} FACTWaveBankMiniWaveFormat; + +typedef struct FACTWaveBankEntry +{ + FAUDIONAMELESS union + { + FAUDIONAMELESS struct + { + uint32_t dwFlags : 4; + uint32_t Duration : 28; + }; + uint32_t dwFlagsAndDuration; + }; + FACTWaveBankMiniWaveFormat Format; + FACTWaveBankRegion PlayRegion; + FACTWaveBankSampleRegion LoopRegion; +} FACTWaveBankEntry; + +typedef struct FACTWaveBankEntryCompact +{ + uint32_t dwOffset : 21; + uint32_t dwLengthDeviation : 11; +} FACTWaveBankEntryCompact; + +typedef struct FACTWaveBankData +{ + uint32_t dwFlags; + uint32_t dwEntryCount; + char szBankName[64]; + uint32_t dwEntryMetaDataElementSize; + uint32_t dwEntryNameElementSize; + uint32_t dwAlignment; + FACTWaveBankMiniWaveFormat CompactFormat; + uint64_t BuildTime; +} FACTWaveBankData; + +#pragma pack(pop) + +typedef struct FACTWaveProperties +{ + char friendlyName[64]; + FACTWaveBankMiniWaveFormat format; + uint32_t durationInSamples; + FACTWaveBankSampleRegion loopRegion; + int32_t streaming; +} FACTWaveProperties; + +typedef struct FACTWaveInstanceProperties +{ + FACTWaveProperties properties; + int32_t backgroundMusic; +} FACTWaveInstanceProperties; + +typedef struct FACTCueProperties +{ + char friendlyName[0xFF]; + int32_t interactive; + uint16_t iaVariableIndex; + uint16_t numVariations; + uint8_t maxInstances; + uint8_t currentInstances; +} FACTCueProperties; + +typedef struct FACTTrackProperties +{ + uint32_t duration; + uint16_t numVariations; + uint8_t numChannels; + uint16_t waveVariation; + uint8_t loopCount; +} FACTTrackProperties; + +typedef struct FACTVariationProperties +{ + uint16_t index; + uint8_t weight; + float iaVariableMin; + float iaVariableMax; + int32_t linger; +} FACTVariationProperties; + +typedef struct FACTSoundProperties +{ + uint16_t category; + uint8_t priority; + int16_t pitch; + float volume; + uint16_t numTracks; + FACTTrackProperties arrTrackProperties[1]; +} FACTSoundProperties; + +typedef struct FACTSoundVariationProperties +{ + FACTVariationProperties variationProperties; + FACTSoundProperties soundProperties; +} FACTSoundVariationProperties; + +typedef struct FACTCueInstanceProperties +{ + uint32_t allocAttributes; + FACTCueProperties cueProperties; + FACTSoundVariationProperties activeVariationProperties; +} FACTCueInstanceProperties; + +#pragma pack(push, 1) + +typedef struct FACTNotificationDescription +{ + uint8_t type; + uint8_t flags; + FACTSoundBank *pSoundBank; + FACTWaveBank *pWaveBank; + FACTCue *pCue; + FACTWave *pWave; + uint16_t cueIndex; + uint16_t waveIndex; + void* pvContext; +} FACTNotificationDescription; + +typedef struct FACTNotificationCue +{ + uint16_t cueIndex; + FACTSoundBank *pSoundBank; + FACTCue *pCue; +} FACTNotificationCue; + +typedef struct FACTNotificationMarker +{ + uint16_t cueIndex; + FACTSoundBank *pSoundBank; + FACTCue *pCue; + uint32_t marker; +} FACTNotificationMarker; + +typedef struct FACTNotificationSoundBank +{ + FACTSoundBank *pSoundBank; +} FACTNotificationSoundBank; + +typedef struct FACTNotificationWaveBank +{ + FACTWaveBank *pWaveBank; +} FACTNotificationWaveBank; + +typedef struct FACTNotificationVariable +{ + uint16_t cueIndex; + FACTSoundBank *pSoundBank; + FACTCue *pCue; + uint16_t variableIndex; + float variableValue; + int32_t local; +} FACTNotificationVariable; + +typedef struct FACTNotificationGUI +{ + uint32_t reserved; +} FACTNotificationGUI; + +typedef struct FACTNotificationWave +{ + FACTWaveBank *pWaveBank; + uint16_t waveIndex; + uint16_t cueIndex; + FACTSoundBank *pSoundBank; + FACTCue *pCue; + FACTWave *pWave; +} FACTNotificationWave; + +struct FACTNotification +{ + uint8_t type; + int32_t timeStamp; + void *pvContext; + FAUDIONAMELESS union + { + FACTNotificationCue cue; + FACTNotificationMarker marker; + FACTNotificationSoundBank soundBank; + FACTNotificationWaveBank waveBank; + FACTNotificationVariable variable; + FACTNotificationGUI gui; + FACTNotificationWave wave; + }; +}; + +#pragma pack(pop) + +/* Constants */ + +#define FACT_CONTENT_VERSION 46 + +static const uint32_t FACT_FLAG_MANAGEDATA = 0x00000001; + +static const uint32_t FACT_FLAG_STOP_RELEASE = 0x00000000; +static const uint32_t FACT_FLAG_STOP_IMMEDIATE = 0x00000001; + +static const uint32_t FACT_FLAG_BACKGROUND_MUSIC = 0x00000002; +static const uint32_t FACT_FLAG_UNITS_MS = 0x00000004; +static const uint32_t FACT_FLAG_UNITS_SAMPLES = 0x00000008; + +static const uint32_t FACT_STATE_CREATED = 0x00000001; +static const uint32_t FACT_STATE_PREPARING = 0x00000002; +static const uint32_t FACT_STATE_PREPARED = 0x00000004; +static const uint32_t FACT_STATE_PLAYING = 0x00000008; +static const uint32_t FACT_STATE_STOPPING = 0x00000010; +static const uint32_t FACT_STATE_STOPPED = 0x00000020; +static const uint32_t FACT_STATE_PAUSED = 0x00000040; +static const uint32_t FACT_STATE_INUSE = 0x00000080; +static const uint32_t FACT_STATE_PREPAREFAILED = 0x80000000; + +static const int16_t FACTPITCH_MIN = -1200; +static const int16_t FACTPITCH_MAX = 1200; +static const int16_t FACTPITCH_MIN_TOTAL = -2400; +static const int16_t FACTPITCH_MAX_TOTAL = 2400; + +static const float FACTVOLUME_MIN = 0.0f; +static const float FACTVOLUME_MAX = 16777216.0f; + +static const uint16_t FACTINDEX_INVALID = 0xFFFF; +static const uint16_t FACTVARIABLEINDEX_INVALID = 0xFFFF; +static const uint16_t FACTCATEGORY_INVALID = 0xFFFF; + +static const uint8_t FACTNOTIFICATIONTYPE_CUEPREPARED = 1; +static const uint8_t FACTNOTIFICATIONTYPE_CUEPLAY = 2; +static const uint8_t FACTNOTIFICATIONTYPE_CUESTOP = 3; +static const uint8_t FACTNOTIFICATIONTYPE_CUEDESTROYED = 4; +static const uint8_t FACTNOTIFICATIONTYPE_MARKER = 5; +static const uint8_t FACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; +static const uint8_t FACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; +static const uint8_t FACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; +static const uint8_t FACTNOTIFICATIONTYPE_GUICONNECTED = 10; +static const uint8_t FACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEPREPARED = 12; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEPLAY = 13; +static const uint8_t FACTNOTIFICATIONTYPE_WAVESTOP = 14; +static const uint8_t FACTNOTIFICATIONTYPE_WAVELOOPED = 15; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; +static const uint8_t FACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; + +static const uint8_t FACT_FLAG_NOTIFICATION_PERSIST = 0x01; + +#define FACT_ENGINE_LOOKAHEAD_DEFAULT 250 + +#define FACT_MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7 +static const uint32_t aWMAAvgBytesPerSec[] = +{ + 12000, + 24000, + 4000, + 6000, + 8000, + 20000, + 2500 +}; + +#define FACT_MAX_WMA_BLOCK_ALIGN_ENTRIES 17 +static const uint32_t aWMABlockAlign[] = +{ + 929, + 1487, + 1280, + 2230, + 8917, + 8192, + 4459, + 5945, + 2304, + 1536, + 1485, + 1008, + 2731, + 4096, + 6827, + 5462, + 1280 +}; + +/* AudioEngine Interface */ + +FACTAPI uint32_t FACTCreateEngine( + uint32_t dwCreationFlags, + FACTAudioEngine **ppEngine +); + +/* See "extensions/CustomAllocatorEXT.txt" for more details. */ +FACTAPI uint32_t FACTCreateEngineWithCustomAllocatorEXT( + uint32_t dwCreationFlags, + FACTAudioEngine **ppEngine, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); + +FACTAPI uint32_t FACTAudioEngine_AddRef(FACTAudioEngine *pEngine); + +FACTAPI uint32_t FACTAudioEngine_Release(FACTAudioEngine *pEngine); + +/* FIXME: QueryInterface? Or just ignore COM garbage... -flibit */ + +FACTAPI uint32_t FACTAudioEngine_GetRendererCount( + FACTAudioEngine *pEngine, + uint16_t *pnRendererCount +); + +FACTAPI uint32_t FACTAudioEngine_GetRendererDetails( + FACTAudioEngine *pEngine, + uint16_t nRendererIndex, + FACTRendererDetails *pRendererDetails +); + +FACTAPI uint32_t FACTAudioEngine_GetFinalMixFormat( + FACTAudioEngine *pEngine, + FAudioWaveFormatExtensible *pFinalMixFormat +); + +FACTAPI uint32_t FACTAudioEngine_Initialize( + FACTAudioEngine *pEngine, + const FACTRuntimeParameters *pParams +); + +FACTAPI uint32_t FACTAudioEngine_ShutDown(FACTAudioEngine *pEngine); + +FACTAPI uint32_t FACTAudioEngine_DoWork(FACTAudioEngine *pEngine); + +FACTAPI uint32_t FACTAudioEngine_CreateSoundBank( + FACTAudioEngine *pEngine, + const void *pvBuffer, + uint32_t dwSize, + uint32_t dwFlags, + uint32_t dwAllocAttributes, + FACTSoundBank **ppSoundBank +); + +FACTAPI uint32_t FACTAudioEngine_CreateInMemoryWaveBank( + FACTAudioEngine *pEngine, + const void *pvBuffer, + uint32_t dwSize, + uint32_t dwFlags, + uint32_t dwAllocAttributes, + FACTWaveBank **ppWaveBank +); + +FACTAPI uint32_t FACTAudioEngine_CreateStreamingWaveBank( + FACTAudioEngine *pEngine, + const FACTStreamingParameters *pParms, + FACTWaveBank **ppWaveBank +); + +FACTAPI uint32_t FACTAudioEngine_PrepareWave( + FACTAudioEngine *pEngine, + uint32_t dwFlags, + const char *szWavePath, + uint32_t wStreamingPacketSize, + uint32_t dwAlignment, + uint32_t dwPlayOffset, + uint8_t nLoopCount, + FACTWave **ppWave +); + +FACTAPI uint32_t FACTAudioEngine_PrepareInMemoryWave( + FACTAudioEngine *pEngine, + uint32_t dwFlags, + FACTWaveBankEntry entry, + uint32_t *pdwSeekTable, /* Optional! */ + uint8_t *pbWaveData, + uint32_t dwPlayOffset, + uint8_t nLoopCount, + FACTWave **ppWave +); + +FACTAPI uint32_t FACTAudioEngine_PrepareStreamingWave( + FACTAudioEngine *pEngine, + uint32_t dwFlags, + FACTWaveBankEntry entry, + FACTStreamingParameters streamingParams, + uint32_t dwAlignment, + uint32_t *pdwSeekTable, /* Optional! */ + uint8_t *pbWaveData, /* ABI bug, do not use! */ + uint32_t dwPlayOffset, + uint8_t nLoopCount, + FACTWave **ppWave +); + +FACTAPI uint32_t FACTAudioEngine_RegisterNotification( + FACTAudioEngine *pEngine, + const FACTNotificationDescription *pNotificationDescription +); + +FACTAPI uint32_t FACTAudioEngine_UnRegisterNotification( + FACTAudioEngine *pEngine, + const FACTNotificationDescription *pNotificationDescription +); + +FACTAPI uint16_t FACTAudioEngine_GetCategory( + FACTAudioEngine *pEngine, + const char *szFriendlyName +); + +FACTAPI uint32_t FACTAudioEngine_Stop( + FACTAudioEngine *pEngine, + uint16_t nCategory, + uint32_t dwFlags +); + +FACTAPI uint32_t FACTAudioEngine_SetVolume( + FACTAudioEngine *pEngine, + uint16_t nCategory, + float volume +); + +FACTAPI uint32_t FACTAudioEngine_Pause( + FACTAudioEngine *pEngine, + uint16_t nCategory, + int32_t fPause +); + +FACTAPI uint16_t FACTAudioEngine_GetGlobalVariableIndex( + FACTAudioEngine *pEngine, + const char *szFriendlyName +); + +FACTAPI uint32_t FACTAudioEngine_SetGlobalVariable( + FACTAudioEngine *pEngine, + uint16_t nIndex, + float nValue +); + +FACTAPI uint32_t FACTAudioEngine_GetGlobalVariable( + FACTAudioEngine *pEngine, + uint16_t nIndex, + float *pnValue +); + +/* SoundBank Interface */ + +FACTAPI uint16_t FACTSoundBank_GetCueIndex( + FACTSoundBank *pSoundBank, + const char *szFriendlyName +); + +FACTAPI uint32_t FACTSoundBank_GetNumCues( + FACTSoundBank *pSoundBank, + uint16_t *pnNumCues +); + +FACTAPI uint32_t FACTSoundBank_GetCueProperties( + FACTSoundBank *pSoundBank, + uint16_t nCueIndex, + FACTCueProperties *pProperties +); + +FACTAPI uint32_t FACTSoundBank_Prepare( + FACTSoundBank *pSoundBank, + uint16_t nCueIndex, + uint32_t dwFlags, + int32_t timeOffset, + FACTCue** ppCue +); + +FACTAPI uint32_t FACTSoundBank_Play( + FACTSoundBank *pSoundBank, + uint16_t nCueIndex, + uint32_t dwFlags, + int32_t timeOffset, + FACTCue** ppCue /* Optional! */ +); + +#ifndef F3DAUDIO_DSP_SETTINGS_DECL +#define F3DAUDIO_DSP_SETTINGS_DECL +typedef struct F3DAUDIO_DSP_SETTINGS F3DAUDIO_DSP_SETTINGS; +#endif /* F3DAUDIO_DSP_SETTINGS_DECL */ + +FACTAPI uint32_t FACTSoundBank_Play3D( + FACTSoundBank *pSoundBank, + uint16_t nCueIndex, + uint32_t dwFlags, + int32_t timeOffset, + F3DAUDIO_DSP_SETTINGS *pDSPSettings, + FACTCue** ppCue /* Optional! */ +); + +FACTAPI uint32_t FACTSoundBank_Stop( + FACTSoundBank *pSoundBank, + uint16_t nCueIndex, + uint32_t dwFlags +); + +FACTAPI uint32_t FACTSoundBank_Destroy(FACTSoundBank *pSoundBank); + +FACTAPI uint32_t FACTSoundBank_GetState( + FACTSoundBank *pSoundBank, + uint32_t *pdwState +); + +/* WaveBank Interface */ + +FACTAPI uint32_t FACTWaveBank_Destroy(FACTWaveBank *pWaveBank); + +FACTAPI uint32_t FACTWaveBank_GetState( + FACTWaveBank *pWaveBank, + uint32_t *pdwState +); + +FACTAPI uint32_t FACTWaveBank_GetNumWaves( + FACTWaveBank *pWaveBank, + uint16_t *pnNumWaves +); + +FACTAPI uint16_t FACTWaveBank_GetWaveIndex( + FACTWaveBank *pWaveBank, + const char *szFriendlyName +); + +FACTAPI uint32_t FACTWaveBank_GetWaveProperties( + FACTWaveBank *pWaveBank, + uint16_t nWaveIndex, + FACTWaveProperties *pWaveProperties +); + +FACTAPI uint32_t FACTWaveBank_Prepare( + FACTWaveBank *pWaveBank, + uint16_t nWaveIndex, + uint32_t dwFlags, + uint32_t dwPlayOffset, + uint8_t nLoopCount, + FACTWave **ppWave +); + +FACTAPI uint32_t FACTWaveBank_Play( + FACTWaveBank *pWaveBank, + uint16_t nWaveIndex, + uint32_t dwFlags, + uint32_t dwPlayOffset, + uint8_t nLoopCount, + FACTWave **ppWave +); + +FACTAPI uint32_t FACTWaveBank_Stop( + FACTWaveBank *pWaveBank, + uint16_t nWaveIndex, + uint32_t dwFlags +); + +/* Wave Interface */ + +FACTAPI uint32_t FACTWave_Destroy(FACTWave *pWave); + +FACTAPI uint32_t FACTWave_Play(FACTWave *pWave); + +FACTAPI uint32_t FACTWave_Stop(FACTWave *pWave, uint32_t dwFlags); + +FACTAPI uint32_t FACTWave_Pause(FACTWave *pWave, int32_t fPause); + +FACTAPI uint32_t FACTWave_GetState(FACTWave *pWave, uint32_t *pdwState); + +FACTAPI uint32_t FACTWave_SetPitch(FACTWave *pWave, int16_t pitch); + +FACTAPI uint32_t FACTWave_SetVolume(FACTWave *pWave, float volume); + +FACTAPI uint32_t FACTWave_SetMatrixCoefficients( + FACTWave *pWave, + uint32_t uSrcChannelCount, + uint32_t uDstChannelCount, + float *pMatrixCoefficients +); + +FACTAPI uint32_t FACTWave_GetProperties( + FACTWave *pWave, + FACTWaveInstanceProperties *pProperties +); + +/* Cue Interface */ + +FACTAPI uint32_t FACTCue_Destroy(FACTCue *pCue); + +FACTAPI uint32_t FACTCue_Play(FACTCue *pCue); + +FACTAPI uint32_t FACTCue_Stop(FACTCue *pCue, uint32_t dwFlags); + +FACTAPI uint32_t FACTCue_GetState(FACTCue *pCue, uint32_t *pdwState); + +FACTAPI uint32_t FACTCue_SetMatrixCoefficients( + FACTCue *pCue, + uint32_t uSrcChannelCount, + uint32_t uDstChannelCount, + float *pMatrixCoefficients +); + +FACTAPI uint16_t FACTCue_GetVariableIndex( + FACTCue *pCue, + const char *szFriendlyName +); + +FACTAPI uint32_t FACTCue_SetVariable( + FACTCue *pCue, + uint16_t nIndex, + float nValue +); + +FACTAPI uint32_t FACTCue_GetVariable( + FACTCue *pCue, + uint16_t nIndex, + float *nValue +); + +FACTAPI uint32_t FACTCue_Pause(FACTCue *pCue, int32_t fPause); + +FACTAPI uint32_t FACTCue_GetProperties( + FACTCue *pCue, + FACTCueInstanceProperties **ppProperties +); + +FACTAPI uint32_t FACTCue_SetOutputVoices( + FACTCue *pCue, + const FAudioVoiceSends *pSendList /* Optional! */ +); + +FACTAPI uint32_t FACTCue_SetOutputVoiceMatrix( + FACTCue *pCue, + const FAudioVoice *pDestinationVoice, /* Optional! */ + uint32_t SourceChannels, + uint32_t DestinationChannels, + const float *pLevelMatrix /* SourceChannels * DestinationChannels */ +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FACT_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FACT3D.h b/dlls/xaudio2_7/FAudio/FACT3D.h new file mode 100644 index 00000000000..6ac02a82986 --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FACT3D.h @@ -0,0 +1,127 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since you are expected to already know how + * XACT works if you are still using these APIs! + */ + +#ifndef FACT3D_H +#define FACT3D_H + +#include "F3DAudio.h" +#include "FACT.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Constants */ + +#define LEFT_AZIMUTH (3.0f * F3DAUDIO_PI / 2.0f) +#define RIGHT_AZIMUTH (F3DAUDIO_PI / 2.0f) +#define FRONT_LEFT_AZIMUTH (7.0f * F3DAUDIO_PI / 4.0f) +#define FRONT_RIGHT_AZIMUTH (F3DAUDIO_PI / 4.0f) +#define FRONT_CENTER_AZIMUTH 0.0f +#define LOW_FREQUENCY_AZIMUTH F3DAUDIO_2PI +#define BACK_LEFT_AZIMUTH (5.0f * F3DAUDIO_PI / 4.0f) +#define BACK_RIGHT_AZIMUTH (3.0f * F3DAUDIO_PI / 4.0f) +#define BACK_CENTER_AZIMUTH F3DAUDIO_PI +#define FRONT_LEFT_OF_CENTER_AZIMUTH (15.0f * F3DAUDIO_PI / 8.0f) +#define FRONT_RIGHT_OF_CENTER_AZIMUTH (F3DAUDIO_PI / 8.0f) + +static const float aStereoLayout[] = +{ + LEFT_AZIMUTH, + RIGHT_AZIMUTH +}; +static const float a2Point1Layout[] = +{ + LEFT_AZIMUTH, + RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH +}; +static const float aQuadLayout[] = +{ + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH +}; +static const float a4Point1Layout[] = +{ + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH +}; +static const float a5Point1Layout[] = +{ + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH +}; +static const float a7Point1Layout[] = +{ + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH, + LEFT_AZIMUTH, + RIGHT_AZIMUTH +}; + +/* Functions */ + +FACTAPI uint32_t FACT3DInitialize( + FACTAudioEngine *pEngine, + F3DAUDIO_HANDLE F3DInstance +); + +FACTAPI uint32_t FACT3DCalculate( + F3DAUDIO_HANDLE F3DInstance, + const F3DAUDIO_LISTENER *pListener, + F3DAUDIO_EMITTER *pEmitter, + F3DAUDIO_DSP_SETTINGS *pDSPSettings +); + +FACTAPI uint32_t FACT3DApply( + F3DAUDIO_DSP_SETTINGS *pDSPSettings, + FACTCue *pCue +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FACT3D_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FAPO.h b/dlls/xaudio2_7/FAudio/FAPO.h new file mode 100644 index 00000000000..0609770047f --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FAPO.h @@ -0,0 +1,207 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since the MSDN docs are still perfectly fine: + * https://docs.microsoft.com/en-us/windows/desktop/api/xapo/ + * + * Of course, the APIs aren't exactly the same since XAPO is super dependent on + * C++. Instead, we use a struct full of functions to mimic a vtable. + * + * The only serious difference is that our FAPO (yes, really) always has the + * Get/SetParameters function pointers, for simplicity. You can ignore these if + * your effect does not have parameters, as they will never get called unless + * it is explicitly requested by the application. + */ + +#ifndef FAPO_H +#define FAPO_H + +#include "FAudio.h" + +#define FAPOAPI FAUDIOAPI +#define FAPOCALL FAUDIOCALL + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Enumerations */ + +typedef enum FAPOBufferFlags +{ + FAPO_BUFFER_SILENT, + FAPO_BUFFER_VALID +} FAPOBufferFlags; + +/* Structures */ + +#pragma pack(push, 1) + +typedef struct FAPORegistrationProperties +{ + FAudioGUID clsid; + int16_t FriendlyName[256]; /* Win32 wchar_t */ + int16_t CopyrightInfo[256]; /* Win32 wchar_t */ + uint32_t MajorVersion; + uint32_t MinorVersion; + uint32_t Flags; + uint32_t MinInputBufferCount; + uint32_t MaxInputBufferCount; + uint32_t MinOutputBufferCount; + uint32_t MaxOutputBufferCount; +} FAPORegistrationProperties; + +typedef struct FAPOLockForProcessBufferParameters +{ + const FAudioWaveFormatEx *pFormat; + uint32_t MaxFrameCount; +} FAPOLockForProcessBufferParameters; + +typedef struct FAPOProcessBufferParameters +{ + void* pBuffer; + FAPOBufferFlags BufferFlags; + uint32_t ValidFrameCount; +} FAPOProcessBufferParameters; + +#pragma pack(pop) + +/* Constants */ + +#define FAPO_MIN_CHANNELS 1 +#define FAPO_MAX_CHANNELS 64 + +#define FAPO_MIN_FRAMERATE 1000 +#define FAPO_MAX_FRAMERATE 200000 + +#define FAPO_REGISTRATION_STRING_LENGTH 256 + +#define FAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001 +#define FAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002 +#define FAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004 +#define FAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008 +#define FAPO_FLAG_INPLACE_REQUIRED 0x00000020 +#define FAPO_FLAG_INPLACE_SUPPORTED 0x00000010 + +/* FAPO Interface */ + +#ifndef FAPO_DECL +#define FAPO_DECL +typedef struct FAPO FAPO; +#endif /* FAPO_DECL */ + +typedef int32_t (FAPOCALL * AddRefFunc)( + void *fapo +); +typedef int32_t (FAPOCALL * ReleaseFunc)( + void *fapo +); +typedef uint32_t (FAPOCALL * GetRegistrationPropertiesFunc)( + void* fapo, + FAPORegistrationProperties **ppRegistrationProperties +); +typedef uint32_t (FAPOCALL * IsInputFormatSupportedFunc)( + void* fapo, + const FAudioWaveFormatEx *pOutputFormat, + const FAudioWaveFormatEx *pRequestedInputFormat, + FAudioWaveFormatEx **ppSupportedInputFormat +); +typedef uint32_t (FAPOCALL * IsOutputFormatSupportedFunc)( + void* fapo, + const FAudioWaveFormatEx *pInputFormat, + const FAudioWaveFormatEx *pRequestedOutputFormat, + FAudioWaveFormatEx **ppSupportedOutputFormat +); +typedef uint32_t (FAPOCALL * InitializeFunc)( + void* fapo, + const void* pData, + uint32_t DataByteSize +); +typedef void (FAPOCALL * ResetFunc)( + void* fapo +); +typedef uint32_t (FAPOCALL * LockForProcessFunc)( + void* fapo, + uint32_t InputLockedParameterCount, + const FAPOLockForProcessBufferParameters *pInputLockedParameters, + uint32_t OutputLockedParameterCount, + const FAPOLockForProcessBufferParameters *pOutputLockedParameters +); +typedef void (FAPOCALL * UnlockForProcessFunc)( + void* fapo +); +typedef void (FAPOCALL * ProcessFunc)( + void* fapo, + uint32_t InputProcessParameterCount, + const FAPOProcessBufferParameters* pInputProcessParameters, + uint32_t OutputProcessParameterCount, + FAPOProcessBufferParameters* pOutputProcessParameters, + int32_t IsEnabled +); +typedef uint32_t (FAPOCALL * CalcInputFramesFunc)( + void* fapo, + uint32_t OutputFrameCount +); +typedef uint32_t (FAPOCALL * CalcOutputFramesFunc)( + void* fapo, + uint32_t InputFrameCount +); +typedef void (FAPOCALL * SetParametersFunc)( + void* fapo, + const void* pParameters, + uint32_t ParameterByteSize +); +typedef void (FAPOCALL * GetParametersFunc)( + void* fapo, + void* pParameters, + uint32_t ParameterByteSize +); + +struct FAPO +{ + AddRefFunc AddRef; + ReleaseFunc Release; + GetRegistrationPropertiesFunc GetRegistrationProperties; + IsInputFormatSupportedFunc IsInputFormatSupported; + IsOutputFormatSupportedFunc IsOutputFormatSupported; + InitializeFunc Initialize; + ResetFunc Reset; + LockForProcessFunc LockForProcess; + UnlockForProcessFunc UnlockForProcess; + ProcessFunc Process; + CalcInputFramesFunc CalcInputFrames; + CalcOutputFramesFunc CalcOutputFrames; + SetParametersFunc SetParameters; + GetParametersFunc GetParameters; +}; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FAPO_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FAPOBase.h b/dlls/xaudio2_7/FAudio/FAPOBase.h new file mode 100644 index 00000000000..c2fcdd2981c --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FAPOBase.h @@ -0,0 +1,264 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since the MSDN docs are still perfectly fine: + * https://docs.microsoft.com/en-us/windows/desktop/api/xapobase/ + * + * Of course, the APIs aren't exactly the same since XAPO is super dependent on + * C++. Instead, we use a struct full of functions to mimic a vtable. + * + * To mimic the CXAPOParametersBase experience, initialize the object like this: + * + * extern FAPORegistrationProperties MyFAPOProperties; + * extern int32_t producer; + * typedef struct MyFAPOParams + * { + * uint32_t something; + * } MyFAPOParams; + * typedef struct MyFAPO + * { + * FAPOBase base; + * uint32_t somethingElse; + * } MyFAPO; + * void MyFAPO_Free(void* fapo) + * { + * MyFAPO *mine = (MyFAPO*) fapo; + * mine->base.pFree(mine->base.m_pParameterBlocks); + * mine->base.pFree(fapo); + * } + * + * MyFAPO *result = (MyFAPO*) SDL_malloc(sizeof(MyFAPO)); + * uint8_t *params = (uint8_t*) SDL_malloc(sizeof(MyFAPOParams) * 3); + * CreateFAPOBase( + * &result->base, + * &MyFAPOProperties, + * params, + * sizeof(MyFAPOParams), + * producer + * ); + * result->base.base.Initialize = (InitializeFunc) MyFAPO_Initialize; + * result->base.base.Process = (ProcessFunc) MyFAPO_Process; + * result->base.Destructor = MyFAPO_Free; + */ + +#ifndef FAPOBASE_H +#define FAPOBASE_H + +#include "FAPO.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Constants */ + +#define FAPOBASE_DEFAULT_FORMAT_TAG FAUDIO_FORMAT_IEEE_FLOAT +#define FAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS FAPO_MIN_CHANNELS +#define FAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS FAPO_MAX_CHANNELS +#define FAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE FAPO_MIN_FRAMERATE +#define FAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE FAPO_MAX_FRAMERATE +#define FAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 + +#define FAPOBASE_DEFAULT_FLAG ( \ + FAPO_FLAG_CHANNELS_MUST_MATCH | \ + FAPO_FLAG_FRAMERATE_MUST_MATCH | \ + FAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | \ + FAPO_FLAG_BUFFERCOUNT_MUST_MATCH | \ + FAPO_FLAG_INPLACE_SUPPORTED \ +) + +#define FAPOBASE_DEFAULT_BUFFER_COUNT 1 + +/* FAPOBase Interface */ + +typedef struct FAPOBase FAPOBase; + +typedef void (FAPOCALL * OnSetParametersFunc)( + FAPOBase *fapo, + const void* parameters, + uint32_t parametersSize +); + +#pragma pack(push, 8) +struct FAPOBase +{ + /* Base Classes/Interfaces */ + FAPO base; + void (FAPOCALL *Destructor)(void*); + + /* Public Virtual Functions */ + OnSetParametersFunc OnSetParameters; + + /* Private Variables */ + const FAPORegistrationProperties *m_pRegistrationProperties; + void* m_pfnMatrixMixFunction; + float *m_pfl32MatrixCoefficients; + uint32_t m_nSrcFormatType; + uint8_t m_fIsScalarMatrix; + uint8_t m_fIsLocked; + uint8_t *m_pParameterBlocks; + uint8_t *m_pCurrentParameters; + uint8_t *m_pCurrentParametersInternal; + uint32_t m_uCurrentParametersIndex; + uint32_t m_uParameterBlockByteSize; + uint8_t m_fNewerResultsReady; + uint8_t m_fProducer; + + /* Protected Variables */ + int32_t m_lReferenceCount; /* LONG */ + + /* Allocator callbacks, NOT part of XAPOBase spec! */ + FAudioMallocFunc pMalloc; + FAudioFreeFunc pFree; + FAudioReallocFunc pRealloc; +}; +#pragma pack(pop) + +FAPOAPI void CreateFAPOBase( + FAPOBase *fapo, + const FAPORegistrationProperties *pRegistrationProperties, + uint8_t *pParameterBlocks, + uint32_t uParameterBlockByteSize, + uint8_t fProducer +); + +/* See "extensions/CustomAllocatorEXT.txt" for more information. */ +FAPOAPI void CreateFAPOBaseWithCustomAllocatorEXT( + FAPOBase *fapo, + const FAPORegistrationProperties *pRegistrationProperties, + uint8_t *pParameterBlocks, + uint32_t uParameterBlockByteSize, + uint8_t fProducer, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); + +FAPOAPI int32_t FAPOBase_AddRef(FAPOBase *fapo); + +FAPOAPI int32_t FAPOBase_Release(FAPOBase *fapo); + +FAPOAPI uint32_t FAPOBase_GetRegistrationProperties( + FAPOBase *fapo, + FAPORegistrationProperties **ppRegistrationProperties +); + +FAPOAPI uint32_t FAPOBase_IsInputFormatSupported( + FAPOBase *fapo, + const FAudioWaveFormatEx *pOutputFormat, + const FAudioWaveFormatEx *pRequestedInputFormat, + FAudioWaveFormatEx **ppSupportedInputFormat +); + +FAPOAPI uint32_t FAPOBase_IsOutputFormatSupported( + FAPOBase *fapo, + const FAudioWaveFormatEx *pInputFormat, + const FAudioWaveFormatEx *pRequestedOutputFormat, + FAudioWaveFormatEx **ppSupportedOutputFormat +); + +FAPOAPI uint32_t FAPOBase_Initialize( + FAPOBase *fapo, + const void* pData, + uint32_t DataByteSize +); + +FAPOAPI void FAPOBase_Reset(FAPOBase *fapo); + +FAPOAPI uint32_t FAPOBase_LockForProcess( + FAPOBase *fapo, + uint32_t InputLockedParameterCount, + const FAPOLockForProcessBufferParameters *pInputLockedParameters, + uint32_t OutputLockedParameterCount, + const FAPOLockForProcessBufferParameters *pOutputLockedParameters +); + +FAPOAPI void FAPOBase_UnlockForProcess(FAPOBase *fapo); + +FAPOAPI uint32_t FAPOBase_CalcInputFrames( + FAPOBase *fapo, + uint32_t OutputFrameCount +); + +FAPOAPI uint32_t FAPOBase_CalcOutputFrames( + FAPOBase *fapo, + uint32_t InputFrameCount +); + +FAPOAPI uint32_t FAPOBase_ValidateFormatDefault( + FAPOBase *fapo, + FAudioWaveFormatEx *pFormat, + uint8_t fOverwrite +); + +FAPOAPI uint32_t FAPOBase_ValidateFormatPair( + FAPOBase *fapo, + const FAudioWaveFormatEx *pSupportedFormat, + FAudioWaveFormatEx *pRequestedFormat, + uint8_t fOverwrite +); + +FAPOAPI void FAPOBase_ProcessThru( + FAPOBase *fapo, + void* pInputBuffer, + float *pOutputBuffer, + uint32_t FrameCount, + uint16_t InputChannelCount, + uint16_t OutputChannelCount, + uint8_t MixWithOutput +); + +FAPOAPI void FAPOBase_SetParameters( + FAPOBase *fapo, + const void* pParameters, + uint32_t ParameterByteSize +); + +FAPOAPI void FAPOBase_GetParameters( + FAPOBase *fapo, + void* pParameters, + uint32_t ParameterByteSize +); + +FAPOAPI void FAPOBase_OnSetParameters( + FAPOBase *fapo, + const void* parameters, + uint32_t parametersSize +); + +FAPOAPI uint8_t FAPOBase_ParametersChanged(FAPOBase *fapo); + +FAPOAPI uint8_t* FAPOBase_BeginProcess(FAPOBase *fapo); + +FAPOAPI void FAPOBase_EndProcess(FAPOBase *fapo); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FAPOBASE_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FAPOFX.h b/dlls/xaudio2_7/FAudio/FAPOFX.h new file mode 100644 index 00000000000..5aae441b2cc --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FAPOFX.h @@ -0,0 +1,178 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +#ifndef FAPOFX_H +#define FAPOFX_H + +#include "FAPO.h" + +#define FAPOFXAPI FAUDIOAPI + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* GUIDs */ + +/* "Legacy" GUIDs are from XAPOFX <= 1.5. They were removed in XAudio 2.8 and later. */ +extern const FAudioGUID FAPOFX_CLSID_FXEQ, FAPOFX_CLSID_FXEQ_LEGACY; +extern const FAudioGUID FAPOFX_CLSID_FXMasteringLimiter, FAPOFX_CLSID_FXMasteringLimiter_LEGACY; +extern const FAudioGUID FAPOFX_CLSID_FXReverb, FAPOFX_CLSID_FXReverb_LEGACY; +extern const FAudioGUID FAPOFX_CLSID_FXEcho, FAPOFX_CLSID_FXEcho_LEGACY; + +/* Structures */ + +#pragma pack(push, 1) + +/* See FAPOFXEQ_* constants below. + * FrequencyCenter is in Hz, Gain is amplitude ratio, Bandwidth is Q factor. + */ +typedef struct FAPOFXEQParameters +{ + float FrequencyCenter0; + float Gain0; + float Bandwidth0; + float FrequencyCenter1; + float Gain1; + float Bandwidth1; + float FrequencyCenter2; + float Gain2; + float Bandwidth2; + float FrequencyCenter3; + float Gain3; + float Bandwidth3; +} FAPOFXEQParameters; + +/* See FAPOFXMASTERINGLIMITER_* constants below. */ +typedef struct FAPOFXMasteringLimiterParameters +{ + uint32_t Release; /* In milliseconds */ + uint32_t Loudness; /* In... uh, MSDN doesn't actually say what. */ +} FAPOFXMasteringLimiterParameters; + +/* See FAPOFXREVERB_* constants below. + * Both parameters are arbitrary and should be treated subjectively. + */ +typedef struct FAPOFXReverbParameters +{ + float Diffusion; + float RoomSize; +} FAPOFXReverbParameters; + +/* See FAPOFXECHO_* constants below. */ +typedef struct FAPOFXEchoParameters +{ + float WetDryMix; /* Percentage of processed signal vs original */ + float Feedback; /* Percentage to feed back into input */ + float Delay; /* In milliseconds */ +} FAPOFXEchoParameters; + +#pragma pack(pop) + +/* Constants */ + +#define FAPOFXEQ_MIN_FRAMERATE 22000 +#define FAPOFXEQ_MAX_FRAMERATE 48000 + +#define FAPOFXEQ_MIN_FREQUENCY_CENTER 20.0f +#define FAPOFXEQ_MAX_FREQUENCY_CENTER 20000.0f +#define FAPOFXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f +#define FAPOFXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f +#define FAPOFXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f +#define FAPOFXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f + +#define FAPOFXEQ_MIN_GAIN 0.126f +#define FAPOFXEQ_MAX_GAIN 7.94f +#define FAPOFXEQ_DEFAULT_GAIN 1.0f + +#define FAPOFXEQ_MIN_BANDWIDTH 0.1f +#define FAPOFXEQ_MAX_BANDWIDTH 2.0f +#define FAPOFXEQ_DEFAULT_BANDWIDTH 1.0f + +#define FAPOFXMASTERINGLIMITER_MIN_RELEASE 1 +#define FAPOFXMASTERINGLIMITER_MAX_RELEASE 20 +#define FAPOFXMASTERINGLIMITER_DEFAULT_RELEASE 6 + +#define FAPOFXMASTERINGLIMITER_MIN_LOUDNESS 1 +#define FAPOFXMASTERINGLIMITER_MAX_LOUDNESS 1800 +#define FAPOFXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000 + +#define FAPOFXREVERB_MIN_DIFFUSION 0.0f +#define FAPOFXREVERB_MAX_DIFFUSION 1.0f +#define FAPOFXREVERB_DEFAULT_DIFFUSION 0.9f + +#define FAPOFXREVERB_MIN_ROOMSIZE 0.0001f +#define FAPOFXREVERB_MAX_ROOMSIZE 1.0f +#define FAPOFXREVERB_DEFAULT_ROOMSIZE 0.6f + +#define FAPOFXECHO_MIN_WETDRYMIX 0.0f +#define FAPOFXECHO_MAX_WETDRYMIX 1.0f +#define FAPOFXECHO_DEFAULT_WETDRYMIX 0.5f + +#define FAPOFXECHO_MIN_FEEDBACK 0.0f +#define FAPOFXECHO_MAX_FEEDBACK 1.0f +#define FAPOFXECHO_DEFAULT_FEEDBACK 0.5f + +#define FAPOFXECHO_MIN_DELAY 1.0f +#define FAPOFXECHO_MAX_DELAY 2000.0f +#define FAPOFXECHO_DEFAULT_DELAY 500.0f + +/* Functions */ + +/* Creates an effect from the pre-made FAPOFX effect library. + * + * clsid: A reference to one of the FAPOFX_CLSID_* GUIDs + * pEffect: Filled with the resulting FAPO object + * pInitData: Starting parameters, pass NULL to use the default values + * InitDataByteSize: Parameter struct size, pass 0 if pInitData is NULL + * + * Returns 0 on success. + */ +FAPOFXAPI uint32_t FAPOFX_CreateFX( + const FAudioGUID *clsid, + FAPO **pEffect, + const void *pInitData, + uint32_t InitDataByteSize +); + +/* See "extensions/CustomAllocatorEXT.txt" for more details. */ +FAPOFXAPI uint32_t FAPOFX_CreateFXWithCustomAllocatorEXT( + const FAudioGUID *clsid, + FAPO **pEffect, + const void *pInitData, + uint32_t InitDataByteSize, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FAPOFX_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FAudio.h b/dlls/xaudio2_7/FAudio/FAudio.h new file mode 100644 index 00000000000..96f07d892f2 --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FAudio.h @@ -0,0 +1,1322 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +#ifndef FAUDIO_H +#define FAUDIO_H + +#ifdef _WIN32 +#define FAUDIOAPI __declspec(dllexport) +#define FAUDIOCALL __cdecl +#else +#define FAUDIOAPI +#define FAUDIOCALL +#endif + +#ifdef _MSC_VER +#define FAUDIODEPRECATED(msg) __declspec(deprecated(msg)) +#else +#define FAUDIODEPRECATED(msg) __attribute__((deprecated(msg))) +#endif + +/* -Wpedantic nameless union/struct silencing */ +#ifndef FAUDIONAMELESS +#ifdef __GNUC__ +#define FAUDIONAMELESS __extension__ +#else +#define FAUDIONAMELESS +#endif /* __GNUC__ */ +#endif /* FAUDIONAMELESS */ + +#include <stdint.h> +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct FAudio FAudio; +typedef struct FAudioVoice FAudioVoice; +typedef FAudioVoice FAudioSourceVoice; +typedef FAudioVoice FAudioSubmixVoice; +typedef FAudioVoice FAudioMasteringVoice; +typedef struct FAudioEngineCallback FAudioEngineCallback; +typedef struct FAudioVoiceCallback FAudioVoiceCallback; + +/* Enumerations */ + +typedef enum FAudioDeviceRole +{ + FAudioNotDefaultDevice = 0x0, + FAudioDefaultConsoleDevice = 0x1, + FAudioDefaultMultimediaDevice = 0x2, + FAudioDefaultCommunicationsDevice = 0x4, + FAudioDefaultGameDevice = 0x8, + FAudioGlobalDefaultDevice = 0xF, + FAudioInvalidDeviceRole = ~FAudioGlobalDefaultDevice +} FAudioDeviceRole; + +typedef enum FAudioFilterType +{ + FAudioLowPassFilter, + FAudioBandPassFilter, + FAudioHighPassFilter, + FAudioNotchFilter +} FAudioFilterType; + +typedef enum FAudioStreamCategory +{ + FAudioStreamCategory_Other, + FAudioStreamCategory_ForegroundOnlyMedia, + FAudioStreamCategory_BackgroundCapableMedia, + FAudioStreamCategory_Communications, + FAudioStreamCategory_Alerts, + FAudioStreamCategory_SoundEffects, + FAudioStreamCategory_GameEffects, + FAudioStreamCategory_GameMedia, + FAudioStreamCategory_GameChat, + FAudioStreamCategory_Speech, + FAudioStreamCategory_Movie, + FAudioStreamCategory_Media +} FAudioStreamCategory; + +/* FIXME: The original enum violates ISO C and is platform specific anyway... */ +typedef uint32_t FAudioProcessor; +#define FAUDIO_DEFAULT_PROCESSOR 0xFFFFFFFF + +/* Structures */ + +#pragma pack(push, 1) + +typedef struct FAudioGUID +{ + uint32_t Data1; + uint16_t Data2; + uint16_t Data3; + uint8_t Data4[8]; +} FAudioGUID; + +/* See MSDN: + * https://msdn.microsoft.com/en-us/library/windows/desktop/dd390970%28v=vs.85%... + */ +typedef struct FAudioWaveFormatEx +{ + uint16_t wFormatTag; + uint16_t nChannels; + uint32_t nSamplesPerSec; + uint32_t nAvgBytesPerSec; + uint16_t nBlockAlign; + uint16_t wBitsPerSample; + uint16_t cbSize; +} FAudioWaveFormatEx; + +/* See MSDN: + * https://msdn.microsoft.com/en-us/library/windows/desktop/dd390971(v=vs.85).a... + */ +typedef struct FAudioWaveFormatExtensible +{ + FAudioWaveFormatEx Format; + union + { + uint16_t wValidBitsPerSample; + uint16_t wSamplesPerBlock; + uint16_t wReserved; + } Samples; + uint32_t dwChannelMask; + FAudioGUID SubFormat; +} FAudioWaveFormatExtensible; + +typedef struct FAudioADPCMCoefSet +{ + int16_t iCoef1; + int16_t iCoef2; +} FAudioADPCMCoefSet; + +typedef struct FAudioADPCMWaveFormat +{ + FAudioWaveFormatEx wfx; + uint16_t wSamplesPerBlock; + uint16_t wNumCoef; + + /* MSVC warns on empty arrays in structs */ + #ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable: 4200) + #endif + + FAudioADPCMCoefSet aCoef[]; + /* MSADPCM has 7 coefficient pairs: + * { + * { 256, 0 }, + * { 512, -256 }, + * { 0, 0 }, + * { 192, 64 }, + * { 240, 0 }, + * { 460, -208 }, + * { 392, -232 } + * } + */ + + #ifdef _MSC_VER + #pragma warning(pop) + #endif +} FAudioADPCMWaveFormat; + +typedef struct FAudioDeviceDetails +{ + int16_t DeviceID[256]; /* Win32 wchar_t */ + int16_t DisplayName[256]; /* Win32 wchar_t */ + FAudioDeviceRole Role; + FAudioWaveFormatExtensible OutputFormat; +} FAudioDeviceDetails; + +typedef struct FAudioVoiceDetails +{ + uint32_t CreationFlags; + uint32_t ActiveFlags; + uint32_t InputChannels; + uint32_t InputSampleRate; +} FAudioVoiceDetails; + +typedef struct FAudioSendDescriptor +{ + uint32_t Flags; /* 0 or FAUDIO_SEND_USEFILTER */ + FAudioVoice *pOutputVoice; +} FAudioSendDescriptor; + +typedef struct FAudioVoiceSends +{ + uint32_t SendCount; + FAudioSendDescriptor *pSends; +} FAudioVoiceSends; + +#ifndef FAPO_DECL +#define FAPO_DECL +typedef struct FAPO FAPO; +#endif /* FAPO_DECL */ + +typedef struct FAudioEffectDescriptor +{ + FAPO *pEffect; + int32_t InitialState; /* 1 - Enabled, 0 - Disabled */ + uint32_t OutputChannels; +} FAudioEffectDescriptor; + +typedef struct FAudioEffectChain +{ + uint32_t EffectCount; + FAudioEffectDescriptor *pEffectDescriptors; +} FAudioEffectChain; + +typedef struct FAudioFilterParameters +{ + FAudioFilterType Type; + float Frequency; /* [0, FAUDIO_MAX_FILTER_FREQUENCY] */ + float OneOverQ; /* [0, FAUDIO_MAX_FILTER_ONEOVERQ] */ +} FAudioFilterParameters; + +typedef struct FAudioBuffer +{ + /* Either 0 or FAUDIO_END_OF_STREAM */ + uint32_t Flags; + /* Pointer to wave data, memory block size. + * Note that pAudioData is not copied; FAudio reads directly from your + * pointer! This pointer must be valid until FAudio has finished using + * it, at which point an OnBufferEnd callback will be generated. + */ + uint32_t AudioBytes; + const uint8_t *pAudioData; + /* Play region, in sample frames. */ + uint32_t PlayBegin; + uint32_t PlayLength; + /* Loop region, in sample frames. + * This can be used to loop a subregion of the wave instead of looping + * the whole thing, i.e. if you have an intro/outro you can set these + * to loop the middle sections instead. If you don't need this, set both + * values to 0. + */ + uint32_t LoopBegin; + uint32_t LoopLength; + /* [0, FAUDIO_LOOP_INFINITE] */ + uint32_t LoopCount; + /* This is sent to callbacks as pBufferContext */ + void *pContext; +} FAudioBuffer; + +typedef struct FAudioBufferWMA +{ + const uint32_t *pDecodedPacketCumulativeBytes; + uint32_t PacketCount; +} FAudioBufferWMA; + +typedef struct FAudioVoiceState +{ + void *pCurrentBufferContext; + uint32_t BuffersQueued; + uint64_t SamplesPlayed; +} FAudioVoiceState; + +typedef struct FAudioPerformanceData +{ + uint64_t AudioCyclesSinceLastQuery; + uint64_t TotalCyclesSinceLastQuery; + uint32_t MinimumCyclesPerQuantum; + uint32_t MaximumCyclesPerQuantum; + uint32_t MemoryUsageInBytes; + uint32_t CurrentLatencyInSamples; + uint32_t GlitchesSinceEngineStarted; + uint32_t ActiveSourceVoiceCount; + uint32_t TotalSourceVoiceCount; + uint32_t ActiveSubmixVoiceCount; + uint32_t ActiveResamplerCount; + uint32_t ActiveMatrixMixCount; + uint32_t ActiveXmaSourceVoices; + uint32_t ActiveXmaStreams; +} FAudioPerformanceData; + +typedef struct FAudioDebugConfiguration +{ + /* See FAUDIO_LOG_* */ + uint32_t TraceMask; + uint32_t BreakMask; + /* 0 or 1 */ + int32_t LogThreadID; + int32_t LogFileline; + int32_t LogFunctionName; + int32_t LogTiming; +} FAudioDebugConfiguration; + +#pragma pack(pop) + +/* This ISN'T packed. Strictly speaking it wouldn't have mattered anyway but eh. + * See https://github.com/microsoft/DirectXTK/issues/256 + */ +typedef struct FAudioXMA2WaveFormatEx +{ + FAudioWaveFormatEx wfx; + uint16_t wNumStreams; + uint32_t dwChannelMask; + uint32_t dwSamplesEncoded; + uint32_t dwBytesPerBlock; + uint32_t dwPlayBegin; + uint32_t dwPlayLength; + uint32_t dwLoopBegin; + uint32_t dwLoopLength; + uint8_t bLoopCount; + uint8_t bEncoderVersion; + uint16_t wBlockCount; +} FAudioXMA2WaveFormat; + +/* Constants */ + +#define FAUDIO_E_OUT_OF_MEMORY 0x8007000e +#define FAUDIO_E_INVALID_ARG 0x80070057 +#define FAUDIO_E_UNSUPPORTED_FORMAT 0x88890008 +#define FAUDIO_E_INVALID_CALL 0x88960001 +#define FAUDIO_E_DEVICE_INVALIDATED 0x88960004 +#define FAPO_E_FORMAT_UNSUPPORTED 0x88970001 + +#define FAUDIO_MAX_BUFFER_BYTES 0x80000000 +#define FAUDIO_MAX_QUEUED_BUFFERS 64 +#define FAUDIO_MAX_AUDIO_CHANNELS 64 +#define FAUDIO_MIN_SAMPLE_RATE 1000 +#define FAUDIO_MAX_SAMPLE_RATE 200000 +#define FAUDIO_MAX_VOLUME_LEVEL 16777216.0f +#define FAUDIO_MIN_FREQ_RATIO (1.0f / 1024.0f) +#define FAUDIO_MAX_FREQ_RATIO 1024.0f +#define FAUDIO_DEFAULT_FREQ_RATIO 2.0f +#define FAUDIO_MAX_FILTER_ONEOVERQ 1.5f +#define FAUDIO_MAX_FILTER_FREQUENCY 1.0f +#define FAUDIO_MAX_LOOP_COUNT 254 + +#define FAUDIO_COMMIT_NOW 0 +#define FAUDIO_COMMIT_ALL 0 +#define FAUDIO_INVALID_OPSET (uint32_t) (-1) +#define FAUDIO_NO_LOOP_REGION 0 +#define FAUDIO_LOOP_INFINITE 255 +#define FAUDIO_DEFAULT_CHANNELS 0 +#define FAUDIO_DEFAULT_SAMPLERATE 0 + +#define FAUDIO_DEBUG_ENGINE 0x0001 +#define FAUDIO_VOICE_NOPITCH 0x0002 +#define FAUDIO_VOICE_NOSRC 0x0004 +#define FAUDIO_VOICE_USEFILTER 0x0008 +#define FAUDIO_VOICE_MUSIC 0x0010 +#define FAUDIO_PLAY_TAILS 0x0020 +#define FAUDIO_END_OF_STREAM 0x0040 +#define FAUDIO_SEND_USEFILTER 0x0080 +#define FAUDIO_VOICE_NOSAMPLESPLAYED 0x0100 +#define FAUDIO_1024_QUANTUM 0x8000 + +#define FAUDIO_DEFAULT_FILTER_TYPE FAudioLowPassFilter +#define FAUDIO_DEFAULT_FILTER_FREQUENCY FAUDIO_MAX_FILTER_FREQUENCY +#define FAUDIO_DEFAULT_FILTER_ONEOVERQ 1.0f + +#define FAUDIO_LOG_ERRORS 0x0001 +#define FAUDIO_LOG_WARNINGS 0x0002 +#define FAUDIO_LOG_INFO 0x0004 +#define FAUDIO_LOG_DETAIL 0x0008 +#define FAUDIO_LOG_API_CALLS 0x0010 +#define FAUDIO_LOG_FUNC_CALLS 0x0020 +#define FAUDIO_LOG_TIMING 0x0040 +#define FAUDIO_LOG_LOCKS 0x0080 +#define FAUDIO_LOG_MEMORY 0x0100 +#define FAUDIO_LOG_STREAMING 0x1000 + +#ifndef _SPEAKER_POSITIONS_ +#define SPEAKER_FRONT_LEFT 0x00000001 +#define SPEAKER_FRONT_RIGHT 0x00000002 +#define SPEAKER_FRONT_CENTER 0x00000004 +#define SPEAKER_LOW_FREQUENCY 0x00000008 +#define SPEAKER_BACK_LEFT 0x00000010 +#define SPEAKER_BACK_RIGHT 0x00000020 +#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 +#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 +#define SPEAKER_BACK_CENTER 0x00000100 +#define SPEAKER_SIDE_LEFT 0x00000200 +#define SPEAKER_SIDE_RIGHT 0x00000400 +#define SPEAKER_TOP_CENTER 0x00000800 +#define SPEAKER_TOP_FRONT_LEFT 0x00001000 +#define SPEAKER_TOP_FRONT_CENTER 0x00002000 +#define SPEAKER_TOP_FRONT_RIGHT 0x00004000 +#define SPEAKER_TOP_BACK_LEFT 0x00008000 +#define SPEAKER_TOP_BACK_CENTER 0x00010000 +#define SPEAKER_TOP_BACK_RIGHT 0x00020000 +#define _SPEAKER_POSITIONS_ +#endif + +#ifndef SPEAKER_MONO +#define SPEAKER_MONO SPEAKER_FRONT_CENTER +#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) +#define SPEAKER_2POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_LOW_FREQUENCY ) +#define SPEAKER_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_BACK_CENTER ) +#define SPEAKER_QUAD \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_4POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_5POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT ) +#define SPEAKER_7POINT1 \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT | \ + SPEAKER_FRONT_LEFT_OF_CENTER | \ + SPEAKER_FRONT_RIGHT_OF_CENTER ) +#define SPEAKER_5POINT1_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_SIDE_LEFT | \ + SPEAKER_SIDE_RIGHT ) +#define SPEAKER_7POINT1_SURROUND \ + ( SPEAKER_FRONT_LEFT | \ + SPEAKER_FRONT_RIGHT | \ + SPEAKER_FRONT_CENTER | \ + SPEAKER_LOW_FREQUENCY | \ + SPEAKER_BACK_LEFT | \ + SPEAKER_BACK_RIGHT | \ + SPEAKER_SIDE_LEFT | \ + SPEAKER_SIDE_RIGHT ) +#define SPEAKER_XBOX SPEAKER_5POINT1 +#endif + +#define FAUDIO_FORMAT_PCM 1 +#define FAUDIO_FORMAT_MSADPCM 2 +#define FAUDIO_FORMAT_IEEE_FLOAT 3 +#define FAUDIO_FORMAT_WMAUDIO2 0x0161 +#define FAUDIO_FORMAT_WMAUDIO3 0x0162 +#define FAUDIO_FORMAT_WMAUDIO_LOSSLESS 0x0163 +#define FAUDIO_FORMAT_XMAUDIO2 0x0166 +#define FAUDIO_FORMAT_EXTENSIBLE 0xFFFE + +extern FAudioGUID DATAFORMAT_SUBTYPE_PCM; +extern FAudioGUID DATAFORMAT_SUBTYPE_IEEE_FLOAT; + +/* FAudio Version API */ + +#define FAUDIO_TARGET_VERSION 8 /* Targeting compatibility with XAudio 2.8 */ + +#define FAUDIO_ABI_VERSION 0 +#define FAUDIO_MAJOR_VERSION 21 +#define FAUDIO_MINOR_VERSION 6 +#define FAUDIO_PATCH_VERSION 0 + +#define FAUDIO_COMPILED_VERSION ( \ + (FAUDIO_ABI_VERSION * 100 * 100 * 100) + \ + (FAUDIO_MAJOR_VERSION * 100 * 100) + \ + (FAUDIO_MINOR_VERSION * 100) + \ + (FAUDIO_PATCH_VERSION) \ +) + +FAUDIOAPI uint32_t FAudioLinkedVersion(void); + +/* FAudio Interface */ + +/* This should be your first FAudio call. + * + * ppFAudio: Filled with the FAudio core context. + * Flags: Can be 0 or FAUDIO_DEBUG_ENGINE. + * XAudio2Processor: Set this to FAUDIO_DEFAULT_PROCESSOR. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioCreate( + FAudio **ppFAudio, + uint32_t Flags, + FAudioProcessor XAudio2Processor +); + +/* See "extensions/COMConstructEXT.txt" for more details */ +FAUDIOAPI uint32_t FAudioCOMConstructEXT(FAudio **ppFAudio, uint8_t version); + +/* Increments a reference counter. When counter is 0, audio is freed. + * Returns the reference count after incrementing. + */ +FAUDIOAPI uint32_t FAudio_AddRef(FAudio *audio); + +/* Decrements a reference counter. When counter is 0, audio is freed. + * Returns the reference count after decrementing. + */ +FAUDIOAPI uint32_t FAudio_Release(FAudio *audio); + +/* Queries the number of sound devices available for use. + * + * pCount: Filled with the number of available sound devices. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_GetDeviceCount(FAudio *audio, uint32_t *pCount); + +/* Gets basic information about a sound device. + * + * Index: Can be between 0 and the result of GetDeviceCount. + * pDeviceDetails: Filled with the device information. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_GetDeviceDetails( + FAudio *audio, + uint32_t Index, + FAudioDeviceDetails *pDeviceDetails +); + +/* You don't actually have to call this, unless you're using the COM APIs. + * See the FAudioCreate API for parameter information. + */ +FAUDIOAPI uint32_t FAudio_Initialize( + FAudio *audio, + uint32_t Flags, + FAudioProcessor XAudio2Processor +); + +/* Register a new set of engine callbacks. + * There is no limit to the number of sets, but expect performance to degrade + * if you have a whole bunch of these. You most likely only need one. + * + * pCallback: The completely-initialized FAudioEngineCallback structure. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_RegisterForCallbacks( + FAudio *audio, + FAudioEngineCallback *pCallback +); + +/* Remove an active set of engine callbacks. + * This checks the pointer value, NOT the callback values! + * + * pCallback: An FAudioEngineCallback structure previously sent to Register. + * + * Returns 0 on success. + */ +FAUDIOAPI void FAudio_UnregisterForCallbacks( + FAudio *audio, + FAudioEngineCallback *pCallback +); + +/* Creates a "source" voice, used to play back wavedata. + * + * ppSourceVoice: Filled with the source voice pointer. + * pSourceFormat: The input wavedata format, see the documentation for + * FAudioWaveFormatEx. + * Flags: Can be 0 or a mix of the following FAUDIO_VOICE_* flags: + * NOPITCH/NOSRC: Resampling is disabled. If you set this, + * the source format sample rate MUST match + * the output voices' input sample rates. + * Also, SetFrequencyRatio will fail. + * USEFILTER: Enables the use of SetFilterParameters. + * MUSIC: Unsupported. + * MaxFrequencyRatio: AKA your max pitch. This allows us to optimize the size + * of the decode/resample cache sizes. For example, if you + * only expect to raise pitch by a single octave, you can + * set this value to 2.0f. 2.0f is the default value. + * Bounds: [FAUDIO_MIN_FREQ_RATIO, FAUDIO_MAX_FREQ_RATIO]. + * pCallback: Voice callbacks, see FAudioVoiceCallback documentation. + * pSendList: List of output voices. If NULL, defaults to master. + * All output voices must have the same sample rate! + * pEffectChain: List of FAPO effects. This value can be NULL. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_CreateSourceVoice( + FAudio *audio, + FAudioSourceVoice **ppSourceVoice, + const FAudioWaveFormatEx *pSourceFormat, + uint32_t Flags, + float MaxFrequencyRatio, + FAudioVoiceCallback *pCallback, + const FAudioVoiceSends *pSendList, + const FAudioEffectChain *pEffectChain +); + +/* Creates a "submix" voice, used to mix/process input voices. + * The typical use case for this is to perform CPU-intensive tasks on large + * groups of voices all at once. Examples include resampling and FAPO effects. + * + * ppSubmixVoice: Filled with the submix voice pointer. + * InputChannels: Input voices will convert to this channel count. + * InputSampleRate: Input voices will convert to this sample rate. + * Flags: Can be 0 or FAUDIO_VOICE_USEFILTER. + * ProcessingStage: If you have multiple submixes that depend on a specific + * order of processing, you can sort them by setting this + * value to prioritize them. For example, submixes with + * stage 0 will process first, then stage 1, 2, and so on. + * pSendList: List of output voices. If NULL, defaults to master. + * All output voices must have the same sample rate! + * pEffectChain: List of FAPO effects. This value can be NULL. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_CreateSubmixVoice( + FAudio *audio, + FAudioSubmixVoice **ppSubmixVoice, + uint32_t InputChannels, + uint32_t InputSampleRate, + uint32_t Flags, + uint32_t ProcessingStage, + const FAudioVoiceSends *pSendList, + const FAudioEffectChain *pEffectChain +); + +/* This should be your second FAudio call, unless you care about which device + * you want to use. In that case, see GetDeviceDetails. + * + * ppMasteringVoice: Filled with the mastering voice pointer. + * InputChannels: Device channel count. Can be FAUDIO_DEFAULT_CHANNELS. + * InputSampleRate: Device sample rate. Can be FAUDIO_DEFAULT_SAMPLERATE. + * Flags: This value must be 0. + * DeviceIndex: 0 for the default device. See GetDeviceCount. + * pEffectChain: List of FAPO effects. This value can be NULL. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_CreateMasteringVoice( + FAudio *audio, + FAudioMasteringVoice **ppMasteringVoice, + uint32_t InputChannels, + uint32_t InputSampleRate, + uint32_t Flags, + uint32_t DeviceIndex, + const FAudioEffectChain *pEffectChain +); + +/* This is the XAudio 2.8+ version of CreateMasteringVoice. + * Right now this doesn't do anything. Don't use this function. + */ +FAUDIOAPI uint32_t FAudio_CreateMasteringVoice8( + FAudio *audio, + FAudioMasteringVoice **ppMasteringVoice, + uint32_t InputChannels, + uint32_t InputSampleRate, + uint32_t Flags, + uint16_t *szDeviceId, + const FAudioEffectChain *pEffectChain, + FAudioStreamCategory StreamCategory +); + +/* Starts the engine, begins processing the audio graph. + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_StartEngine(FAudio *audio); + +/* Stops the engine and halts all processing. + * The audio device will continue to run, but will produce silence. + * The graph will be frozen until you call StartEngine, where it will then + * resume all processing exactly as it would have had this never been called. + */ +FAUDIOAPI void FAudio_StopEngine(FAudio *audio); + +/* Flushes a batch of FAudio calls compiled with a given "OperationSet" tag. + * This function is based on IXAudio2::CommitChanges from the XAudio2 spec. + * This is useful for pushing calls that need to be done perfectly in sync. For + * example, if you want to play two separate sources at the exact same time, you + * can call FAudioSourceVoice_Start with an OperationSet value of your choice, + * then call CommitChanges with that same value to start the sources together. + * + * OperationSet: Either a value known by you or FAUDIO_COMMIT_ALL + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudio_CommitOperationSet( + FAudio *audio, + uint32_t OperationSet +); + +/* DO NOT USE THIS FUNCTION OR I SWEAR TO GOD */ +FAUDIODEPRECATED("This function will break your program! Use FAudio_CommitOperationSet instead!") +FAUDIOAPI uint32_t FAudio_CommitChanges(FAudio *audio); + +/* Requests various bits of performance information from the engine. + * + * pPerfData: Filled with the data. See FAudioPerformanceData for details. + */ +FAUDIOAPI void FAudio_GetPerformanceData( + FAudio *audio, + FAudioPerformanceData *pPerfData +); + +/* When using a Debug binary, this lets you configure what information gets + * logged to output. Be careful, this can spit out a LOT of text. + * + * pDebugConfiguration: See FAudioDebugConfiguration for details. + * pReserved: Set this to NULL. + */ +FAUDIOAPI void FAudio_SetDebugConfiguration( + FAudio *audio, + FAudioDebugConfiguration *pDebugConfiguration, + void* pReserved +); + +/* Requests the values that determine's the engine's update size. + * For example, a 48KHz engine with a 1024-sample update period would return + * 1024 for the numerator and 48000 for the denominator. With this information, + * you can determine the precise update size in milliseconds. + * + * quantumNumerator - The engine's update size, in sample frames. + * quantumDenominator - The engine's sample rate, in Hz + */ +FAUDIOAPI void FAudio_GetProcessingQuantum( + FAudio *audio, + uint32_t *quantumNumerator, + uint32_t *quantumDenominator +); + +/* FAudioVoice Interface */ + +/* Requests basic information about a voice. + * + * pVoiceDetails: See FAudioVoiceDetails for details. + */ +FAUDIOAPI void FAudioVoice_GetVoiceDetails( + FAudioVoice *voice, + FAudioVoiceDetails *pVoiceDetails +); + +/* Change the output voices for this voice. + * This function is invalid for mastering voices. + * + * pSendList: List of output voices. If NULL, defaults to master. + * All output voices must have the same sample rate! + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetOutputVoices( + FAudioVoice *voice, + const FAudioVoiceSends *pSendList +); + +/* Change/Remove the effect chain for this voice. + * + * pEffectChain: List of FAPO effects. This value can be NULL. + * Note that the final channel counts for this chain MUST + * match the input/output channel count that was + * determined at voice creation time! + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetEffectChain( + FAudioVoice *voice, + const FAudioEffectChain *pEffectChain +); + +/* Enables an effect in the effect chain. + * + * EffectIndex: The index of the effect (based on the chain order). + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_EnableEffect( + FAudioVoice *voice, + uint32_t EffectIndex, + uint32_t OperationSet +); + +/* Disables an effect in the effect chain. + * + * EffectIndex: The index of the effect (based on the chain order). + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_DisableEffect( + FAudioVoice *voice, + uint32_t EffectIndex, + uint32_t OperationSet +); + +/* Queries the enabled/disabled state of an effect in the effect chain. + * + * EffectIndex: The index of the effect (based on the chain order). + * pEnabled: Filled with either 1 (Enabled) or 0 (Disabled). + * + * Returns 0 on success. + */ +FAUDIOAPI void FAudioVoice_GetEffectState( + FAudioVoice *voice, + uint32_t EffectIndex, + int32_t *pEnabled +); + +/* Submits a block of memory to be sent to FAPO::SetParameters. + * + * EffectIndex: The index of the effect (based on the chain order). + * pParameters: The values to be copied and submitted to the FAPO. + * ParametersByteSize: This should match what the FAPO expects! + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetEffectParameters( + FAudioVoice *voice, + uint32_t EffectIndex, + const void *pParameters, + uint32_t ParametersByteSize, + uint32_t OperationSet +); + +/* Requests the latest parameters from FAPO::GetParameters. + * + * EffectIndex: The index of the effect (based on the chain order). + * pParameters: Filled with the latest parameter values from the FAPO. + * ParametersByteSize: This should match what the FAPO expects! + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_GetEffectParameters( + FAudioVoice *voice, + uint32_t EffectIndex, + void *pParameters, + uint32_t ParametersByteSize +); + +/* Sets the filter variables for a voice. + * This is only valid on voices with the USEFILTER flag. + * + * pParameters: See FAudioFilterParameters for details. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetFilterParameters( + FAudioVoice *voice, + const FAudioFilterParameters *pParameters, + uint32_t OperationSet +); + +/* Requests the filter variables for a voice. + * This is only valid on voices with the USEFILTER flag. + * + * pParameters: See FAudioFilterParameters for details. + */ +FAUDIOAPI void FAudioVoice_GetFilterParameters( + FAudioVoice *voice, + FAudioFilterParameters *pParameters +); + +/* Sets the filter variables for a voice's output voice. + * This is only valid on sends with the USEFILTER flag. + * + * pDestinationVoice: An output voice from the voice's send list. + * pParameters: See FAudioFilterParameters for details. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetOutputFilterParameters( + FAudioVoice *voice, + FAudioVoice *pDestinationVoice, + const FAudioFilterParameters *pParameters, + uint32_t OperationSet +); + +/* Requests the filter variables for a voice's output voice. + * This is only valid on sends with the USEFILTER flag. + * + * pDestinationVoice: An output voice from the voice's send list. + * pParameters: See FAudioFilterParameters for details. + */ +FAUDIOAPI void FAudioVoice_GetOutputFilterParameters( + FAudioVoice *voice, + FAudioVoice *pDestinationVoice, + FAudioFilterParameters *pParameters +); + +/* Sets the global volume of a voice. + * + * Volume: Amplitude ratio. 1.0f is default, 0.0f is silence. + * Note that you can actually set volume < 0.0f! + * Bounds: [-FAUDIO_MAX_VOLUME_LEVEL, FAUDIO_MAX_VOLUME_LEVEL] + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetVolume( + FAudioVoice *voice, + float Volume, + uint32_t OperationSet +); + +/* Requests the global volume of a voice. + * + * pVolume: Filled with the current voice amplitude ratio. + */ +FAUDIOAPI void FAudioVoice_GetVolume( + FAudioVoice *voice, + float *pVolume +); + +/* Sets the per-channel volumes of a voice. + * + * Channels: Must match the channel count of this voice! + * pVolumes: Amplitude ratios for each channel. Same as SetVolume. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetChannelVolumes( + FAudioVoice *voice, + uint32_t Channels, + const float *pVolumes, + uint32_t OperationSet +); + +/* Requests the per-channel volumes of a voice. + * + * Channels: Must match the channel count of this voice! + * pVolumes: Filled with the current channel amplitude ratios. + */ +FAUDIOAPI void FAudioVoice_GetChannelVolumes( + FAudioVoice *voice, + uint32_t Channels, + float *pVolumes +); + +/* Sets the volumes of a send's output channels. The matrix is based on the + * voice's input channels. For example, the default matrix for a 2-channel + * source and a 2-channel output voice is as follows: + * [0] = 1.0f; <- Left input, left output + * [1] = 0.0f; <- Right input, left output + * [2] = 0.0f; <- Left input, right output + * [3] = 1.0f; <- Right input, right output + * This is typically only used for panning or 3D sound (via F3DAudio). + * + * pDestinationVoice: An output voice from the voice's send list. + * SourceChannels: Must match the voice's input channel count! + * DestinationChannels: Must match the destination's input channel count! + * pLevelMatrix: A float[SourceChannels * DestinationChannels]. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioVoice_SetOutputMatrix( + FAudioVoice *voice, + FAudioVoice *pDestinationVoice, + uint32_t SourceChannels, + uint32_t DestinationChannels, + const float *pLevelMatrix, + uint32_t OperationSet +); + +/* Gets the volumes of a send's output channels. See SetOutputMatrix. + * + * pDestinationVoice: An output voice from the voice's send list. + * SourceChannels: Must match the voice's input channel count! + * DestinationChannels: Must match the voice's output channel count! + * pLevelMatrix: A float[SourceChannels * DestinationChannels]. + */ +FAUDIOAPI void FAudioVoice_GetOutputMatrix( + FAudioVoice *voice, + FAudioVoice *pDestinationVoice, + uint32_t SourceChannels, + uint32_t DestinationChannels, + float *pLevelMatrix +); + +/* Removes this voice from the audio graph and frees memory. */ +FAUDIOAPI void FAudioVoice_DestroyVoice(FAudioVoice *voice); + +/* FAudioSourceVoice Interface */ + +/* Starts processing for a source voice. + * + * Flags: Must be 0. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_Start( + FAudioSourceVoice *voice, + uint32_t Flags, + uint32_t OperationSet +); + +/* Pauses processing for a source voice. Yes, I said pausing. + * If you want to _actually_ stop, call FlushSourceBuffers next. + * + * Flags: Can be 0 or FAUDIO_PLAY_TAILS, which allows effects to + * keep emitting output even after processing has stopped. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_Stop( + FAudioSourceVoice *voice, + uint32_t Flags, + uint32_t OperationSet +); + +/* Submits a block of wavedata for the source to process. + * + * pBuffer: See FAudioBuffer for details. + * pBufferWMA: See FAudioBufferWMA for details. (Also, don't use WMA.) + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_SubmitSourceBuffer( + FAudioSourceVoice *voice, + const FAudioBuffer *pBuffer, + const FAudioBufferWMA *pBufferWMA +); + +/* Removes all buffers from a source, with a minor exception. + * If the voice is still playing, the active buffer is left alone. + * All buffers that are removed will spawn an OnBufferEnd callback. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_FlushSourceBuffers( + FAudioSourceVoice *voice +); + +/* Takes the last buffer currently queued and sets the END_OF_STREAM flag. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_Discontinuity( + FAudioSourceVoice *voice +); + +/* Sets the loop count of the active buffer to 0. + * + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_ExitLoop( + FAudioSourceVoice *voice, + uint32_t OperationSet +); + +/* Requests the state and some basic statistics for this source. + * + * pVoiceState: See FAudioVoiceState for details. + * Flags: Can be 0 or FAUDIO_VOICE_NOSAMPLESPLAYED. + */ +FAUDIOAPI void FAudioSourceVoice_GetState( + FAudioSourceVoice *voice, + FAudioVoiceState *pVoiceState, + uint32_t Flags +); + +/* Sets the frequency ratio (fancy phrase for pitch) of this source. + * + * Ratio: The frequency ratio, must be <= MaxFrequencyRatio. + * OperationSet: See CommitChanges. Default is FAUDIO_COMMIT_NOW. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_SetFrequencyRatio( + FAudioSourceVoice *voice, + float Ratio, + uint32_t OperationSet +); + +/* Requests the frequency ratio (fancy phrase for pitch) of this source. + * + * pRatio: Filled with the frequency ratio. + */ +FAUDIOAPI void FAudioSourceVoice_GetFrequencyRatio( + FAudioSourceVoice *voice, + float *pRatio +); + +/* Resets the core sample rate of this source. + * You probably don't want this, it's more likely you want SetFrequencyRatio. + * This is used to recycle voices without having to constantly reallocate them. + * For example, if you have wavedata that's all float32 mono, but the sample + * rates are different, you can take a source that was being used for a 48KHz + * wave and call this so it can be used for a 44.1KHz wave. + * + * NewSourceSampleRate: The new sample rate for this source. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioSourceVoice_SetSourceSampleRate( + FAudioSourceVoice *voice, + uint32_t NewSourceSampleRate +); + +/* FAudioMasteringVoice Interface */ + +/* Requests the channel mask for the mastering voice. + * This is typically used with F3DAudioInitialize, but you may find it + * interesting if you want to see the user's basic speaker layout. + * + * pChannelMask: Filled with the channel mask. + * + * Returns 0 on success. + */ +FAUDIOAPI uint32_t FAudioMasteringVoice_GetChannelMask( + FAudioMasteringVoice *voice, + uint32_t *pChannelMask +); + +/* FAudioEngineCallback Interface */ + +/* If something horrible happens, this will be called. + * + * Error: The error code that spawned this callback. + */ +typedef void (FAUDIOCALL * OnCriticalErrorFunc)( + FAudioEngineCallback *callback, + uint32_t Error +); + +/* This is called at the end of a processing update. */ +typedef void (FAUDIOCALL * OnProcessingPassEndFunc)( + FAudioEngineCallback *callback +); + +/* This is called at the beginning of a processing update. */ +typedef void (FAUDIOCALL * OnProcessingPassStartFunc)( + FAudioEngineCallback *callback +); + +struct FAudioEngineCallback +{ + OnCriticalErrorFunc OnCriticalError; + OnProcessingPassEndFunc OnProcessingPassEnd; + OnProcessingPassStartFunc OnProcessingPassStart; +}; + +/* FAudioVoiceCallback Interface */ + +/* When a buffer is no longer in use, this is called. + * + * pBufferContext: The pContext for the FAudioBuffer in question. + */ +typedef void (FAUDIOCALL * OnBufferEndFunc)( + FAudioVoiceCallback *callback, + void *pBufferContext +); + +/* When a buffer is now being used, this is called. + * + * pBufferContext: The pContext for the FAudioBuffer in question. + */ +typedef void (FAUDIOCALL * OnBufferStartFunc)( + FAudioVoiceCallback *callback, + void *pBufferContext +); + +/* When a buffer completes a loop, this is called. + * + * pBufferContext: The pContext for the FAudioBuffer in question. + */ +typedef void (FAUDIOCALL * OnLoopEndFunc)( + FAudioVoiceCallback *callback, + void *pBufferContext +); + +/* When a buffer that has the END_OF_STREAM flag is finished, this is called. */ +typedef void (FAUDIOCALL * OnStreamEndFunc)( + FAudioVoiceCallback *callback +); + +/* If something horrible happens to a voice, this is called. + * + * pBufferContext: The pContext for the FAudioBuffer in question. + * Error: The error code that spawned this callback. + */ +typedef void (FAUDIOCALL * OnVoiceErrorFunc)( + FAudioVoiceCallback *callback, + void *pBufferContext, + uint32_t Error +); + +/* When this voice is done being processed, this is called. */ +typedef void (FAUDIOCALL * OnVoiceProcessingPassEndFunc)( + FAudioVoiceCallback *callback +); + +/* When a voice is about to start being processed, this is called. + * + * BytesRequested: The number of bytes needed from the application to + * complete a full update. For example, if we need 512 + * frames for a whole update, and the voice is a float32 + * stereo source, BytesRequired will be 4096. + */ +typedef void (FAUDIOCALL * OnVoiceProcessingPassStartFunc)( + FAudioVoiceCallback *callback, + uint32_t BytesRequired +); + +struct FAudioVoiceCallback +{ + OnBufferEndFunc OnBufferEnd; + OnBufferStartFunc OnBufferStart; + OnLoopEndFunc OnLoopEnd; + OnStreamEndFunc OnStreamEnd; + OnVoiceErrorFunc OnVoiceError; + OnVoiceProcessingPassEndFunc OnVoiceProcessingPassEnd; + OnVoiceProcessingPassStartFunc OnVoiceProcessingPassStart; +}; + +/* FAudio Custom Allocator API + * See "extensions/CustomAllocatorEXT.txt" for more information. + */ + +typedef void* (FAUDIOCALL * FAudioMallocFunc)(size_t size); +typedef void (FAUDIOCALL * FAudioFreeFunc)(void* ptr); +typedef void* (FAUDIOCALL * FAudioReallocFunc)(void* ptr, size_t size); + +FAUDIOAPI uint32_t FAudioCreateWithCustomAllocatorEXT( + FAudio **ppFAudio, + uint32_t Flags, + FAudioProcessor XAudio2Processor, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); +FAUDIOAPI uint32_t FAudioCOMConstructWithCustomAllocatorEXT( + FAudio **ppFAudio, + uint8_t version, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); + +/* FAudio Engine Procedure API + * See "extensions/EngineProcedureEXT.txt" for more information. + */ +typedef void (FAUDIOCALL *FAudioEngineCallEXT)(FAudio *audio, float *output); +typedef void (FAUDIOCALL *FAudioEngineProcedureEXT)(FAudioEngineCallEXT defaultEngineProc, FAudio *audio, float *output, void *user); + +FAUDIOAPI void FAudio_SetEngineProcedureEXT( + FAudio *audio, + FAudioEngineProcedureEXT clientEngineProc, + void *user +); + + +/* FAudio I/O API */ + +#define FAUDIO_SEEK_SET 0 +#define FAUDIO_SEEK_CUR 1 +#define FAUDIO_SEEK_END 2 +#define FAUDIO_EOF -1 + +typedef size_t (FAUDIOCALL * FAudio_readfunc)( + void *data, + void *dst, + size_t size, + size_t count +); +typedef int64_t (FAUDIOCALL * FAudio_seekfunc)( + void *data, + int64_t offset, + int whence +); +typedef int (FAUDIOCALL * FAudio_closefunc)( + void *data +); + +typedef struct FAudioIOStream +{ + void *data; + FAudio_readfunc read; + FAudio_seekfunc seek; + FAudio_closefunc close; + void *lock; +} FAudioIOStream; + +FAUDIOAPI FAudioIOStream* FAudio_fopen(const char *path); +FAUDIOAPI FAudioIOStream* FAudio_memopen(void *mem, int len); +FAUDIOAPI uint8_t* FAudio_memptr(FAudioIOStream *io, size_t offset); +FAUDIOAPI void FAudio_close(FAudioIOStream *io); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FAUDIO_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */ diff --git a/dlls/xaudio2_7/FAudio/FAudioFX.h b/dlls/xaudio2_7/FAudio/FAudioFX.h new file mode 100644 index 00000000000..22052d33e87 --- /dev/null +++ b/dlls/xaudio2_7/FAudio/FAudioFX.h @@ -0,0 +1,308 @@ +/* FAudio - XAudio Reimplementation for FNA + * + * Copyright (c) 2011-2021 Ethan Lee, Luigi Auriemma, and the MonoGame Team + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Ethan "flibitijibibo" Lee flibitijibibo@flibitijibibo.com + * + */ + +/* This file has no documentation since the MSDN docs are still perfectly fine: + * https://docs.microsoft.com/en-us/windows/desktop/api/xaudio2fx/ + * + * Note, however, that FAudio's Reverb implementation does NOT support the new + * parameters for XAudio 2.9's 7.1 Reverb effect! + */ + +#ifndef FAUDIOFX_H +#define FAUDIOFX_H + +#include "FAudio.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* GUIDs */ + +extern const FAudioGUID FAudioFX_CLSID_AudioVolumeMeter; +extern const FAudioGUID FAudioFX_CLSID_AudioReverb; + +/* Structures */ + +#pragma pack(push, 1) + +typedef struct FAudioFXVolumeMeterLevels +{ + float *pPeakLevels; + float *pRMSLevels; + uint32_t ChannelCount; +} FAudioFXVolumeMeterLevels; + +typedef struct FAudioFXReverbParameters +{ + float WetDryMix; + uint32_t ReflectionsDelay; + uint8_t ReverbDelay; + uint8_t RearDelay; + uint8_t PositionLeft; + uint8_t PositionRight; + uint8_t PositionMatrixLeft; + uint8_t PositionMatrixRight; + uint8_t EarlyDiffusion; + uint8_t LateDiffusion; + uint8_t LowEQGain; + uint8_t LowEQCutoff; + uint8_t HighEQGain; + uint8_t HighEQCutoff; + float RoomFilterFreq; + float RoomFilterMain; + float RoomFilterHF; + float ReflectionsGain; + float ReverbGain; + float DecayTime; + float Density; + float RoomSize; +} FAudioFXReverbParameters; + +typedef struct FAudioFXReverbParameters9 +{ + float WetDryMix; + uint32_t ReflectionsDelay; + uint8_t ReverbDelay; + uint8_t RearDelay; + uint8_t SideDelay; + uint8_t PositionLeft; + uint8_t PositionRight; + uint8_t PositionMatrixLeft; + uint8_t PositionMatrixRight; + uint8_t EarlyDiffusion; + uint8_t LateDiffusion; + uint8_t LowEQGain; + uint8_t LowEQCutoff; + uint8_t HighEQGain; + uint8_t HighEQCutoff; + float RoomFilterFreq; + float RoomFilterMain; + float RoomFilterHF; + float ReflectionsGain; + float ReverbGain; + float DecayTime; + float Density; + float RoomSize; +} FAudioFXReverbParameters9; + +typedef struct FAudioFXReverbI3DL2Parameters +{ + float WetDryMix; + int32_t Room; + int32_t RoomHF; + float RoomRolloffFactor; + float DecayTime; + float DecayHFRatio; + int32_t Reflections; + float ReflectionsDelay; + int32_t Reverb; + float ReverbDelay; + float Diffusion; + float Density; + float HFReference; +} FAudioFXReverbI3DL2Parameters; + +#pragma pack(pop) + +/* Constants */ + +#define FAUDIOFX_DEBUG 1 + +#define FAUDIOFX_REVERB_MIN_FRAMERATE 20000 +#define FAUDIOFX_REVERB_MAX_FRAMERATE 48000 + +#define FAUDIOFX_REVERB_MIN_WET_DRY_MIX 0.0f +#define FAUDIOFX_REVERB_MIN_REFLECTIONS_DELAY 0 +#define FAUDIOFX_REVERB_MIN_REVERB_DELAY 0 +#define FAUDIOFX_REVERB_MIN_REAR_DELAY 0 +#define FAUDIOFX_REVERB_MIN_7POINT1_SIDE_DELAY 0 +#define FAUDIOFX_REVERB_MIN_7POINT1_REAR_DELAY 0 +#define FAUDIOFX_REVERB_MIN_POSITION 0 +#define FAUDIOFX_REVERB_MIN_DIFFUSION 0 +#define FAUDIOFX_REVERB_MIN_LOW_EQ_GAIN 0 +#define FAUDIOFX_REVERB_MIN_LOW_EQ_CUTOFF 0 +#define FAUDIOFX_REVERB_MIN_HIGH_EQ_GAIN 0 +#define FAUDIOFX_REVERB_MIN_HIGH_EQ_CUTOFF 0 +#define FAUDIOFX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f +#define FAUDIOFX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f +#define FAUDIOFX_REVERB_MIN_ROOM_FILTER_HF -100.0f +#define FAUDIOFX_REVERB_MIN_REFLECTIONS_GAIN -100.0f +#define FAUDIOFX_REVERB_MIN_REVERB_GAIN -100.0f +#define FAUDIOFX_REVERB_MIN_DECAY_TIME 0.1f +#define FAUDIOFX_REVERB_MIN_DENSITY 0.0f +#define FAUDIOFX_REVERB_MIN_ROOM_SIZE 0.0f + +#define FAUDIOFX_REVERB_MAX_WET_DRY_MIX 100.0f +#define FAUDIOFX_REVERB_MAX_REFLECTIONS_DELAY 300 +#define FAUDIOFX_REVERB_MAX_REVERB_DELAY 85 +#define FAUDIOFX_REVERB_MAX_REAR_DELAY 5 +#define FAUDIOFX_REVERB_MAX_7POINT1_SIDE_DELAY 5 +#define FAUDIOFX_REVERB_MAX_7POINT1_REAR_DELAY 20 +#define FAUDIOFX_REVERB_MAX_POSITION 30 +#define FAUDIOFX_REVERB_MAX_DIFFUSION 15 +#define FAUDIOFX_REVERB_MAX_LOW_EQ_GAIN 12 +#define FAUDIOFX_REVERB_MAX_LOW_EQ_CUTOFF 9 +#define FAUDIOFX_REVERB_MAX_HIGH_EQ_GAIN 8 +#define FAUDIOFX_REVERB_MAX_HIGH_EQ_CUTOFF 14 +#define FAUDIOFX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f +#define FAUDIOFX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f +#define FAUDIOFX_REVERB_MAX_ROOM_FILTER_HF 0.0f +#define FAUDIOFX_REVERB_MAX_REFLECTIONS_GAIN 20.0f +#define FAUDIOFX_REVERB_MAX_REVERB_GAIN 20.0f +#define FAUDIOFX_REVERB_MAX_DENSITY 100.0f +#define FAUDIOFX_REVERB_MAX_ROOM_SIZE 100.0f + +#define FAUDIOFX_REVERB_DEFAULT_WET_DRY_MIX 100.0f +#define FAUDIOFX_REVERB_DEFAULT_REFLECTIONS_DELAY 5 +#define FAUDIOFX_REVERB_DEFAULT_REVERB_DELAY 5 +#define FAUDIOFX_REVERB_DEFAULT_REAR_DELAY 5 +#define FAUDIOFX_REVERB_DEFAULT_7POINT1_SIDE_DELAY 5 +#define FAUDIOFX_REVERB_DEFAULT_7POINT1_REAR_DELAY 20 +#define FAUDIOFX_REVERB_DEFAULT_POSITION 6 +#define FAUDIOFX_REVERB_DEFAULT_POSITION_MATRIX 27 +#define FAUDIOFX_REVERB_DEFAULT_EARLY_DIFFUSION 8 +#define FAUDIOFX_REVERB_DEFAULT_LATE_DIFFUSION 8 +#define FAUDIOFX_REVERB_DEFAULT_LOW_EQ_GAIN 8 +#define FAUDIOFX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4 +#define FAUDIOFX_REVERB_DEFAULT_HIGH_EQ_GAIN 8 +#define FAUDIOFX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4 +#define FAUDIOFX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f +#define FAUDIOFX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f +#define FAUDIOFX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f +#define FAUDIOFX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f +#define FAUDIOFX_REVERB_DEFAULT_REVERB_GAIN 0.0f +#define FAUDIOFX_REVERB_DEFAULT_DECAY_TIME 1.0f +#define FAUDIOFX_REVERB_DEFAULT_DENSITY 100.0f +#define FAUDIOFX_REVERB_DEFAULT_ROOM_SIZE 100.0f + +#define FAUDIOFX_I3DL2_PRESET_DEFAULT \ + {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_GENERIC \ + {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_PADDEDCELL \ + {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_ROOM \ + {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_BATHROOM \ + {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_LIVINGROOM \ + {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_STONEROOM \ + {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_AUDITORIUM \ + {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_CONCERTHALL \ + {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_CAVE \ + {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_ARENA \ + {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_HANGAR \ + {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_CARPETEDHALLWAY \ + {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_HALLWAY \ + {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_STONECORRIDOR \ + {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_ALLEY \ + {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_FOREST \ + {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_CITY \ + {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_MOUNTAINS \ + {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_QUARRY \ + {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_PLAIN \ + {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_PARKINGLOT \ + {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_SEWERPIPE \ + {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_UNDERWATER \ + {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_SMALLROOM \ + {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_MEDIUMROOM \ + {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_LARGEROOM \ + {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_MEDIUMHALL \ + {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_LARGEHALL \ + {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f} +#define FAUDIOFX_I3DL2_PRESET_PLATE \ + {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f} + +/* Functions */ + +FAUDIOAPI uint32_t FAudioCreateVolumeMeter(FAPO** ppApo, uint32_t Flags); +FAUDIOAPI uint32_t FAudioCreateReverb(FAPO** ppApo, uint32_t Flags); +FAUDIOAPI uint32_t FAudioCreateReverb9(FAPO** ppApo, uint32_t Flags); + +/* See "extensions/CustomAllocatorEXT.txt" for more information. */ +FAUDIOAPI uint32_t FAudioCreateVolumeMeterWithCustomAllocatorEXT( + FAPO** ppApo, + uint32_t Flags, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); +FAUDIOAPI uint32_t FAudioCreateReverbWithCustomAllocatorEXT( + FAPO** ppApo, + uint32_t Flags, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); +FAUDIOAPI uint32_t FAudioCreateReverb9WithCustomAllocatorEXT( + FAPO** ppApo, + uint32_t Flags, + FAudioMallocFunc customMalloc, + FAudioFreeFunc customFree, + FAudioReallocFunc customRealloc +); + +FAUDIOAPI void ReverbConvertI3DL2ToNative( + const FAudioFXReverbI3DL2Parameters *pI3DL2, + FAudioFXReverbParameters *pNative +); +FAUDIOAPI void ReverbConvertI3DL2ToNative9( + const FAudioFXReverbI3DL2Parameters *pI3DL2, + FAudioFXReverbParameters9 *pNative, + int32_t sevenDotOneReverb +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* FAUDIOFX_H */ + +/* vim: set noexpandtab shiftwidth=8 tabstop=8: */
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92982
Your paranoid android.
=== debiant2 (build log) ===
/home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2173: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' /usr/bin/ld: collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2642: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status dlls/xaudio2_5/compat.o/home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:: in function `2830: undefined reference to `XA27_CreateMasteringVoicepFAudio_SetEngineProcedureEXT': /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/compat.c:2830: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `dlls/xaudio2_5/xaudio_dll.opFAudio_SetEngineProcedureEXT: in function `' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status Task: The win32 Wine build failed
=== debiant2 (build log) ===
/home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2173: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2408: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2830: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2642: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' /usr/bin/ld: collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/compat.c:2830: undefined reference to `pFAudio_SetEngineProcedureEXT' /usr/bin/ld: collect2: error: ld returned 1 exit status /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/xaudio2_7/xaudio_dll.c:1751: undefined reference to `pFAudio_SetEngineProcedureEXT' collect2: error: ld returned 1 exit status Task: The wow64 Wine build failed
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- configure.ac | 55 ----------------------- dlls/x3daudio1_0/Makefile.in | 3 +- dlls/x3daudio1_1/Makefile.in | 3 +- dlls/x3daudio1_2/Makefile.in | 3 +- dlls/x3daudio1_3/Makefile.in | 3 +- dlls/x3daudio1_4/Makefile.in | 3 +- dlls/x3daudio1_5/Makefile.in | 3 +- dlls/x3daudio1_6/Makefile.in | 3 +- dlls/x3daudio1_7/Makefile.in | 3 +- dlls/xactengine2_0/Makefile.in | 3 +- dlls/xactengine2_4/Makefile.in | 3 +- dlls/xactengine2_7/Makefile.in | 3 +- dlls/xactengine2_9/Makefile.in | 3 +- dlls/xactengine3_0/Makefile.in | 3 +- dlls/xactengine3_1/Makefile.in | 3 +- dlls/xactengine3_2/Makefile.in | 3 +- dlls/xactengine3_3/Makefile.in | 3 +- dlls/xactengine3_4/Makefile.in | 3 +- dlls/xactengine3_5/Makefile.in | 3 +- dlls/xactengine3_6/Makefile.in | 3 +- dlls/xactengine3_7/Makefile.in | 3 +- dlls/xapofx1_1/Makefile.in | 3 +- dlls/xapofx1_2/Makefile.in | 3 +- dlls/xapofx1_3/Makefile.in | 3 +- dlls/xapofx1_4/Makefile.in | 3 +- dlls/xapofx1_5/Makefile.in | 3 +- dlls/xaudio2_0/Makefile.in | 3 +- dlls/xaudio2_1/Makefile.in | 3 +- dlls/xaudio2_2/Makefile.in | 3 +- dlls/xaudio2_3/Makefile.in | 3 +- dlls/xaudio2_4/Makefile.in | 3 +- dlls/xaudio2_5/Makefile.in | 3 +- dlls/xaudio2_6/Makefile.in | 3 +- dlls/xaudio2_7/Makefile.in | 3 +- dlls/xaudio2_7/compat.c | 42 ------------------ dlls/xaudio2_7/faudio.c | 65 ++++++++++------------------ dlls/xaudio2_7/x3daudio.c | 9 ---- dlls/xaudio2_7/xact_dll.c | 7 --- dlls/xaudio2_7/xapo.c | 8 +--- dlls/xaudio2_7/xapofx.c | 2 - dlls/xaudio2_7/xaudio_allocator.c | 2 - dlls/xaudio2_7/xaudio_dll.c | 72 ------------------------------- dlls/xaudio2_7/xaudio_private.h | 32 ++++---------- dlls/xaudio2_8/Makefile.in | 3 +- dlls/xaudio2_9/Makefile.in | 3 +- 45 files changed, 67 insertions(+), 332 deletions(-)
diff --git a/configure.ac b/configure.ac index f76dd047825..ff323920af6 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,6 @@ AC_ARG_WITH(coreaudio, AS_HELP_STRING([--without-coreaudio],[do not use the Core [if test "x$withval" = "xno"; then ac_cv_header_CoreAudio_CoreAudio_h=no; fi]) AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS])) AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)])) -AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAudio2 support)])) AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms])) AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig])) AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library])) @@ -1705,21 +1704,6 @@ fi WINE_NOTICE_WITH(sdl,[test "x$ac_cv_lib_soname_SDL2" = "x"], [libSDL2 ${notice_platform}development files not found, SDL2 won't be supported.])
-dnl **** Check for FAudio **** -if test "x$with_faudio" != "xno" -then - WINE_PACKAGE_FLAGS(FAUDIO,[FAudio],[-lFAudio],,, - [AC_CHECK_HEADERS([FAudio.h], - [WINE_CHECK_SONAME(FAudio,FAudioCreate,,,[$FAUDIO_LIBS],[[libFAudio*]])]) - WINE_CHECK_LIB_FUNCS([FAudio_CommitOperationSet \ - F3DAudioInitialize8 \ - FAudioLinkedVersion \ - FAudioCreateReverb9WithCustomAllocatorEXT], [$FAUDIO_LIBS]) - ]) -fi -WINE_NOTICE_WITH(faudio,[test "x$ac_cv_lib_soname_FAudio" = "x"], - [libFAudio ${notice_platform}development files not found, XAudio2 won't be supported.]) - dnl **** Check for capi4linux **** if test "x$with_capi" != "xno" then @@ -1898,45 +1882,6 @@ WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal" != xyes], [libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.], [enable_openal32])
-if test "x$ac_cv_lib_soname_FAudio" = "x" -then - enable_x3daudio1_0=${enable_x3daudio1_0:-no} - enable_x3daudio1_1=${enable_x3daudio1_1:-no} - enable_x3daudio1_2=${enable_x3daudio1_2:-no} - enable_x3daudio1_3=${enable_x3daudio1_3:-no} - enable_x3daudio1_4=${enable_x3daudio1_4:-no} - enable_x3daudio1_5=${enable_x3daudio1_5:-no} - enable_x3daudio1_6=${enable_x3daudio1_6:-no} - enable_x3daudio1_7=${enable_x3daudio1_7:-no} - enable_xactengine2_0=${enable_xactengine2_0:-no} - enable_xactengine2_4=${enable_xactengine2_4:-no} - enable_xactengine2_7=${enable_xactengine2_7:-no} - enable_xactengine2_9=${enable_xactengine2_9:-no} - enable_xactengine3_0=${enable_xactengine3_0:-no} - enable_xactengine3_1=${enable_xactengine3_1:-no} - enable_xactengine3_2=${enable_xactengine3_2:-no} - enable_xactengine3_3=${enable_xactengine3_3:-no} - enable_xactengine3_4=${enable_xactengine3_4:-no} - enable_xactengine3_5=${enable_xactengine3_5:-no} - enable_xactengine3_6=${enable_xactengine3_6:-no} - enable_xactengine3_7=${enable_xactengine3_7:-no} - enable_xapofx1_1=${enable_xapofx1_1:-no} - enable_xapofx1_2=${enable_xapofx1_2:-no} - enable_xapofx1_3=${enable_xapofx1_3:-no} - enable_xapofx1_4=${enable_xapofx1_4:-no} - enable_xapofx1_5=${enable_xapofx1_5:-no} - enable_xaudio2_0=${enable_xaudio2_0:-no} - enable_xaudio2_1=${enable_xaudio2_1:-no} - enable_xaudio2_2=${enable_xaudio2_2:-no} - enable_xaudio2_3=${enable_xaudio2_3:-no} - enable_xaudio2_4=${enable_xaudio2_4:-no} - enable_xaudio2_5=${enable_xaudio2_5:-no} - enable_xaudio2_6=${enable_xaudio2_6:-no} - enable_xaudio2_7=${enable_xaudio2_7:-no} - enable_xaudio2_8=${enable_xaudio2_8:-no} - enable_xaudio2_9=${enable_xaudio2_9:-no} -fi - dnl **** Check for libkstat **** if test "$ac_cv_header_kstat_h" = "yes" then diff --git a/dlls/x3daudio1_0/Makefile.in b/dlls/x3daudio1_0/Makefile.in index 1fc804116be..58ac6cf62e5 100644 --- a/dlls/x3daudio1_0/Makefile.in +++ b/dlls/x3daudio1_0/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=0 -DXAUDIO2_VER=0 MODULE = x3daudio1_0.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_1/Makefile.in b/dlls/x3daudio1_1/Makefile.in index 75cacbbdb27..763a9d937fc 100644 --- a/dlls/x3daudio1_1/Makefile.in +++ b/dlls/x3daudio1_1/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=1 -DXAUDIO2_VER=1 MODULE = x3daudio1_1.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_2/Makefile.in b/dlls/x3daudio1_2/Makefile.in index c621ba9bfe9..51233a4ccc3 100644 --- a/dlls/x3daudio1_2/Makefile.in +++ b/dlls/x3daudio1_2/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=2 -DXAUDIO2_VER=2 MODULE = x3daudio1_2.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_3/Makefile.in b/dlls/x3daudio1_3/Makefile.in index fb678cf19a3..3d16a3a4ff8 100644 --- a/dlls/x3daudio1_3/Makefile.in +++ b/dlls/x3daudio1_3/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=3 -DXAUDIO2_VER=3 MODULE = x3daudio1_3.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_4/Makefile.in b/dlls/x3daudio1_4/Makefile.in index 66805bfc845..e2be41d7b09 100644 --- a/dlls/x3daudio1_4/Makefile.in +++ b/dlls/x3daudio1_4/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=4 -DXAUDIO2_VER=4 MODULE = x3daudio1_4.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_5/Makefile.in b/dlls/x3daudio1_5/Makefile.in index 3180ac41b17..5dd086c70d2 100644 --- a/dlls/x3daudio1_5/Makefile.in +++ b/dlls/x3daudio1_5/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=5 -DXAUDIO2_VER=5 MODULE = x3daudio1_5.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_6/Makefile.in b/dlls/x3daudio1_6/Makefile.in index 54f46236d62..742c2600a59 100644 --- a/dlls/x3daudio1_6/Makefile.in +++ b/dlls/x3daudio1_6/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=6 -DXAUDIO2_VER=6 MODULE = x3daudio1_6.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in index a53a993019e..d83d74ed961 100644 --- a/dlls/x3daudio1_7/Makefile.in +++ b/dlls/x3daudio1_7/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DX3DAUDIO1_VER=7 -DXAUDIO2_VER=7 MODULE = x3daudio1_7.dll PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine2_0/Makefile.in b/dlls/xactengine2_0/Makefile.in index 6a98d4df558..109b22d0f28 100644 --- a/dlls/xactengine2_0/Makefile.in +++ b/dlls/xactengine2_0/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine2_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0200 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine2_4/Makefile.in b/dlls/xactengine2_4/Makefile.in index eef48ed32ea..8f3e7d4c18b 100644 --- a/dlls/xactengine2_4/Makefile.in +++ b/dlls/xactengine2_4/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine2_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0204 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine2_7/Makefile.in b/dlls/xactengine2_7/Makefile.in index bdc0c5565e3..2238abdaab8 100644 --- a/dlls/xactengine2_7/Makefile.in +++ b/dlls/xactengine2_7/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine2_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0207 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine2_9/Makefile.in b/dlls/xactengine2_9/Makefile.in index 035b6276e37..00300f15f43 100644 --- a/dlls/xactengine2_9/Makefile.in +++ b/dlls/xactengine2_9/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine2_9.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0209 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in index 940d33560e2..ed4234c631a 100644 --- a/dlls/xactengine3_0/Makefile.in +++ b/dlls/xactengine3_0/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_0.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0300 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in index 683be88529e..0e38f117d23 100644 --- a/dlls/xactengine3_1/Makefile.in +++ b/dlls/xactengine3_1/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_1.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0301 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in index f8c0d9cec89..270ebd91ae2 100644 --- a/dlls/xactengine3_2/Makefile.in +++ b/dlls/xactengine3_2/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_2.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0302 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in index 8a5854a0813..64f869f9da7 100644 --- a/dlls/xactengine3_3/Makefile.in +++ b/dlls/xactengine3_3/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_3.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0303 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in index 024e96c3a17..121a540b968 100644 --- a/dlls/xactengine3_4/Makefile.in +++ b/dlls/xactengine3_4/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_4.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0304 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in index 9a1d7813b13..0966775a67e 100644 --- a/dlls/xactengine3_5/Makefile.in +++ b/dlls/xactengine3_5/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_5.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0305 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in index 859fb906571..3d7a0aec12a 100644 --- a/dlls/xactengine3_6/Makefile.in +++ b/dlls/xactengine3_6/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_6.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0306 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in index 4e606ad5a49..652b0f69106 100644 --- a/dlls/xactengine3_7/Makefile.in +++ b/dlls/xactengine3_7/Makefile.in @@ -2,8 +2,7 @@ MODULE = xactengine3_7.dll IMPORTS = ole32 uuid EXTRADEFS = -DXACT3_VER=0x0307 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xapofx1_1/Makefile.in b/dlls/xapofx1_1/Makefile.in index 58e07c94af8..8c20c941c6c 100644 --- a/dlls/xapofx1_1/Makefile.in +++ b/dlls/xapofx1_1/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAPOFX1_VER=1 -DXAUDIO2_VER=2 MODULE = xapofx1_1.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in index 146a679ceff..6a0f6863919 100644 --- a/dlls/xapofx1_2/Makefile.in +++ b/dlls/xapofx1_2/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAPOFX1_VER=2 -DXAUDIO2_VER=3 MODULE = xapofx1_2.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xapofx1_3/Makefile.in b/dlls/xapofx1_3/Makefile.in index c9f4bd80d92..fbe4b696a59 100644 --- a/dlls/xapofx1_3/Makefile.in +++ b/dlls/xapofx1_3/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAPOFX1_VER=3 -DXAUDIO2_VER=4 MODULE = xapofx1_3.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xapofx1_4/Makefile.in b/dlls/xapofx1_4/Makefile.in index bd71b614bad..812e9be52d4 100644 --- a/dlls/xapofx1_4/Makefile.in +++ b/dlls/xapofx1_4/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAPOFX1_VER=4 -DXAUDIO2_VER=6 MODULE = xapofx1_4.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xapofx1_5/Makefile.in b/dlls/xapofx1_5/Makefile.in index 42eadd12614..4e57d1e1015 100644 --- a/dlls/xapofx1_5/Makefile.in +++ b/dlls/xapofx1_5/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAPOFX1_VER=5 -DXAUDIO2_VER=7 MODULE = xapofx1_5.dll IMPORTS = ole32 PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ faudio.c \ diff --git a/dlls/xaudio2_0/Makefile.in b/dlls/xaudio2_0/Makefile.in index 9e981603db4..fb5a2a955c2 100644 --- a/dlls/xaudio2_0/Makefile.in +++ b/dlls/xaudio2_0/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=0 MODULE = xaudio2_0.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in index fc81d653ab3..e801e19c9f5 100644 --- a/dlls/xaudio2_1/Makefile.in +++ b/dlls/xaudio2_1/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=1 MODULE = xaudio2_1.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_2/Makefile.in b/dlls/xaudio2_2/Makefile.in index f4b0e4578b8..73a9df2f471 100644 --- a/dlls/xaudio2_2/Makefile.in +++ b/dlls/xaudio2_2/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=2 MODULE = xaudio2_2.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_3/Makefile.in b/dlls/xaudio2_3/Makefile.in index d9337240350..dc0f39788b1 100644 --- a/dlls/xaudio2_3/Makefile.in +++ b/dlls/xaudio2_3/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=3 MODULE = xaudio2_3.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in index 0a8b6277b8e..d7e99b2d347 100644 --- a/dlls/xaudio2_4/Makefile.in +++ b/dlls/xaudio2_4/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=4 MODULE = xaudio2_4.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_5/Makefile.in b/dlls/xaudio2_5/Makefile.in index 5805a4d7629..63a36db7bda 100644 --- a/dlls/xaudio2_5/Makefile.in +++ b/dlls/xaudio2_5/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=5 MODULE = xaudio2_5.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_6/Makefile.in b/dlls/xaudio2_6/Makefile.in index 3dd582e512e..ab10021fc02 100644 --- a/dlls/xaudio2_6/Makefile.in +++ b/dlls/xaudio2_6/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=6 MODULE = xaudio2_6.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in index 26ced808cc6..22d991cacc9 100644 --- a/dlls/xaudio2_7/Makefile.in +++ b/dlls/xaudio2_7/Makefile.in @@ -1,8 +1,7 @@ EXTRADEFS = -DXAUDIO2_VER=7 MODULE = xaudio2_7.dll IMPORTS = advapi32 ole32 user32 uuid -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_7/compat.c b/dlls/xaudio2_7/compat.c index e756736e23f..45adcd41407 100644 --- a/dlls/xaudio2_7/compat.c +++ b/dlls/xaudio2_7/compat.c @@ -89,8 +89,6 @@ * Add SideDelay member to XAUDIO2FX_REVERB_PARAMETERS */
-#include "config.h" - #define NONAMELESSUNION #define NONAMELESSSTRUCT #define COBJMACROS @@ -2162,16 +2160,6 @@ static HRESULT WINAPI XA20_CreateMasteringVoice(IXAudio20 *iface,
This->mst.effect_chain = wrap_effect_chain(pEffectChain);
- pthread_mutex_lock(&This->mst.engine_lock); - - This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL); - - pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock); - - pthread_mutex_unlock(&This->mst.engine_lock); - - pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); - pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
@@ -2397,16 +2385,6 @@ static HRESULT WINAPI XA22_CreateMasteringVoice(IXAudio22 *iface,
This->mst.effect_chain = wrap_effect_chain(pEffectChain);
- pthread_mutex_lock(&This->mst.engine_lock); - - This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL); - - pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock); - - pthread_mutex_unlock(&This->mst.engine_lock); - - pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); - pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
@@ -2631,16 +2609,6 @@ static HRESULT WINAPI XA23_CreateMasteringVoice(IXAudio23 *iface,
This->mst.effect_chain = wrap_effect_chain(pEffectChain);
- pthread_mutex_lock(&This->mst.engine_lock); - - This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL); - - pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock); - - pthread_mutex_unlock(&This->mst.engine_lock); - - pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); - pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
@@ -2819,16 +2787,6 @@ static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface,
This->mst.effect_chain = wrap_effect_chain(pEffectChain);
- pthread_mutex_lock(&This->mst.engine_lock); - - This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL); - - pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock); - - pthread_mutex_unlock(&This->mst.engine_lock); - - pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); - pFAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
diff --git a/dlls/xaudio2_7/faudio.c b/dlls/xaudio2_7/faudio.c index 0858b79d973..064769d0d17 100644 --- a/dlls/xaudio2_7/faudio.c +++ b/dlls/xaudio2_7/faudio.c @@ -16,10 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h> -#include <dlfcn.h>
#define NONAMELESSUNION #define COBJMACROS @@ -31,11 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
#define MAKE_FUNCPTR(f) typeof(f) * p##f = NULL; MAKE_FUNCPTR(FAudio_AddRef) -#ifdef HAVE_FAUDIO_COMMITOPERATIONSET MAKE_FUNCPTR(FAudio_CommitOperationSet) -#else -MAKE_FUNCPTR(FAudio_CommitChanges) -#endif MAKE_FUNCPTR(FAudio_CreateMasteringVoice) MAKE_FUNCPTR(FAudio_CreateMasteringVoice8) MAKE_FUNCPTR(FAudio_CreateSourceVoice) @@ -87,21 +80,15 @@ MAKE_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) MAKE_FUNCPTR(FAudioCreate) MAKE_FUNCPTR(FAudioCreateReverb) MAKE_FUNCPTR(FAudioCreateReverb9) -#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT MAKE_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) -#endif MAKE_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) MAKE_FUNCPTR(FAudioCreateVolumeMeter) MAKE_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) -#ifdef HAVE_FAUDIOLINKEDVERSION MAKE_FUNCPTR(FAudioLinkedVersion) -#endif
MAKE_FUNCPTR(F3DAudioCalculate) MAKE_FUNCPTR(F3DAudioInitialize) -#ifdef HAVE_F3DAUDIOINITIALIZE8 MAKE_FUNCPTR(F3DAudioInitialize8) -#endif
MAKE_FUNCPTR(FACTAudioEngine_AddRef) MAKE_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) @@ -169,31 +156,39 @@ MAKE_FUNCPTR(FACTWaveBank_Stop) MAKE_FUNCPTR(FAPOFX_CreateFXWithCustomAllocatorEXT) #undef MAKE_FUNCPTR
-#ifdef SONAME_LIBFAUDIO +static HMODULE sdl2; +static HMODULE faudio;
BOOL load_faudio(void) { - void *faudio; + if (!(faudio = LoadLibraryA( "FAudio" ))) + { +#ifdef _WIN64 +#define ARCH_SUFFIX "-x86_64" +#else +#define ARCH_SUFFIX "-x86" +#endif + sdl2 = LoadLibraryA( "C:\Windows\Mono\Mono-2.0\lib\SDL2" ARCH_SUFFIX ".dll" ); + faudio = LoadLibraryA( "C:\Windows\Mono\Mono-2.0\lib\FAudio" ARCH_SUFFIX ".dll" ); +#undef ARCH_SUFFIX + }
- if (!(faudio = dlopen( SONAME_LIBFAUDIO, RTLD_NOW ))) + if (!faudio) { - ERR( "FAudio library %s not found.\n", SONAME_LIBFAUDIO ); + ERR( "FAudio library not found.\n" ); return FALSE; }
#define LOAD_FUNCPTR(f) \ - if (!(p##f = dlsym( faudio, #f ))) \ - { \ - ERR( "FAudio function %s not found\n", #f ); \ - dlclose( faudio ); \ - return FALSE; \ + if (!(p##f = (void *)GetProcAddress( faudio, #f ))) \ + { \ + ERR( "FAudio function %s not found\n", #f ); \ + FreeLibrary( faudio ); \ + faudio = NULL; \ + return FALSE; \ } LOAD_FUNCPTR(FAudio_AddRef) -#ifdef HAVE_FAUDIO_COMMITOPERATIONSET LOAD_FUNCPTR(FAudio_CommitOperationSet) -#else -LOAD_FUNCPTR(FAudio_CommitChanges) -#endif LOAD_FUNCPTR(FAudio_CreateMasteringVoice) LOAD_FUNCPTR(FAudio_CreateMasteringVoice8) LOAD_FUNCPTR(FAudio_CreateSourceVoice) @@ -245,21 +240,15 @@ LOAD_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) LOAD_FUNCPTR(FAudioCreate) LOAD_FUNCPTR(FAudioCreateReverb) LOAD_FUNCPTR(FAudioCreateReverb9) -#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT LOAD_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) -#endif LOAD_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) LOAD_FUNCPTR(FAudioCreateVolumeMeter) LOAD_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) -#ifdef HAVE_FAUDIOLINKEDVERSION LOAD_FUNCPTR(FAudioLinkedVersion) -#endif
LOAD_FUNCPTR(F3DAudioCalculate) LOAD_FUNCPTR(F3DAudioInitialize) -#ifdef HAVE_F3DAUDIOINITIALIZE8 LOAD_FUNCPTR(F3DAudioInitialize8) -#endif
LOAD_FUNCPTR(FACTAudioEngine_AddRef) LOAD_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) @@ -330,16 +319,8 @@ LOAD_FUNCPTR(FAPOFX_CreateFXWithCustomAllocatorEXT) return TRUE; }
-#else /* SONAME_LIBFAUDIO */ - -BOOL load_faudio(void) -{ - ERR( "FAudio support not compiled in.\n" ); - return FALSE; -} - -#endif /* SONAME_LIBFAUDIO */ - void unload_faudio(void) { + if (faudio) FreeLibrary(faudio); + if (sdl2) FreeLibrary(sdl2); } diff --git a/dlls/xaudio2_7/x3daudio.c b/dlls/xaudio2_7/x3daudio.c index f07a1282150..450016f7b95 100644 --- a/dlls/xaudio2_7/x3daudio.c +++ b/dlls/xaudio2_7/x3daudio.c @@ -17,8 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h>
#include "windef.h" @@ -28,8 +26,6 @@
#include "wine/debug.h"
-#include <F3DAudio.h> - #if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); #endif @@ -58,12 +54,7 @@ HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound, X3DAUDIO_HANDLE handle) { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle); -#ifdef HAVE_F3DAUDIOINITIALIZE8 return pF3DAudioInitialize8(chanmask, speedofsound, handle); -#else - pF3DAudioInitialize(chanmask, speedofsound, handle); - return S_OK; -#endif } #endif /* XAUDIO2_VER >= 8 */
diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c index 229980216f7..59ef6ab740d 100644 --- a/dlls/xaudio2_7/xact_dll.c +++ b/dlls/xaudio2_7/xact_dll.c @@ -16,10 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h> -#include <FACT.h>
#define NONAMELESSUNION #define COBJMACROS @@ -1466,11 +1463,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); if (!load_faudio()) return FALSE; - -#ifdef HAVE_FAUDIOLINKEDVERSION TRACE("Using FAudio version %d\n", pFAudioLinkedVersion() ); -#endif - break; case DLL_PROCESS_DETACH: unload_faudio(); diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c index 7972f01a994..1b0ae8639cf 100644 --- a/dlls/xaudio2_7/xapo.c +++ b/dlls/xaudio2_7/xapo.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h>
#define NONAMELESSUNION @@ -32,10 +30,6 @@ #include "wine/debug.h" #include "wine/heap.h"
-#include <FAPO.h> -#include <FAPOFX.h> -#include <FAudioFX.h> - WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
static XA2XAPOFXImpl *impl_from_IXAPO(IXAPO *iface) @@ -313,7 +307,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo) XAudio_Internal_Free, XAudio_Internal_Realloc ); -#if XAUDIO2_VER >= 9 && HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT +#if XAUDIO2_VER >= 9 if(IsEqualGUID(clsid, &CLSID_AudioReverb27)) return pFAudioCreateReverb9WithCustomAllocatorEXT( fapo, diff --git a/dlls/xaudio2_7/xapofx.c b/dlls/xaudio2_7/xapofx.c index 4cbc2816bc8..e6c488bb8b8 100644 --- a/dlls/xaudio2_7/xapofx.c +++ b/dlls/xaudio2_7/xapofx.c @@ -17,8 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h>
#define NONAMELESSUNION diff --git a/dlls/xaudio2_7/xaudio_allocator.c b/dlls/xaudio2_7/xaudio_allocator.c index 41be48a80f3..7a86e25f06b 100644 --- a/dlls/xaudio2_7/xaudio_allocator.c +++ b/dlls/xaudio2_7/xaudio_allocator.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h>
#define NONAMELESSUNION diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index eb3cae7ad62..21bd57b4587 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" - #include <stdarg.h>
#define NONAMELESSUNION @@ -88,9 +86,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); if (!load_faudio()) return FALSE; -#ifdef HAVE_FAUDIOLINKEDVERSION TRACE("Using FAudio version %d\n", pFAudioLinkedVersion() ); -#endif break; case DLL_PROCESS_DETACH: unload_faudio(); @@ -1287,13 +1283,6 @@ static void WINAPI XA2M_DestroyVoice(IXAudio2MasteringVoice *iface) EnterCriticalSection(&This->lock);
destroy_voice(This); - pthread_mutex_lock(&This->engine_lock); - This->engine_params.proc = NULL; - pthread_cond_broadcast(&This->engine_ready); - pthread_mutex_unlock(&This->engine_lock); - - WaitForSingleObject(This->engine_thread, INFINITE); - This->engine_thread = NULL;
LeaveCriticalSection(&This->lock); } @@ -1664,49 +1653,6 @@ static HRESULT WINAPI IXAudio2Impl_CreateSubmixVoice(IXAudio2 *iface, return S_OK; }
-/* called thread created by SDL, must not access Wine TEB */ -void engine_cb(FAudioEngineCallEXT proc, FAudio *faudio, float *stream, void *user) -{ - XA2VoiceImpl *This = user; - - pthread_mutex_lock(&This->engine_lock); - - This->engine_params.proc = proc; - This->engine_params.stream = stream; - This->engine_params.faudio = faudio; - - pthread_cond_broadcast(&This->engine_ready); - - while(This->engine_params.proc) - pthread_cond_wait(&This->engine_done, &This->engine_lock); - - pthread_mutex_unlock(&This->engine_lock); -} - -/* wine thread, OK to access TEB, invoke client code, etc */ -DWORD WINAPI engine_thread(void *user) -{ - XA2VoiceImpl *This = user; - - pthread_mutex_lock(&This->engine_lock); - - pthread_cond_broadcast(&This->engine_done); - - do{ - pthread_cond_wait(&This->engine_ready, &This->engine_lock); - - if(This->engine_params.proc){ - This->engine_params.proc(This->engine_params.faudio, This->engine_params.stream); - This->engine_params.proc = NULL; - pthread_cond_broadcast(&This->engine_done); - } - }while(This->in_use); - - pthread_mutex_unlock(&This->engine_lock); - - return 0; -} - static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface, IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, UINT32 inputSampleRate, UINT32 flags, const WCHAR *deviceId, @@ -1740,16 +1686,6 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
This->mst.effect_chain = wrap_effect_chain(pEffectChain);
- pthread_mutex_lock(&This->mst.engine_lock); - - This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL); - - pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock); - - pthread_mutex_unlock(&This->mst.engine_lock); - - pFAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst); - pFAudio_CreateMasteringVoice8(This->faudio, &This->mst.faudio_voice, inputChannels, inputSampleRate, flags, NULL /* TODO: (uint16_t*)deviceId */, This->mst.effect_chain, (FAudioStreamCategory)streamCategory); @@ -1786,11 +1722,7 @@ static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface,
TRACE("(%p)->(0x%x)\n", This, operationSet);
-#ifdef HAVE_FAUDIO_COMMITOPERATIONSET return pFAudio_CommitOperationSet(This->faudio, operationSet); -#else - return pFAudio_CommitChanges(This->faudio); -#endif }
static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface, @@ -1927,10 +1859,6 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p InitializeCriticalSection(&object->mst.lock); object->mst.lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2MasteringVoice.lock");
- pthread_mutex_init(&object->mst.engine_lock, NULL); - pthread_cond_init(&object->mst.engine_done, NULL); - pthread_cond_init(&object->mst.engine_ready, NULL); - pFAudioCOMConstructWithCustomAllocatorEXT( &object->faudio, XAUDIO2_VER, diff --git a/dlls/xaudio2_7/xaudio_private.h b/dlls/xaudio2_7/xaudio_private.h index 35d0410f60f..908ea577725 100644 --- a/dlls/xaudio2_7/xaudio_private.h +++ b/dlls/xaudio2_7/xaudio_private.h @@ -23,24 +23,18 @@ #include "xaudio2.h" #include "xapo.h"
-#include <F3DAudio.h> -#include <FACT.h> -#include <FACT3D.h> -#include <FAPO.h> -#include <FAPOBase.h> -#include <FAPOFX.h> -#include <FAudio.h> -#include <FAudioFX.h> - -#include <pthread.h> +#include "FAudio/F3DAudio.h" +#include "FAudio/FACT.h" +#include "FAudio/FACT3D.h" +#include "FAudio/FAPO.h" +#include "FAudio/FAPOBase.h" +#include "FAudio/FAPOFX.h" +#include "FAudio/FAudio.h" +#include "FAudio/FAudioFX.h"
#define MAKE_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN; MAKE_FUNCPTR(FAudio_AddRef) -#ifdef HAVE_FAUDIO_COMMITOPERATIONSET MAKE_FUNCPTR(FAudio_CommitOperationSet) -#else -MAKE_FUNCPTR(FAudio_CommitChanges) -#endif MAKE_FUNCPTR(FAudio_CreateMasteringVoice) MAKE_FUNCPTR(FAudio_CreateMasteringVoice8) MAKE_FUNCPTR(FAudio_CreateSourceVoice) @@ -92,21 +86,15 @@ MAKE_FUNCPTR(FAudioCOMConstructWithCustomAllocatorEXT) MAKE_FUNCPTR(FAudioCreate) MAKE_FUNCPTR(FAudioCreateReverb) MAKE_FUNCPTR(FAudioCreateReverb9) -#ifdef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT MAKE_FUNCPTR(FAudioCreateReverb9WithCustomAllocatorEXT) -#endif MAKE_FUNCPTR(FAudioCreateReverbWithCustomAllocatorEXT) MAKE_FUNCPTR(FAudioCreateVolumeMeter) MAKE_FUNCPTR(FAudioCreateVolumeMeterWithCustomAllocatorEXT) -#ifdef HAVE_FAUDIOLINKEDVERSION MAKE_FUNCPTR(FAudioLinkedVersion) -#endif
MAKE_FUNCPTR(F3DAudioCalculate) MAKE_FUNCPTR(F3DAudioInitialize) -#ifdef HAVE_F3DAUDIOINITIALIZE8 MAKE_FUNCPTR(F3DAudioInitialize8) -#endif
MAKE_FUNCPTR(FACTAudioEngine_AddRef) MAKE_FUNCPTR(FACTAudioEngine_CreateInMemoryWaveBank) @@ -246,10 +234,6 @@ typedef struct _XA2VoiceImpl { float *stream; } engine_params;
- HANDLE engine_thread; - pthread_cond_t engine_done, engine_ready; - pthread_mutex_t engine_lock; - struct list entry; } XA2VoiceImpl;
diff --git a/dlls/xaudio2_8/Makefile.in b/dlls/xaudio2_8/Makefile.in index 69aa0d42b81..27c90eba408 100644 --- a/dlls/xaudio2_8/Makefile.in +++ b/dlls/xaudio2_8/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=8 MODULE = xaudio2_8.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \ diff --git a/dlls/xaudio2_9/Makefile.in b/dlls/xaudio2_9/Makefile.in index b3256636f4d..682f68c76b0 100644 --- a/dlls/xaudio2_9/Makefile.in +++ b/dlls/xaudio2_9/Makefile.in @@ -2,8 +2,7 @@ EXTRADEFS = -DXAUDIO2_VER=9 MODULE = xaudio2_9.dll IMPORTS = advapi32 ole32 user32 uuid PARENTSRC = ../xaudio2_7 -EXTRALIBS = $(DL_LIBS) -EXTRAINCL = $(FAUDIO_CFLAGS) +EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ compat.c \
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92983
Your paranoid android.
=== debiant2 (32 bit report) ===
xactengine3_7: xact3.c:87: Test failed: 0, Unexpected value 0x80070005 xact3.c:87: Test failed: 1, Unexpected value 0x80070005 xact3.c:87: Test failed: 2, Unexpected value 0x80070005 xact3.c:87: Test failed: 3, Unexpected value 0x80070005 xact3.c:87: Test failed: 4, Unexpected value 0x80070005 xact3.c:87: Test failed: 5, Unexpected value 0x80070005 xact3.c:87: Test failed: 6, Unexpected value 0x80070005 xact3.c:87: Test failed: 7, Unexpected value 0x80070005 xact3.c:87: Test failed: 8, Unexpected value 0x80070005 xact3.c:87: Test failed: 9, Unexpected value 0x80070005 xact3.c:87: Test failed: 10, Unexpected value 0x80070005 xact3.c:87: Test failed: 11, Unexpected value 0x80070005 xact3.c:87: Test failed: 12, Unexpected value 0x80070005 xact3.c:87: Test failed: 13, Unexpected value 0x80070005
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (32 bit Chinese:China report) ===
xactengine3_7: xact3.c:87: Test failed: 0, Unexpected value 0x80070005 xact3.c:87: Test failed: 1, Unexpected value 0x80070005 xact3.c:87: Test failed: 2, Unexpected value 0x80070005 xact3.c:87: Test failed: 3, Unexpected value 0x80070005 xact3.c:87: Test failed: 4, Unexpected value 0x80070005 xact3.c:87: Test failed: 5, Unexpected value 0x80070005 xact3.c:87: Test failed: 6, Unexpected value 0x80070005 xact3.c:87: Test failed: 7, Unexpected value 0x80070005 xact3.c:87: Test failed: 8, Unexpected value 0x80070005 xact3.c:87: Test failed: 9, Unexpected value 0x80070005 xact3.c:87: Test failed: 10, Unexpected value 0x80070005 xact3.c:87: Test failed: 11, Unexpected value 0x80070005 xact3.c:87: Test failed: 12, Unexpected value 0x80070005 xact3.c:87: Test failed: 13, Unexpected value 0x80070005
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (32 bit WoW report) ===
xactengine3_7: xact3.c:87: Test failed: 0, Unexpected value 0x80070005 xact3.c:87: Test failed: 1, Unexpected value 0x80070005 xact3.c:87: Test failed: 2, Unexpected value 0x80070005 xact3.c:87: Test failed: 3, Unexpected value 0x80070005 xact3.c:87: Test failed: 4, Unexpected value 0x80070005 xact3.c:87: Test failed: 5, Unexpected value 0x80070005 xact3.c:87: Test failed: 6, Unexpected value 0x80070005 xact3.c:87: Test failed: 7, Unexpected value 0x80070005 xact3.c:87: Test failed: 8, Unexpected value 0x80070005 xact3.c:87: Test failed: 9, Unexpected value 0x80070005 xact3.c:87: Test failed: 10, Unexpected value 0x80070005 xact3.c:87: Test failed: 11, Unexpected value 0x80070005 xact3.c:87: Test failed: 12, Unexpected value 0x80070005 xact3.c:87: Test failed: 13, Unexpected value 0x80070005
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (64 bit WoW report) ===
xactengine3_7: xact3.c:87: Test failed: 0, Unexpected value 0x80070005 xact3.c:87: Test failed: 1, Unexpected value 0x80070005 xact3.c:87: Test failed: 2, Unexpected value 0x80070005 xact3.c:87: Test failed: 3, Unexpected value 0x80070005 xact3.c:87: Test failed: 4, Unexpected value 0x80070005 xact3.c:87: Test failed: 5, Unexpected value 0x80070005 xact3.c:87: Test failed: 6, Unexpected value 0x80070005 xact3.c:87: Test failed: 7, Unexpected value 0x80070005 xact3.c:87: Test failed: 8, Unexpected value 0x80070005 xact3.c:87: Test failed: 9, Unexpected value 0x80070005 xact3.c:87: Test failed: 10, Unexpected value 0x80070005 xact3.c:87: Test failed: 11, Unexpected value 0x80070005 xact3.c:87: Test failed: 12, Unexpected value 0x80070005 xact3.c:87: Test failed: 13, Unexpected value 0x80070005
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/xaudio2_7/compat.c | 26 +++++++++++++------------- dlls/xaudio2_7/xact_dll.c | 30 +++++++++++++++--------------- dlls/xaudio2_7/xapo.c | 13 ++++++------- dlls/xaudio2_7/xaudio_dll.c | 31 +++++++++++++++---------------- 4 files changed, 49 insertions(+), 51 deletions(-)
diff --git a/dlls/xaudio2_7/compat.c b/dlls/xaudio2_7/compat.c index 45adcd41407..5d9daff67de 100644 --- a/dlls/xaudio2_7/compat.c +++ b/dlls/xaudio2_7/compat.c @@ -109,7 +109,7 @@ static XAUDIO2_SEND_DESCRIPTOR *convert_send_descriptors23(const XAUDIO23_VOICE_ XAUDIO2_SEND_DESCRIPTOR *ret; DWORD i;
- ret = HeapAlloc(GetProcessHeap(), 0, sends->OutputCount * sizeof(XAUDIO2_SEND_DESCRIPTOR)); + ret = malloc(sends->OutputCount * sizeof(XAUDIO2_SEND_DESCRIPTOR));
for(i = 0; i < sends->OutputCount; ++i){ ret[i].Flags = 0; @@ -158,7 +158,7 @@ static HRESULT WINAPI XA20SRC_SetOutputVoices(IXAudio20SourceVoice *iface, hr = IXAudio2SourceVoice_SetOutputVoices(&This->IXAudio2SourceVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -415,7 +415,7 @@ static HRESULT WINAPI XA23SRC_SetOutputVoices(IXAudio23SourceVoice *iface, hr = IXAudio2SourceVoice_SetOutputVoices(&This->IXAudio2SourceVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -935,7 +935,7 @@ static HRESULT WINAPI XA20SUB_SetOutputVoices(IXAudio20SubmixVoice *iface, hr = IXAudio2SubmixVoice_SetOutputVoices(&This->IXAudio2SubmixVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -1120,7 +1120,7 @@ static HRESULT WINAPI XA23SUB_SetOutputVoices(IXAudio23SubmixVoice *iface, hr = IXAudio2SubmixVoice_SetOutputVoices(&This->IXAudio2SubmixVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -1495,7 +1495,7 @@ static HRESULT WINAPI XA20M_SetOutputVoices(IXAudio20MasteringVoice *iface, hr = IXAudio2MasteringVoice_SetOutputVoices(&This->IXAudio2MasteringVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -1680,7 +1680,7 @@ static HRESULT WINAPI XA23M_SetOutputVoices(IXAudio23MasteringVoice *iface, hr = IXAudio2MasteringVoice_SetOutputVoices(&This->IXAudio2MasteringVoice_iface, psends);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2101,7 +2101,7 @@ static HRESULT WINAPI XA20_CreateSourceVoice(IXAudio20 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2127,7 +2127,7 @@ static HRESULT WINAPI XA20_CreateSubmixVoice(IXAudio20 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2326,7 +2326,7 @@ static HRESULT WINAPI XA22_CreateSourceVoice(IXAudio22 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2352,7 +2352,7 @@ static HRESULT WINAPI XA22_CreateSubmixVoice(IXAudio22 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2550,7 +2550,7 @@ static HRESULT WINAPI XA23_CreateSourceVoice(IXAudio23 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } @@ -2576,7 +2576,7 @@ static HRESULT WINAPI XA23_CreateSubmixVoice(IXAudio23 *iface, pEffectChain);
if(pSendList) - HeapFree(GetProcessHeap(), 0, sends.pSends); + free(sends.pSends);
return hr; } diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c index 59ef6ab740d..fae997c9779 100644 --- a/dlls/xaudio2_7/xact_dll.c +++ b/dlls/xaudio2_7/xact_dll.c @@ -95,7 +95,7 @@ static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface) ret = pFACTCue_Destroy(This->fact_cue); if (ret != 0) WARN("pFACTCue_Destroy returned %d\n", ret); - HeapFree(GetProcessHeap(), 0, This); + free(This); return S_OK; }
@@ -313,7 +313,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface, return E_FAIL; }
- cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); + cue = calloc(1, sizeof(*cue)); if (!cue) { pFACTCue_Destroy(fcue); @@ -355,7 +355,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, if(FAILED(hr)) return hr;
- cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); + cue = calloc(1, sizeof(*cue)); if (!cue) { pFACTCue_Destroy(fcue); @@ -389,7 +389,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Destroy(IXACT3SoundBank *iface) TRACE("(%p)\n", This);
hr = pFACTSoundBank_Destroy(This->fact_soundbank); - HeapFree(GetProcessHeap(), 0, This); + free(This); return hr; }
@@ -438,7 +438,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Destroy(IXACT3Wave *iface) TRACE("(%p)\n", This);
hr = pFACTWave_Destroy(This->fact_wave); - HeapFree(GetProcessHeap(), 0, This); + free(This); return hr; }
@@ -554,7 +554,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Destroy(IXACT3WaveBank *iface) TRACE("(%p)\n", This);
hr = pFACTWaveBank_Destroy(This->fact_wavebank); - HeapFree(GetProcessHeap(), 0, This); + free(This); return hr; }
@@ -611,7 +611,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface, return E_FAIL; }
- wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); + wave = calloc(1, sizeof(*wave)); if (!wave) { pFACTWave_Destroy(fwave); @@ -653,7 +653,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Play(IXACT3WaveBank *iface, if(FAILED(hr)) return hr;
- wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); + wave = calloc(1, sizeof(*wave)); if (!wave) { pFACTWave_Destroy(fwave); @@ -788,7 +788,7 @@ static ULONG WINAPI IXACT3EngineImpl_Release(IXACT3Engine *iface) TRACE("(%p)->(): Refcount now %u\n", This, ref);
if (!ref) - HeapFree(GetProcessHeap(), 0, This); + free(This); return ref; }
@@ -943,7 +943,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, return E_FAIL; }
- sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sb)); + sb = calloc(1, sizeof(*sb)); if (!sb) { pFACTSoundBank_Destroy(fsb); @@ -980,7 +980,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac return E_FAIL; }
- wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); + wb = calloc(1, sizeof(*wb)); if (!wb) { pFACTWaveBank_Destroy(fwb); @@ -1028,7 +1028,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa return E_FAIL; }
- wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); + wb = calloc(1, sizeof(*wb)); if (!wb) { pFACTWaveBank_Destroy(fwb); @@ -1089,7 +1089,7 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface, return E_FAIL; }
- wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); + wave = calloc(1, sizeof(*wave)); if (!wave) { pFACTWave_Destroy(fwave); @@ -1414,7 +1414,7 @@ static HRESULT WINAPI XACT3CF_CreateInstance(IClassFactory *iface, IUnknown *pOu if(pOuter) return CLASS_E_NOAGGREGATION;
- object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + object = calloc(1, sizeof(*object)); if(!object) return E_OUTOFMEMORY;
@@ -1430,7 +1430,7 @@ static HRESULT WINAPI XACT3CF_CreateInstance(IClassFactory *iface, IUnknown *pOu
hr = IXACT3Engine_QueryInterface(&object->IXACT3Engine_iface, riid, ppobj); if(FAILED(hr)){ - HeapFree(GetProcessHeap(), 0, object); + free(object); return hr; }
diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c index 1b0ae8639cf..6a4f64a38ef 100644 --- a/dlls/xaudio2_7/xapo.c +++ b/dlls/xaudio2_7/xapo.c @@ -28,7 +28,6 @@ #include "xapofx.h"
#include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
@@ -82,7 +81,7 @@ static ULONG WINAPI XAPOFX_Release(IXAPO *iface) TRACE("(%p)->(): Refcount now %u\n", This, ref);
if(!ref) - HeapFree(GetProcessHeap(), 0, This); + free(This);
return ref; } @@ -292,7 +291,7 @@ static ULONG WINAPI xapocf_Release(IClassFactory *iface) ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(): Refcount now %u\n", This, ref); if (!ref) - HeapFree(GetProcessHeap(), 0, This); + free(This); return ref; }
@@ -360,14 +359,14 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut if(pOuter) return CLASS_E_NOAGGREGATION;
- object = heap_alloc(sizeof(*object)); + object = malloc(sizeof(*object)); object->IXAPO_iface.lpVtbl = &XAPOFX_Vtbl; object->IXAPOParameters_iface.lpVtbl = &XAPOFXParameters_Vtbl;
hr = get_fapo_from_clsid(This->class, &object->fapo);
if(FAILED(hr)){ - HeapFree(GetProcessHeap(), 0, object); + free(object); return hr; }
@@ -396,12 +395,12 @@ static const IClassFactoryVtbl xapo_Vtbl = HRESULT make_xapo_factory(REFCLSID clsid, REFIID riid, void **ppv) { HRESULT hr; - struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf)); + struct xapo_cf *ret = malloc(sizeof(struct xapo_cf)); ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl; ret->class = clsid; ret->ref = 0; hr = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv); if(FAILED(hr)) - HeapFree(GetProcessHeap(), 0, ret); + free(ret); return hr; } diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index 21bd57b4587..638bfedd3b7 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -35,7 +35,6 @@
#include "wine/asm.h" #include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
@@ -119,7 +118,7 @@ static int32_t FAPOCALL XAPO_Release(void *iface) IXAPO_Release(This->xapo); if(This->xapo_params) IXAPOParameters_Release(This->xapo_params); - heap_free(This); + free(This); } return r; } @@ -295,7 +294,7 @@ static XA2XAPOImpl *wrap_xapo(IUnknown *unk) xapo_params = NULL; }
- ret = heap_alloc(sizeof(*ret)); + ret = malloc(sizeof(*ret));
ret->xapo = xapo; ret->xapo_params = xapo_params; @@ -315,7 +314,7 @@ FAudioEffectChain *wrap_effect_chain(const XAUDIO2_EFFECT_CHAIN *pEffectChain) if(!pEffectChain) return NULL;
- ret = heap_alloc(sizeof(*ret) + sizeof(FAudioEffectDescriptor) * pEffectChain->EffectCount); + ret = malloc(sizeof(*ret) + sizeof(FAudioEffectDescriptor) * pEffectChain->EffectCount);
ret->EffectCount = pEffectChain->EffectCount; ret->pEffectDescriptors = (void*)(ret + 1); @@ -336,7 +335,7 @@ static void free_effect_chain(FAudioEffectChain *chain) return; for(i = 0; i < chain->EffectCount; ++i) XAPO_Release(chain->pEffectDescriptors[i].pEffect); - heap_free(chain); + free(chain); }
/* Send Wrapping */ @@ -349,7 +348,7 @@ static FAudioVoiceSends *wrap_voice_sends(const XAUDIO2_VOICE_SENDS *sends) if(!sends) return NULL;
- ret = heap_alloc(sizeof(*ret) + sends->SendCount * sizeof(FAudioSendDescriptor)); + ret = malloc(sizeof(*ret) + sends->SendCount * sizeof(FAudioSendDescriptor)); ret->SendCount = sends->SendCount; ret->pSends = (FAudioSendDescriptor*)(ret + 1); for(i = 0; i < sends->SendCount; ++i){ @@ -364,7 +363,7 @@ static void free_voice_sends(FAudioVoiceSends *sends) { if(!sends) return; - heap_free(sends); + free(sends); }
/* Voice Callbacks */ @@ -1423,15 +1422,15 @@ static ULONG WINAPI IXAudio2Impl_Release(IXAudio2 *iface) LIST_FOR_EACH_ENTRY_SAFE(v, v2, &This->voices, XA2VoiceImpl, entry){ v->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&v->lock); - HeapFree(GetProcessHeap(), 0, v); + free(v); }
- HeapFree(GetProcessHeap(), 0, This->cbs); + free(This->cbs);
This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock);
- HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; } @@ -1455,7 +1454,7 @@ static HRESULT WINAPI IXAudio2Impl_RegisterForCallbacks(IXAudio2 *iface, }
This->ncbs++; - This->cbs = heap_realloc(This->cbs, This->ncbs * sizeof(*This->cbs)); + This->cbs = realloc(This->cbs, This->ncbs * sizeof(*This->cbs));
This->cbs[i] = pCallback;
@@ -1497,7 +1496,7 @@ static inline XA2VoiceImpl *create_voice(IXAudio2Impl *This) { XA2VoiceImpl *voice;
- voice = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*voice)); + voice = calloc(1, sizeof(*voice)); if(!voice) return NULL;
@@ -1805,7 +1804,7 @@ static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface) ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(): Refcount now %u\n", This, ref); if (!ref) - HeapFree(GetProcessHeap(), 0, This); + free(This); return ref; }
@@ -1823,7 +1822,7 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p if(pOuter) return CLASS_E_NOAGGREGATION;
- object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + object = calloc(1, sizeof(*object)); if(!object) return E_OUTOFMEMORY;
@@ -1901,12 +1900,12 @@ static const IClassFactoryVtbl XAudio2CF_Vtbl = static inline HRESULT make_xaudio2_factory(REFIID riid, void **ppv) { HRESULT hr; - struct xaudio2_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xaudio2_cf)); + struct xaudio2_cf *ret = malloc(sizeof(struct xaudio2_cf)); ret->IClassFactory_iface.lpVtbl = &XAudio2CF_Vtbl; ret->ref = 0; hr = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv); if(FAILED(hr)) - HeapFree(GetProcessHeap(), 0, ret); + free(ret); return hr; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92984
Your paranoid android.
=== debiant2 (32 bit report) ===
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (32 bit Chinese:China report) ===
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (32 bit WoW report) ===
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
=== debiant2 (64 bit WoW report) ===
xaudio2_7: xaudio2.c:1000: Test failed: Couldn't load xapofx1_1.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_2.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_3.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_4.dll xaudio2.c:1000: Test failed: Couldn't load xapofx1_5.dll xaudio2.c:1085: Test failed: Couldn't load xaudio2_8.dll xaudio2.c:1295: Test failed: XAudio 2.7 not available xaudio2.c:1321: Test failed: XAudio 2.8 not available
On 6/23/21 7:37 AM, Rémi Bernon wrote:
I'm sending this as an RFC for now as there's been some discussion already about how to handle PE dependencies. I think the approach I'm taking here, by including FAudio headers directly in the source and loading it dynamically is the easiest way, and the least disruptive for building and running Wine, if not the cleanest. All the other solutions have higher friction, either on third party packages, or on the system distribution.
I don't think this is a very good idea, for several reasons:
* firstly, it's a huge amount of imported code;
* secondly, the headers can easily change in the near future (and FAudio has usually taken a loose approach to compatibility);
* thirdly, at least some distributions actually explicitly don't like this [1].
As I've said, I think it's past time we ask distributions what they actually want, and work with them accordingly. My guess is it'll be some variation of pkg-config.
Upstream FAudio now has a pure Win32 backend, which makes it much easier to build as PE. This was never a requirement, and this series should work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway to support WMA decoding. Right now, with or without the Win32 backend, this would also introduce a functional regression as although supported by the new FAudio Win32 backend, it also depends on the WMA decoder MF transform to be implemented, which isn't the case yet in Wine.
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
We already load and use PE libraries in mshtml and mscoree even if they're not built as PE. Is there a reason this would be different?
On 6/23/21 11:25 AM, Esme Povirk (she/they) wrote:
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
We already load and use PE libraries in mshtml and mscoree even if they're not built as PE. Is there a reason this would be different?
Ideally I'd like to see us leverage the distribution's dependency management rather than trying to roll our own, avoid adding more download prompts, and let distributions ship the library versions they want to. I suspect (at least some) distributions want this as well, but I'm not sure. It'd also be nice to e.g. avoid shipping our own PE libz when it turns out that Debian already ships one for us.
Whether wine-mono and wine-gecko can be adapted to use that kind of system is less clear to me, but if possible I think it'd be nice.
On Wed, Jun 23, 2021 at 11:33:17AM -0500, Zebediah Figura (she/her) wrote:
On 6/23/21 11:25 AM, Esme Povirk (she/they) wrote:
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
We already load and use PE libraries in mshtml and mscoree even if they're not built as PE. Is there a reason this would be different?
Ideally I'd like to see us leverage the distribution's dependency management rather than trying to roll our own, avoid adding more download prompts, and let distributions ship the library versions they want to. I suspect (at least some) distributions want this as well, but I'm not sure. It'd also be nice to e.g. avoid shipping our own PE libz when it turns out that Debian already ships one for us.
Whether wine-mono and wine-gecko can be adapted to use that kind of system is less clear to me, but if possible I think it'd be nice.
I don't remember seeing the download prompts on my non-development-fun-only machine. Turns out that appwiz looks for the `.msi`s in /wine/, /usr/share, /usr/share/wine and /opt/wine before attempting to download them and Arch Linux packages both wine-mono and wine-gecko.
https://source.winehq.org/git/wine.git/blob/1de583a4dac7:/dlls/appwiz.cpl/ad...
https://archlinux.org/packages/community/any/wine-mono/ https://archlinux.org/packages/community/x86_64/wine-gecko/
On 6/23/21 5:22 PM, Zebediah Figura (she/her) wrote:
On 6/23/21 7:37 AM, Rémi Bernon wrote:
I'm sending this as an RFC for now as there's been some discussion already about how to handle PE dependencies. I think the approach I'm taking here, by including FAudio headers directly in the source and loading it dynamically is the easiest way, and the least disruptive for building and running Wine, if not the cleanest. All the other solutions have higher friction, either on third party packages, or on the system distribution.
I don't think this is a very good idea, for several reasons:
- firstly, it's a huge amount of imported code;
I honestly don't think it is.
- secondly, the headers can easily change in the near future (and FAudio
has usually taken a loose approach to compatibility);
From what I could see it's usually okay, with new functions and structures added when they require a new ABI.
I don't see how this is so different from the current situation, as the current source shows it, we only check for the new function presence in the public headers.
The struct changes could be a problem, but only if we don't control the distribution of the PE FAudio. If we consider FAudio to be provided by Wine Mono for instance, it's merely a matter of making sure Wine Mono updates also update the headers here.
- thirdly, at least some distributions actually explicitly don't like
this [1].
This more precisely applies to sources, and sources which are already packaged as separate Debian packages. This is not the case here, and going that way is an entirely separate approach which IMHO has a good number of downsides.
As I've said, I think it's past time we ask distributions what they actually want, and work with them accordingly. My guess is it'll be some variation of pkg-config.
I don't think this is only a matter of discussion with the distros.
Having the dependencies provided by the system creates a much higher friction when building and running Wine from source.
Although I like the idea in theory, it's something I don't look forward to. Multi-arch is already so much of a mess than people started relying on container to build things in a sane environment.
So far Wine will be the first and probably only user ever of these new MinGW dependencies, and I don't think it's nice to delegate this to distros.
We can probably use (cross-)pkg-config for the build-time discovery (however bad it will be to integrate to configure, I tried but quickly bailed out), but then comes the problem to how to load the DLLs at runtime.
We usually compile-in the SO name, because dlopen has a set of builtin search paths, but that won't work with PE file, unless we add such paths to Wine loader.
I can also pretty easily see DRMs or anti-tamper mechanisms trigger if an unknown module is loaded from some non-standard location.
Overall this seems way more complicated, and IMHO too much for this particular case.
Upstream FAudio now has a pure Win32 backend, which makes it much easier to build as PE. This was never a requirement, and this series should work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway to support WMA decoding. Right now, with or without the Win32 backend, this would also introduce a functional regression as although supported by the new FAudio Win32 backend, it also depends on the WMA decoder MF transform to be implemented, which isn't the case yet in Wine.
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
Is this still something we should worry about with the PE conversion? I don't see any sane path ahead if we add that problem on top, unless we just include FAudio source and be done with it.
To be completely honest I don't really understand the state of XAudio. Having just this thin shell just makes everything more complicated than it needs.
The DLLs are pretty useless without FAudio, so either we should delegate the build of fully functional XAudio DLLs to FAudio which it already (partially) supports, or we should be able to build fully functional XAudio DLLs directly in Wine tree.
This remarks only applies to some of the dependencies, not ones where they are only part of the functionality, or, like winex11.drv just not possibly integrated, but it also definitely applies to, say, vkd3d.
I don't completely understand [1] why it's separate and IMHO it makes integration and working on both Wine and vkd3d just horribly painful.
[1] Well I understand source ports, but I don't see why having it live in Wine would make source ports more complicated. I understand wined3d is already used that way, and it should be pretty much possible to do the same for vkd3d.
Cheers,
On 6/23/21 11:33 AM, Rémi Bernon wrote:
On 6/23/21 5:22 PM, Zebediah Figura (she/her) wrote:
On 6/23/21 7:37 AM, Rémi Bernon wrote:
I'm sending this as an RFC for now as there's been some discussion already about how to handle PE dependencies. I think the approach I'm taking here, by including FAudio headers directly in the source and loading it dynamically is the easiest way, and the least disruptive for building and running Wine, if not the cleanest. All the other solutions have higher friction, either on third party packages, or on the system distribution.
I don't think this is a very good idea, for several reasons:
- firstly, it's a huge amount of imported code;
I honestly don't think it is.
It's 3482 lines of code; I'm not sure what you count as huge if not that...?
- secondly, the headers can easily change in the near future (and FAudio
has usually taken a loose approach to compatibility);
From what I could see it's usually okay, with new functions and structures added when they require a new ABI.
I don't see how this is so different from the current situation, as the current source shows it, we only check for the new function presence in the public headers.
The struct changes could be a problem, but only if we don't control the distribution of the PE FAudio. If we consider FAudio to be provided by Wine Mono for instance, it's merely a matter of making sure Wine Mono updates also update the headers here.
I'm not terribly concerned about API breakage, but I'm a lot more concerned than I would be with some other libraries.
More to the point, I don't want to be constantly updating headers when new features are added.
vkd3d is in a similar situation, and also evolving very quickly.
- thirdly, at least some distributions actually explicitly don't like
this [1].
This more precisely applies to sources, and sources which are already packaged as separate Debian packages. This is not the case here, and going that way is an entirely separate approach which IMHO has a good number of downsides.
Maybe Debian disagrees, but I'm not sure why headers don't count here. Note also that Debian generally has separate packages specifically for the headers.
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
As I've said, I think it's past time we ask distributions what they actually want, and work with them accordingly. My guess is it'll be some variation of pkg-config.
I don't think this is only a matter of discussion with the distros.
Having the dependencies provided by the system creates a much higher friction when building and running Wine from source.
Although I like the idea in theory, it's something I don't look forward to. Multi-arch is already so much of a mess than people started relying on container to build things in a sane environment.
So far Wine will be the first and probably only user ever of these new MinGW dependencies, and I don't think it's nice to delegate this to distros.
We're not the only user of PE libraries, or Debian wouldn't already be shipping some. See [1] for example.
More to the point, all I'm really trying to advocate for is *asking first*. I don't necessarily claim that distributions *want* to ship mingw dependencies, but we haven't asked them, and in the case that they *do* want to—which seems more than plausible to me—we should work with them rather than doing everything ourselves. The point is, nobody's asked yet.
For that matter, as to my own opinions on what Should Be Done, I'm not even attached to asking distributions to ship PE dependencies. I'd be happy to do that from winehq hosted repositories. I *am* attached to using deb/rpm/pkgbuild packages rather than inventing our own, on the other hand.
FWIW, multiarch isn't actually a mess anymore; I can build wine just fine without a container on Debian [2] and Arch, and even if it was there is a right solution, which is *fix multiarch*.
[1] https://packages.debian.org/sid/libz-mingw-w64-dev
[2] With the exception of GStreamer :-(
We can probably use (cross-)pkg-config for the build-time discovery (however bad it will be to integrate to configure, I tried but quickly bailed out), but then comes the problem to how to load the DLLs at runtime.
Right, it doesn't work currently, I also tried to see if it would work with system libz. Unfortunately I couldn't easily make it work. But it seems plausible that we'd want to make it possible for it to work. Maybe that means tweaking MinGW pkg-config a bit.
We usually compile-in the SO name, because dlopen has a set of builtin search paths, but that won't work with PE file, unless we add such paths to Wine loader.
That sounds like a good idea to me.
I can also pretty easily see DRMs or anti-tamper mechanisms trigger if an unknown module is loaded from some non-standard location.
I think there are solutions to this. One that comes to mind is symlinking. If we end up using a special reparse tag for system32 DLLs (to avoid copying them into the prefix while still pretending that they're in the prefix to a Win32 application) we could use the same solution for PE dependencies.
(Also, doesn't this patch series do exactly that anyway?)
Overall this seems way more complicated, and IMHO too much for this particular case.
Upstream FAudio now has a pure Win32 backend, which makes it much easier to build as PE. This was never a requirement, and this series should work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway to support WMA decoding. Right now, with or without the Win32 backend, this would also introduce a functional regression as although supported by the new FAudio Win32 backend, it also depends on the WMA decoder MF transform to be implemented, which isn't the case yet in Wine.
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
Is this still something we should worry about with the PE conversion? I don't see any sane path ahead if we add that problem on top, unless we just include FAudio source and be done with it.
Well, I'm not sure it'd be too hard to maintain alternate dlopen/LoadLibrary paths, for instance, and to use different paths to search for the library depending on whether we're using mingw.
To be completely honest I don't really understand the state of XAudio. Having just this thin shell just makes everything more complicated than it needs.
The DLLs are pretty useless without FAudio, so either we should delegate the build of fully functional XAudio DLLs to FAudio which it already (partially) supports, or we should be able to build fully functional XAudio DLLs directly in Wine tree.
This remarks only applies to some of the dependencies, not ones where they are only part of the functionality, or, like winex11.drv just not possibly integrated, but it also definitely applies to, say, vkd3d.
I think FAudio and vkd3d are the particularly important cases, but other PE dependencies could (possibly) include libmpg123, libgsm, libpng, libjpeg, libtiff, libgnutls, libfreetype, libxml2, libOSMesa, libz.
I don't completely understand [1] why it's separate and IMHO it makes integration and working on both Wine and vkd3d just horribly painful.
[1] Well I understand source ports, but I don't see why having it live in Wine would make source ports more complicated. I understand wined3d is already used that way, and it should be pretty much possible to do the same for vkd3d.
I'm not deeply involved in either decision, but I'd offer as an explanation that Wine is comparatively very heavy-weight. It takes up a lot of space, consumes a decent number of resources while running, requires that it be the one to set up the process and launch your main executable, and it's not exactly trivial to compile winelib applications.
One could make an argument for having the FAudio or vkd3d source live in the wine tree, though, which strikes me as a bit more reasonable. I can't as easily come up with reasons not to do that.
On 6/23/21 7:11 PM, Henri Verbeet wrote:
On Wed, 23 Jun 2021 at 17:23, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
I don't think this is a very good idea, for several reasons:
Yeah, I'm definitely not a fan of the proprietary/"modern" approach of just copying everything into the same source tree, instead of building proper interfaces and infrastructure.
I think this approach is meaningful and valuable when two projects are separate.
It's not and it gets in the way when the two are just meant to live together and are developed in a tightly coupled cycles, especially by the same people, following the same development processes (less true for FAudio).
On 6/23/21 7:15 PM, Zebediah Figura (she/her) wrote:
On 6/23/21 11:33 AM, Rémi Bernon wrote:
On 6/23/21 5:22 PM, Zebediah Figura (she/her) wrote:
On 6/23/21 7:37 AM, Rémi Bernon wrote:
I'm sending this as an RFC for now as there's been some discussion already about how to handle PE dependencies. I think the approach I'm taking here, by including FAudio headers directly in the source and loading it dynamically is the easiest way, and the least disruptive for building and running Wine, if not the cleanest. All the other solutions have higher friction, either on third party packages, or on the system distribution.
I don't think this is a very good idea, for several reasons:
- firstly, it's a huge amount of imported code;
I honestly don't think it is.
It's 3482 lines of code; I'm not sure what you count as huge if not that...?
XAudio source, which is mostly just plumbing around FAudio is 6k LoC?
deflate.c is 3k?
I don't know but this is not huge, and there's no logic there, merely type and function declarations.
- secondly, the headers can easily change in the near future (and FAudio
has usually taken a loose approach to compatibility);
From what I could see it's usually okay, with new functions and structures added when they require a new ABI.
I don't see how this is so different from the current situation, as the current source shows it, we only check for the new function presence in the public headers.
The struct changes could be a problem, but only if we don't control the distribution of the PE FAudio. If we consider FAudio to be provided by Wine Mono for instance, it's merely a matter of making sure Wine Mono updates also update the headers here.
I'm not terribly concerned about API breakage, but I'm a lot more concerned than I would be with some other libraries.
More to the point, I don't want to be constantly updating headers when new features are added.
vkd3d is in a similar situation, and also evolving very quickly.
For FAudio it's not changing so much as far as I can see.
- thirdly, at least some distributions actually explicitly don't like
this [1].
This more precisely applies to sources, and sources which are already packaged as separate Debian packages. This is not the case here, and going that way is an entirely separate approach which IMHO has a good number of downsides.
Maybe Debian disagrees, but I'm not sure why headers don't count here. Note also that Debian generally has separate packages specifically for the headers.
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
Again I'm not against proper dependency management, but I don't think it's a hard rule either and like everything it's a matter of pros and cons. It actually probably makes more sense for FAudio than it does for vkd3d, as FAudio is currently already used for porting XNA games.
Forcefully splitting everything into dynamic libraries just for the sake of defining proper interfaces at every level doesn't make much sense. We don't have proper dependency management for Wine internals, we create interfaces as we need to, and we change them as we need.
As I've said, I think it's past time we ask distributions what they actually want, and work with them accordingly. My guess is it'll be some variation of pkg-config.
I don't think this is only a matter of discussion with the distros.
Having the dependencies provided by the system creates a much higher friction when building and running Wine from source.
Although I like the idea in theory, it's something I don't look forward to. Multi-arch is already so much of a mess than people started relying on container to build things in a sane environment.
So far Wine will be the first and probably only user ever of these new MinGW dependencies, and I don't think it's nice to delegate this to distros.
We're not the only user of PE libraries, or Debian wouldn't already be shipping some. See [1] for example.
Yes they ship some, and I'm sure they do to make development of Windows applications easier on Linux. FAudio doesn't make anything easier here, people would target XAudio libraries directly, other dependencies may be more useful (libjpeg, etc...).
More to the point, all I'm really trying to advocate for is *asking first*. I don't necessarily claim that distributions *want* to ship mingw dependencies, but we haven't asked them, and in the case that they *do* want to—which seems more than plausible to me—we should work with them rather than doing everything ourselves. The point is, nobody's asked yet.
Thing is that I'm personally not going to ask because I'm not already convinced it's a good idea, and I'm not sure I want to use my system distribution for this case.
For that matter, as to my own opinions on what Should Be Done, I'm not even attached to asking distributions to ship PE dependencies. I'd be happy to do that from winehq hosted repositories. I *am* attached to using deb/rpm/pkgbuild packages rather than inventing our own, on the other hand.
FWIW, multiarch isn't actually a mess anymore; I can build wine just fine without a container on Debian [2] and Arch, and even if it was there is a right solution, which is *fix multiarch*.
Yes it's getting better, but people moved on already.
And to the contrary to multi-arch, which has a well established way of building, with packages being built as part of the other architectures supported by Debian (for instance), MinGW is not and never will be a supported architecture.
Packages will need to be defined and maintained separately, with an even less standardized filesystem location. Some use /usr/<mingw-arch>/{include,lib}, while multi-arch usually uses /usr/{include,lib}/<arch>/, but that may vary.
[2] With the exception of GStreamer :-(
So still mess, and it's been a while.
We can probably use (cross-)pkg-config for the build-time discovery (however bad it will be to integrate to configure, I tried but quickly bailed out), but then comes the problem to how to load the DLLs at runtime.
Right, it doesn't work currently, I also tried to see if it would work with system libz. Unfortunately I couldn't easily make it work. But it seems plausible that we'd want to make it possible for it to work. Maybe that means tweaking MinGW pkg-config a bit.
At least on my debian I can use prefixed pkg-config, like x86_64-w64-mingw32-pkg-config and that works fine, but Wine configure overrides PKG_CONFIG_PATH (and it probably shouldn't), and in any case this needs to be implemented somehow in m4 language which I absolutely don't master.
We usually compile-in the SO name, because dlopen has a set of builtin search paths, but that won't work with PE file, unless we add such paths to Wine loader.
That sounds like a good idea to me.
I can also pretty easily see DRMs or anti-tamper mechanisms trigger if an unknown module is loaded from some non-standard location.
I think there are solutions to this. One that comes to mind is symlinking. If we end up using a special reparse tag for system32 DLLs (to avoid copying them into the prefix while still pretending that they're in the prefix to a Win32 application) we could use the same solution for PE dependencies.
(Also, doesn't this patch series do exactly that anyway?)
Yes, it loads the DLL from Wine Mono installation as a fallback. IMHO it would be better if FAudio was in system32. And even better if we could build it as a builtin DLL and have it installed already as part of Wine build / installation.
Overall this seems way more complicated, and IMHO too much for this particular case.
Upstream FAudio now has a pure Win32 backend, which makes it much easier to build as PE. This was never a requirement, and this series should work too with the SDL2 backend, as it tries to load Wine Mono SDL2 and FAudio as a fallback after trying from the prefix system libraries.
It could help the transition though, and is going to be required anyway to support WMA decoding. Right now, with or without the Win32 backend, this would also introduce a functional regression as although supported by the new FAudio Win32 backend, it also depends on the WMA decoder MF transform to be implemented, which isn't the case yet in Wine.
What if Wine is built without MinGW? Do we care about that case? If we don't care about it for XAudio, what about other libraries?
Is this still something we should worry about with the PE conversion? I don't see any sane path ahead if we add that problem on top, unless we just include FAudio source and be done with it.
Well, I'm not sure it'd be too hard to maintain alternate dlopen/LoadLibrary paths, for instance, and to use different paths to search for the library depending on whether we're using mingw.
It's not only about that. XAudio also has a nasty thread swap mechanism to support the case where the FAudio processing thread is created by SDL2, and is not a Wine thread. Of course this could be ifdefed too, but I think everybody will be happy if we could drop it.
To be completely honest I don't really understand the state of XAudio. Having just this thin shell just makes everything more complicated than it needs.
The DLLs are pretty useless without FAudio, so either we should delegate the build of fully functional XAudio DLLs to FAudio which it already (partially) supports, or we should be able to build fully functional XAudio DLLs directly in Wine tree.
This remarks only applies to some of the dependencies, not ones where they are only part of the functionality, or, like winex11.drv just not possibly integrated, but it also definitely applies to, say, vkd3d.
I think FAudio and vkd3d are the particularly important cases, but other PE dependencies could (possibly) include libmpg123, libgsm, libpng, libjpeg, libtiff, libgnutls, libfreetype, libxml2, libOSMesa, libz.
I don't completely understand [1] why it's separate and IMHO it makes integration and working on both Wine and vkd3d just horribly painful.
[1] Well I understand source ports, but I don't see why having it live in Wine would make source ports more complicated. I understand wined3d is already used that way, and it should be pretty much possible to do the same for vkd3d.
I'm not deeply involved in either decision, but I'd offer as an explanation that Wine is comparatively very heavy-weight. It takes up a lot of space, consumes a decent number of resources while running, requires that it be the one to set up the process and launch your main executable, and it's not exactly trivial to compile winelib applications.
I didn't mean using Wine to run an application,
One could make an argument for having the FAudio or vkd3d source live in the wine tree, though, which strikes me as a bit more reasonable. I can't as easily come up with reasons not to do that.
but this instead. For vkd3d in particular, Wine is its primary user, and shares the developers too.
Having well-defined interfaces and proper ABI compatibility is something I perfectly understand, when a piece of software needs to be distributed and used separately. The only reason I can understand for Wine to go through that interface, is that it makes a good test case, but then it also makes integration, testing, and d3d12 updates in Wine more complicated than it needs to be.
The vkd3d internals also then cannot benefit from Wine facilities, such as debug logging, and have to duplicate them in vkd3d source, with some alternate variable to know about.
Wouldn't it be easier to just use D3D12 interface as the public interface to vkd3d? And just build d3d12.dll / d3d12.so there directly instead of having a small piece still living in Wine? Same for XAudio.
And having vkd3d live in Wine source wouldn't make it impossible to build a standalone SO version of it with well defined interface too, to support source ports, either with some configure flags, or using a separate configure / Makefile in d3d12 folder.
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
It may be questionable from a philosophical standpoint, but that's the world we live in. Linux distros don't care about backwards compatibility, and I have no reason to believe that this is going to change, or that they would do a better job with PE packages.
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
Jacek
On 6/25/21 2:38 PM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
Jacek
IMHO this is pretty inconvenient too.
Having to build with winegcc means that building full featured Wine would have to be done in three steps in worst case, where we need to build winegcc first (and Wine import libs and headers I guess?), then these dependencies, passing them wherever that was built, then Wine again for real, passing it wherever these dependencies have been built.
Developing on both sides is going to be even more inconvenient than the canonical Linux way where we have to build the dependencies with MinGW first, install them locally somewhere, and point Wine where it can find the headers and import libs.
Of course if the dependencies never change, it doesn't matter too much, and for these I would even be more in favor of Zeb's proposal. But for the ones which are likely to change, and which we will work on often, like FAudio, I think this should be somehow directly integrated in Wine build process in a straightforward way.
This means either import their source, or make Wine build able to build them from an external source directory. It's actually pretty much the same as this here, but better integrated (and I don't even think we have to use upstream build systems to build the sources we need).
Cheers,
On 6/25/21 2:54 PM, Rémi Bernon wrote:
Developing on both sides is going to be even more inconvenient than the canonical Linux way where we have to build the dependencies with MinGW first, install them locally somewhere, and point Wine where it can find the headers and import libs.
Majority of developers work on Wine itself and for them we could provide pre-built static libs and/or they would just build them once in a while, install and have multiple Wine builds use them.
Full bootstrap would indeed require 3-step process and it's probably what you'd want when working on dependencies themselves. But we could make 'wine-addons' build system optionally take care of building both addons and Wine itself, which could hide that in in a single make invocation.
That said, if we can make it work nice inside Wine itself, I'm not against it. I just fear that it won't be pretty...
Jacek
On 6/28/21 3:15 PM, Jacek Caban wrote:
On 6/25/21 2:54 PM, Rémi Bernon wrote:
Developing on both sides is going to be even more inconvenient than the canonical Linux way where we have to build the dependencies with MinGW first, install them locally somewhere, and point Wine where it can find the headers and import libs.
Majority of developers work on Wine itself and for them we could provide pre-built static libs and/or they would just build them once in a while, install and have multiple Wine builds use them.
Full bootstrap would indeed require 3-step process and it's probably what you'd want when working on dependencies themselves. But we could make 'wine-addons' build system optionally take care of building both addons and Wine itself, which could hide that in in a single make invocation.
That said, if we can make it work nice inside Wine itself, I'm not against it. I just fear that it won't be pretty...
It may be easier to use this wine-addons project to aggregate all the required dependencies, maintain the required glue (possibly ugly, but I don't think it has to be), and more properly expose their versions.
Wine build would then be pointed to the wine-addons source with a configure flag, or consider the dependencies as missing.
Of course, pre-built could be provided too, but I'm not sure if it's even worth the trouble if the build is straightforward (and not much longer).
On Mon, Jun 28, 2021 at 9:49 AM Rémi Bernon rbernon@codeweavers.com wrote:
On 6/28/21 3:15 PM, Jacek Caban wrote:
It may be easier to use this wine-addons project to aggregate all the required dependencies, maintain the required glue (possibly ugly, but I don't think it has to be), and more properly expose their versions.
Wine build would then be pointed to the wine-addons source with a configure flag, or consider the dependencies as missing.
Of course, pre-built could be provided too, but I'm not sure if it's even worth the trouble if the build is straightforward (and not much longer). -- Rémi Bernon rbernon@codeweavers.com
Using wine-addons would also mean it would be simpler to deal with less popular distros and also macOS (currently a nightmare)
Moving the using static PE would save a lot of stress maintenance.
On 6/25/21 7:38 AM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
I remember a discussion a while ago, but why exactly do we need winegcc rather than plain mingw?
I remember one argument being that we might not know the CRT version linked to, but does this really matter in practice for any of our libraries? E.g. the ones I'm aware of ship their own malloc/free wrappers for memory they return.
On 6/28/21 5:51 AM, Zebediah Figura (she/her) wrote:
On 6/25/21 7:38 AM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
I remember a discussion a while ago, but why exactly do we need winegcc rather than plain mingw?
Those are just different CRTs. We use msvcrt/ucrt importlib in Wine with tiny additions of static parts of msvcrt and winecrt0. mingw-w64 has a ton of additions and depends on msvcrt importlib, libmingwex.a and libmingw32.a combination. You can't mix them in general (and there is no reason to).
Jacek
On 6/28/21 8:05 AM, Jacek Caban wrote:
On 6/28/21 5:51 AM, Zebediah Figura (she/her) wrote:
On 6/25/21 7:38 AM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
I remember a discussion a while ago, but why exactly do we need winegcc rather than plain mingw?
Those are just different CRTs. We use msvcrt/ucrt importlib in Wine with tiny additions of static parts of msvcrt and winecrt0. mingw-w64 has a ton of additions and depends on msvcrt importlib, libmingwex.a and libmingw32.a combination. You can't mix them in general (and there is no reason to).
I'm still missing something; shouldn't a shared library built with mingw stand alone? Why would it matter what import library + CRT version + crt0 library the rest of the source is built with?
On Mon, Jun 28, 2021 at 10:46 AM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
I'm still missing something; shouldn't a shared library built with mingw stand alone? Why would it matter what import library + CRT version + crt0 library the rest of the source is built with?
It matters if the ABI requires malloc/free, FILE pointers, or fd's, but I doubt this is common for Wine.
On 6/28/21 5:46 PM, Zebediah Figura (she/her) wrote:
On 6/28/21 8:05 AM, Jacek Caban wrote:
On 6/28/21 5:51 AM, Zebediah Figura (she/her) wrote:
On 6/25/21 7:38 AM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
I remember a discussion a while ago, but why exactly do we need winegcc rather than plain mingw?
Those are just different CRTs. We use msvcrt/ucrt importlib in Wine with tiny additions of static parts of msvcrt and winecrt0. mingw-w64 has a ton of additions and depends on msvcrt importlib, libmingwex.a and libmingw32.a combination. You can't mix them in general (and there is no reason to).
I'm still missing something; shouldn't a shared library built with mingw stand alone? Why would it matter what import library + CRT version + crt0 library the rest of the source is built with?
It matters a lot less for shared libraries, but we're talking about using static libraries.
Jacek
On 6/25/21 2:38 PM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward.
To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here:
https://github.com/cjacek/wine-addons
While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well).
We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step.
Jacek
Hi all!
I went ahead on this approach, to see how nicely this could be integrated into Wine build, things well pretty well, and I reached a point where I'm quite happy with the result.
FAudio was my starting point, for XAudio libraries conversion, but things turned out well and I've been able to integrate several other dependencies pretty easily.
I don't know if I should invest more time on it, and I don't really know if we need this to even cover all these dependencies, it would be nice to make a list of which one we really need here (some may be hard to integrate that way, see at the bottom of the message).
# Where
If you are interested in having a look, I've pushed the related Wine changes to https://github.com/rbernon/wine, in a "wip/wine-ext" branch, with the text format patches here:
https://github.com/rbernon/wine/compare/master...wip/wine-ext.patch
As well as the dependencies sources in "wine-ext" repository to aggregate them:
https://github.com/rbernon/wine-ext
(The Wine patches include a bunch of not completely related commits, more specifically gdi32 font parsing, to ease the conversion of some unixlib code back to PE, I'll probably send them upstream at some point).
# How
The "wine-ext" repository references a fork of every dependency as a submodule. It needs to be cloned somewhere, with "--recurse-submodules", and then its path provided to "configure --with-wine-ext=<path>", which will check that its "VERSION" file number is what current version of Wine expects.
The repository can also be exported as a versioned tarball of all the sources, eventually downloaded, extracted and used in the same way.). I didn't even had to make any modification to the dependencies sources, and I just referenced the current latest release for each.
(To be completely honest I'm not even sure if submodules are really useful here, I don't really see what difference it would make to just extract their release tarballs... maybe it would lack the ability to do bisect on them, I don't know if that's useful.)
(I'm also not completely sure if it makes a real conceptual difference with including these sources directly in Wine tree, but I can see how this is a bit "cleaner".)
For every dependency, there's a Makefile.in in a new external/ folder in Wine source, and it references sources from the "wine-ext" location.
The dependencies then are built as static libraries. They could very well be changed to DLL without trouble, we would have to define a spec file for each one though.
(Having all built as static libraries makes everything a bit more verbose, as for instance, winefreetype depends on winezlib, winepng and others, and they all need to be added as imports to anything which needs winefreetype.)
Any module which would need functionality from these libraries is converted to import them, and add the relevant include flags from the "wine-ext" directory, in order to find the library headers.
(For simplicity, it's a hard dependency requirement, and if the "wine-ext" folder is not provided then the modules are disabled. It may be better to make that optional, but it would make the changes more complicated too.)
# Plumbing
It required adapting makedep a little bit to make it less strict on external sources, mostly to pass some conditional includes that aren't taken anyway, or because they sometimes include a "config.h", which would end up in some other location than Wine's "config.h".
Most of the time, we don't need anything more than a few extra compilation defines. For a few dependencies (libpng, mpg123), I added some plumbing headers in Wine source to make them happy, and it's a bit ugly, although the plumbing is very small.
These headers could also very well live in "wine-ext" instead but as it sometimes drives the enabled features it may be better to have them in Wine.
# Problems
Among the possible issues that went to mind:
* Would it cause licensing problems? The "wine-ext" repository has a Makefile to create a tarball of all the sources, so they can be then redistributed (and eventually used to build Wine instead of the repository with submodules), so maybe it's all fine?
* There's some remaining dependencies, although I thought maybe they weren't the most important ones, and maybe a unixlib split could be more appropriate:
- OpenAL is written in C++, and although Wine build system could perhaps be adapted to support building C++ sources, I faced a lot of compilation errors and didn't feel the energy to dig further.
- libgphoto2 could be compiled, but its Win32 support seems to depend on MinGW posix runtime, so it misses a lot of things when built in Wine. I saw people mentioning MSVC builds, so maybe I missed something there.
(It's a lot of code though, and I'm not sure if it's even going to be working in the Win32 world as it seems to be accessing some low-level camera stuff. There again I didn't spend much time on it.)
- libcapi and libctapi, but I'm not sure if it's just a matter of building for Win32, and I didn't even try adding them.
* Some dependencies aren't built with all the features enabled:
- mpg123 more specifically doesn't have its assembler optimizations. I think it may be possible to include them, but they are not in C but as separate assembly file for every architecture, and I didn't find an easy way to build them conditionally.
- freetype2 also misses a few things, notably harfbuzz. I added brotli and bzip2 more for fun than anything, and it also went well, but harfbuzz is C++ too and it may be more complicated. I'm not sure how much of a trouble this is. Of course there's always the option not to use the PE freetype here, the unixlib split is done already.
Cheers,
Rémi Bernon rbernon@codeweavers.com writes:
On 6/25/21 2:38 PM, Jacek Caban wrote:
On 6/23/21 8:38 PM, Alexandre Julliard wrote:
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
I agree that it's a good way to move forward. To implement it, we will need to build dependencies with winegcc (rather than plain mingw). I did experiment with it last year, you may see it here: https://github.com/cjacek/wine-addons While the build system itself is just a rough draft and needs rethinking, it shows how to build static libs with winegcc (it links them into standalone PE files, but they should be ready to statically link to Wine modules as well). We will probably also need such static libs to be more portable by getting rid of libgcc dependency, but that's a latter step. Jacek
Hi all!
I went ahead on this approach, to see how nicely this could be integrated into Wine build, things well pretty well, and I reached a point where I'm quite happy with the result.
Sorry about the late reply, I finally found the time to look into this.
I like your idea of using the Wine makefiles and bypassing the upstream build system. I'm not convinced that it can work in all cases, but when it works it definitely makes things a lot easier.
The "wine-ext" repository references a fork of every dependency as a submodule. It needs to be cloned somewhere, with "--recurse-submodules", and then its path provided to "configure --with-wine-ext=<path>", which will check that its "VERSION" file number is what current version of Wine expects.
That would make it hard to do bisects. You'd need to be able to extract multiple versions at once, or switch wine-ext commits to follow Wine, at which point we would be reinventing git submodules.
(I'm also not completely sure if it makes a real conceptual difference with including these sources directly in Wine tree, but I can see how this is a bit "cleaner".)
Maybe a little cleaner, but I'm thinking that importing the sources would save a lot of trouble. Especially since with your approach we only need to import *.[ch] and not the rest of the project.
- There's some remaining dependencies, although I thought maybe they weren't the most important ones, and maybe a unixlib split could be
more appropriate:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
On 8/31/21 4:47 PM, Alexandre Julliard wrote:
I like your idea of using the Wine makefiles and bypassing the upstream build system. I'm not convinced that it can work in all cases, but when it works it definitely makes things a lot easier.
Sure, I was even surprised it went so well. I guess we're lucky so far.
- There's some remaining dependencies, although I thought maybe they weren't the most important ones, and maybe a unixlib split could be more appropriate:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
I can have a try.
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard julliard@winehq.org:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
On 9/1/21 5:13 PM, Stefan Dösinger wrote:
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard julliard@winehq.org:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
FWIW I had a very quick look yesterday and it seems like there's also a lot of assembly code. I'm not sure that it'd work out easily anyway.
Maybe gnutls isn’t a good candidate full PE conversion.
On Wed, Sep 1, 2021 at 11:33 AM Rémi Bernon rbernon@codeweavers.com wrote:
On 9/1/21 5:13 PM, Stefan Dösinger wrote:
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard <julliard@winehq.org
:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that
currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
FWIW I had a very quick look yesterday and it seems like there's also a lot of assembly code. I'm not sure that it'd work out easily anyway. -- Rémi Bernon rbernon@codeweavers.com
On 9/1/21 10:32 AM, Rémi Bernon wrote:
On 9/1/21 5:13 PM, Stefan Dösinger wrote:
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard julliard@winehq.org:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
FWIW I had a very quick look yesterday and it seems like there's also a lot of assembly code. I'm not sure that it'd work out easily anyway.
Wait, why not? Why shouldn't MinGW be capable of dealing with assembly?
FWIW, I've seen MinGW builds of gnutls (msys2 ships one, for example), and their configure.ac seems to explicitly support it.
On 9/1/21 5:44 PM, Zebediah Figura (she/her) wrote:
On 9/1/21 10:32 AM, Rémi Bernon wrote:
On 9/1/21 5:13 PM, Stefan Dösinger wrote:
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard julliard@winehq.org:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
FWIW I had a very quick look yesterday and it seems like there's also a lot of assembly code. I'm not sure that it'd work out easily anyway.
Wait, why not? Why shouldn't MinGW be capable of dealing with assembly?
FWIW, I've seen MinGW builds of gnutls (msys2 ships one, for example), and their configure.ac seems to explicitly support it.
Sure, but the way I did it here everything is built with Wine makefiles, not with the original build system. Which has advantages but causes some issues with non-C sources, as I described in my previous message.
On 9/1/21 5:32 PM, Rémi Bernon wrote:
On 9/1/21 5:13 PM, Stefan Dösinger wrote:
Am 31.08.2021 um 17:47 schrieb Alexandre Julliard julliard@winehq.org:
More important ones would be GnuTLS and libxml2. It may be interesting to see how well GnuTLS works with your scheme.
How will certificates work in a PE GnuTLS? My understanding is that currently Windows apps running in Wine will automagically pick up whatever root certificates the distro ships, which seems like a useful feature to me, in particular in corporate environments that might add their own internal certs.
FWIW I had a very quick look yesterday and it seems like there's also a lot of assembly code. I'm not sure that it'd work out easily anyway.
So libxml2/libxslt weren't too bad, there's a bit of plumbing to do though, with some xsltconfig.h and xmlversion.h headers expected to be found by users of the libraries, so they have to be added either in every module, or somewhere in wine private headers.
They also cause a few warnings but that could probably be hidden, and I could then convert msxml3 to PE without much trouble.
I updated by wip/wine-ext branch with these changes, and I also fixed a few things that were previously broken.
In addition, I modified the way the sources are looked for, to remove the umbrella project in favor of individual configure flags (or using the existing --with-(png|xml|...) when they existed) to indicate where the sources are located.
I think this would be best for flexibility, if Linux distribution desire to provide alternate sources for instance. I haven't added any default value but in the case we consider adding the sources in the tree that's probably how we could do it.
Then, on the other hand, gnutls seems more complicated. It's mostly about the nettle library actually, as gnutls is just a facade over it.
As I described, it has all bunch of assembly files for the optimized versions of the algorithms, and worst, these asm files seems to actually be full of m4 macros. Anyway, they also have generic C versions of the algorithms, so we could just use them instead.
However it's not all, as they also have a few generated tables, which seem to be target architecture dependent. AFAICS the generators are simple C files which we could probably compile too, and generate the tables at build time, but that will probably require a bit more makedep.c changes (unless I missed an easy way to do it).
There's also of course the consideration about how the certificates are going to be found, as described by Stephan.
Cheers,
I know I'm representing the minority opinion here, but I'd like to offer my objections anyway :-)
I think the solution I originally proposed doesn't make a lot of sense in retrospect. However, I don't like this one either.
I've tried to rethink my position to be more reasonable, and I'd like whatever solution we come up with to satisfy three things:
(1) I really don't want to have to build any libraries that aren't part of Wine. More importantly, I don't want anyone who's not a regular Wine developer to ever have to build any libraries that aren't part of Wine. Also, if I do need to build (say) libvkd3d-shader, I want to *only* have to build libvkd3d-shader and not all of the Wine dependencies at once.
This is quite likely the only thing that holds me back from contributing to wine-mono (not that this is entirely Esme's fault; the problem affects mono upstream, although wine-mono has doubled down on it)
(2) I would like bisecting dependencies to not be a pain. As someone who will be working on vkd3d a lot, this is quite important to me. Ideally this means that the dependencies should exist in shared libraries, not static ones.
I would also like to be able to develop in a separate tree, since git submodules are terrible for doing active development on a component. Rémi's proposed solution does not really allow for that as far as I can tell.
As an aside, I still think there is something to be gained in using shared libraries to reduce disk space. Almost all of our PE dependencies are not only shared across multiple DLLs, but will often be loaded multiple times in the same process (vkd3d, faudio, gnutls, libpng, zlib, freetype, mpg123 all come immediately to mind. To some degree we can try to abstract that out with our own shared-to-static shims, but that takes some work which I think is rather unnecessary.)
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
ἔρρωσθε, Zebediah
[1] https://wiki.debian.org/EmbeddedCopies
[2] https://fedoraproject.org/wiki/Bundled_Libraries
[3] https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-...
[4] https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
I don't see any harm in asking. I'll admit that I'm fairly skeptical, so it will be up to you to build a convincing case. Getting the buy-in of the major distros is obviously a required step.
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
I don't see any harm in asking. I'll admit that I'm fairly skeptical, so it will be up to you to build a convincing case. Getting the buy-in of the major distros is obviously a required step.
Well, to be clear, I'm not even necessarily trying to build a case (anymore); I'd just like to not leave them out of the conversation.
In particular, I think distributions *may* want to encourage us toward dynamic linking, and they also *may* want to distribute dependencies separately (so that they can, say, distribute our libgnutls in sync with ELF libgnutls in case they need to do a security update). For that matter that doesn't necessarily preclude building everything with submodules, although I personally would like to avoid submodules or anything like them.
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
Note that there would also need to be some sort of DLL versioning scheme, to handle ABI changes.
On 9/1/21 2:05 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
Note that there would also need to be some sort of DLL versioning scheme, to handle ABI changes.
As far as I understand, this is already dealt with by appending the major version number to the DLL name, e.g. "libfreetype-6.dll", or do you mean something different?
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/1/21 2:05 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
Note that there would also need to be some sort of DLL versioning scheme, to handle ABI changes.
As far as I understand, this is already dealt with by appending the major version number to the DLL name, e.g. "libfreetype-6.dll", or do you mean something different?
Something like that, yes. Of course there isn't necessarily a correlation between major version numbers and ABI changes...
On 8/31/21 10:06 PM, Zebediah Figura (she/her) wrote:
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
I don't see any harm in asking. I'll admit that I'm fairly skeptical, so it will be up to you to build a convincing case. Getting the buy-in of the major distros is obviously a required step.
Well, to be clear, I'm not even necessarily trying to build a case (anymore); I'd just like to not leave them out of the conversation.
In particular, I think distributions *may* want to encourage us toward dynamic linking, and they also *may* want to distribute dependencies separately (so that they can, say, distribute our libgnutls in sync with ELF libgnutls in case they need to do a security update). For that matter that doesn't necessarily preclude building everything with submodules, although I personally would like to avoid submodules or anything like them.
Remember that we need the libs to have custom names, to avoid conflicts with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
At least the first distribution I've talked to (Fedora) already has mingw packages for many of our desired PE dependencies, and the initial response I got was something along the lines of "why can't you use those?" and "is there any way you can avoid having to rename libraries?"
For a fixed location a better path would be /opt/wine/ext as /opt/wine is already used for both wine-mono (/opt/wine/mono) and wine-gecko (/opt/wine/gecko)
On Thu, Sep 2, 2021 at 3:20 PM Zebediah Figura (she/her) < zfigura@codeweavers.com> wrote:
On 8/31/21 10:06 PM, Zebediah Figura (she/her) wrote:
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions.
As
I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue
that
we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
I don't see any harm in asking. I'll admit that I'm fairly skeptical, so it will be up to you to build a convincing case. Getting the buy-in of the major distros is obviously a required step.
Well, to be clear, I'm not even necessarily trying to build a case (anymore); I'd just like to not leave them out of the conversation.
In particular, I think distributions *may* want to encourage us toward dynamic linking, and they also *may* want to distribute dependencies separately (so that they can, say, distribute our libgnutls in sync with ELF libgnutls in case they need to do a security update). For that matter that doesn't necessarily preclude building everything with submodules, although I personally would like to avoid submodules or anything like them.
Remember that we need the libs to have custom names, to avoid
conflicts
with Windows apps shipping the same libs.
Yep, I've been keeping that in mind. If we want to distribute shared libraries I'm inclined to think the best solution there is to copy (or symlink, or fake-symlink) them into the prefix with different names.
This won't work for nested dependencies. For instance the PE libpng is going to import the PE zlib, so it needs to have been renamed at build time already.
Indeed; that's annoying, but thanks for pointing it out.
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
At least the first distribution I've talked to (Fedora) already has mingw packages for many of our desired PE dependencies, and the initial response I got was something along the lines of "why can't you use those?" and "is there any way you can avoid having to rename libraries?"
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand.
You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag. And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand.
You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
Presumably Wine and system libs shouldn't do import resolving by hand.
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand. You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
I don't see how this would work. All such libraries will import msvcrt or kernel32, but you can't have these end up in a separate namespace.
And how do you define a "system lib"? Do you somehow tell the PE loader the actual Unix path that the dll was loaded from? What if the distro installs the Wine DLLs in the same dir?
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
Well, you'll need to copy, say, zlib1.dll into the prefix. How do you know this is the zlib1.dll from the system package, and not one installed by an app? Do you add the builtin flag, altering the binary when copying it?
On 9/3/21 12:02 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand. You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
I don't see how this would work. All such libraries will import msvcrt or kernel32, but you can't have these end up in a separate namespace.
And how do you define a "system lib"? Do you somehow tell the PE loader the actual Unix path that the dll was loaded from? What if the distro installs the Wine DLLs in the same dir?
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
Well, you'll need to copy, say, zlib1.dll into the prefix. How do you know this is the zlib1.dll from the system package, and not one installed by an app? Do you add the builtin flag, altering the binary when copying it?
I did fail to consider that case, thanks.
After thinking about it for a while I've come up with the following algorithm:
Suppose that module A imports module B.
1. If module A is marked "builtin" or "system":
a. Try to find a module marked "builtin" or "system" in memory, and return it if found. (Skip "builtin" if the load order requires.)
b. Try to load a module from WINESYSTEMDLLDIR#. If found, mark the module as "system".
c. Try to find a module marked "native" in memory, and return it if found. (Skip this step if the load order requires.)
d. Try to load a builtin or native module using the normal logic.
2. Otherwise, i.e. module A is native:
a. Try to find a module marked "builtin" or "native" (modulo load order) in memory, and return it if found. Skip "system".
b. Try to load a builtin or native module using the normal logic.
This should avoid ever loading a system module for a native module; it should avoid loading a native module when we want a system module (provided that system modules are present; if they aren't things are already broken). It should also handle e.g. ucrtbase imports, regardless if ucrtbase is builtin or native.
The downside I can see is that if ucrtbase is native, we'll always search WINESYSTEMDLLDIRs for it. If that's a performance problem, we could always bypass step 1b for a predefined list of modules.
This does rely on the fact that WINESYSTEMDLLDIRs are unique and only contain system libraries. It's not obvious to me that would be a problem to guarantee. The list might contain one or more paths like:
* C:/windows/system32/wine-ext/ [1] * Z:/usr/x86_64-w64-mingw32/bin/ [2] * Z:/usr/lib/wine/ext/
I'm sure this all looks like a pile of hacks. Granted, it doesn't look unreasonable to me, but I suppose I'm also biased. I'm just trying my best to make dynamic libraries a possibility, because static libraries suck for development. And, more importantly, I'm trying to give distributions an accurate representation of our requirements.
[1] As far as I'm aware, the only reason we need to copy libraries to the C: drive is that anticheats *might* complain if libraries are loaded from another drive? Was there a concrete example of this? Or was there another problem I was missing?
[2] Or distribution equivalent. That's assuming that distributions are in favor of having us dynamically link to pre-built libraries, though, and that's an open question. It's also not clear how we would get this path.
FWIW, I don't think Remi's solution requires that we use static libraries. If we are taking over the build process for libpng, we can just as easily put it in our own winepng.dll as we can statically link it into user32 and windowscodecs.
Nor does getting libraries from the distribution require that they be dynamic, we could pick up static libraries from the distro at Wine build time. Then we'd still have the decision of whether to put that library into its own dll or the Wine dll's that use it.
On 9/3/21 3:06 PM, Esme Povirk (she/they) wrote:
FWIW, I don't think Remi's solution requires that we use static libraries. If we are taking over the build process for libpng, we can just as easily put it in our own winepng.dll as we can statically link it into user32 and windowscodecs.
Nor does getting libraries from the distribution require that they be dynamic, we could pick up static libraries from the distro at Wine build time. Then we'd still have the decision of whether to put that library into its own dll or the Wine dll's that use it.
Sure, renaming libraries or using static libraries are both an option. The hitch is that it seems Fedora doesn't really want us to do either of these. (Personally I don't either, because it makes development more annoying, for one reason or another.) Granted, that is only one distribution, though; I haven't yet sent mails to others.
A simpler solution might be to do something similar to the DELAYIMPORTS mechanism, but instead of using __wine_spec_delay_load, we'd use some special Wine-specific function to load the .dll, which would search the system paths first for the dll and its dependencies, and (if found there) set a "system" flag so that normal dll resolution doesn't find it in memory.
This would mean that we don't need to give any special treatment to builtin dlls, just dll's loaded using this particular mechanism.
Then again, the dll would still be visible to Windows software, even if trying to load it by just the basename wouldn't find that version, so it might still cause problems.
On Fri, Sep 3, 2021 at 2:11 PM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
On 9/3/21 12:02 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand. You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
I don't see how this would work. All such libraries will import msvcrt or kernel32, but you can't have these end up in a separate namespace.
And how do you define a "system lib"? Do you somehow tell the PE loader the actual Unix path that the dll was loaded from? What if the distro installs the Wine DLLs in the same dir?
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
Well, you'll need to copy, say, zlib1.dll into the prefix. How do you know this is the zlib1.dll from the system package, and not one installed by an app? Do you add the builtin flag, altering the binary when copying it?
I did fail to consider that case, thanks.
After thinking about it for a while I've come up with the following algorithm:
Suppose that module A imports module B.
If module A is marked "builtin" or "system":
a. Try to find a module marked "builtin" or "system" in memory, and
return it if found. (Skip "builtin" if the load order requires.)
b. Try to load a module from WINESYSTEMDLLDIR#. If found, mark the
module as "system".
c. Try to find a module marked "native" in memory, and return it if
found. (Skip this step if the load order requires.)
d. Try to load a builtin or native module using the normal logic.
Otherwise, i.e. module A is native:
a. Try to find a module marked "builtin" or "native" (modulo load
order) in memory, and return it if found. Skip "system".
b. Try to load a builtin or native module using the normal logic.
This should avoid ever loading a system module for a native module; it should avoid loading a native module when we want a system module (provided that system modules are present; if they aren't things are already broken). It should also handle e.g. ucrtbase imports, regardless if ucrtbase is builtin or native.
The downside I can see is that if ucrtbase is native, we'll always search WINESYSTEMDLLDIRs for it. If that's a performance problem, we could always bypass step 1b for a predefined list of modules.
This does rely on the fact that WINESYSTEMDLLDIRs are unique and only contain system libraries. It's not obvious to me that would be a problem to guarantee. The list might contain one or more paths like:
- C:/windows/system32/wine-ext/ [1]
- Z:/usr/x86_64-w64-mingw32/bin/ [2]
- Z:/usr/lib/wine/ext/
I'm sure this all looks like a pile of hacks. Granted, it doesn't look unreasonable to me, but I suppose I'm also biased. I'm just trying my best to make dynamic libraries a possibility, because static libraries suck for development. And, more importantly, I'm trying to give distributions an accurate representation of our requirements.
[1] As far as I'm aware, the only reason we need to copy libraries to the C: drive is that anticheats *might* complain if libraries are loaded from another drive? Was there a concrete example of this? Or was there another problem I was missing?
[2] Or distribution equivalent. That's assuming that distributions are in favor of having us dynamically link to pre-built libraries, though, and that's an open question. It's also not clear how we would get this path.
Another potential issue that I'm thinking of, is that if you have these dependencies shipped by distribution packages, you may end up in a situation where an application starts using them as their own dependencies, instead of the non-wine-specific versions.
Clearly it's not a good practice, but you can't prevent it as soon as distributions provide the packages, and I can imagine a few reasons why they would do so (because it's convenient and the non-wine-specific version isn't packaged, or at a different version).
If we only build them as part of Wine, you really have to build your application against Wine build tree to end up in the same situation.
Of course, we can then consider that it's not our problem and don't care about breakage a dependency update could cause, but still...
Cheers,
Sveinar
On 05.09.2021 14:04, Rémi Bernon wrote:
Another potential issue that I'm thinking of, is that if you have these dependencies shipped by distribution packages, you may end up in a situation where an application starts using them as their own dependencies, instead of the non-wine-specific versions.
Clearly it's not a good practice, but you can't prevent it as soon as distributions provide the packages, and I can imagine a few reasons why they would do so (because it's convenient and the non-wine-specific version isn't packaged, or at a different version).
I might have missunderstood (quite likely) something here... You guys are not talking about making distro's provide packages needed for "special wine-only stuff" right?
Are distributions supposed to provide any sort of "wine-only-but-can-be-used-for-other-stuff" packages that will be required for wine to build/run?
If we only build them as part of Wine, you really have to build your application against Wine build tree to end up in the same situation.
Of course, we can then consider that it's not our problem and don't care about breakage a dependency update could cause, but still...
Cheers,
On 9/3/21 2:11 PM, Zebediah Figura (she/her) wrote:
On 9/3/21 12:02 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand. You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
I don't see how this would work. All such libraries will import msvcrt or kernel32, but you can't have these end up in a separate namespace.
And how do you define a "system lib"? Do you somehow tell the PE loader the actual Unix path that the dll was loaded from? What if the distro installs the Wine DLLs in the same dir?
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
Well, you'll need to copy, say, zlib1.dll into the prefix. How do you know this is the zlib1.dll from the system package, and not one installed by an app? Do you add the builtin flag, altering the binary when copying it?
I did fail to consider that case, thanks.
After thinking about it for a while I've come up with the following algorithm:
Suppose that module A imports module B.
If module A is marked "builtin" or "system":
a. Try to find a module marked "builtin" or "system" in memory, and
return it if found. (Skip "builtin" if the load order requires.)
b. Try to load a module from WINESYSTEMDLLDIR#. If found, mark the
module as "system".
c. Try to find a module marked "native" in memory, and return it if
found. (Skip this step if the load order requires.)
d. Try to load a builtin or native module using the normal logic.
Otherwise, i.e. module A is native:
a. Try to find a module marked "builtin" or "native" (modulo load
order) in memory, and return it if found. Skip "system".
b. Try to load a builtin or native module using the normal logic.
This should avoid ever loading a system module for a native module; it should avoid loading a native module when we want a system module (provided that system modules are present; if they aren't things are already broken). It should also handle e.g. ucrtbase imports, regardless if ucrtbase is builtin or native.
The downside I can see is that if ucrtbase is native, we'll always search WINESYSTEMDLLDIRs for it. If that's a performance problem, we could always bypass step 1b for a predefined list of modules.
This does rely on the fact that WINESYSTEMDLLDIRs are unique and only contain system libraries. It's not obvious to me that would be a problem to guarantee. The list might contain one or more paths like:
- C:/windows/system32/wine-ext/ [1]
- Z:/usr/x86_64-w64-mingw32/bin/ [2]
- Z:/usr/lib/wine/ext/
I'm sure this all looks like a pile of hacks. Granted, it doesn't look unreasonable to me, but I suppose I'm also biased. I'm just trying my best to make dynamic libraries a possibility, because static libraries suck for development. And, more importantly, I'm trying to give distributions an accurate representation of our requirements.
[1] As far as I'm aware, the only reason we need to copy libraries to the C: drive is that anticheats *might* complain if libraries are loaded from another drive? Was there a concrete example of this? Or was there another problem I was missing?
[2] Or distribution equivalent. That's assuming that distributions are in favor of having us dynamically link to pre-built libraries, though, and that's an open question. It's also not clear how we would get this path.
Actually, while thinking about it I realized another, more salient snag: if system library A tries to load system library B dynamically, we have no way of knowing whether to give it the system or application library.
I don't think there's any way around this. Even rewriting the import table using objcopy or something (which was actually proposed in conversation with distributions) wouldn't fix this. We have to use a different name, or abandon dynamic libraries altogether.
Maybe there's clever solution I'm missing?
On 09/09/2021 07:38, Zebediah Figura wrote:
On 9/3/21 2:11 PM, Zebediah Figura (she/her) wrote:
On 9/3/21 12:02 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 9/3/21 3:26 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
Actually, an alternate solution occurred to me:
If we are loading any library that is a dependency of a builtin library, always load it from a fixed path like /usr/lib/wine/ext/, and essentially treat it as if we had loaded using an absolute path instead of a relative path, so as to skip existing DLLs loaded under that name.
Mark that DLL with an internal flag, and don't consider it when searching for existing DLLs with that name, to avoid the other side.
I know there are a lot of other things standing in the way of shared libraries, and that this would require some nontrivial loader work, but does it at least seem plausible? Are there snags I'm not noticing?
Sure, you can try to create a separate namespace for these without actually changing their names. It's not clear to me how you are going to determine which DLLs should go into that namespace, and how that's going to work with apps that do import resolving by hand. You'll also have to invent some mechanism to have Wine treat them as builtins even though they don't have the builtin flag.
The distinguishing factor I was thinking of is that if it's a system lib or linked to by a system lib, it's marked as a system lib. That doesn't work for libraries loaded dynamically, and there we have the extra caveat that we don't want to mark every dynamically loaded library as a system lib, so I think we'd need an internal flag to LoadLibraryExW().
I don't see how this would work. All such libraries will import msvcrt or kernel32, but you can't have these end up in a separate namespace.
And how do you define a "system lib"? Do you somehow tell the PE loader the actual Unix path that the dll was loaded from? What if the distro installs the Wine DLLs in the same dir?
And somehow you need to differentiate them from the exact same DLLs being shipped by an app...
Sorry, I'm not sure what you mean by this, that's different from what I described above?
Well, you'll need to copy, say, zlib1.dll into the prefix. How do you know this is the zlib1.dll from the system package, and not one installed by an app? Do you add the builtin flag, altering the binary when copying it?
I did fail to consider that case, thanks.
After thinking about it for a while I've come up with the following algorithm:
Suppose that module A imports module B.
- If module A is marked "builtin" or "system":
a. Try to find a module marked "builtin" or "system" in memory, and return it if found. (Skip "builtin" if the load order requires.)
b. Try to load a module from WINESYSTEMDLLDIR#. If found, mark the module as "system".
c. Try to find a module marked "native" in memory, and return it if found. (Skip this step if the load order requires.)
d. Try to load a builtin or native module using the normal logic.
- Otherwise, i.e. module A is native:
a. Try to find a module marked "builtin" or "native" (modulo load order) in memory, and return it if found. Skip "system".
b. Try to load a builtin or native module using the normal logic.
This should avoid ever loading a system module for a native module; it should avoid loading a native module when we want a system module (provided that system modules are present; if they aren't things are already broken). It should also handle e.g. ucrtbase imports, regardless if ucrtbase is builtin or native.
The downside I can see is that if ucrtbase is native, we'll always search WINESYSTEMDLLDIRs for it. If that's a performance problem, we could always bypass step 1b for a predefined list of modules.
This does rely on the fact that WINESYSTEMDLLDIRs are unique and only contain system libraries. It's not obvious to me that would be a problem to guarantee. The list might contain one or more paths like:
- C:/windows/system32/wine-ext/ [1]
- Z:/usr/x86_64-w64-mingw32/bin/ [2]
- Z:/usr/lib/wine/ext/
I'm sure this all looks like a pile of hacks. Granted, it doesn't look unreasonable to me, but I suppose I'm also biased. I'm just trying my best to make dynamic libraries a possibility, because static libraries suck for development. And, more importantly, I'm trying to give distributions an accurate representation of our requirements.
[1] As far as I'm aware, the only reason we need to copy libraries to the C: drive is that anticheats *might* complain if libraries are loaded from another drive? Was there a concrete example of this? Or was there another problem I was missing?
[2] Or distribution equivalent. That's assuming that distributions are in favor of having us dynamically link to pre-built libraries, though, and that's an open question. It's also not clear how we would get this path.
Actually, while thinking about it I realized another, more salient snag: if system library A tries to load system library B dynamically, we have no way of knowing whether to give it the system or application library.
I don't think there's any way around this. Even rewriting the import table using objcopy or something (which was actually proposed in conversation with distributions) wouldn't fix this. We have to use a different name, or abandon dynamic libraries altogether.
Maybe there's clever solution I'm missing?
Can't you just add some wine-specific logic to LoadLibrary to handle this? System libs shouldn't be loading non-system-libs anyway. While it may be ugly, you can check the return address and see if it's within a system lib's address range.
On 9/9/21 16:33, Gabriel Ivăncescu wrote:
O
Can't you just add some wine-specific logic to LoadLibrary to handle this? System libs shouldn't be loading non-system-libs anyway. While it may be ugly, you can check the return address and see if it's within a system lib's address range.
Leaving the fragility of such a solution apart, I think it is not supposed to work nicely with numerous hotpatchers which hook LoadLibrary at various API levels. The return address will point to the hooker in this case, besides potentially breaking the hotpatcher's logic.
On Wed, Sep 8, 2021 at 11:39 PM Zebediah Figura zfigura@codeweavers.com wrote:
Actually, while thinking about it I realized another, more salient snag: if system library A tries to load system library B dynamically, we have no way of knowing whether to give it the system or application library.
I don't think there's any way around this. Even rewriting the import table using objcopy or something (which was actually proposed in conversation with distributions) wouldn't fix this. We have to use a different name, or abandon dynamic libraries altogether.
Maybe there's clever solution I'm missing?
If a library needs to do this, then we will have to modify it no matter what solution we use.
Actually, the "clever" solution may be to base any changes in loader behavior on the path of the dll, not how it was loaded. If a library is dynamically loading dependencies on Windows, it's already going to ensure it loads them based on its own location.
On Thu, Sep 9, 2021 at 8:56 AM Esme Povirk (she/they) esme@codeweavers.com wrote:
On Wed, Sep 8, 2021 at 11:39 PM Zebediah Figura zfigura@codeweavers.com wrote:
Actually, while thinking about it I realized another, more salient snag: if system library A tries to load system library B dynamically, we have no way of knowing whether to give it the system or application library.
I don't think there's any way around this. Even rewriting the import table using objcopy or something (which was actually proposed in conversation with distributions) wouldn't fix this. We have to use a different name, or abandon dynamic libraries altogether.
Maybe there's clever solution I'm missing?
If a library needs to do this, then we will have to modify it no matter what solution we use.
On 9/9/21 9:05 AM, Esme Povirk (she/they) wrote:
Actually, the "clever" solution may be to base any changes in loader behavior on the path of the dll, not how it was loaded. If a library is dynamically loading dependencies on Windows, it's already going to ensure it loads them based on its own location.
Is that guaranteed? Is there any reason that an application can't put DLLs in system32?
Granted, I don't actually know if there even are any libraries that do this. I guess that if there are, it'd break building everything as static as well, so maybe it doesn't matter.
On Thu, Sep 9, 2021 at 10:53 AM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
Is that guaranteed? Is there any reason that an application can't put DLLs in system32?
No, but open-source libraries that target windows have to cope with being installed in an arbitrary location. That means that if any applications install things in system32 on Windows, they need to cope with that too. So if one *were* broken in that way, it'd be broken on Windows too.
"Esme Povirk (she/they)" esme@codeweavers.com writes:
On Thu, Sep 9, 2021 at 10:53 AM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
Is that guaranteed? Is there any reason that an application can't put DLLs in system32?
No, but open-source libraries that target windows have to cope with being installed in an arbitrary location. That means that if any applications install things in system32 on Windows, they need to cope with that too. So if one *were* broken in that way, it'd be broken on Windows too.
That would assume that all libraries find all their data based solely on the library path. That seems optimistic...
Note that the issue is not only with imported libraries, it could be using external config files or registry keys, all of these would have to be renamed as well.
On 9/10/21 3:49 AM, Alexandre Julliard wrote:
"Esme Povirk (she/they)" esme@codeweavers.com writes:
On Thu, Sep 9, 2021 at 10:53 AM Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
Is that guaranteed? Is there any reason that an application can't put DLLs in system32?
No, but open-source libraries that target windows have to cope with being installed in an arbitrary location. That means that if any applications install things in system32 on Windows, they need to cope with that too. So if one *were* broken in that way, it'd be broken on Windows too.
That would assume that all libraries find all their data based solely on the library path. That seems optimistic...
Note that the issue is not only with imported libraries, it could be using external config files or registry keys, all of these would have to be renamed as well.
That applies to static libraries, too, though. In that case I guess we have no choice but to go through and check for them...
On Fri, Sep 10, 2021 at 3:49 AM Alexandre Julliard julliard@winehq.org wrote:
That would assume that all libraries find all their data based solely on the library path. That seems optimistic...
Note that the issue is not only with imported libraries, it could be using external config files or registry keys, all of these would have to be renamed as well.
I think this is usually the case based on the work I've done packaging open-source (primarily unix) libraries for Windows.
I also think that it should be the goal of upstream libraries or at least distributions to provide versions that are useful for targeting Windows, and an important part of that is being able to function in an application that doesn't know what directory it'll be installed to, and may not have an install process at all. Especially if distributions actively want us to use their packages, they should be willing to accept patches for that. It does of course leave us dependent on distributions instead of letting us take matters into our own hands, but that would be a problem anyway.
Sveinar
On 10.09.2021 18:10, Esme Povirk (she/they) wrote:
On Fri, Sep 10, 2021 at 3:49 AM Alexandre Julliard julliard@winehq.org wrote:
That would assume that all libraries find all their data based solely on the library path. That seems optimistic...
Note that the issue is not only with imported libraries, it could be using external config files or registry keys, all of these would have to be renamed as well.
I think this is usually the case based on the work I've done packaging open-source (primarily unix) libraries for Windows.
I also think that it should be the goal of upstream libraries or at least distributions to provide versions that are useful for targeting Windows, and an important part of that is being able to function in an application that doesn't know what directory it'll be installed to, and may not have an install process at all. Especially if distributions actively want us to use their packages, they should be willing to accept patches for that. It does of course leave us dependent on distributions instead of letting us take matters into our own hands, but that would be a problem anyway.
What about those "release distros" everyone love to hate? (Like Debian & family). Doing active development on said libraries when some distros have a 1+ year release policy - and rarely backport unless there is severe bugs. "Not our (WineHQ's) problem"? I mean, Debian testing (Bookworm) is still at wine-5.0.3. Bullseye that just got released is also at wine-5.0.3.... and in 3 months or so, i guess WineHQ is up to wine-stable-7.0.
I am not saying this won't change with some goodwill, but i do not hold high hopes for some of the slower release based distro's in that regard, especially if the list of "needed libs" grows exponentially fast :)
On 8/31/21 2:30 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
On 8/31/21 1:25 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I know people here think that they won't want to distribute PE libraries, but I'm inclined to think that at least some distributions won't be happy with our proposed solution either. See [1] [2] [3] [4] for popular distributions trying to discourage source imports and static libraries. I get that we're a special case, and maybe distributions will think so too, but I really want to again argue that we shouldn't be making that decision for them.
Have you tried asking them?
I haven't yet. I didn't really want to speak on behalf of the Wine project if the consensus was against consulting them, and I didn't want to start that conversation without the possibility that its fruits would at least be taken into account. But if there are no objections I'll start writing some mails.
I don't see any harm in asking. I'll admit that I'm fairly skeptical, so it will be up to you to build a convincing case. Getting the buy-in of the major distros is obviously a required step.
I've spent the last couple of weeks asking Fedora [1], Debian [2], openSUSE [3], and Arch (private conversation with the maintainer). There is, perhaps unfortunately, a unanimous consensus among these that they would indeed like to see us use their packages, and to link dynamically rather than statically.
Fedora ships about half of the libraries we need already; Debian ships only one (if you even count zlib), Arch ships none. But representatives from all of these offered to add the missing ones.
Fedora, openSUSE, and Debian all have a MinGW version of pkg-config, which can be used to find include and library paths for the relevant libraries. Arch doesn't have it, but the AUR does; I think it's a clear enough standard to standardize on.
We don't however have a standardized way to find libraries which don't have pkg-config support (which I think only ends up being gsm?) We also don't have a standardized way to find the runtime path.
(As to the question of why these packages exist in the first place: the uses that people mentioned seem to be mostly about cross-compiling software for Windows on a Linux host. openSUSE also mentioned that some of its packages are used by the WSL loader. In general there appears to be some demand for them, but they're also not currently a very high priority. For example, Debian has had an open bug [4], with a decent amount of discussion, regarding adding mingw support to multiarch instead of its current none-arch solution. But being used by Wine would certainly change things.)
I brought up the problem of dynamic library conflicts in the above discussions; the response was universally along the lines of "we'd really prefer it if you could use dynamic libraries", accompanied by proposals to work around it on the Wine side. It's not particularly surprising that distributions would want this; after all, it means less work for them (and more for us), but personally I'm inclined to believe it makes sense, and it's worth pursuing if it's at all possible.
So in short, the assumption that distributions don't want to deal with our nonsense doesn't seem to hold. For better or for worse.
With that in mind, I believe we will still want some way of building that does *not* rely on distribution packages—in case one is building from source on a system that doesn't provide any, and doesn't want to build them manually.
And given that Fedora and Debian currently package some, but not all, of the libraries we need, we should ideally also be able to use what distribution packages are available and fall back to static libraries for the others.
So I think we do want something like Rémi's solution, but on top of that I'd like to propose that we allow for using pre-built dynamic libraries where available.
I have attached a set of 3 patches to this mail that should give a very rough idea of what this would look like. It comprises an implementation of my proposed rudimentary "namespacing" in the loader, and the configure bits to look for and use MinGW zlib. The namespacing seems to work, after some basic tests. (dbghelp is kind of broken, because it doesn't handle multiple identically named libraries, but that needs to be fixed anyway.) The runtime dynamic library path is specified via a configure variable.
This doesn't include the mentioned fallback mechanism (or apply on top of Rémi's patches at all), mostly because it's not clear to me how close to the eventual upstream Rémi's patches are.
And yes, it's possible that an application breaks for the simple reason that we're using dynamic libraries it doesn't expect. The best I can offer is that usually when applications trawl the loader state, they're looking for things like ntdll and kernel32, and also that SxS exists and so it's not unheard of to see multiple identically named libraries anyway. If nothing else I'd like to argue that the risk of breaking, at this point, is low enough that it's worth at least trying. If we have a fallback mechanism, plus the ability to bisect, it'll be easy enough to diagnose failure anyway.
Sorry for being overly verbose in the above, I wanted to accurately summarize the discussion and make sure all points had been touched on.
ἔρρωσθε, Zebediah
[1] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/...
[2] https://lists.debian.org/debian-devel/2021/09/msg00074.html
[3] https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/A...
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606825
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=98088
Your paranoid android.
=== debiant2 (build log) ===
Task: The win32 Wine build failed
=== debiant2 (build log) ===
Task: The wow64 Wine build failed
Zebediah Figura zfigura@codeweavers.com writes:
I've spent the last couple of weeks asking Fedora [1], Debian [2], openSUSE [3], and Arch (private conversation with the maintainer). There is, perhaps unfortunately, a unanimous consensus among these that they would indeed like to see us use their packages, and to link dynamically rather than statically.
Thank you for doing this!
So I think we do want something like Rémi's solution, but on top of that I'd like to propose that we allow for using pre-built dynamic libraries where available.
Yes, it seems clear that we'll need our own solution anyway, so we should move ahead with that. It should be easy to preserve a way at least for developers to use distro packages instead of the bundled libs, so that we can experiment further. Making it seamless for end users can then be a long term goal.
Sorry for being overly verbose in the above, I wanted to accurately summarize the discussion and make sure all points had been touched on.
ἔρρωσθε, Zebediah
Hi
just one question though... Did you have the opportunity to ask them how they intend to do non-regression testing
seems to be they have lots of stuff in place, and we could benefit from it ; I'm thinking in particular when they'll move forward in one of the shared lib?
A+
On 9/21/21 7:08 AM, Eric Pouech wrote:
Hi
just one question though... Did you have the opportunity to ask them how they intend to do non-regression testing
seems to be they have lots of stuff in place, and we could benefit from it ; I'm thinking in particular when they'll move forward in one of the shared lib?
Sorry, I'm not sure I understand what you mean? I assume you're referring to running the Wine self-tests after building from source, but I don't see how MinGW system libraries would change anything there.
Le 21/09/2021 à 18:05, Zebediah Figura a écrit :
On 9/21/21 7:08 AM, Eric Pouech wrote:
Hi
just one question though... Did you have the opportunity to ask them how they intend to do non-regression testing
seems to be they have lots of stuff in place, and we could benefit from it ; I'm thinking in particular when they'll move forward in one of the shared lib?
Sorry, I'm not sure I understand what you mean? I assume you're referring to running the Wine self-tests after building from source, but I don't see how MinGW system libraries would change anything there.
my point was not related to the architecture choice but rather on who's doing what
it seems to me that for now distros don't test that much the impact on wine from the changes they push on their own
it could be an opportunity to ask them for more
A+
Maybe i am overly pessimistic here, but what kind of tests are distro's that do not provide wine-devel on a bi-weekly release schedule going to do regarding wine spesific impacts?
Sveinar
----- On Sep 21, 2021, at 6:40 PM, Eric Pouech eric.pouech@orange.fr wrote:
Le 21/09/2021 à 18:05, Zebediah Figura a écrit :
On 9/21/21 7:08 AM, Eric Pouech wrote:
Hi
just one question though... Did you have the opportunity to ask them how they intend to do non-regression testing
seems to be they have lots of stuff in place, and we could benefit from it ; I'm thinking in particular when they'll move forward in one of the shared lib?
Sorry, I'm not sure I understand what you mean? I assume you're referring to running the Wine self-tests after building from source, but I don't see how MinGW system libraries would change anything there.
my point was not related to the architecture choice but rather on who's doing what
it seems to me that for now distros don't test that much the impact on wine from the changes they push on their own
it could be an opportunity to ask them for more
A+
It's not important to run tests on the very latest version of Wine, nor is it important to run all the tests. We could provide a list of the ones that most closely depend on a particular library.
On 8/31/21 8:06 PM, Zebediah Figura (she/her) wrote:
(1) I really don't want to have to build any libraries that aren't part of Wine. More importantly, I don't want anyone who's not a regular Wine developer to ever have to build any libraries that aren't part of Wine. Also, if I do need to build (say) libvkd3d-shader, I want to *only* have to build libvkd3d-shader and not all of the Wine dependencies at once.
This is quite likely the only thing that holds me back from contributing to wine-mono (not that this is entirely Esme's fault; the problem affects mono upstream, although wine-mono has doubled down on it)
(Well, things like zlib is clearly not part of Wine, but TBH I don't really see how vkd3d is not a part of Wine.)
With the PoC you could already be working on the dependencies sources in the "wine-ext" umbrella project, building whichever Wine module depends on it to test it. If you don't need to build any Wine module to test it, then just build the project with its own build system.
Then, having a separate umbrella project has its drawbacks and I agree with Alexandre here that it makes bisection inconvenient. But even if we consider having the sources included in Wine you could very well have a configure flag to point to an alternate source location, while still using Wine makefiles to build the corresponding Wine module.
(2) I would like bisecting dependencies to not be a pain. As someone who will be working on vkd3d a lot, this is quite important to me. Ideally this means that the dependencies should exist in shared libraries, not static ones.
I would also like to be able to develop in a separate tree, since git submodules are terrible for doing active development on a component. Rémi's proposed solution does not really allow for that as far as I can tell.
Anyway, I'm not sure vkd3d if was in question here. I mentioned it previously as an example of external dependencies which I would find nicer to have integrated with Wine build (alongside with wine-mono and wine-gecko but they're way beyond reach), but I don't know that we're planning on any change there.
As an aside, I still think there is something to be gained in using shared libraries to reduce disk space. Almost all of our PE dependencies are not only shared across multiple DLLs, but will often be loaded multiple times in the same process (vkd3d, faudio, gnutls, libpng, zlib, freetype, mpg123 all come immediately to mind. To some degree we can try to abstract that out with our own shared-to-static shims, but that takes some work which I think is rather unnecessary.)
Well, my PoC didn't use shared libraries because it seemed to be the initially intended way with Jacek idea. However, using Wine makefiles it's really just a matter of few lines and a specfile to make them DLLs instead.
(3) Most importantly, I would like to coöperate with distributions. As I understand, they already don't like the way we distribute wine-mono and wine-gecko, and I don't think we should annoy them any further by going behind their back and distributing more pre-built libraries.
I'm sure they dislike the wine-mono / wine-gecko situation more because we're downloading them separately from an untrusted source rather than because they embed a lot of already packaged third-party dependencies.
FWIW building them as part of Wine would probably be much appreciated, regardless of their content.
Cheers,
On 8/31/21 1:57 PM, Rémi Bernon wrote:
On 8/31/21 8:06 PM, Zebediah Figura (she/her) wrote:
(1) I really don't want to have to build any libraries that aren't part of Wine. More importantly, I don't want anyone who's not a regular Wine developer to ever have to build any libraries that aren't part of Wine. Also, if I do need to build (say) libvkd3d-shader, I want to *only* have to build libvkd3d-shader and not all of the Wine dependencies at once.
This is quite likely the only thing that holds me back from contributing to wine-mono (not that this is entirely Esme's fault; the problem affects mono upstream, although wine-mono has doubled down on it)
(Well, things like zlib is clearly not part of Wine, but TBH I don't really see how vkd3d is not a part of Wine.)
(Well, vkd3d is worked on almost exclusively by Wine developers, and hosted on winehq.org, but it's really meant to be a separate project usable outside of Wine. That said, if it were just vkd3d I probably wouldn't complain—after all, if we hadn't decided to split out vkd3d into a separate library all of that stuff would have been in Wine anyway.)
With the PoC you could already be working on the dependencies sources in the "wine-ext" umbrella project, building whichever Wine module depends on it to test it. If you don't need to build any Wine module to test it, then just build the project with its own build system.
Then, having a separate umbrella project has its drawbacks and I agree with Alexandre here that it makes bisection inconvenient. But even if we consider having the sources included in Wine you could very well have a configure flag to point to an alternate source location, while still using Wine makefiles to build the corresponding Wine module.
I may have miscommunicated; what I'm getting at is that I currently don't have to compile, say, libgnutls, and I would like to continue not having to compile libgnutls. Ideally I'd like to be able to link to pre-compiled static and shared libraries, and even more ideally I shouldn't have to manually set up configure to find them. Granted, without integrating those into a package somehow this is going to be difficult.
I guess the thing that makes this painful (in the projects I have worked with that do submodules, most prominently Proton and Mono) is twofold:
(1) build system recursion makes full builds *much* slower even when there's nothing to build. Granted, your PoC makes this a non-issue, but I'm also much less optimistic than Alexandre that trying to bypass projects' build systems is a good idea. Also granted, there are ways to get around this regardless...
(2) full builds are much slower anyway. This is particularly a problem for non-regular contributors [or even non-contributors who want to build a project from source, which is quite common!] It's also a problem if we end up compiling subprojects using Wine's tooling somehow, because that can easily change a *lot*.
Granted, I haven't actually tried, maybe the number and scope of subprojects we actually have makes this not much of an issue. But the number looks comparable to those projects that I hate dealing with, and the scope doesn't look that different...
Sorry for the slow reply, I'll admit I didn't really want to get into an involved discussion, and I don't particularly expect to get anywhere, but I'd at least like to try to explain my reasoning.
On 6/23/21 1:38 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
It may be questionable from a philosophical standpoint, but that's the world we live in. Linux distros don't care about backwards compatibility, and I have no reason to believe that this is going to change, or that they would do a better job with PE packages.
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
Mostly what I'm trying to advocate for in this thread is that we ask distributions what they want instead of deciding for them. Just because static linking might be easier for them doesn't mean it's what they actually want, and I think there are salient and good reasons why they wouldn't want it. Now, if we have that conversation and nobody wants to ship dependencies themselves, I'm prepared to shut up and deal with the decision; I won't be happy about it, but I seem to be in the minority at least among Wine developers here.
Not least because I'm not convinced that "Linux distros don't care about backwards compatiblity", or (as implied) that they don't care about philosophical correctness. I get the impression rather that some libraries don't care about backwards compatibility, and don't give distributions a choice in the matter. I'd really like to not see us become one of those, at least with respect to not giving distributions a choice. And I think that distributions broadly *do* care about philosophical correctness (as arises from practical correctness!) as evidenced by the Debian/Fedora/Gentoo policies linked earlier in this thread [1] [2] [3]. (Yeah, they're mostly talking about source imports, but some of the arguments apply to submodule-type dependencies as well.)
I get that we may have been burned in the past by breakages that have been the distribution's fault, but I think the response to that shouldn't be to break off negotiating with them and do what we think is right.
Now, with that said, here's some reasons, which I'm hoping are both strong and practical, that we should rely on distribution packages. Some arguments for not embedding or static linking don't really apply to PE dependencies, because they really are a special case. But others do:
* Projects that import source take so much longer to build. That applies whether the source is baked in, statically linked, or even built as a shared library. The last two cases actually often get worse because the build system needs to recurse (but baked-in source has its own problems.) This is probably the top reason I absolutely hate contributing to wine-mono, and why although it's my job to work on Proton I avoid its build system like the plague (preferring instead to compile individual Wine modules). [4]
I as a DirectShow developer need to build GStreamer anyway, for various reasons (I need the latest version, or to fix an upstream bug, etc.) But I've never needed to compile FAudio from source, and I don't want to have to take that extra time during a Wine build. Relying on my distribution package makes things much easier for me.
* Static linking makes bisects painful. You have to rebuild the downstream project every time. Shared libraries would be a lot better, for this and for other reasons. Even if the decision ends up being to distribute libraries ourselves I'd like to advocate that they be shared rather than static.
* By linking libraries statically, or by linking them shared and distributing them ourselves, we are taking up more disk space that could be shared. This is obviously a garbage argument because no other application is using PE libraries, except that:
(a) some distributions [5] and unofficial repositories [6] do ship MinGW libraries, which means that there *is* a demand for them outside of Wine, and
(b) if we link them statically, even within Wine we'd be sharing many libraries across several modules [libvkd3d and libvkd3d-shader across d3dcompiler_*, d3d12, dxgi; libfaudio across all of the many xaudio modules; even libmpg123 across l3codeca.acm and mp3dmod!], and to avoid this we'd have to use some sort of manually defined static -> shared shim. At that point distributing the shared library seems like less work.
* This might not be under consideration, but I'll mention it anyway: We may have gotten used to the appwiz prompts, but they're honestly an awful user experience.
* Submodules are not fun to deal with, particularly the part where 'git submodule update' forces you off a branch.
ἔρρωσθε, Zebediah
[1] https://wiki.debian.org/EmbeddedCopies
[2] https://fedoraproject.org/wiki/Bundled_Libraries
[3] https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies
[4] As a bit of an aside, this may be my top complaint about modern dependency management. It makes things easier for the project maintainer, and for people who work on the project all of the time, because they have to build everything from source anyway. And it makes things easier for the end-user, because they don't need to take any extra steps when installing [and often need to take less!] But it makes things much worse on the developer of a downstream/upstream component, or on the end user who needs to compile the package for some reason.
[5] https://packages.ubuntu.com/search?suite=hirsute%C2%A7ion=all&arch=any&a...
[6] https://martchus.no-ip.biz/buildservice/#package-search-section?name%3Dmingw...
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
- By linking libraries statically, or by linking them shared and distributing them ourselves, we are taking up more disk space that
could be shared. This is obviously a garbage argument because no other application is using PE libraries, except that:
(a) some distributions [5] and unofficial repositories [6] do ship MinGW libraries, which means that there *is* a demand for them outside of Wine, and
Note that one of the drawbacks of shared PE libs is that they are visible to the app, and potentially conflict with libraries bundled with the app. This means that we'd want to rename our versions, so even though Debian ships a zlib.dll, we would need our own separate winezlib.dll anyway.
On 6/28/21 6:59 AM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
- By linking libraries statically, or by linking them shared and distributing them ourselves, we are taking up more disk space that could be shared. This is obviously a garbage argument because no
other application is using PE libraries, except that:
(a) some distributions [5] and unofficial repositories [6] do ship MinGW libraries, which means that there *is* a demand for them outside of Wine, and
Note that one of the drawbacks of shared PE libs is that they are visible to the app, and potentially conflict with libraries bundled with the app. This means that we'd want to rename our versions, so even though Debian ships a zlib.dll, we would need our own separate winezlib.dll anyway.
Ugh. That was probably pointed out to me ages ago, but I forgot about it :-(
On 6/28/21 5:48 AM, Zebediah Figura (she/her) wrote:
Sorry for the slow reply, I'll admit I didn't really want to get into an involved discussion, and I don't particularly expect to get anywhere, but I'd at least like to try to explain my reasoning.
Sorry if the discussion sounds involved, I think it's interesting to have this discussed, and even if I have some preferences right now, I'm trying to be open to being convinced otherwise.
On 6/23/21 1:38 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
It may be questionable from a philosophical standpoint, but that's the world we live in. Linux distros don't care about backwards compatibility, and I have no reason to believe that this is going to change, or that they would do a better job with PE packages.
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
Mostly what I'm trying to advocate for in this thread is that we ask distributions what they want instead of deciding for them. Just because static linking might be easier for them doesn't mean it's what they actually want, and I think there are salient and good reasons why they wouldn't want it. Now, if we have that conversation and nobody wants to ship dependencies themselves, I'm prepared to shut up and deal with the decision; I won't be happy about it, but I seem to be in the minority at least among Wine developers here.
Let's say we ask, what are we going to consider as a good enough effort from our side?
Would it be enough to ask Debian's and RedHat's MinGW package maintainers (who already maintain a few MinGW packages) if they would be ready to make a few more, and hope that the other distributions will follow?
According to https://pkgs.org/search/?q=mingw, among distros which aren't apparently based on deb/rpm packages, Alpine, Arch or Solus don't have any MinGW packages yet except for the runtime itself. Also I'm sure that website also misses a few popular yet exotic distros.
Looking that the packages there, I can already spot differences between Debian, RedHat (and others) approaches, going over a few ones, I found already:
Debian: /usr/i686-w64-mingw32/{bin,include,lib} RedHat: /usr/i686-w64-mingw32/sys-root/mingw/{bin,include,lib} Solus: /usr/share/mingw-w64/i686-w64-mingw32/{bin,include,lib}
This is not necessarily an issue but if we embed default search paths into Wine, this has to be taken into consideration.
It also means that we would need to make it dynamically configurable, and even if the distro build scripts may override the default, once built it would be bound to a specific filesystem organization.
- Projects that import source take so much longer to build. That applies
whether the source is baked in, statically linked, or even built as a shared library. The last two cases actually often get worse because the build system needs to recurse (but baked-in source has its own problems.) This is probably the top reason I absolutely hate contributing to wine-mono, and why although it's my job to work on Proton I avoid its build system like the plague (preferring instead to compile individual Wine modules). [4]
I think there's different scale of dependencies, and I believe the discussion is only valid for the small ones. However inconvenient Wine Mono and Gecko are to build, I don't think it's a good idea to consider including them in Wine.
FWIW I don't think we have to stick to upstream build system and have recursive make anywhere if we don't want to. We only need the code to implement our DLLs, not the build system.
I as a DirectShow developer need to build GStreamer anyway, for various reasons (I need the latest version, or to fix an upstream bug, etc.) But I've never needed to compile FAudio from source, and I don't want to have to take that extra time during a Wine build. Relying on my distribution package makes things much easier for me.
- Static linking makes bisects painful. You have to rebuild the
downstream project every time. Shared libraries would be a lot better, for this and for other reasons. Even if the decision ends up being to distribute libraries ourselves I'd like to advocate that they be shared rather than static.
System provided libraries can also be problematic when the regression comes from the system update.
And as I explained in my reply to Jacek, I don't think building these dependencies separately from Wine is convenient either. If that's the plan, I'd rather go through the system distribution.
- By linking libraries statically, or by linking them shared and
distributing them ourselves, we are taking up more disk space that could be shared. This is obviously a garbage argument because no other application is using PE libraries, except that:
(a) some distributions [5] and unofficial repositories [6] do ship MinGW libraries, which means that there *is* a demand for them outside of Wine, and
I don't think we should rely on user-contributed packages. Either the distro have what we need, or we should provide the packages as an alternative.
(b) if we link them statically, even within Wine we'd be sharing many libraries across several modules [libvkd3d and libvkd3d-shader across d3dcompiler_*, d3d12, dxgi; libfaudio across all of the many xaudio modules; even libmpg123 across l3codeca.acm and mp3dmod!], and to avoid this we'd have to use some sort of manually defined static -> shared shim. At that point distributing the shared library seems like less work.
Are the xaudio libraries supposed to share state on Windows? If not then I think we should probably not either. It may be a waste of disk space, but we could consider the prefix size issue to be a separate one.
- Submodules are not fun to deal with, particularly the part where 'git
submodule update' forces you off a branch.
I agree, but I don't think we need to have that. We could just pass the source location as a configure flag, regardless to how that has been pulled, and consider the dependency as missing if sources are not provided.
Cheers,
On 6/28/21 7:22 AM, Rémi Bernon wrote:
On 6/28/21 5:48 AM, Zebediah Figura (she/her) wrote:
Sorry for the slow reply, I'll admit I didn't really want to get into an involved discussion, and I don't particularly expect to get anywhere, but I'd at least like to try to explain my reasoning.
Sorry if the discussion sounds involved, I think it's interesting to have this discussed, and even if I have some preferences right now, I'm trying to be open to being convinced otherwise.
On 6/23/21 1:38 PM, Alexandre Julliard wrote:
"Zebediah Figura (she/her)" zfigura@codeweavers.com writes:
I know that dependency management (and ABI compatibility, for that matter) has fallen out of style in some circles, in favor of statically linking everything or shipping all your dependencies, but I really don't think that's a good thing, it has easily visible negative effects, and while I don't really want to get into an argument over it I also don't want to see us adopt that philosophy without question.
It may be questionable from a philosophical standpoint, but that's the world we live in. Linux distros don't care about backwards compatibility, and I have no reason to believe that this is going to change, or that they would do a better job with PE packages.
And honestly, building our dependencies as PE and linking them statically would make things so much easier for everybody, that there would need to be strong practical reasons to go out of our way to start relying on distro packages for this. A general dislike of the approach is not good enough IMHO.
Mostly what I'm trying to advocate for in this thread is that we ask distributions what they want instead of deciding for them. Just because static linking might be easier for them doesn't mean it's what they actually want, and I think there are salient and good reasons why they wouldn't want it. Now, if we have that conversation and nobody wants to ship dependencies themselves, I'm prepared to shut up and deal with the decision; I won't be happy about it, but I seem to be in the minority at least among Wine developers here.
Let's say we ask, what are we going to consider as a good enough effort from our side?
Would it be enough to ask Debian's and RedHat's MinGW package maintainers (who already maintain a few MinGW packages) if they would be ready to make a few more, and hope that the other distributions will follow?
I was planning to send a mail to the public lists of at least the largest distributions (Debian, Ubuntu, Fedora, Gentoo, Red Hat, Arch) asking how they'd like to see PE libraries packaged and used, or if they'd prefer not to package them at all. I don't necessarily expect consensus from this, but if only some of them want to ship their own dependencies, it seems feasible to make that optional in our build system.
According to https://pkgs.org/search/?q=mingw, among distros which aren't apparently based on deb/rpm packages, Alpine, Arch or Solus don't have any MinGW packages yet except for the runtime itself. Also I'm sure that website also misses a few popular yet exotic distros.
Looking that the packages there, I can already spot differences between Debian, RedHat (and others) approaches, going over a few ones, I found already:
Debian: /usr/i686-w64-mingw32/{bin,include,lib} RedHat: /usr/i686-w64-mingw32/sys-root/mingw/{bin,include,lib} Solus: /usr/share/mingw-w64/i686-w64-mingw32/{bin,include,lib}
This is not necessarily an issue but if we embed default search paths into Wine, this has to be taken into consideration.
It also means that we would need to make it dynamically configurable, and even if the distro build scripts may override the default, once built it would be bound to a specific filesystem organization.
Yeah, I think that's one of the problems, we'll need some standard way to retrieve the linker search paths, like (say) MINGW_LD_LIBRARY_PATH...
As for compile time, my preferred solution would be something like x86_64-w64-mingw32-pkg-config (actually this sort of exists already IIRC, and may even be usable.)
- Projects that import source take so much longer to build. That applies
whether the source is baked in, statically linked, or even built as a shared library. The last two cases actually often get worse because the build system needs to recurse (but baked-in source has its own problems.) This is probably the top reason I absolutely hate contributing to wine-mono, and why although it's my job to work on Proton I avoid its build system like the plague (preferring instead to compile individual Wine modules). [4]
I think there's different scale of dependencies, and I believe the discussion is only valid for the small ones. However inconvenient Wine Mono and Gecko are to build, I don't think it's a good idea to consider including them in Wine.
FWIW I don't think we have to stick to upstream build system and have recursive make anywhere if we don't want to. We only need the code to implement our DLLs, not the build system.
Are you advocating for a source import? I'd really like to argue against using a source import.
I as a DirectShow developer need to build GStreamer anyway, for various reasons (I need the latest version, or to fix an upstream bug, etc.) But I've never needed to compile FAudio from source, and I don't want to have to take that extra time during a Wine build. Relying on my distribution package makes things much easier for me.
- Static linking makes bisects painful. You have to rebuild the
downstream project every time. Shared libraries would be a lot better, for this and for other reasons. Even if the decision ends up being to distribute libraries ourselves I'd like to advocate that they be shared rather than static.
System provided libraries can also be problematic when the regression comes from the system update.
And as I explained in my reply to Jacek, I don't think building these dependencies separately from Wine is convenient either. If that's the plan, I'd rather go through the system distribution.
- By linking libraries statically, or by linking them shared and
distributing them ourselves, we are taking up more disk space that could be shared. This is obviously a garbage argument because no other application is using PE libraries, except that:
(a) some distributions [5] and unofficial repositories [6] do ship MinGW libraries, which means that there *is* a demand for them outside of Wine, and
I don't think we should rely on user-contributed packages. Either the distro have what we need, or we should provide the packages as an alternative.
I'm not saying we should rely on them; I'm just trying to point out that we're not the only people that want them, and shouldn't operate under the assumption that we are.
Granted, I see Giovanni says that Debian's packages shouldn't really exist.
(b) if we link them statically, even within Wine we'd be sharing many libraries across several modules [libvkd3d and libvkd3d-shader across d3dcompiler_*, d3d12, dxgi; libfaudio across all of the many xaudio modules; even libmpg123 across l3codeca.acm and mp3dmod!], and to avoid this we'd have to use some sort of manually defined static -> shared shim. At that point distributing the shared library seems like less work.
Are the xaudio libraries supposed to share state on Windows? If not then I think we should probably not either.
Is there any such global state? I was under the impression that it was all instance-specific.
It may be a waste of disk space, but we could consider the prefix size issue to be a separate one.
I'm not talking about prefix size. Prefix size makes it worse, but even one extra set of libraries is too much as far as I'm concerned.
- Submodules are not fun to deal with, particularly the part where 'git
submodule update' forces you off a branch.
I agree, but I don't think we need to have that. We could just pass the source location as a configure flag, regardless to how that has been pulled, and consider the dependency as missing if sources are not provided.
Cheers,
On 6/28/21 5:53 PM, Zebediah Figura (she/her) wrote:
On 6/28/21 7:22 AM, Rémi Bernon wrote:
On 6/28/21 5:48 AM, Zebediah Figura (she/her) wrote:
- Projects that import source take so much longer to build. That applies
whether the source is baked in, statically linked, or even built as a shared library. The last two cases actually often get worse because the build system needs to recurse (but baked-in source has its own problems.) This is probably the top reason I absolutely hate contributing to wine-mono, and why although it's my job to work on Proton I avoid its build system like the plague (preferring instead to compile individual Wine modules). [4]
I think there's different scale of dependencies, and I believe the discussion is only valid for the small ones. However inconvenient Wine Mono and Gecko are to build, I don't think it's a good idea to consider including them in Wine.
FWIW I don't think we have to stick to upstream build system and have recursive make anywhere if we don't want to. We only need the code to implement our DLLs, not the build system.
Are you advocating for a source import? I'd really like to argue against using a source import.
Not importing their source into Wine tree if we can find a better way (like hosting them separately, with some optional build integration), but I also don't think we should rule it out as a possibility so easily.
For instance, we are importing pieces of musl source into Wine already. From a security updates point of view (which is one of the reason to prefer system-distributed packages) I find duplicating and maintaining our own C runtime much more concerning.
Of course it's even harder to do otherwise, so I understand the rationale.
Hi,
Il 23/06/21 19:15, Zebediah Figura (she/her) ha scritto:
We're not the only user of PE libraries, or Debian wouldn't already be shipping some. See [1] for example.
More to the point, all I'm really trying to advocate for is *asking first*. I don't necessarily claim that distributions *want* to ship mingw dependencies, but we haven't asked them, and in the case that they *do* want to—which seems more than plausible to me—we should work with them rather than doing everything ourselves. The point is, nobody's asked yet.
I believe the only reason Debian is shipping a few MinGW-compiled libraries is to have win32-loader[1], which is compiled as a standard Debian package. It is a very fringe application and I doubt many people would notice if it disappeared. I guess it is there mainly because someone thought it was a cool idea at some point and nobody has yet thought that it is too of a burden to maintain; and yes, sometimes it can be useful for users. But, relevantly to our discussion, I don't think there is in Debian any intent to maintain a set of MinGW-compiled packages for general use, not to speak of available contributor time (Wine itself is stuck to 5.0 in Debian, because unfortunately nobody has find the time to get it updated since then).
[1] https://en.wikipedia.org/wiki/Win32-loader
So, I don't think that there is any value, at this point, in sharing PE libraries with other software, from the point of view of Debian.
What instead I think Debian (and Debian users) would much prefer is to avoid downloading binaries compiled from somewhere else than Debian build servers, like it happens now for gecko and mono. I don't know what are the reasons behind that choice, but I personally dislike it both as a user (because when I download packages from my distribution I expect to have stuff working without having to download other code from other places; downloading executable code requires trusting your peer, and one of the reasons of using a distribution is to put your trust in them and not having to question it again for any program you run) and as a developer (because I have to interact at runtime with my program to have it running the code I'm working on). I would really like to avoid adding FAudio to this dreaded list.
My two cents, Giovanni.
On 6/24/21 11:56 AM, Giovanni Mascellani wrote:
What instead I think Debian (and Debian users) would much prefer is to avoid downloading binaries compiled from somewhere else than Debian build servers, like it happens now for gecko and mono. I don't know what are the reasons behind that choice, but I personally dislike it both as a user (because when I download packages from my distribution I expect to have stuff working without having to download other code from other places; downloading executable code requires trusting your peer, and one of the reasons of using a distribution is to put your trust in them and not having to question it again for any program you run) and as a developer (because I have to interact at runtime with my program to have it running the code I'm working on). I would really like to avoid adding FAudio to this dreaded list.
I think the reason is because of how huge the codebase of Wine Gecko and Wine Mono is, as well as how painful it would be to integrate to Wine build, both in term of integration and impact on Wine development.
Wine Mono is quite alright to build separately, but it's still a huge task, and although I think I've built a custom Wine Gecko once, it was such a pain that I'm not even sure I actually did or if it was just in my dreams.
Then I agree that it's pretty inconvenient to have them separate, and also not nice to distribute them through a side-channel.
On Wed, 23 Jun 2021 at 17:23, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
I don't think this is a very good idea, for several reasons:
Yeah, I'm definitely not a fan of the proprietary/"modern" approach of just copying everything into the same source tree, instead of building proper interfaces and infrastructure.