From f542e59a20db61df21f07ac5276b26e576983fa2 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Mon, 21 Sep 2026 09:13:33 -0400 Subject: [PATCH] Audio: DirectAudio for games, and the microphone, from Bannerlator's Linux session Two opt-ins on a new Audio screen, both ported from Bannerlator's gamescope runtime where they are proven with voice in Steam's own tester. DirectAudio replaces the audio driver inside the games the client launches - Wine's mmdevapi driver, glibc build - with one that talks to a helper on the Android side over a unix socket. The client keeps PulseAudio either way: it is a native Linux program with no other way to make a sound. The helper runs here because nothing inside the session can open Android's audio: a game is a glibc process in a rootfs that binds no /system, and the uid the helper runs under is what the recording permission is checked against. The microphone is its own opt-in. The helper opens the input stream only when asked and writes it to a pipe; PulseAudio's module-pipe-source turns that into a source the client sees as DirectAudioMic. The daemon makes the pipe and the helper waits for it - the two used to race, and the module fails on EEXIST. The Proton wrappers gain Bannerlator's bl_directaudio, which adds the driver's directory to WINEDLLPATH and names the driver in the prefix, and refuses on any Proton that is not Wine 11 rather than pair a driver with an interface it was not built against, which would be silence rather than an error. bl_game_cpus comes along in the same splice and is inert until BL_GAME_CPUS is set. The driver is staged into the runtime at every launch like the session scripts; the helper ships as libdirectaudiorelay.so beside the PulseAudio daemon. Both are the binaries Bannerlator carries, built by The412Banner/directaudio's relay workflow (linux-wine11 build against ValveSoftware/wine proton_11.0). --- README.md | 24 ++++ app/src/main/AndroidManifest.xml | 4 + .../assets/directaudio/linux-wine11/README.md | 115 ++++++++++++++++++ .../aarch64-unix/winedirectaudio.so | Bin 0 -> 68064 bytes .../aarch64-windows/winedirectaudio.drv | Bin 0 -> 524288 bytes .../i386-windows/winedirectaudio.drv | Bin 0 -> 16384 bytes .../directaudio/linux-wine11/version.txt | 4 + .../com/steamdeck/launcher/MainActivity.kt | 19 +++ .../audio/DirectAudioRelayComponent.java | 108 ++++++++++++++++ .../launcher/audio/PulseAudioComponent.java | 46 +++++-- .../launcher/session/SessionFiles.kt | 27 ++++ .../launcher/session/SessionPrefs.kt | 17 +++ .../launcher/session/SessionService.kt | 35 +++++- .../com/steamdeck/launcher/ui/AudioDialog.kt | 69 +++++++++++ .../com/steamdeck/launcher/ui/MainScreen.kt | 5 + .../jniLibs/arm64-v8a/libdirectaudiorelay.so | Bin 0 -> 28112 bytes .../usr/local/bin/bannerlator-steam-compat | 72 ++++++++++- 17 files changed, 534 insertions(+), 11 deletions(-) create mode 100644 app/src/main/assets/directaudio/linux-wine11/README.md create mode 100644 app/src/main/assets/directaudio/linux-wine11/aarch64-unix/winedirectaudio.so create mode 100644 app/src/main/assets/directaudio/linux-wine11/aarch64-windows/winedirectaudio.drv create mode 100644 app/src/main/assets/directaudio/linux-wine11/i386-windows/winedirectaudio.drv create mode 100644 app/src/main/assets/directaudio/linux-wine11/version.txt create mode 100644 app/src/main/java/com/steamdeck/launcher/audio/DirectAudioRelayComponent.java create mode 100644 app/src/main/java/com/steamdeck/launcher/ui/AudioDialog.kt create mode 100644 app/src/main/jniLibs/arm64-v8a/libdirectaudiorelay.so diff --git a/README.md b/README.md index 24a3072f25..fc862761fb 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,30 @@ nothing. The client rewrites those keys when it exits, so the app writes them ag session start. Games with always-online DRM will not start offline, and nothing can be installed or updated. +## Audio + +The Steam client always plays through **PulseAudio** — it is a native Linux program with no other +way to make a sound, and its menus, music and voice chat all go through it. **Audio** on the main +screen adds two things on top, each applying at the next session start: + +- **DirectAudio for games** — replaces Wine's audio driver *inside the games the client launches* + with Bannerlator's DirectAudio, which talks straight to Android over a socket instead of through + PulseAudio: lower latency, and no resampling in between. The client is untouched. It only pairs + with a Wine 11 Proton (Valve's ARM64 builds, GE-Proton, proton-cachyos); on anything else the + wrapper leaves it off and says so in the log, because a mismatch would be silence rather than an + error. A game's first launch after turning it on still uses Proton's own audio — the driver is + named in the game's prefix, which does not exist until that first launch — and the second uses + DirectAudio. +- **Microphone** — the relay helper opens Android's input stream under the app's own uid (which is + what the recording permission is checked against) and PulseAudio exposes it to the client as a + source named **DirectAudioMic**, so Steam voice chat works. Asks for the recording permission when + turned on; off, nothing in the session can record and Android's indicator stays off. + +The helper is a small Android program the app runs beside the session; the driver is a glibc build +staged into the runtime at every launch like the session scripts, so a fix reaches an installed +runtime without re-hosting it. Proven in Bannerlator's Linux session with voice in Steam's own +tester; ⚠️ not yet exercised in this app. + ## Compatibility tools **Compatibility tools** (main screen and drawer) installs GE-Proton or proton-cachyos — native diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3dd7ae4e0d..895c35c55c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,6 +17,10 @@ itself with the phone via boot receivers and signs this client out seconds after every login; a normal permission, and it cannot touch anything in the foreground. --> + + diff --git a/app/src/main/assets/directaudio/linux-wine11/README.md b/app/src/main/assets/directaudio/linux-wine11/README.md new file mode 100644 index 0000000000..7a7935c407 --- /dev/null +++ b/app/src/main/assets/directaudio/linux-wine11/README.md @@ -0,0 +1,115 @@ +# DirectAudio for the Linux Steam client (relay build) + +This is the driver for games that run under **Valve's ARM64 Proton inside a Linux +runtime on Android** - Bannerlator's linuxfs session with the native Steam client - +where the game process is a glibc process and cannot touch Android's audio +libraries itself. + +Two pieces, both required: + +| piece | what it is | where it runs | +|---|---|---| +| `aarch64-unix/winedirectaudio.so` + the two PE shells | the Wine `mmdevapi` driver, glibc build, **no AAudio inside** | in the game, inside the Linux rootfs | +| `directaudio-relay` | a small bionic program that owns the AAudio output and microphone streams | on the Android side, under the app's uid | + +They meet over a unix socket. The driver connects, sends its launch config, and +gets back two shared-memory rings: one it fills with mixed game audio, one the +helper fills with microphone audio. The helper plays and records; the driver +keeps doing everything else it always did. + +## Which Proton + +Built inside `ValveSoftware/wine` at `proton_11.0`. The private `mmdevapi` +interface it implements is byte-identical across **Proton 11.0 (ARM64)**, +**Proton Experimental (ARM64)** and our own Wine-11 layers (checked 2026-09-19), +so this one build serves any of them. A future Proton on a Wine 12 base will +need a rebuild - the interface is not versioned, and a mismatch is silence, not +an error. + +## Installing the driver next to Proton (not into it) + +Steam verifies and updates its Proton depots, so files added under +`steamapps/common/Proton .../files/lib/wine/` will not survive. Put the driver +in a directory of its own and point Wine at it: + +``` +/directaudio/lib/wine/aarch64-unix/winedirectaudio.so +/directaudio/lib/wine/aarch64-windows/winedirectaudio.drv +/directaudio/lib/wine/i386-windows/winedirectaudio.drv +``` + +and set, for the game process: + +``` +WINEDLLPATH=/directaudio/lib/wine +``` + +Wine searches `WINEDLLPATH` entries with the per-arch subdirectories appended, +so both the PE shell and the unixlib are found there. In Bannerlator's runtime +the natural place to export it is the `bannerlator-proton` compatibility-tool +wrapper, which every Proton launch goes through. + +## Selecting the driver + +`mmdevapi` only tries the drivers named in the registry (or its built-in +`pulse,alsa,oss,coreaudio` list, which does not know about this one). Set, in the +game's prefix: + +``` +wine reg add "HKCU\Software\Wine\Drivers" /v Audio /d directaudio /f +``` + +Under Proton the prefix is `compatdata//pfx`; run the command with that +prefix as `WINEPREFIX` using Proton's own `bin-arm64/wine`, or write the key from +the wrapper before it hands off to Proton. + +## Running the helper + +``` +directaudio-relay --socket [--log] +``` + +- Run it **under the app's uid**, the way the app already runs its PulseAudio + daemon. Android checks `RECORD_AUDIO` against the calling uid, so a helper + started any other way can play but cannot record. +- Start it **before** the game: the driver asks "is a helper there?" once, when + Wine picks an audio driver, and falls back to unavailable if not. +- The socket path must be reachable from inside the Linux rootfs. Bannerlator + binds the app's files directory and its runtime directory into the session at + their own paths, so any socket under either works unchanged on both sides. +- The helper serves any number of game processes; each gets its own streams. + It exits on `SIGTERM`; a game exiting tears down that game's streams only. + +## Telling the driver where the helper is + +``` +BANNER_AUDIO_DIRECT_RELAY= +``` + +Unset, the driver looks for `$XDG_RUNTIME_DIR/directaudio-relay`. + +## Everything else is unchanged + +All `BANNER_AUDIO_DIRECT_*` knobs mean what they mean in the in-process build: +`_PERF`, `_ADAPTIVE`, `_DECAY`, `_MS`, `_MAXMS`, `_BF`, `_MBF`, `_EXCLUSIVE`, +`_WATCHDOG`, `_STALL_MS`, `_DECAY_*`, `_LOG`, `_PERIOD_MS`, `_MINPERIOD_MS`, and +the live-config mailbox `_RUNTIME` (the helper watches the file; it must be a +path the helper can read on the Android side). **`BANNER_AUDIO_DIRECT_MIC=1`** +exposes the capture endpoint exactly as before: the helper opens the input +stream (`VOICE_COMMUNICATION` preset) when the game connects and makes it hot on +the game's first capture start. + +One thing is different: there is one extra hand-off, the ring. The helper's +callback pulls a burst from it, so the driver keeps two bursts queued (about 8 ms +on a 192-frame device) on top of the AAudio buffer the presets control, and the +helper raises that if a callback ever finds the ring short. `get_latency` reports +the sum, so a game that sizes its own buffers from it still sees the truth. + +## Proving it is running + +- Helper side: `logcat -s DA-Relay:I` shows `hello from `, then `open: buffer + ... ring target ...`, then `capture open` / `capture start` for the mic. +- Game side: the session log carries `DirectAudio: relay: connected - ...`. +- The game process's `/proc//maps` shows `winedirectaudio.so` and **no** + `libaaudio.so` (it is in the helper's maps instead). The AudioFlinger track is + owned by the helper's pid. diff --git a/app/src/main/assets/directaudio/linux-wine11/aarch64-unix/winedirectaudio.so b/app/src/main/assets/directaudio/linux-wine11/aarch64-unix/winedirectaudio.so new file mode 100644 index 0000000000000000000000000000000000000000..7d3083052af69d314bd8f4502d1fe75c6ebfbf31 GIT binary patch literal 68064 zcmeIbd3;nw)<0agZ)bt9gb+wbFu5Jppe!Q0Vs1JC0zrr&Dl_^_y3+|HhAd>!L{M%5 zDvC2t+OQ3%1ecLyWFE$09NLkg0mornW)K8%?<627j>fR1h1l=++}e54-e z%mpl=2Y6a9bY=oRs0aMJ0qcpMfA&HryBGY^y}(O*p>tO+@cVj!_k(zQ;`60m@E7$0 zcl82K>VxurlUf?5op%c*y{-?db@9L#rzwHHn6W|ga|IfPs^u&LDFYS))1wOf# zeueddzqXflpX~*Ib1(REFZemVz_Y>UAoMt2pQorl^jWRL>#k`44rkff%Zo~iv&$>& zWfj@kEPH;|9oe~gWqHdB$}959vhGM(QBs_jW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#)2q=&(aVr4b~DC zt@GDc&wr`s!+5!#ih6p^rxDcAm_mP}9v}L9^YqclGre1EU&QtBHoYOv=MlX^9}SH~ z>#07BjJNZnPwUSfy}nP+bGf(a`P=n!ub$V#?ameY&*h?QNRJI~|s#a?~C)j>;sxnlHDYEYDG4ugon_?YiMH zt!Bny4PjnN$}DN@T{)G-6_wJ>w@kQY!ld!jD%I@dMoVCW zE6ZD9rwaO8>52+Ap`f?`|5oHx;ooJ*psXa_r6*uuuZR_-BIJnnpRNyqryNloS=^6<6rO`#(s?50Z=GT5?1m zFrMnucUKF#JM7AnAG-`+#Orf^%+s+tCik!0FLDA@PCW4X++Xul)*U;wOEh?W?nfu- za9*GLf1YxG4>a|ocaLY;47@>2yZGn+m8YdTCg-2G!_zq^C*RHU+<)^_*6S1h)Hdf| z2eT}^P#Le!=MSFp`GdF5>+}BqLa%St3G(@fr+ogR`a|&e*Utxx_~P>=pRak!+X0ID z@gIK&pvL-G8ku4h@XU;VE5Ru2FqJx=8K{`JWOjP3LIf~S1m=Joyge@L&- z<-bRdPk6eI2MRg?|MqMB>gTW25P5nVC#=`^Z@u31&pV#B` z4&a4!kJsmM$G%P-L$A-}#_RKb9RZrL{eAk3vrnJBCh25&!t3+&J-_-q{yV4F-%7*{ zA6}2ACsAf>pU=07pjA9#s7tTB9tVG_!+8HQOj?K2Oj`X?9&qXvc)xl5X1oxle?NKs g@f=Z4HL6-20#Tl~t)r+(rQZJ6Mj+mKeGdM=0Pg^cs{jB1 literal 0 HcmV?d00001 diff --git a/app/src/main/assets/directaudio/linux-wine11/aarch64-windows/winedirectaudio.drv b/app/src/main/assets/directaudio/linux-wine11/aarch64-windows/winedirectaudio.drv new file mode 100644 index 0000000000000000000000000000000000000000..d078149dc9e44895236c98df348cfb29aca5612a GIT binary patch literal 524288 zcmeI$UufM|9RTp}y*EwM*3H{Lx=t#&8xA{>SX5MG(AzGXvBVj+sznf+HdoR$ZL%~S z8TBFlVN8AL?UUleqU50|3oAYj!MaT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io/linux-wine11/i386-windows/winedirectaudio.drv b/app/src/main/assets/directaudio/linux-wine11/i386-windows/winedirectaudio.drv new file mode 100644 index 0000000000000000000000000000000000000000..93efd051f78be6dfb83c9e6d56824bd68359f10c GIT binary patch literal 16384 zcmeI2v1=4T6vp2sQ6e6)O+dk74h&c=OBAtO;~ErJJaPs_IB?e;$tL41?Cr{>5Ckj1 zLcvB*#MUCVmPaZJYby&aEc^$=ZhbSm7nkF%FqPu>U}oO?-g|R%zi#g4>a8JJM6|%8 zXGeXjL2q1RI06gJu0(}&+*|}7_a29P}j|qcgO@L=Bd`}#dQ7@M5m26V{(a(b85tO zCufuxne(GY-fi!HTtofsI=LL?9PVmKA80&uT$>=e?PPJ7heR(d7FjTLdTp3T7DAV#Ah~jdTp3TwAu*af&d7B00@8p2!H?xfB*=900{ht1U^pK-KQImzxBRvFp7yx z6`K4TzUA6mR2Hp{o)X6z z?{3P=WxZwX>dJZ(EFb^^AOHd&00JNY0w4eaAOHd&00MtRV8mDNf8EA!21c#I}0=r009sH0T2KI5C8!X009sH0T4Ja0e*k3-?^W2*WAE;=stH}yKg7nj~{q% eG=cyKfB*=900@8p2!H?xfB*=900{gQ1bzX(Lh3dE literal 0 HcmV?d00001 diff --git a/app/src/main/assets/directaudio/linux-wine11/version.txt b/app/src/main/assets/directaudio/linux-wine11/version.txt new file mode 100644 index 0000000000..a32f892380 --- /dev/null +++ b/app/src/main/assets/directaudio/linux-wine11/version.txt @@ -0,0 +1,4 @@ +directaudio linux-wine11 relay build +source 3548a4a730e8d01cb0cb0268d51a2fb8f23dcd33 +wine ValveSoftware/wine@proton_11.0 +unixlib.h sha256 fdbed263338d0719c4d12e02b045c23721de33219ec8878e4c2d7ebc9efcbe09 diff --git a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt index 29d57cf9d1..5f1537659a 100644 --- a/app/src/main/java/com/steamdeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/steamdeck/launcher/MainActivity.kt @@ -33,6 +33,7 @@ import com.steamdeck.launcher.session.ProtonExtras import com.steamdeck.launcher.session.SessionPrefs import com.steamdeck.launcher.ui.ProtonDialog import com.steamdeck.launcher.ui.ProtonRow +import com.steamdeck.launcher.ui.AudioDialog import com.steamdeck.launcher.ui.DriverDialog import com.steamdeck.launcher.ui.DriverRow import com.steamdeck.launcher.ui.ConfirmDialog @@ -73,6 +74,9 @@ class MainActivity : ComponentActivity() { private var offline by mutableStateOf(false) private var protonRows by mutableStateOf>(emptyList()) private var showDrivers by mutableStateOf(false) + private var showAudio by mutableStateOf(false) + private var directAudio by mutableStateOf(false) + private var mic by mutableStateOf(false) private var linuxRows by mutableStateOf>(emptyList()) private var linuxSteam by mutableStateOf("") private var linuxDesktop by mutableStateOf("") @@ -116,6 +120,7 @@ class MainActivity : ComponentActivity() { onFrameGen = { showFrameGen = true }, onProtons = { refreshProtons(); showProtons = true }, onDrivers = { refreshDrivers(); showDrivers = true }, + onAudio = { directAudio = SessionPrefs.directAudio(this); mic = SessionPrefs.micEnabled(this); showAudio = true }, onCredits = { showCredits = true }, ) if (showApps) DesktopAppsDialog( @@ -142,6 +147,20 @@ class MainActivity : ComponentActivity() { onRemoveAndroid = { id -> TurnipDriver(this).remove(id); refreshDrivers() }, onDismiss = { showDrivers = false }, ) + if (showAudio) AudioDialog( + directAudio = directAudio, mic = mic, + onDirectAudio = { on -> SessionPrefs.setDirectAudio(this, on); directAudio = on }, + onMic = { on -> + SessionPrefs.setMicEnabled(this, on) + mic = on + // The session checks the grant itself at start; asking here means the + // answer is in before the first session that wants it. + if (on && checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { + requestPermissions(arrayOf(Manifest.permission.RECORD_AUDIO), 2) + } + }, + onDismiss = { showAudio = false }, + ) if (showRemove) ConfirmDialog( title = "Remove Linux runtime", text = "This deletes the runtime, the Steam client inside it, and every game installed there.", diff --git a/app/src/main/java/com/steamdeck/launcher/audio/DirectAudioRelayComponent.java b/app/src/main/java/com/steamdeck/launcher/audio/DirectAudioRelayComponent.java new file mode 100644 index 0000000000..9f872e1d43 --- /dev/null +++ b/app/src/main/java/com/steamdeck/launcher/audio/DirectAudioRelayComponent.java @@ -0,0 +1,108 @@ +package com.steamdeck.launcher.audio; + +import android.os.Process; +import android.util.Log; + +import com.steamdeck.launcher.core.EnvironmentComponent; +import com.steamdeck.launcher.core.ProcessHelper; + +import java.io.File; +import java.util.ArrayList; + +/** + * The DirectAudio relay helper, which owns Android's speaker and microphone on behalf of a Linux + * session. + * + *

Nothing inside the session can open Android's audio itself. A game is a glibc process in a + * rootfs that binds no {@code /system}, and a glibc process cannot call libaaudio at all; the + * session is also never given a way to spawn a bionic helper of its own. So the helper runs out + * here, under the app's own uid, and the driver inside Wine talks to it over a unix socket. The uid + * matters for more than tidiness: Android checks the microphone permission against whoever opens + * the stream, so a helper started any other way could play but never record. + * + *

It is executed from the app's native library directory because Android will not execute a + * binary from anywhere else - the same reason the PulseAudio daemon ships as {@code + * libpulseaudio.so} despite being a program rather than a library. + * + *

Started before the client, because the driver asks once whether a helper is there, when Wine + * picks an audio driver, and reports itself unavailable if not. Ported from Bannerlator (GPL-3.0); + * the helper binary is the one built by The412Banner/directaudio's relay workflow. + */ +public class DirectAudioRelayComponent extends EnvironmentComponent { + private static final String TAG = "DirectAudioRelay"; + /** The helper, named as a library so Android will run it. */ + public static final String BINARY = "libdirectaudiorelay.so"; + + private final File socketPath; + /** Null when the microphone was not asked for; the helper then opens no input stream. */ + private final File micFifoPath; + private int pid = -1; + + public DirectAudioRelayComponent(File socketPath, File micFifoPath) { + this.socketPath = socketPath; + this.micFifoPath = micFifoPath; + } + + @Override + public void start() { + stop(); + File binary = new File(context.getApplicationInfo().nativeLibraryDir, BINARY); + if (!binary.isFile()) { + Log.w(TAG, "helper missing at " + binary + "; DirectAudio will report itself unavailable"); + return; + } + File parent = socketPath.getParentFile(); + if (parent != null) { + //noinspection ResultOfMethodCallIgnored + parent.mkdirs(); + } + // A socket left by a session that did not shut down cleanly is not a listener, and the + // helper would fail to bind onto it. + //noinspection ResultOfMethodCallIgnored + socketPath.delete(); + + // PulseAudio's pipe module insists on creating the pipe itself and fails if one is already + // there. The helper creates one too when the path is missing, and it starts a few + // milliseconds after the daemon is exec'd - well before the daemon has read its config. So + // left to itself the helper won its own race, the daemon's mkfifo failed with EEXIST, and + // the microphone was lost while everything else came up. Wait for the daemon to make the + // pipe before the helper runs; it appears within a second, and if it never does the helper + // starts anyway and creates it, which is the right thing when the daemon is not involved. + if (micFifoPath != null) { + long deadline = System.currentTimeMillis() + 3000L; + while (!micFifoPath.exists() && System.currentTimeMillis() < deadline) { + try { + Thread.sleep(50L); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; + } + } + Log.i(TAG, micFifoPath.exists() ? "microphone pipe made by the daemon; starting helper" + : "daemon did not make the microphone pipe in 3 s; helper will make it"); + } + + StringBuilder command = new StringBuilder(binary.getAbsolutePath()); + command.append(" --socket ").append(socketPath.getAbsolutePath()); + if (micFifoPath != null) { + // The helper creates the pipe if it is not there. PulseAudio is told the same path and + // reads from the other end of it. + command.append(" --mic-fifo ").append(micFifoPath.getAbsolutePath()); + } + ArrayList env = new ArrayList<>(); + env.add("HOME=" + context.getFilesDir()); + pid = ProcessHelper.exec(command.toString(), env.toArray(new String[0]), context.getFilesDir()); + Log.i(TAG, "started pid=" + pid + " socket=" + socketPath + + (micFifoPath != null ? " mic=" + micFifoPath : " (no microphone)")); + } + + @Override + public void stop() { + if (pid != -1) { + // The helper exits on a signal and tears down its streams; there is nothing below it to + // orphan, unlike the proot tree. + Process.killProcess(pid); + pid = -1; + } + } +} diff --git a/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java b/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java index 54d696ffd3..7ea51058df 100644 --- a/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java +++ b/app/src/main/java/com/steamdeck/launcher/audio/PulseAudioComponent.java @@ -32,10 +32,23 @@ public class PulseAudioComponent extends EnvironmentComponent { public static final String SOCKET_NAME = "PS0"; private final File workingDir; + /** + * A named pipe carrying microphone audio, or null for no microphone. The bundle ships + * module-aaudio-sink but no matching source, and the daemon runs where Android permits + * recording - so pointing module-pipe-source at a pipe the DirectAudio relay helper writes + * turns that one stream into a source the client can see, named DirectAudioMic. + */ + private final String micFifoPath; private int pid = -1; public PulseAudioComponent(Context context) { + this(context, null); + } + + /** As above, with a microphone fed from {@code micFifoPath}; null for output only. */ + public PulseAudioComponent(Context context, String micFifoPath) { this.workingDir = new File(context.getFilesDir(), "pulseaudio"); + this.micFifoPath = micFifoPath; } public File socket() { @@ -60,13 +73,32 @@ public class PulseAudioComponent extends EnvironmentComponent { //noinspection ResultOfMethodCallIgnored socket().delete(); - FileUtils.writeString(new File(workingDir, "default.pa"), String.join("\n", - "load-module module-native-protocol-unix auth-anonymous=1 auth-cookie-enabled=0 socket=\"" - + socket().getAbsolutePath() + "\"", - // volume=1.0 is not optional: with no volume argument module-aaudio-sink defaults - // the sink to 0% and the session plays silence. - "load-module module-aaudio-sink performance_mode=1 adaptive=1 volume=1.0", - "set-default-sink AAudioSink")); + // module-pipe-source creates the pipe with mkfifo and fails outright if one is already + // there - EEXIST, reported as "Unknown error 17" - and the module then does not load at + // all, so the source never appears and the client reports no microphone. Ours lives in the + // app's files directory and survives a session, so after the very first run the path would + // always be occupied. Removed here, before the daemon reads this config: the daemon makes + // it, and the relay helper starts afterwards and is content to find one already made. + if (micFifoPath != null && !micFifoPath.isEmpty()) { + //noinspection ResultOfMethodCallIgnored + new File(micFifoPath).delete(); + } + ArrayList config = new ArrayList<>(); + config.add("load-module module-native-protocol-unix auth-anonymous=1 auth-cookie-enabled=0 socket=\"" + + socket().getAbsolutePath() + "\""); + // volume=1.0 is not optional: with no volume argument module-aaudio-sink defaults + // the sink to 0% and the session plays silence. + config.add("load-module module-aaudio-sink performance_mode=1 adaptive=1 volume=1.0"); + config.add("set-default-sink AAudioSink"); + if (micFifoPath != null && !micFifoPath.isEmpty()) { + // The format is the helper's, fixed at s16le/48000/mono: it resamples when the device + // grants another input rate, so the daemon is never told a rate the bytes are not. + // A pipe has no clock, so nothing here corrects drift - acceptable for voice. + config.add("load-module module-pipe-source source_name=DirectAudioMic file=\"" + + micFifoPath + "\" format=s16le rate=48000 channels=1"); + config.add("set-default-source DirectAudioMic"); + } + FileUtils.writeString(new File(workingDir, "default.pa"), String.join("\n", config)); File modules = new File(workingDir, "modules/arm64"); ArrayList env = new ArrayList<>(); diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt index 89094434c3..0719803d4b 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt @@ -11,6 +11,8 @@ import java.io.File object SessionFiles { private const val TAG = "SessionFiles" private const val NO_PAD_SWITCH = "Download/steamdeck-no-pad" + /** Where the DirectAudio driver lives inside the runtime; the wrappers get it as BL_DIRECTAUDIO. */ + const val DIRECTAUDIO_DIR = "usr/local/lib/directaudio" /** * The libraries and scripts the session runs, refreshed from the apk at every launch. @@ -59,6 +61,31 @@ object SessionFiles { } if (!installed) Log.e(TAG, "$relative NOT staged") } + // The DirectAudio driver for games under Proton: the glibc build of winedirectaudio, which + // the Proton wrappers add to WINEDLLPATH when the session asks for it (BL_DIRECTAUDIO). + // Staged like the scripts, so a driver fix reaches an installed runtime without re-hosting. + val directAudio = arrayOf( + "aarch64-unix/winedirectaudio.so", + "aarch64-windows/winedirectaudio.drv", + "i386-windows/winedirectaudio.drv", + ) + for (relative in directAudio) { + val target = File(root, "$DIRECTAUDIO_DIR/lib/wine/$relative") + val staged = File(target.parentFile, target.name + ".staged") + var installed = false + try { + target.parentFile?.mkdirs() + context.assets.open("directaudio/linux-wine11/$relative").use { input -> + staged.outputStream().use { output -> FileUtils.copy(input, output) } + } + installed = staged.setReadable(true, false) && staged.renameTo(target) + } catch (e: Exception) { + Log.w(TAG, "could not stage DirectAudio $relative", e) + } finally { + if (!installed) staged.delete() + } + if (!installed) Log.e(TAG, "DirectAudio $relative NOT staged") + } // What every process in the session preloads. LD_PRELOAD in the environment would not // survive: the Steam client rebuilds it for each process it starts and appends its own // overlay entry without a separator, which silently drops whatever was there. diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt index b8c74fea84..ae989e1f6a 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionPrefs.kt @@ -63,6 +63,23 @@ object SessionPrefs { prefs(context).edit().putString("linuxDriver.$mode", id).apply() } + /** + * DirectAudio for the games the client launches: Wine's audio driver inside them replaced by + * ours, which talks to a helper on this side. The client itself keeps PulseAudio either way. + */ + fun directAudio(context: Context): Boolean = prefs(context).getBoolean("directAudio", false) + + fun setDirectAudio(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("directAudio", on).apply() + } + + /** The microphone, its own opt-in: the helper opens an input stream only when asked. */ + fun micEnabled(context: Context): Boolean = prefs(context).getBoolean("mic", false) + + fun setMicEnabled(context: Context, on: Boolean) { + prefs(context).edit().putBoolean("mic", on).apply() + } + /** The Android driver the compositor loads: "" = pick by GPU, else a bundled or imported id. */ @JvmStatic fun androidDriver(context: Context): String = prefs(context).getString("androidDriver", "") ?: "" diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt index 648c6ea04a..493df896cf 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt @@ -10,6 +10,7 @@ import android.app.PendingIntent import android.app.Service import android.content.Context import android.content.Intent +import android.content.pm.PackageManager import android.net.wifi.WifiManager import android.os.Build import android.os.Environment @@ -18,6 +19,7 @@ import android.os.PowerManager import android.util.Log import com.steamdeck.launcher.R import com.steamdeck.launcher.SessionActivity +import com.steamdeck.launcher.audio.DirectAudioRelayComponent import com.steamdeck.launcher.audio.PulseAudioComponent import com.steamdeck.launcher.core.EnvVars import com.steamdeck.launcher.core.EnvironmentComponent @@ -133,10 +135,41 @@ class SessionService : Service() { // its authors advise for those GPUs and what nothing else in the list needs. tuDebug(linuxDriverId)?.let { guest.add("TU_DEBUG=$it") } - val pulse = PulseAudioComponent(this) + // PulseAudio always: the client is a native Linux program and has no other way to make a + // sound - its menus, its music and its voice chat all go through here. DirectAudio is not + // an alternative to it on this path: it replaces the audio driver INSIDE Wine, so it + // changes what games do and leaves the client alone. The microphone is its own opt-in on + // top, and the helper only opens an input stream when asked - so a user who wants game + // sound but no recording gets exactly that, and Android's recording indicator stays off. + val wantsDirectAudio = SessionState.mode == MODE_STEAM && SessionPrefs.directAudio(this) + val wantsMic = SessionPrefs.micEnabled(this) && + checkSelfPermission(android.Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED + // Both paths sit under the app's files directory, which the session binds at its own path, + // so the same string is valid on both sides and nothing has to be translated. + val audioDir = File(filesDir, "directaudio").apply { mkdirs() } + val relaySocket = File(audioDir, "relay.sock") + val micFifo = if (wantsMic) File(audioDir, "mic.fifo") else null + + val pulse = PulseAudioComponent(this, micFifo?.absolutePath) pulse.setContext(this) guest.add("PULSE_SERVER=unix:" + pulse.socket().absolutePath) components.add(pulse) + if (wantsDirectAudio || wantsMic) { + // After the daemon in the list, so it can wait for the pipe the daemon makes. + val relay = DirectAudioRelayComponent(relaySocket, micFifo) + relay.setContext(this) + components.add(relay) + } + if (wantsDirectAudio) { + // Read by the Proton wrappers, which point Wine at the driver and name it in the + // prefix. Absent, they take an early return and the game uses Proton's own audio - so + // this variable is the whole of the selection. + guest.add("BL_DIRECTAUDIO=/" + SessionFiles.DIRECTAUDIO_DIR) + guest.add("BANNER_AUDIO_DIRECT_RELAY=" + relaySocket.absolutePath) + } + Log.i(TAG, "audio: PulseAudio" + (if (wantsDirectAudio) " + DirectAudio for games" else "") + + (if (wantsMic) " + microphone" else "") + + (if (SessionPrefs.micEnabled(this) && !wantsMic) " (microphone wanted but RECORD_AUDIO not granted)" else "")) guest.add("BL_WIDTH=" + size.first) guest.add("BL_HEIGHT=" + size.second) diff --git a/app/src/main/java/com/steamdeck/launcher/ui/AudioDialog.kt b/app/src/main/java/com/steamdeck/launcher/ui/AudioDialog.kt new file mode 100644 index 0000000000..c2a6d13259 --- /dev/null +++ b/app/src/main/java/com/steamdeck/launcher/ui/AudioDialog.kt @@ -0,0 +1,69 @@ +package com.steamdeck.launcher.ui + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Switch +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +/** + * The two audio opt-ins. The client always has PulseAudio; these change what the games get and + * whether anything can record. Both apply at the next session start. + */ +@Composable +fun AudioDialog( + directAudio: Boolean, + mic: Boolean, + onDirectAudio: (Boolean) -> Unit, + onMic: (Boolean) -> Unit, + onDismiss: () -> Unit, +) { + AlertDialog( + onDismissRequest = onDismiss, + title = { Text("Audio") }, + text = { + Column { + Text( + "The Steam client itself always plays through PulseAudio. These two change what happens around it, at the next session start.", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Spacer(Modifier.height(12.dp)) + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) { + Column(modifier = Modifier.weight(1f)) { + Text("DirectAudio for games", style = MaterialTheme.typography.bodyMedium) + Text( + "Replaces Wine's audio driver inside the games the client launches with one that talks straight to Android — lower latency, no PulseAudio in between. Wine 11 Protons only (Valve's ARM64, GE, cachyos); on anything else it stays off rather than play silence. A game's first launch after turning this on still uses Proton's own audio; the second uses this.", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + Switch(checked = directAudio, onCheckedChange = onDirectAudio) + } + Spacer(Modifier.height(8.dp)) + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) { + Column(modifier = Modifier.weight(1f)) { + Text("Microphone", style = MaterialTheme.typography.bodyMedium) + Text( + "Gives the session Android's microphone: the Steam client shows an input device named DirectAudioMic, for voice chat. Asks for the recording permission; with it off, nothing in the session can record and Android's indicator stays off.", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + Switch(checked = mic, onCheckedChange = onMic) + } + } + }, + confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } }, + ) +} diff --git a/app/src/main/java/com/steamdeck/launcher/ui/MainScreen.kt b/app/src/main/java/com/steamdeck/launcher/ui/MainScreen.kt index a51109338a..888b55c05a 100644 --- a/app/src/main/java/com/steamdeck/launcher/ui/MainScreen.kt +++ b/app/src/main/java/com/steamdeck/launcher/ui/MainScreen.kt @@ -67,6 +67,7 @@ fun MainScreen( onFrameGen: () -> Unit, onProtons: () -> Unit, onDrivers: () -> Unit, + onAudio: () -> Unit, onOffline: () -> Unit, onCredits: () -> Unit, ) { @@ -182,6 +183,10 @@ fun MainScreen( onClick = onDrivers, modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight + 5.dp * k), ) { Text("Graphics drivers", fontSize = 13.sp * k) } + OutlinedButton( + onClick = onAudio, + modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight + 5.dp * k), + ) { Text("Audio", fontSize = 13.sp * k) } Spacer(Modifier.height(10.dp * k)) Text( "by The412Banner and maxjivi05 · credits", diff --git a/app/src/main/jniLibs/arm64-v8a/libdirectaudiorelay.so b/app/src/main/jniLibs/arm64-v8a/libdirectaudiorelay.so new file mode 100644 index 0000000000000000000000000000000000000000..d530b848ff722ac830212e25a6028260b675a132 GIT binary patch literal 28112 zcmeHwdwf*Ywf{addCW`_NFam|Fd3p~CcGgbfM6yeU=mc~5EZpHnIw~B$Ya9H1PIRo zY#WMg8N^4yO0asHnJc}K3(EA01nl)fZ7q*#y@w9ANDDTuFCGDys9I*Y-- z!&wrG0v*9Ix!f!#D3zaD&5fx}!L>-KUAs~~Fde4UQ&Uw!N~vAAr_&^tsHrLlwTr}0 z#nthtY4>!wotld6Xp9{da(Tz88`D}vn36adAJ{IrM#huxkVl}Vw<*2f~<(?q4BnyR|LAMHra|LH^R z>DNgEy-E743^O%V`9AL^QOG-| zFD_Ves#V!8e4#UkQUB4TE0@gAc)mb~8D%!{7_T;Epi(rZD(RVeps3;ID+iUkihO z5C;D?3_b|K*v<5i90tE741Px#e0CUoE^s4!-*+DkVy}Pff0EEnLL?&7YAW)SOaHrn z#b$l0{P<=;Va`npzlX0Q69JtX2FkAiXCov%F62P6_sW7M!TDpl~pdcmRa4l z<(zQZYU~KGoIt7_&N}9DJ1ZNSSdGnXYh21)jZIE_qq~~mdRrrN*=riD^~~j{th2d! z-KG}S+(>~LLxffZ?lz~h(ZMQf8yr=vo>(`sCU>pVX00l##J_G^KUrmSTPtf>rM14^ zQ3+;NcYjesGvq4+TsHthUj(|`Rp^IRFLT<#u-a*}k;F}i0W0erE*rB}R@$1}SpypL z@h|NkQ(2i+4jj=@O&K33t5(L_Xl-=3>TR|rVpv&M2JUWqgN@NRn9J5!)!?dOd3nuM zcE>_Dzy_+Z(Av;cZ?n)C2Nun9S{rPx5}Px>+39kBr#Qd4y4vPkXkTF~YLu(823tcV zDOZ-_27XT4l4hIBz0mDwx{;GSctp&kQ`XSj*kElMpo1zjbUIpCwWA3$Qw^zId>(6^ z%<6X7S+&eV?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am-compat index 7669773638..b7c0659ad1 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-compat +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-compat @@ -70,6 +70,58 @@ TOOL_MANIFEST_VDF = """"manifest" } """ % LAUNCHER +# Resolves the depot at launch time, so the tool can be registered before the depot exists and +# survives the client updating or replacing it. Proton takes its base directory from +# dirname(sys.argv[0]) without resolving it, so it is run from the depot itself. +# Cores for a game the client launches, kept separate from the client's own. One mask suits the +# client's menus and another suits a game, and they are wanted at the same time - so the game's is +# applied here, in the launch path every game goes through, rather than to the session as a whole. +BL_GAME_CPUS_SETUP = """ +bl_game_cpus() { + [ -n "${BL_GAME_CPUS:-}" ] || return 0 + command -v taskset >/dev/null 2>&1 || return 0 + # exec'd through taskset rather than set afterwards: a mask applied to a pid races the process + # into spawning its own threads, and this way every thread inherits it from the first instruction. + BL_TASKSET="taskset -c $BL_GAME_CPUS" + echo "bannerlator-proton: game cores $BL_GAME_CPUS" >&2 +} +""" + +BL_DIRECTAUDIO_SETUP = """ +bl_directaudio() { + base=$1 + [ -n "${BL_DIRECTAUDIO:-}" ] || return 0 + [ -d "$BL_DIRECTAUDIO/lib/wine" ] || return 0 + version=$("$base/files/bin-arm64/wine" --version 2>/dev/null) + major=${version#wine-} + major=${major%%.*} + if [ "$major" != "11" ]; then + echo "bannerlator-proton: DirectAudio left off - it is built for Wine 11 and this Proton is '${version:-unknown}'. Pairing them would be silent rather than broken, so it is not worth guessing." >&2 + return 0 + fi + # Wine appends the per-architecture subdirectory to each entry, so the directory holding + # aarch64-unix/ and aarch64-windows/ is what goes here. + WINEDLLPATH="$BL_DIRECTAUDIO/lib/wine${WINEDLLPATH:+:$WINEDLLPATH}" + export WINEDLLPATH + # mmdevapi only tries the drivers named in the registry; its built-in list is pulse, alsa, oss and + # coreaudio and knows nothing about this one. The key is appended to the prefix's user.reg rather + # than written with `wine reg`, which would start a wineserver here just to set one value. + reg="${STEAM_COMPAT_DATA_PATH:-}/pfx/user.reg" + if [ -f "$reg" ]; then + if ! grep -q '"Audio"="directaudio"' "$reg" 2>/dev/null; then + printf '\n[Software\\\\Wine\\\\Drivers] %s\n"Audio"="directaudio"\n' "$(date +%s)" >> "$reg" + echo "bannerlator-proton: DirectAudio selected in the prefix" >&2 + fi + else + # A prefix that does not exist yet is created by Proton moments from now, after this runs, so + # the key lands on the NEXT launch of that game. Said out loud because silent audio on a first + # launch would otherwise look like a fault. + echo "bannerlator-proton: no prefix yet - DirectAudio takes effect the next time this game starts" >&2 + fi + echo "bannerlator-proton: DirectAudio ready (Wine $major)" >&2 +} +""" + # Resolves the depot at launch time, so the tool can be registered before the depot exists and # survives the client updating or replacing it. Proton takes its base directory from # dirname(sys.argv[0]) without resolving it, so it is run from the depot itself. @@ -98,12 +150,19 @@ fi for name in %s; do depot="$steam_root/steamapps/common/$name" if [ -d "$depot/files/bin-arm64" ] && [ -x "$depot/proton" ]; then - exec "$depot/proton" "$verb" "$@" + bl_directaudio "$depot" + bl_game_cpus + exec ${BL_TASKSET:-} "$depot/proton" "$verb" "$@" fi done echo "bannerlator-proton: no ARM64 Proton depot yet - the client downloads one as this tool's dependency; retry the launch once it has" >&2 exit 1 """ % " ".join('"%s"' % n for n in SOURCES) +# Spliced in after the formatting above, never through it: the function body contains ${major%%.*} +# and a % format would eat that into a single %, leaving a shell expansion that silently does +# something else. +LAUNCHER_SH = LAUNCHER_SH.replace( + "verb=$1; shift", "verb=$1; shift\n" + BL_DIRECTAUDIO_SETUP + BL_GAME_CPUS_SETUP, 1) # A third-party Proton dropped into compatibilitytools.d - GE-Proton, proton-cachyos, anything of # that shape - is adopted rather than used as shipped, for the same two reasons Valve's ARM64 depot @@ -135,9 +194,11 @@ if [ -f "$fake" ]; then *) LD_PRELOAD="$fake${LD_PRELOAD:+:$LD_PRELOAD}"; export LD_PRELOAD ;; esac fi +bl_directaudio "$here" +bl_game_cpus # Proton takes its base directory from dirname(sys.argv[0]) without resolving it, so it has to be # started from its own tree. -exec "$here/%s" "$verb" "$@" +exec ${BL_TASKSET:-} "$here/%s" "$verb" "$@" """ EXTRA_COMPAT_TOOL_VDF = """"compatibilitytools" { @@ -292,8 +353,13 @@ def adopt_extras(tools): name = first_key(compat_vdf, ["compatibilitytools", "compat_tools"]) or entry wrapper = os.path.join(tool_dir, EXTRA_WRAPPER) try: + # Formatted first, spliced second: the function carries a printf %s and a + # ${major%%.*} of its own, and putting it through the format would eat both. + body = (EXTRA_WRAPPER_SH % entry_point).replace( + 'here=$(dirname "$0")', + 'here=$(dirname "$0")\n' + BL_DIRECTAUDIO_SETUP + BL_GAME_CPUS_SETUP, 1) with open(wrapper, "w", encoding="utf-8") as f: - f.write(EXTRA_WRAPPER_SH % entry_point) + f.write(body) os.chmod(wrapper, 0o755) with open(manifest, "w", encoding="utf-8") as f: f.write(EXTRA_MANIFEST_VDF)