Streaming and playing on the Nintendo Switch remotely!

Overview

Switch-Stream

This is a semi-convoluted application as a proof-of-concept that someone could play their Switch from a distance. A server is connected via capture card to the Switch's HDMI (video / audio) and returns it to a remote browser via WebRTC, resulting in a latency of 200-300ms. Gamepad inputs are read by the remote browser and sent to the server, which translates the inputs and takes advantage of a fork of the joycontrol Python package to send corresponding Switch Pro Controller inputs to a Nintendo Switch.

Video Demonstration

https://youtu.be/yyRQYroEMno

Hardware Requirements

  • A computer that can work as a Linux server
  • Decent bandwidth to send the stream through
  • Capture card to capture video and audio. I used an AVerMedia Live Gamer Mini.
  • Bluetooth compatibility. If you need a USB adapter, I highly recommend the ASUS BT-500 as it had the best response for me.

Software Requirements

  • Go 1.16 or later
  • Python3 to run controller_emulator.py
  • GStreamer w/ Plugins: This takes the video and audio from the capture card and we use WebRTC to stream it.
  • STUN and TURN server: These are used for negotiating a connection between the remote browser and the local machine streaming video and audio. If you want secure connections, you should use LetsEncrypt to acquire an SSL certificate for these servers. I recommend using coTURN, but you can use your own implementations if you prefer.
  • ALSA: provides audio and MIDI functionality to the Linux operating system.
  • V4L2: a collection of device drivers and an API for supporting realtime video capture on Linux systems.

Setup

Server

  1. Open a port in your router and your server for WebSocket connection, and assign that number in main.go
  2. Choose a port for the local TCP connection between the Go code and the Python code, and assign it in those files.
  3. Connect to the switch once. After that, you can use reconnect_bt_addr from the joycontrol package to instantly reconnect to the Switch.

Client

  1. Assign your TURN server's username and credential in login-and-control.js as well as the IP of the server hosting the Switch Streaming and WebSocket Port opened previously.
  2. Add the STUN and TURN servers you have in the STUN_SERVER and TURN_SERVER constants in the same file.

You may need to change some elements of the GStreamer pipelines in server/main.go based on your configuration.

Runtime

Server

  1. Turn on the Nintendo Switch, and go to home menu
  2. Run sudo python3 ./controller_emulator.py and wait for it to say "Listening for TCP
  3. Run go build && ./switch_stream_server. The Python code should note that the Go program has connected to it.
  4. The remote browser should now be able to connect to your server and send inputs to the Switch and receive audio / video from it!

You should be good to go after finishing these. When clicking connect, you should be able to connect an XInput or PS3/4 controller to your browser and it should start working!

You might also like...

A Gmail Clone which built with ReactJS and Redux. You can sign in with your Google Account, compose a new e-mail and send realtime emails to the project.

Gmail Clone with ReactJS A Gmail Clone that you can sign in with your Google Account, compose a new e-mail and send realtime emails to the project. Cl

Nov 14, 2022

Senior Design Project. Water intake tracker. Software for the communication to bottle and app. Software for app and database

WaterMate Senior Design Project. Water intake tracker to provide everyone with an easy to use water tracking system that can be integrated with your f

Nov 10, 2021

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Oct 11, 2022

Fast and advanced, document based and key-value based NoSQL database that able to work as it is installed.

Fast and advanced, document based and key-value based NoSQL database that able to work as it is installed.

About Fast and advanced, document based and key-value based NoSQL database that able to work as it is installed. Features NoSQL database Can be run as

Dec 7, 2022

Plant trees to harvest apples. Sell apples to buy upgrades. Sell apples and wares to make the most money and top the leaderboard!

Plant trees to harvest apples. Sell apples to buy upgrades. Sell apples and wares to make the most money and top the leaderboard!

Happy Harvesters Apple Orchard Game A browser based game that is also mobile friendly so you can finally say "How about THEM apples". Table of Content

May 21, 2022

XML/HTML parser and processing library for JavaScript and TypeScript

XML/HTML parser and processing library for JavaScript and TypeScript

[VIEW DOCUMENTATION] Robin is an XML parser and processing library that supports a sane version of HTML. It features a set of DOM utilities, including

Oct 5, 2022

Fast and advanced, document-based and key-value-based NoSQL database.

Fast and advanced, document-based and key-value-based NoSQL database.

Contents About Features Installation Links About Fast and advanced, document-based and key-value-based NoSQL database. Features NoSQL database Can be

Dec 7, 2022

Explore, create and deploy your SQLite databases right from your browser. Quick and easy, no installation required.

Explore, create and deploy your SQLite databases right from your browser. Quick and easy, no installation required.

SQLighter (under development, alpha code) SQLighter is a database explorer born for SQLite that helps you design and deploy your application database

Sep 20, 2022

⚡️ lowdb is a small local JSON database powered by Lodash (supports Node, Electron and the browser)

Lowdb Small JSON database for Node, Electron and the browser. Powered by Lodash. ⚡ db.get('posts') .push({ id: 1, title: 'lowdb is awesome'}) .wri

Dec 30, 2022
Releases(v2.1.0)
  • v2.1.0(Jul 6, 2022)

    The client side of the program didn't provide much feedback on how your controller inputs are translated into Switch inputs. I have added Joy-cons to the sides of the display that show what input you are pressing when press a button on the controller.

    https://user-images.githubusercontent.com/44577941/177650855-3ccbcc66-ed25-40f1-9a14-e3dc75c0c9db.mp4

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Apr 23, 2022)

    • Server files are entirely Go
    • Server-side optimizations for faster input transmission
    • Server can be long-running
    • Use Arduinos instead of Bluetooth for greater reliability and faster communication
    • Client no longer dependent on gamepad.js; now uses the GamePad Web API
    • Client-side optimizations for faster input transmission
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jun 11, 2021)

Owner
Charles Zawacki
I'm a Virginia Tech student majoring in Computer Science. I invest time on the side working on various projects with Android apps, Javascript bots, and more.
Charles Zawacki
An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪

Example Streaming App ?? ?? This repository serves as a point of reference when developing a streaming application with Memgraph and a message broker

Memgraph 40 Dec 20, 2022
HLS, DASH, and future HTTP streaming protocols library for video.js

videojs-http-streaming (VHS) Play HLS, DASH, and future HTTP streaming protocols with video.js, even where they're not natively supported. Included in

Video.js 2.2k Jan 5, 2023
A transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

JavaScript Database (JSDB) A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to

Small Technology Foundation 237 Nov 13, 2022
Like JSON-RPC, but supports streaming.

Earthstar Streaming RPC Similar to JSON-RPC, but also supports streaming (soon). Written to be used in Earthstar (github, docs). Table of Contents Usa

Earthstar Project 5 Feb 10, 2022
AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.

Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a

Andrey Gershun 6.1k Jan 9, 2023
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.

knex.js A SQL query builder that is flexible, portable, and fun to use! A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle

knex 16.9k Jan 4, 2023
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite datab

MikroORM 5.4k Dec 31, 2022
Azure Data Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Azure Data Studio is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Microsoft 7k Dec 31, 2022