From 2dc74f7574ebf01eb953fff35f08c782d60e31a7 Mon Sep 17 00:00:00 2001 From: xlulx <92148312+xlulx@users.noreply.github.com> Date: Fri, 27 Nov 2026 16:27:32 +0300 Subject: [PATCH] fix(bionic): DroidDeck's DirectAudio settings, the microphone among them, reach Bionic Wine's audio driver (#3277) --- tools/bionic-runtime/tool/launch.sh | 7 ++++++- tools/tests/test_bionic_paths.py | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/bionic-runtime/tool/launch.sh b/tools/bionic-runtime/tool/launch.sh index 9ea92668a3..b6821f7e85 100644 --- a/tools/bionic-runtime/tool/launch.sh +++ b/tools/bionic-runtime/tool/launch.sh @@ -29,6 +29,11 @@ echo "$(date +%H:%M:%S) $verb $EXE ($VERSION, uid $(id -u), DISPLAY ${DISPLAY:-u # Keep Steam's game identity, DroidDeck's input/display/driver/sync settings and its game environment (the names # ../proton lists in DROIDDECK_BIONIC_KEEP); drop the rest of the glibc guest's environment. KEEP=" ${DROIDDECK_BIONIC_KEEP:-} " +# The built-in DirectAudio driver reads DroidDeck's AUDIO_DIRECT_* settings (the microphone switch among them) under +# the BANNER_ names droiddeck-proton gives them for Proton. +for v in $(env | sed -n 's/^\(AUDIO_DIRECT_[A-Za-z0-9_]*\)=.*/\1/p'); do + eval "export BANNER_$v=\"\$$v\"" +done for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do case "$KEEP" in *" $v "*) continue ;; esac case "$v" in @@ -36,7 +41,7 @@ for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do ANDROID_*|BOOTCLASSPATH|DEX2OATBOOTCLASSPATH|SYSTEMSERVERCLASSPATH|EXTERNAL_STORAGE|ASEC_MOUNTPOINT) ;; FAKE_*|SDL_*|DD_WIDTH|DD_HEIGHT|DD_VK_DRIVER|WINEDLLOVERRIDES) ;; DISPLAY|GAMESCOPE_WAYLAND_DISPLAY|FEX_*) ;; - TU_DEBUG|MESA_NO_ERROR|DXVK_CONFIG|DXVK_HUD|DROIDDECK_FORCE_SSBS) ;; + TU_DEBUG|MESA_NO_ERROR|DXVK_CONFIG|DXVK_HUD|DROIDDECK_FORCE_SSBS|BANNER_AUDIO_DIRECT_*) ;; mesa_glthread|vblank_mode|ZINK_*|GALLIUM_HUD|GALLIUM_THREAD) ;; DD_SYNC|DD_FSYNC_FIRST|DD_SYNC_FALLBACK|PROTON_NO_ESYNC|PROTON_NO_FSYNC|PROTON_NO_NTSYNC|WINEESYNC) ;; PROTON_USE_D7VK) ;; diff --git a/tools/tests/test_bionic_paths.py b/tools/tests/test_bionic_paths.py index 3671aa68bd..1e50a7a477 100644 --- a/tools/tests/test_bionic_paths.py +++ b/tools/tests/test_bionic_paths.py @@ -65,6 +65,14 @@ class ToolArguments(unittest.TestCase): def test_wine_keeps_the_guest_root(self): self.assertIn('DROIDDECK_GUEST_ROOT) ;;', LAUNCH.read_text()) + def test_directaudio_settings_reach_the_built_in_driver(self): + text = LAUNCH.read_text() + block = text[text.index('KEEP="'):text.index('export PATH=/system/bin')] + script = block + 'env | grep -E "AUDIO_DIRECT_|^OTHER=" | sort\n' + env = {'PATH': os.environ['PATH'], 'DROIDDECK_BIONIC_KEEP': 'PATH', 'AUDIO_DIRECT_MIC': '1', 'AUDIO_DIRECT_MS': '60', 'OTHER': 'x'} + result = subprocess.run(['sh', '-c', script], env=env, text=True, capture_output=True, check=True) + self.assertEqual(['BANNER_AUDIO_DIRECT_MIC=1', 'BANNER_AUDIO_DIRECT_MS=60'], result.stdout.split()) + class SessionLogs(unittest.TestCase): SESSION = '/data/user/0/com.droiddeck.launcher/files/logs/2026-11-22-09-steam'