Feature/Initial Livekit MatrixRTC Integration#6564
Conversation
Signed-off-by: herrfeder <14598229+herrfeder@users.noreply.github.com>
|
It seems the mentioned C++ dependencies of webrtc-sys are breaking the current pipeline setup, I will introduce additional modifications to fix that. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6564 +/- ##
==========================================
- Coverage 89.92% 89.17% -0.75%
==========================================
Files 381 384 +3
Lines 106860 107900 +1040
Branches 106860 107900 +1040
==========================================
+ Hits 96095 96224 +129
- Misses 7108 8023 +915
+ Partials 3657 3653 -4 ☔ View full report in Codecov by Sentry. |
|
Hello, As this is not a small contribution, I need a bit more context:
|
yes, this was my first experiment to vibecode such a huge functionality but I took reasonable time and care to clean up the mess (strip down bloated function/trait signatures, remove dead code and distribute functionality to reasonable locations and files). Actually it's only about 1500 additional LOC. The big blob is the changed Cargo.lock, that has a lot of changes because of the Livekit/WebRTC dependencies. The test coverage is yet not really satisfying but before doing even more effort into something you may not appreciate at all I decided to go public with this effort. Actually the questions on my side are:
With the feedback/decision if a Livekit specific SDK crate is a worthsome addition to the Rust-SDK, I can for sure break this down to smaller more digestable PRs? |
|
I've been experimenting with adding audio/video call support to Fractal (the GNOME Matrix client, GTK4/Rust, no embedded WebView) in my spare time, and ran into exactly the gap this PR closes. Posting this in case it's useful context for the direction discussion above. Pulled Confirmed against the livekit server source and logs:
Without per-participant key distribution over Matrix ( A note on the widget-driver path (#4963, #4990): it's a reasonable option for Element X and similar hosts that can embed a WebView. But it doesn't generalise. A native GTK or Qt desktop client has no sensible way to ship a WebKit runtime plus the entire Element Call JS bundle just to make matrix-rust-sdk has always been positioned as an SDK any Rust Matrix client can build on. For that to remain true for RTC, it'd be useful to have a native path alongside the widget path, not replaced by it. If the maintainers had a moment, two questions from a downstream hobbyist's perspective:
I'm not in a position to commit to anything, but if audio support lands in this branch I'll try it against Fractal locally and report back what I see. |
I introduced an example rtc_livekit_join which shows how to use matrix-sdk-rtc-livekit to join/leave a LiveKit room with Element-Call based SFrame Encryption and also with MatrixRTC call memberships. Initially this was done to have a headless video streaming towards Element Call from embedded devices like Raspberry Pis and Jetson Nanos, therefore only video is covered here and no audio yet.
I could also structure this functionality into an self-contained example without wiring it directly into the sources of the Rust-SDK but I guess this feature is something at least some people are looking for and therefore I guess it's beneficial to bring it into the Rust-SDK Core.
To make this example work, I introduced the following:
matrix-sdk-rtc-livekitwhichencryption_keysevents of other participantsPlease see the readme of the example https://github.com/herrfeder/matrix-rust-sdk/blob/feature/livekit-webrtc-integration/examples/rtc_livekit_join/README.md for more detailed information and also how to use the necessary environment variables for the example.
Current workarounds (I'm not happy with):
It seems the newest Livekit SDK Source is broken livekit-api uses types that don't exist in livekit-protocol livekit/rust-sdks#1080 and therefore depending on the initial branch which made the livekit rust sdk compatible with Element Call
The Livekit webrtc-sys doesn't like OpenSSL Bindings (at least on my machine) and therefore makes usage of rusttls-tls necessary and therefore needed to modify more Cargo dependencies than desired
the introduction of Livekit SDK and especially webrtc-sys introduces some C++ dependencies that needs some special handling, after a lot of try and error and dead ends I had over multiple Linux platforms (x86, various ARM) the best results with g++-13 and gcc-13 which differs from the current dependencies for the runner setup for this repository (happy about recommendations to deal more gracefully with it)
I've documented the public API Changes in the appropriate
CHANGELOG.mdfiles.This PR was made with the help of AI.
Signed-off-by: herrfeder 14598229+herrfeder@users.noreply.github.com