From 4de28717f1228f70fbafb2569c9a4eee2cbfd6a1 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sat, 24 Oct 2026 19:49:52 -0400 Subject: [PATCH] feat: guide shared-screen co-op through Steam Link --- app/src/main/AndroidManifest.xml | 4 ++ .../launcher/lan/LocalLanActivity.kt | 29 ++++++++ .../droiddeck/launcher/lan/SteamLinkCoop.kt | 31 ++++++++ .../launcher/lan/SteamLinkCoopPanel.kt | 40 +++++++++++ app/src/main/res/values/lan.xml | 26 +++++-- docs/local-lan.md | 72 +++++++++++++++++-- 6 files changed, 191 insertions(+), 11 deletions(-) create mode 100644 app/src/main/java/com/droiddeck/launcher/lan/SteamLinkCoop.kt create mode 100644 app/src/main/java/com/droiddeck/launcher/lan/SteamLinkCoopPanel.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 229aad7d3d..bf39f0ddc6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,6 +29,10 @@ + + + + Unit, + onClient: () -> Unit, +) { + SettingsGroup(stringResource(R.string.lan_coop_title)) { + Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) { + Text(stringResource(R.string.lan_coop_overview)) + Text(stringResource(R.string.lan_coop_network)) + Text(stringResource(R.string.lan_coop_host)) + SecondaryButton(stringResource(if (hostRunning) R.string.lan_coop_return_host else R.string.lan_coop_open_launcher), onClick = onHost) + if (hostAddress != null) { + SelectionContainer { Text(stringResource(R.string.lan_coop_host_address, hostAddress)) } + } else Text(stringResource(R.string.lan_coop_find_host)) + Text(stringResource(R.string.lan_coop_client)) + PrimaryButton(stringResource(if (clientInstalled) R.string.lan_coop_open_client else R.string.lan_coop_get_client), onClick = onClient) + Text(stringResource(R.string.lan_coop_controllers)) + Text(stringResource(R.string.lan_coop_offline)) + } + } +} diff --git a/app/src/main/res/values/lan.xml b/app/src/main/res/values/lan.xml index f8ead5c5cc..a2b003d1a3 100644 --- a/app/src/main/res/values/lan.xml +++ b/app/src/main/res/values/lan.xml @@ -1,10 +1,10 @@ - Local LAN · Experimental - Offline Wi-Fi hotspot and USB/Ethernet LAN setup - Device testing is still needed. Use a game with LAN or direct-IP multiplayer. LAN setup does not add multiplayer to a game or replace Steam authentication. Set this up before launching the game. + Local multiplayer · Experimental + LAN connections and shared-screen co-op with Steam Link + Choose LAN play with a game on each device, or shared-screen co-op with one game running on the host. The game must support the chosen multiplayer mode. Device testing is still needed. Wireless LAN - Host creates a password-protected local network without a router or internet. It may disconnect your current Wi-Fi. On the other device, join using Android Wi-Fi settings and choose to stay connected without internet. Then select the LAN interface below on both devices. If cellular takes priority, turn mobile data off while playing. + Host creates a password-protected local network without a router or internet. It may disconnect your current Wi-Fi. On the other device, join using Android Wi-Fi settings and choose to stay connected without internet. For separate-copy LAN games, select the LAN interface below on both devices; for Steam Link, select it on the host only. If cellular takes priority, turn mobile data off while playing. Host offline hotspot Stop hotspot Starting hotspot… @@ -22,11 +22,25 @@ USB-C / Ethernet LAN Connect a data-capable USB-C cable and enable USB tethering on one device in Android settings. This only works if the other device supports the USB network driver and host role. If no LAN interface appears, try reversing the cable’s host/device roles or use USB Ethernet adapters. Charging or file-transfer mode alone does not create a LAN. DroidDeck cannot enable USB tethering itself. Android network settings - Game LAN interface - Select the interface whose IP belongs to your local connection. DroidDeck reports this interface and its real index to the Linux session. This does not change Android routing; use the host’s IP in the game if LAN discovery fails. Selection lasts until the app process exits or you return to the default below. + Host / game LAN interface + Select the interface whose IP belongs to your local connection. For separate-copy LAN games, do this on both devices. For Steam Link, only the DroidDeck host needs this selection. Set it before launching Steam or the game. This does not change Android routing. Selection lasts until the app process exits or you return to the default below. No local IPv4 interfaces are visible yet. Connect the devices first. %1$s is unavailable. Reconnect or choose another interface. Use for games Selected Android default network + Shared-screen co-op · Steam Link + The host runs one copy of a game with local co-op or split-screen support. Both devices see the same picture and each can provide a controller. Steam Link handles the client’s video, audio, and input. + 1. Connect both devices to the same Wi-Fi, or create an offline hotspot below and join it from the second device. Select the host’s LAN interface below before starting Steam. + 2. On the host, start Steam in DroidDeck, then enable Settings → Remote Play → Enable Remote Play. Keep DroidDeck’s host controls enabled. Return to the host to approve the pairing PIN when Steam Link asks. + Return to host Steam + Back to DroidDeck to start Steam + Selected LAN address: %1$s\nIf discovery fails, add this host address in Steam Link on the second device. + If Steam Link cannot find the host, select the host’s LAN interface below to see its address. + 3. On the second device, open Steam Link, pair with the host, and start streaming. Connect that player’s controller to the second device, or enable Steam Link’s touch controller. The second device does not need to run a DroidDeck Linux session. + Open Steam Link on this device + Get Steam Link for this device + 4. Launch the game through the host’s Steam and join its local multiplayer mode. Keep the host’s controller and the Steam Link controller as separate gamepads. If both control the same player, check Steam’s controller order and the game’s controller settings. Keyboard and mouse input may be shared instead of creating another player. + Install, sign in, and pair while online before travel. A local hotspot provides the network, but first-time pairing and fully offline Steam Link play still need testing on this setup. No ADB, Shizuku, or root setup is required by this integration. + No Steam Link app, app store, or browser could be opened. Install Steam Link on the second device and retry. diff --git a/docs/local-lan.md b/docs/local-lan.md index 1bfd11edd8..b2b73509a7 100644 --- a/docs/local-lan.md +++ b/docs/local-lan.md @@ -1,11 +1,11 @@ -# Local LAN experiment +# Local multiplayer experiment Status: implemented prototype; no two-device hardware or game validation. Open -**Settings → Overview → Local LAN · Experimental** before starting a session. +**Settings → Overview → Local multiplayer · Experimental** before starting a session. ## Scope -Two devices each run their own copy of a LAN-capable game. One device can create +LAN mode: two devices each run their own copy of a LAN-capable game. One device can create an Android local-only hotspot; the other joins it through Android Wi-Fi settings. No router, SIM, mobile data, internet connection, or root access is required by the hotspot API. Android chooses the network name, password, band, and subnet. @@ -19,11 +19,62 @@ USB Ethernet adapters and an Ethernet cable are another possible transport. DroidDeck does not create USB gadget functions, force USB roles, enable tethering, or install kernel drivers. -This does not implement remote play, controller forwarding, online matchmaking, -an internet-sharing hotspot, a virtual LAN tunnel, or generic split-screen co-op. +Shared-screen mode: one DroidDeck device runs a game through Steam and the other +uses Valve's Steam Link app for video, audio, and controller input. This reuses +DroidDeck's existing Steam Remote Play host; it adds a setup guide and a client +app/store handoff, not a new streaming implementation or an embedded client. + +Neither mode adds online matchmaking, an internet-sharing hotspot, a virtual LAN +tunnel, or multiplayer to games that do not support it. Steam authentication, account/licensing requirements, DRM, and a game's own network implementation still apply. Prepare and test offline mode before travel. +## Shared-screen co-op through Steam Link + +This is the EasyControl-style outcome: the game runs on the host, both devices +see the host's picture, and the client supplies a separate gamepad. No ADB, +Shizuku, root permission, or Android-wide input injection is introduced. The +screen includes distinct host and client instructions, a return-to-host button +when a Steam session is running, the selected LAN address for manual pairing, +and a button to open Steam Link on the device being used. When Steam Link is +absent, that button opens its store listing with a browser fallback; installation +and pairing remain user actions. App availability refreshes when setup resumes. + +1. Put both devices on the same Wi-Fi, or host the local-only hotspot and join it + from the second device. Select the host's actual LAN interface before launching + Steam. The Steam Link client does **not** need a Linux session or DroidDeck's + guest-interface override. +2. Start Steam through DroidDeck on the host and enable **Settings → Remote Play → + Enable Remote Play**. The host must remain running and its own controls must + remain enabled. This guide returns to an existing Steam session; it does not + bypass DroidDeck's normal setup checks to start a new one. +3. Open Steam Link on the second device, find/add the host, and approve its pairing + PIN in the host's Steam. Attach the second player's controller to the client + device or enable Steam Link's touch controller. Start streaming. +4. Launch a local co-op/split-screen game through the host's Steam. Enter its local + multiplayer mode and join using the second gamepad. The desired result is two + distinct controllers, not keyboard/mouse events controlling the same player. + If necessary adjust Steam's controller order and the game's input settings. + Player numbering is controlled by Steam/the game; this guide does not force + the host into player one or merge the inputs in DroidDeck. + +The host's existing capture path uses PipeWire and its MediaCodec-backed V4L2 +encoder bridge ([release notes](releases/0.6.0.md), +[VideoEncodeBridge](../app/src/main/java/com/droiddeck/launcher/session/VideoEncodeBridge.kt)). +Steam Link handles pairing, the streaming protocol, decoding, and remote input; +Steam's virtual-controller support supplies guest controller devices. Games added +to Steam can be candidates, but a standalone non-Steam session is not a host for +this flow. Displaying two copies of the same split-screen picture does not give +each player an independent camera or turn a single-player game into co-op. + +Install the client, authenticate Steam, and pair while online before travel. The +hotspot itself needs no internet, but fully offline streaming and first-time +offline pairing have **not** been validated in this DroidDeck setup. Do not equate +successful hotspot creation with working Steam Link. Sources: +[Valve Remote Play support](https://help.steampowered.com/en/faqs/view/0689-74B8-92AC-10F2), +[network requirements](https://help.steampowered.com/en/faqs/view/3E3D-BE6B-787D-A5D2), +and [Valve's Android client listing](https://play.google.com/store/apps/details?id=com.valvesoftware.steamlink). + ## Linux integration The guest uses Android's kernel networking rather than a separate network @@ -103,6 +154,17 @@ interfaces/addresses, game versions, and whether mobile data/VPNs were enabled: actual interface/address before testing guest traffic. Repeat with airplane mode/no SIM, cable unplug/replug, and USB Ethernet adapters. Check charging direction, thermal load, and sustained play. +7. For shared-screen co-op, test Steam Link installed/missing, store/browser + fallback, returning after installation, pairing PIN approval, manual host-IP + entry, and return-to-host behavior. In a local co-op game, press different + buttons/sticks on host and client simultaneously and confirm two independent + players. Repeat using the Steam Link touch controller; check controller order, + video, audio, reconnect, and behavior when the client exits. +8. Repeat shared-screen play over the local-only hotspot with no mobile data or + external Wi-Fi, first with an already-paired client and then first-time pairing. + Record authentication/pairing failures separately from discovery, video, audio, + input, and LAN routing failures. Measure stream latency, frame drops, and host + thermal load during sustained play before choosing performance defaults. Keep this experimental until those results exist; successful builds are not evidence of working multiplayer.