Skip to content

Conversation

vldevel
Copy link

@vldevel vldevel commented Sep 5, 2025

This PR brings the following fixes and changes:

  • In run.py, fetch a depot_tools version which matches the release date of the WebRTC SDK release we are using (and pin this depot_tools version so that it does not get automatically and spuriously updated by the build system). This restore m114 buidability. This also makes it possible to keep building this release "indefinitely" (even in a few months or years). Note that a new WEBRTC_LAST_COMMIT_DATE entry has also been added to the VERSION file to hold this date.

  • In run.py, ensure that the depot_tools Python3 venv is properly bootstrapped (else, the build may fail, depending on what Python3 modules are installed or not on the host system).

  • In run.py, ensure that 'ranlib' is called to create an index of the native object modules, since (quoted from llvm-ar documentation): "Unlike other implementations of ranlib, llvm-ranlib indexes LLVM bitcode files, not native object modules". This way the Linux WebRTC static library can be successfully linked to a shared library using GNU ld.

  • Added 'windows_add_192k.patch', from roxie/m137 branch.

  • Several changes done to run.py so to allow building the library on ARM64 (arm_v8) Linux hosts. Note however that the said hosts will still need an x86_64 emulator installed (e.g. box64) because even though I did add "host_cpu=arm64" to the build parameters, the WebRTC SDK build system still uses an x86_64 LLVM toolset to build on arm64 !!! o.O With these changes, I could get m114 to build on my ARM64 SBC.

This PR brings the following fixes and changes:

- In run.py, fetch a depot_tools version which matches the release date of the
  WebRTC SDK release we are using (and pin this depot_tools version so that it
  does not get automatically and spuriously updated by the build system). This
  restore m114 buidability. This also makes it possible to keep building this
  release "indefinitely" (even in a few months or years).
  Note that a new WEBRTC_LAST_COMMIT_DATE entry has also been added to the
  VERSION file to hold this date.

- In run.py, ensure that the depot_tools Python3 venv is properly bootstrapped
  (else, the build may fail, depending on what Python3 modules are installed
  or not on the host system).

- In run.py, ensure that 'ranlib' is called to create an index of the native
  object modules, since (quoted from llvm-ar documentation): "Unlike other
  implementations of ranlib, llvm-ranlib indexes LLVM bitcode files, not
  native object modules". This way the Linux WebRTC static library can be
  successfully linked to a shared library using GNU ld.

- Added 'windows_add_192k.patch', from roxie/m137 branch.

- Several changes done to run.py so to allow building the library on ARM64
  (arm_v8) Linux hosts. Note however that the said hosts will still need an
  x86_64 emulator installed (e.g. box64) because even though I did add
  "host_cpu=arm64" to the build parameters, the WebRTC SDK build system still
  uses an x86_64 LLVM toolset to build on arm64 !!! o.O With these changes,
  I could get m114 to build on my ARM64 SBC.
@vldevel
Copy link
Author

vldevel commented Sep 5, 2025

Given the issues seen with m137, I would dare to kindly recommend that we stick with m114 for now... This PR allows it.

vldevel referenced this pull request in secondlife/viewer Sep 5, 2025
The primary feature of this commit is to update libwebrtc from m114
to m137.  This is needed to make webrtc buildable, as m114 is not buildable
by the current toolset.

m137 had some changes to the API, which required renaming or changing namespace
of some of the calls.

Additionally, this PR moves from a callback mechanism for gathering the energy
levels for tuning to a wrapper AudioDeviceModule, which gives us more control
over the audio stream.

Finally, the new m137-based webrtc has been updated to allow for 192khz audio
streams.
@vldevel
Copy link
Author

vldevel commented Oct 10, 2025

Given the issues seen with m137

As an update about these issues, I could finally manage to compile WebRTC SDK m137 for Linux aarch64 (1), could also get llwebrtc+m137 to compile under Windows/VS2002 (2), and finally got llwebrtc to link with m137 on macOS (3).
So, there is no more obstacle for m137 adoption, as far as I am concerned (even if adopting it was a total PITA).

(1) Using cross-compilation since I could not get past a box64 and/or llvm malloc bug when trying to compile it "natively" on an ARM64 SBC. See #13 about the cross-compilation enablement changes needed for run.py.
(2) You need to ensure NOMINMAX is defined in llwebrtc/llwebrtc_impl.h, so that VS2022 does not try and use its broken min()/max() versions in place of std::min and std::max.
(3) I managed to create a VitrualBox Hackintosh VM using Monterey so to be able to install Xcode 13, which can link (with warnings) LL's WebRTC SDK "universal" build for macOS, unlike Xcode 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant