Skip to content

LiveStream SFU Relay Service Release Candidate#1

Merged
TechnicallyComputers merged 76 commits intomainfrom
TechnicallyComputers/dev
Mar 20, 2026
Merged

LiveStream SFU Relay Service Release Candidate#1
TechnicallyComputers merged 76 commits intomainfrom
TechnicallyComputers/dev

Conversation

@TechnicallyComputers
Copy link
Owner

@TechnicallyComputers TechnicallyComputers commented Mar 20, 2026

LiveStream SFU Relay Service Release Candidate


Note

Medium Risk
Touches netplay streaming/capture paths and introduces continuous canvas compositing, which could impact SFU video quality/performance and host capture behavior. Most changes are additive with fallbacks, but regressions would affect live streaming reliability.

Overview
Adds an Arcade Lobby stream compositor that renders multiple SFU producer video streams into a single hidden canvas grid (80/20 pinned vs previews) for remote viewing.

Updates NetplayEngine/NetplayMenu to initialize/register/unregister/pin streams via the compositor, and to prefer capturing the compositor canvas in netplayCaptureCanvasVideo() with fallback to the emulator canvas.

Includes workflow/build housekeeping (cleanup node_modules, copy to nightly, slower/cleaner archive progress logging) and adds extensive implementation/docs (ARCADE_LOBBY_COMPOSITOR.md, build integration notes, diagnostics).

Written by Cursor Bugbot for commit 393437f. This will update automatically on new commits. Configure here.

TechnicallyComputers and others added 30 commits January 18, 2026 03:49
SocketIO connections to the SFU are slowly being implemented and working.  Still no full service stack yet, but almost have transports for video/audio working.
Improvements to RoomManager.py mostly, still updating the logic for expected behaviours.  Rooms now get some existing data about users from the information available when they are joined, but still not updating when for existing room members when a new user joins, and metadata is not yet correct.
Player table now updates with new players joining and disconnecting.
from here we need to introduce persistent and authentic netplayIDs, and enforce that across the SFU to replace userID and ingame playernames.
Netplay code has been I think now fully compartmentalized, and segmented in large part, one of my major goals.
Now basically all netplay related functions are compartmentalized and categorized in new .js scripts and the hooks and calls are all working with the use of binds and etc between the loader, minify, and emulator.js main file, and the engine and menu components are talking to eachother, so functionally all netplay logic and netplay menu logic is now isolate, and the project should be able to merge upstream updates to emulator.js with fewer conflicts

Still need to fix netplay code after refactor and redesign.  Features are broken, code is isolated and functions have proper calls, some logic was optimized.
Improving functionality, readability, stability of NetplayUI and some functions from the engine like leaveroom related ones.  Major stability update to the new refactored and compartmentalized UI
Still working on audio and inputs but getting closer.  Still need UI overhauls to manage room states better but need core channel functions up.
Working on fixing input sync and audio transports.  Making some progress.
Receiving relay and p2p inputs, still working on unpacking and processing them
Inputs successfully translated into the emulator, now refactoring input management logic into InputSync and SimpleController
SimpleController is used for controller generation specific handling, there will be more data and different handling for newer generation controllers, and isolating the logic for handling them through separate workflows.
Optimizing UI, slot selector, and moving to using the router metadata on the SFU server as a central authority for slot selection and slot changes.
Slot Selector massive improvements, migration to using SFU as source of metadata
Nearly fixed netplay lobby/listing menu flow.
reviewing and optimizing transport handling next
And tweaks to Transports as I closer inspect transports and consuming/producing to optimize video/aduio streams for playback and for sync-based netcode.
significant netplay updates, basic video streaming, audio streaming, improved room and slot management, spectator support, video/audio/inputs work as expected mostly now in live stream.  Still working on enabling and configuring all netplay options (unordered p2p inputs not working yet)
WebRTC P2P data channel negotiations, optimizations in progress.  Some progress is made in handshakes but still not fully connected or well integrated.
Initial fix.  Still not behaving as clean as expected, but we have working P2P controller inputs from client to host.
now host doesn't prematurely terminate P2P sessions that are successfully started, unordered p2p inputs are now working fully, and not dependent on host configuration.
Don't need TURN for P2P, since relayed inputs can go through SFU instead where connection is known to work and other infrastructure is already maintained.
Bot executes basic layout, going to do some prep work and optimization of initial experiences, then move forward.
First working implementation of a hybrid SFU/TURN architecture using a TURN server to resolve P2P for controller input, and an SFU server (mediasoup installed via npm/pip)  which is now used to run video/audio.  The intention of this project is to fully replace ICE server and TURN resolution for for streaming audio video, with better performing SFU server, to optimize performance over private networks.  This project is not intended to be exposed to the internet, and is designed with consideration that it will be run behind a LAN and VPN/Wireguard network only, with no public access.
Improvements to RoomManager.py mostly, still updating the logic for expected behaviours.  Rooms now get some existing data about users from the information available when they are joined, but still not updating when for existing room members when a new user joins, and metadata is not yet correct.
Player table now updates with new players joining and disconnecting.
from here we need to introduce persistent and authentic netplayIDs, and enforce that across the SFU to replace userID and ingame playernames.
Netplay code has been I think now fully compartmentalized, and segmented in large part, one of my major goals.
Now basically all netplay related functions are compartmentalized and categorized in new .js scripts and the hooks and calls are all working with the use of binds and etc between the loader, minify, and emulator.js main file, and the engine and menu components are talking to eachother, so functionally all netplay logic and netplay menu logic is now isolate, and the project should be able to merge upstream updates to emulator.js with fewer conflicts

