Native Rust library for realtime communication with Relay, handling:
- Controller input over WebRTC DataChannel
- Audio/video encoding over WebRTC transport (post-MVP)
- C++ library
vulcast-rtc
encapsulating a WebRTC client using MediaSoup - Rust sys crate
vulcast-rtc-sys
exposing FFI declarations fromvulcast-rtc
- Rust crate
vulcast-rtc
exposing high-level abstractions forvulcast-rtc-sys
I don't recommend building natively on the Raspberry Pi itself. I tried myself and it never finished.
cargo build
Only cross-compilation for armv7-unknown-linux-gnueabihf is supported.
- Install cross-compiler toolchain for arm-linux-gnueabihf
You must use a toolchain that has a relatively old version of glibc (<2.32), such as Raspberry Pi GCC Cross-Compiler Toolchains (Buster) gcc 10.3.0 from https://github.com/abhiTronix/raspberry-pi-cross-compilers. The rest of these instructions assume you are using this toolchain.
- Install Rust cross-compiler toolchain for armv7-unknown-linux-gnueabihf
# install rust cross toolchain
rustup target add armv7-unknown-linux-gnueabihf
- Build a project using
vulcast-rtc
Replace /path/to/cross-pi-gcc-10.3.0-2
with where you extracted the toolchain to.
# add cross-compiler toolchain to PATH
export PATH=/mnt/scratch/cross-pi-gcc-10.3.0-2/bin:$PATH
# set linker for cargo to use for armv7-unknown-linux-gnueabihf target
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER='\
/path/to/cross-pi-gcc-10.3.0-2/bin/arm-linux-gnueabihf-gcc'
# set sysroot and platform defines for bindgen
export BINDGEN_EXTRA_CLANG_ARGS='\
--sysroot=/path/to/cross-pi-gcc-10.3.0-2/arm-linux-gnueabihf/ \
-I/path/to/cross-pi-gcc-10.3.0-2/arm-linux-gnueabihf/libc/usr/include/'
cargo build --example echo --target=armv7-unknown-linux-gnueabihf
The echo
example will produce a dummy video feed and a silent audio feed, and print consumed data.
cargo run --example echo -- --signal-addr <signal-addr> --token <token>
# Fatal error in: ../../media/engine/adm_helpers.cc, line 39
# last system error: 88
# Check failed: 0 == adm->Init() (0 vs. -1)
Install an audio server like PulseAudio.
Probably because we also link pthread
as part of WebRTC and there is a conflict.
Try using rustls
instead of native-tls
. If that doesn't work then just turn TLS off.
Your cross-compiler toolchain uses an incompatible version of glibc. Try using one of these: https://github.com/abhiTronix/raspberry-pi-cross-compilers