Hey there community! Hope everyone is keeping well.
I’ve been attempting to get ASIO compiled into the engine using RtAudio. I’ve based a lot of my solution off the already implemented AudioCapture plugin. I essentially ported all the relevant Windows stuff and left out the other backend factory that produces audio capture implementations for other Platforms. My port works fine with Direct Sound and also works with WASAPI (although a bit clicky). I’m now wanting to get ASIO incorporated because it provides me with multichannel input from my soundcard which I’d really like have because it allows me to loopback multichannel. I’m hoping that I can just grab hold of the multichannel buffer and then choose a specific channel from it to feed a synth component.
I’m using Visual Studio 2019 with the 2017 build tools. Nothing strange here from what I can see.
I’ve gone ahead and compiled theRtAudio examples with ASIO - this is all working fine aswell, no problems.
Now, when I try to compile the ASIO third party headers + source into UE4, I’m hit with this error to do with a file in the Windows kits headers that I can’t quite figure and the Build.bat/Rebuild.bat returns with a code -1 and no more information. I’ve tried running Visual Studio as admin and still get the same errors. Not sure this would be the issue as I’ve had it crop up before in other projects, but it was actually something in my code.
In order to get to this point I’ve gone through the including Third Party documentation on the UE site. → https://docs.unrealengine.com/en-US/…ies/index.html
I’ve done the following things to get to this point:
- I’ve replaced all the occurrences of #include <windows.h> with #include “Windows/WindowsHWrapper.h”.
- I’ve wrapped references to the Windows macros TRUE or FALSE with #include “Windows/AllowWindowsPlatformTypes.h” and #include “Windows/HideWindowsPlatformTypes.h”
- I’ve wrapped THIRD_PARTY_INCLUDES_START and THIRD_PARTY_INCLUDES_END around other third party includes (like <string.h>)
- I’ve replaced references to WIN32 with PLATFORM_WINDOWS (not sure this is necessary though - doesn’t seem to change much)
- To stop the compiler throwing errors about macros being undefined I removed the #undef macros for MAC, SGI, BEOS in g_include.h
- In order to use a standard C++ forward defined interface for IASIO used in iasiodrv.h, I was required to add an include an <objbase.h> header from the windows kit.
Here is my compiler output:
1>------ Rebuild All started: Project: PluginMaker, Configuration: Development_Editor x64 ------
1>Cleaning PluginMakerEditor and UnrealHeaderTool binaries...
1>Creating makefile for PluginMakerEditor (no existing makefile)
1>Parsing headers for PluginMakerEditor
1> Running UnrealHeaderTool "D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\PluginMaker.uproject" "D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\Intermediate\Build\Win64\PluginMakerEditor\Development\PluginMakerEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
1>Reflection code generated for PluginMakerEditor in 5,7706694 seconds
1>Building PluginMakerEditor...
1>Using Visual Studio 2019 14.25.28614 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 25 actions with 16 processes...
1> [1/25] Default.rc2
1> [2/25] Default.rc2
1> [3/25] SharedPCH.Engine.ShadowErrors.cpp
1> [4/25] asiolist.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1> [5/25] ConfigurableAudioCapComponent.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1> [6/25] asiodrivers.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1> [7/25] asio.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1> [8/25] PluginMaker.init.gen.cpp
1> [9/25] ConfigurableAudioCap.cpp
1> [10/25] PluginMakerGameModeBase.cpp
1> [11/25] ConfigurableAudioCapture.init.gen.cpp
1> [12/25] PluginMaker.cpp
1> [13/25] iasiothiscallresolver.cpp
1> [14/25] ConfigurableAudioCapture.cpp
1> [15/25] ConfigurableAudioCapComponent.gen.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1> [16/25] PluginMakerGameModeBase.gen.cpp
1> [17/25] ConfigurableAudioCap.gen.cpp
1> [18/25] TestBlueprintFunctionLibrary.gen.cpp
1> [19/25] TestBlueprintFunctionLibrary.cpp
1> [20/25] UE4Editor-PluginMaker.lib
1> Creating library D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\Intermediate\Build\Win64\UE4Editor\Development\PluginMaker\UE4Editor-PluginMaker.lib and object D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\Intermediate\Build\Win64\UE4Editor\Development\PluginMaker\UE4Editor-PluginMaker.exp
1> [21/25] UE4Editor-PluginMaker.dll
1> Creating library D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\Intermediate\Build\Win64\UE4Editor\Development\PluginMaker\UE4Editor-PluginMaker.suppressed.lib and object D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\Intermediate\Build\Win64\UE4Editor\Development\PluginMaker\UE4Editor-PluginMaker.suppressed.exp
1> [22/25] RtAudio.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpc.h(135): fatal error C1083: Cannot open include file: 'rpcerr.h': No such file or directory
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(49,5): error MSB3073: The command ""C:\Program Files\Epic Games\UE_4.24\Engine\Build\BatchFiles\Rebuild.bat" PluginMakerEditor Win64 Development -Project="D:\Unreal Projects\ConfigurableAudioCapturePlugin\PluginMaker\PluginMaker.uproject" -WaitMutex -FromMsBuild" exited with code -1.
1>Done building project "PluginMaker.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
My Module build code is the following:
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class ConfigurableAudioCapture : ModuleRules
{
public ConfigurableAudioCapture(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
bEnforceIWYU = false;
PublicDependencyModuleNames.AddRange(
new string] {
"Core",
"CoreUObject",
"Engine",
"AudioMixer",
"SignalProcessing"
}
);
PublicIncludePaths.AddRange(new string] { "ConfigurableAudioCapture/Public" });
PrivateIncludePaths.AddRange(new string] { "ConfigurableAudioCapture/Private", "ConfigurableAudioCapture/ThirdParty" });
if (Target.Platform == UnrealTargetPlatform.Win32 ||
Target.Platform == UnrealTargetPlatform.Win64)
{
PublicDefinitions.Add("WITH_RTAUDIO=1");
PublicDefinitions.Add("WITH_CONFIGURABLEAUDIOCAPTURE=1");
// Allow us to use direct sound
AddEngineThirdPartyPrivateStaticDependencies(Target, "DirectSound");
}
else
{
// Not supported on this platform
//PublicDefinitions.Add("WITH_CONFIGURABLEAUDIOCAPTURE=0");
}
}
}
If anyone has any bright ideas about this compiler error I’d be super appreciative! Maybe you could point me in the right direction, it feels like it’s getting close to being able to compile!