Still need to fix netplay code after refactor and redesign.  Features are broken, code is isolated and functions have proper calls, some logic was optimized.
Improving functionality, readability, stability of NetplayUI and some functions from the engine like leaveroom related ones.  Major stability update to the new refactored and compartmentalized UI
Still working on audio and inputs but getting closer.  Still need UI overhauls to manage room states better but need core channel functions up.
Working on fixing input sync and audio transports.  Making some progress.
Receiving relay and p2p inputs, still working on unpacking and processing them
Inputs successfully translated into the emulator, now refactoring input management logic into InputSync and SimpleController
SimpleController is used for controller generation specific handling, there will be more data and different handling for newer generation controllers, and isolating the logic for handling them through separate workflows.
Optimizing UI, slot selector, and moving to using the router metadata on the SFU server as a central authority for slot selection and slot changes.
Slot Selector massive improvements, migration to using SFU as source of metadata
Nearly fixed netplay lobby/listing menu flow.
reviewing and optimizing transport handling next
And tweaks to Transports as I closer inspect transports and consuming/producing to optimize video/aduio streams for playback and for sync-based netcode.
significant netplay updates, basic video streaming, audio streaming, improved room and slot management, spectator support, video/audio/inputs work as expected mostly now in live stream.  Still working on enabling and configuring all netplay options (unordered p2p inputs not working yet)
WebRTC P2P data channel negotiations, optimizations in progress.  Some progress is made in handshakes but still not fully connected or well integrated.
Initial fix.  Still not behaving as clean as expected, but we have working P2P controller inputs from client to host.
now host doesn't prematurely terminate P2P sessions that are successfully started, unordered p2p inputs are now working fully, and not dependent on host configuration.
Don't need TURN for P2P, since relayed inputs can go through SFU instead where connection is known to work and other infrastructure is already maintained.
Bot executes basic layout, going to do some prep work and optimization of initial experiences, then move forward.
…uters/EmulatorJS-SFU into TechnicallyComputers/dev
updating new documentation mostly to get all projects up to date and in sync before new work begins.
Significant optimizations for livestream video latency for mobile and remote clients.  Removing other lobby type options at this time and only supporting livestream.  P2P is optional and not supported for input, only relay is an official supported, because P2P input connections depend on user ICE configurations and network setup with clients networks.

Updates to session management for reconnects and network transitions for mobile users, not ideal, but there is aggressive session reconnect logic that works well when the user is switching networks.  Initial network switch refreshes transports, and for some reason session clean up removes the transports 30 seconds later anyways, but it also prompts and instantaneous refresh and it seems to work pretty smoothly good enough for mobile users switching networks.
@TechnicallyComputers TechnicallyComputers merged commit f4e03f0 into main Mar 20, 2026
1 check passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

- name: Copy to nightly folder
run: |
cd /mnt/HDD/public/
rsync -auv --exclude .EmulatorJS/data/cores/ .EmulatorJS/ nightly/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rsync exclude pattern won't match, cores copied unintentionally

Medium Severity

The --exclude .EmulatorJS/data/cores/ pattern in the rsync command will never match anything. Because the source is .EmulatorJS/ (with trailing slash), rsync treats file paths as relative to inside that directory (e.g., data/cores/...). The exclude pattern .EmulatorJS/data/cores/ includes the source directory name, which doesn't appear in the internal transfer paths. The pattern needs to be data/cores/ instead.

Fix in Cursor Fix in Web


---

**Implementation completed successfully with zero errors and comprehensive documentation.**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Development scaffolding files committed in release candidate

Medium Severity

Several development-only files are included in this release candidate: an AI prompt template (.github/prompts/), internal task checklists (COMPLETION_CHECKLIST.md, IMPLEMENTATION_COMPLETE.md), and a .js usage-example file (ARCADE_LOBBY_USAGE.js) at the repo root. The .js file and .md files at root are not in .npmignore, so they'll ship in npm packages and build archives. The ARCADE_LOBBY_USAGE.js file contains non-executable top-level code that would error if loaded.

Additional Locations (2)
Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants