Skip to content

Commit 3d1bb12

Browse files
committed
Provide the PulseAudio socket required by the Waydroid container
1 parent 326bde0 commit 3d1bb12

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎.github/workflows/waydroid-experiment.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
sha256sum "$RUNNER_TEMP/waydroid-repo.sh" > dist/waydroid/repo-setup-sha256.txt
3636
sudo bash "$RUNNER_TEMP/waydroid-repo.sh" noble
3737
sudo apt-get update
38-
sudo apt-get install -y waydroid weston dbus-x11
38+
sudo apt-get install -y waydroid weston dbus-x11 pulseaudio
3939
sudo waydroid init -s VANILLA
4040
sudo python3 - <<'PY'
4141
import configparser

‎docs/en/fastlane.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ committing the lock file and using `bundle exec fastlane` locally and in CI.
123123

124124
## Optional Waydroid experiment
125125

126-
On a disposable Ubuntu host with Waydroid initialized for software rendering, Docker, Weston,
126+
On a disposable Ubuntu host with Waydroid initialized for software rendering, Docker, Weston, PulseAudio,
127127
D-Bus, Android SDK, Go and JDK 21, run `bundle exec fastlane android waydroid_smoke`.
128128
The lane builds debug and instrumentation APKs, boots Waydroid, and tests the production VPN
129129
against disposable OpenSSH and a private HTTP echo origin. Direct origin access must fail first;

‎docs/ru/fastlane.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bundle exec fastlane android test
125125

126126
## Необязательный эксперимент Waydroid
127127

128-
На одноразовом Ubuntu-хосте с Waydroid, настроенным на программный рендеринг, Docker, Weston,
128+
На одноразовом Ubuntu-хосте с Waydroid, настроенным на программный рендеринг, Docker, Weston, PulseAudio,
129129
D-Bus, Android SDK, Go и JDK 21 запустите `bundle exec fastlane android waydroid_smoke`.
130130
Lane собирает debug и instrumentation APK, запускает Waydroid и проверяет рабочий VPN
131131
с временным OpenSSH и закрытым HTTP echo-сервером. Прямой доступ к серверу сначала должен

‎scripts/waydroid-smoke.sh‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cleanup() {
1818
sudo waydroid container stop || true
1919
docker rm -f megaproxy-waydroid-ssh megaproxy-waydroid-origin >/dev/null 2>&1 || true
2020
docker network rm megaproxy-waydroid >/dev/null 2>&1 || true
21+
pulseaudio --kill || true
2122
kill "$weston_pid" 2>/dev/null || true
2223
}
2324
trap cleanup EXIT
@@ -26,10 +27,18 @@ for _ in {1..30}; do
2627
sleep 1
2728
done
2829
[[ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]]
30+
# Waydroid bind-mounts the audio socket even in a headless session.
31+
pulseaudio --start --exit-idle-time=-1
32+
[[ -S "$XDG_RUNTIME_DIR/pulse/native" ]]
2933
sudo systemctl start waydroid-container
3034
waydroid session start > dist/waydroid/session.log 2>&1 &
35+
session_pid=$!
3136
for _ in {1..90}; do
32-
if [[ "$(sudo waydroid shell -- getprop sys.boot_completed 2>/dev/null | tr -d '\r')" == 1 ]]; then break; fi
37+
if ! kill -0 "$session_pid" 2>/dev/null; then
38+
cat dist/waydroid/session.log >&2
39+
exit 1
40+
fi
41+
if [[ "$(timeout 10s sudo waydroid shell -- getprop sys.boot_completed 2>/dev/null | tr -d '\r')" == 1 ]]; then break; fi
3342
sleep 2
3443
done
3544
[[ "$(sudo waydroid shell -- getprop sys.boot_completed | tr -d '\r')" == 1 ]]

0 commit comments

Comments
 (0)