Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a838175
Build on LiveKit's official C++ SDK 1.13.1
avinoamn Nov 9, 2026
7c1bec7
Windows: pin LiveKit's DLLs so quitting doesn't crash
avinoamn Nov 9, 2026
cc56be5
Hold the official SDK's objects safely
mdepinet Nov 14, 2026
5f499cc
Keep a participant's identity after the SDK frees it
mdepinet Nov 15, 2026
cbf207f
Android: build the official C++ SDK instead of using the fork
mdepinet Nov 14, 2026
ba0e9bd
Android: build the SDK with the shared C++ runtime
mdepinet Nov 15, 2026
a043d5e
Warn about stream lock contention only when it keeps happening
mdepinet Nov 15, 2026
a5c3f75
Let the unit tests compile in builds without screen capture
mdepinet Nov 15, 2026
ecf18f4
Run the test suites on an Android emulator in CI
mdepinet Nov 15, 2026
b69d6d0
Pend E2EE tests that need encrypted video to start, on Android
mdepinet Nov 15, 2026
be2e1cf
Allocate an audio stream's ring buffer only once it starts reading
mdepinet Nov 15, 2026
5f35721
Android: Java-load the extension library for the architecture it's bu…
mdepinet Nov 15, 2026
46d3b59
Address review: Android build hosts, template safety, stricter test c…
mdepinet Nov 15, 2026
84196ae
Log why the Android app stopped when the tests don't finish
mdepinet Nov 15, 2026
3dac22d
Fail Android test runs when the app crashes while shutting down
mdepinet Nov 15, 2026
f7c5fca
Address review: release published tracks when the connection ends
mdepinet Nov 15, 2026
9850d01
Unbind the local participant when its connection ends
mdepinet Nov 15, 2026
3a4ff39
Android tests: relaunch an app that exits before the tests start
mdepinet Nov 15, 2026
a0e3149
Address review: unregister RPC handlers when unbinding the local part…
mdepinet Nov 15, 2026
9bfda9c
Merge main: livekit-client 2.24.0 (#18)
mdepinet Nov 16, 2026
79774cf
Stop a receiver's ratchets from undoing its new key in an E2EE test
mdepinet Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 136 additions & 17 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,26 @@ jobs:

- name: Set up Android NDK
if: matrix.platform == 'android'
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
ndk-version: r27d

- name: Export NDK path
if: matrix.platform == 'android'
run: echo "ANDROID_NDK_ROOT=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV"

- name: Install Android SDK build dependencies
if: matrix.platform == 'android'
run: sudo apt-get update && sudo apt-get install -y ninja-build

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
godot-cpp
key: deps-${{ matrix.platform }}-${{ matrix.arch || matrix.platform }}-${{ hashFiles('build.sh') }}
livekit-sdk
key: deps-${{ matrix.platform }}-${{ matrix.arch || matrix.platform }}-${{ hashFiles('build.sh', 'patches/**') }}

- name: Build GDExtension
shell: bash
Expand Down Expand Up @@ -180,22 +190,131 @@ jobs:

- name: Run tests
run: |
# Join tokens for the integration tests, signed with the dev server's key.
token() {
python3 - "$1" <<'PY'
import base64, hashlib, hmac, json, sys, time
def b64(b): return base64.urlsafe_b64encode(b).rstrip(b"=").decode()
now = int(time.time())
claims = {"iss": "devkey", "sub": sys.argv[1], "iat": now, "nbf": now, "exp": now + 3600,
"video": {"room": "web-integration", "roomJoin": True, "canPublish": True,
"canSubscribe": True, "canPublishData": True}}
signing = b64(json.dumps({"alg": "HS256", "typ": "JWT"}).encode()) + "." + b64(json.dumps(claims).encode())
print(signing + "." + b64(hmac.new(b"secret", signing.encode(), hashlib.sha256).digest()))
PY
}
export LIVEKIT_TEST_URL=ws://127.0.0.1:7880
export LIVEKIT_TOKEN_1=$(token web-user-1)
export LIVEKIT_TOKEN_2=$(token web-user-2)
export LIVEKIT_TOKEN_1=$(python3 test/dev_token.py web-user-1 web-integration)
export LIVEKIT_TOKEN_2=$(python3 test/dev_token.py web-user-2 web-integration)
export RUN_E2E=1
export LIVEKIT_E2E_URL=ws://127.0.0.1:7880
./test_web.sh

android:
name: Test on Android (x86_64 emulator)
runs-on: ubuntu-latest
env:
GODOT_VERSION: "4.5.2"
LIVEKIT_SERVER_VERSION: "1.13.7"
# The emulator reaches the host's localhost at 10.0.2.2.
LIVEKIT_TEST_URL: ws://10.0.2.2:7880
LIVEKIT_E2E_URL: ws://10.0.2.2:7880
RUN_E2E: "1"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install SCons
run: pip install scons

- name: Set up Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r27d

- name: Export NDK path
run: echo "ANDROID_NDK_ROOT=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV"

- name: Install Android SDK build dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
godot-cpp
livekit-sdk
key: deps-android-x86_64-${{ hashFiles('build.sh', 'patches/**') }}

# x86_64, since GitHub's runners can only emulate their own architecture at a usable speed.
- name: Build GDExtension
run: ./build.sh android x86_64

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Cache Godot and export templates
id: cache-godot
uses: actions/cache@v4
with:
path: |
godot
~/.local/share/godot/export_templates
key: godot-${{ env.GODOT_VERSION }}-android-templates

- name: Download Godot and Android export templates
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip
unzip -q Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip
mv Godot_v${GODOT_VERSION}-stable_linux.x86_64 godot
chmod +x godot
wget -q https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
templates=~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
mkdir -p "$templates"
unzip -q -j Godot_v${GODOT_VERSION}-stable_export_templates.tpz 'templates/android_*' 'templates/version.txt' -d "$templates"

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-godot-${{ env.GODOT_VERSION }}

- name: Install GUT
run: |
git clone --depth 1 --branch v9.5.0 https://github.com/bitwes/Gut.git /tmp/gut
mkdir -p addons
cp -r /tmp/gut/addons/gut addons/gut

- name: Start LiveKit server
run: |
wget -q https://github.com/livekit/livekit/releases/download/v${LIVEKIT_SERVER_VERSION}/livekit_${LIVEKIT_SERVER_VERSION}_linux_amd64.tar.gz
tar -xzf livekit_${LIVEKIT_SERVER_VERSION}_linux_amd64.tar.gz livekit-server
./livekit-server --dev > livekit-server.log 2>&1 &

- name: Create join tokens
run: |
echo "LIVEKIT_TOKEN_1=$(python3 test/dev_token.py android-user-1 android-integration)" >> "$GITHUB_ENV"
echo "LIVEKIT_TOKEN_2=$(python3 test/dev_token.py android-user-2 android-integration)" >> "$GITHUB_ENV"

# Before starting the emulator, since both need a lot of CPU.
- name: Export test app
run: ./test_android.sh --export-only build/android-tests.apk --arch x86_64

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
arch: x86_64
cores: 4
ram-size: 4096M
# The action's defaults, but with audio, which the tests play.
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -no-boot-anim
disable-animations: true
script: ./test_android.sh --apk build/android-tests.apk
9 changes: 7 additions & 2 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ jobs:
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
ndk-version: r27d

- name: Install Android SDK build dependencies
if: matrix.platform == 'android'
run: sudo apt-get update && sudo apt-get install -y ninja-build

- name: Set up Emscripten
if: matrix.platform == 'web'
Expand All @@ -86,7 +90,8 @@ jobs:
with:
path: |
godot-cpp
key: deps-${{ matrix.platform }}-${{ matrix.arch || matrix.platform }}-${{ hashFiles('build.sh') }}
livekit-sdk
key: deps-${{ matrix.platform }}-${{ matrix.arch || matrix.platform }}-${{ hashFiles('build.sh', 'patches/**') }}

- name: Build GDExtension
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export_presets.cfg
# Build artifacts and downloaded SDKs
godot-cpp/
livekit-sdk/
livekit-sdk-build/
livekit-js/
src/web/gen/
*.wasm
Expand Down Expand Up @@ -38,3 +39,6 @@ test_results_*.xml

# Godot UID files
*.uid

# Android build template, installed by test_android.sh
/android/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ If you have [GUT (Godot Unit Test)](https://github.com/bitwes/Gut) installed in

`./test_web.sh` runs the tests that apply to the web build in headless Chrome. It requires a web build, Godot's web export templates, and `google-chrome`.

`./test_android.sh` runs the tests on a connected Android device or emulator. It requires an Android build for the device (`./build.sh android x86_64` for an x86_64 emulator), Godot's Android export templates, the Android SDK (`ANDROID_HOME`) and a JDK (`JAVA_HOME`).

## Continuous Integration

The project is configured with GitHub Actions to automatically build releases for Linux, Windows, and macOS whenever a new tag (e.g., `v1.0.0`) is pushed. Check the `.github/workflows` directory for details.
Expand Down
9 changes: 7 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if is_android:
Exit(1)
ndk_bin = toolchain_bins[0]
ndk_sysroot = os.path.join(os.path.dirname(ndk_bin), 'sysroot')
android_target = 'aarch64-linux-android24'
android_target = 'x86_64-linux-android24' if arch == 'x86_64' else 'aarch64-linux-android24'
env = Environment()
env.Replace(CC=os.path.join(ndk_bin, 'clang'))
env.Replace(CXX=os.path.join(ndk_bin, 'clang++'))
Expand Down Expand Up @@ -95,7 +95,9 @@ if enable_screen_capture:
env.Append(LIBPATH=libpath)

if is_android:
env.Append(CCFLAGS=[f'--target={android_target}', f'--sysroot={ndk_sysroot}', '-fPIC', '-march=armv8-a'])
env.Append(CCFLAGS=[f'--target={android_target}', f'--sysroot={ndk_sysroot}', '-fPIC'])
if arch == 'arm64':
env.Append(CCFLAGS=['-march=armv8-a'])
env.Append(CXXFLAGS=['-std=c++20'])
env.Append(LINKFLAGS=[f'--target={android_target}', f'--sysroot={ndk_sysroot}'])
env.Append(CPPDEFINES=['ANDROID_ENABLED', 'UNIX_ENABLED'])
Expand Down Expand Up @@ -226,6 +228,9 @@ else: # linux, android
# file-extension suffix (which causes "should have exactly one target
# with the suffix: .dll").
lib_name = f"{env['SHLIBPREFIX']}godot-livekit.{platform}.{arch}{env['SHLIBSUFFIX']}"
if platform == 'windows':
src_files.append('src/windows_pin.cpp')

library = env.SharedLibrary(target=lib_name, source=src_files)
installed_library = env.Install('addons/godot-livekit/bin', library)
Default(installed_library)
2 changes: 2 additions & 0 deletions addons/godot-livekit/godot-livekit.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ windows.x86_64 = "res://addons/godot-livekit/bin/libgodot-livekit.windows.x86_64
macos.arm64 = "res://addons/godot-livekit/bin/libgodot-livekit.macos.arm64.dylib"
macos.x86_64 = "res://addons/godot-livekit/bin/libgodot-livekit.macos.x86_64.dylib"
android.arm64 = "res://addons/godot-livekit/bin/libgodot-livekit.android.arm64.so"
android.x86_64 = "res://addons/godot-livekit/bin/libgodot-livekit.android.x86_64.so"
web.wasm32.nothreads = "res://addons/godot-livekit/bin/libgodot-livekit.web.wasm32.nothreads.wasm"

[dependencies]
Expand All @@ -16,3 +17,4 @@ windows.x86_64 = {"res://addons/godot-livekit/bin/livekit_ffi.dll": "", "res://a
macos.arm64 = {"res://addons/godot-livekit/bin/macos-arm64/liblivekit_ffi.dylib": "", "res://addons/godot-livekit/bin/macos-arm64/liblivekit.dylib": ""}
macos.x86_64 = {"res://addons/godot-livekit/bin/macos-x86_64/liblivekit_ffi.dylib": "", "res://addons/godot-livekit/bin/macos-x86_64/liblivekit.dylib": ""}
android.arm64 = {"res://addons/godot-livekit/bin/android-arm64/liblivekit_ffi.so": "", "res://addons/godot-livekit/bin/android-arm64/liblivekit.so": ""}
android.x86_64 = {"res://addons/godot-livekit/bin/android-x86_64/liblivekit_ffi.so": "", "res://addons/godot-livekit/bin/android-x86_64/liblivekit.so": ""}
Loading