I’m trying to add stereo audio support to the render streaming package, which I believe requires modifying the underlying WebRTC package.
I’m following the instructions here (for windows): https://github.com/Unity-Technologies/com.unity.webrtc/blob/develop/Plugin~/README.md
Problem is, I get to the “Build plugin” step and cmake isn’t able to find the libwebrtc package. There’s no cmake file in the .zip folder I downloaded from the releases page, which I suspect could be the problem, but I don’t know how to fix it.
The provided screenshots of the folder structure don’t seem accurate to me, and I’m a bit confused where to put the “lib” and “include” folders that I unpacked from the libwebrtc zip. Has anyone had success going through this process, and if so could you explain to me how you did it? Any help would be greatly appreciated.
This is the full error from cmake:
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find WebRTC (missing: WEBRTC_LIBRARY WEBRTC_LIBRARY_DEBUG)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
cmake/FindWebRTC.cmake:48 (find_package_handle_standard_args)
CMakeLists.txt:62 (find_package)
Have a look on the file Plugin~/cmake/FindWebRTC.cmake:
https://github.com/Unity-Technologies/com.unity.webrtc/blob/develop/Plugin~/cmake/FindWebRTC.cmake
The error
“Could NOT find WebRTC (missing: WEBRTC_LIBRARY WEBRTC_LIBRARY_DEBUG)”
is raised because it cannot find webrtc in the Plugin~/ directrory.
=> You should extract and copy the modified webrtc in the Plugin~/ directory.
@gauzinski is correct but be wary @a_willette and any lucky soul which finds this thread, it can fail even with WebRTC in the correct place.
A hack that you can do is replace “${CMAKE_ANDROID_ARCH}” (check 1a of the screenshot) with one of the folders that actually exists in your working directory, such as “arm64” or “x64” (check 1b of the screenshot). Then change the set(WEBRTC_LIBRARY) to how it looks in #2 of the screenshot.
This is because earlier in the build_plugin_android.sh, CMAKE_ANDROID_ARCH_ABI is set to arm64-v8a. This causes CMAKE_ANDROID_ARCH to change to the same value, because in the docs, CMAKE_ANDROID_ARCH is set to CMAKE_ANDROID_ARCH_ABI when you’re using the Makefiles generator (the default for Linux and WSL2 on Windows). For some reason, the build script does not download a version of libwebrtc that contains the arm64-v8a libraries. Clearly it’s been deprecated from the last 2 years.
This is hacky, it modifies how the CMake actually works, but once it’s done it doesn’t have to be configured again. Previously, I’ve only changed #2 of the screenshot and the build works out fine. Not really sure what to make of that.
Hope this saves someone a day of work.
1 Like