Git Product home page Git Product logo

moonlight-switch's Introduction

Moonlight-Switch

Moonlight-Switch is a port of Moonlight Game Streaming Project for Nintendo Switch.

Screenshots

Preview

How to reach higher bitrate

To be able to use high bitrate setting especially with 1080p - resolution, you need to overclock CPU/GPU of your console.

To learn more about that you can take a look at Sys-Clk homebrew or entire Atmosphere build - 4IFIR which includes everything you need to overclock your console

I DO NOT RESPOSIBLE FOR ANY DAMAGE TO YOUR CONSOLE IF ANYTHING WILL GO WRONG! I am using 4IFIR by myself and not find any issue, but everything possible. So think by you own head and be responsible for what you do with your devices!

Installing

  1. Download latest Moonlight-Switch release.
  2. Put Moonlight.nro to sdcard:/switch/Moonlight-Switch;
  3. Launch hbmenu over Title Redirection (for FULL RAM access);
  4. Launch moonlight.

Or download it from HB App Store

Discord

Feel free to join Moonlight discord server, you will find me there in "switch-help" channel

Controls

Mouse

With touch screen you can move your coursor, tap to left click, scroll 2 fingers to scroll.

While touching screen ZR and ZL buttons will work like left and right mouse buttons.

Also while touching screen L and R sticks will work like scrolling wheel.

USB mouse working as well.

Keyboard

You can use onscreen keyboard, tap 3 fingers on screen to show it.

USB keyboard working as well.

Gamepad

By default, Switch gamepad configured as X360 gamepad (A/B and X/Y swapped). Key mapping available in application settings.

Up to 5 gamepads (includes handheld mode) supported. Half of joycons are also supported.

SixAxis

You should configure your Sunshine server to recognise controller as DS4 one to be able to use Gyro and Accelerometer. Only works for player 1 controller.

Ingame overlay

To open overlay, press - and + key simultaneously by default or Hold ESC on keyboard.

Key combination and holding time are configurable in settings.

NSP forwarder

App supports NSP forwarders to start stream immediately with predefined configuration. Add app you want to launch in Favorites list first.

You'll need to add thees arguments to the forwarder:

  • --host - Mac address of your PC (you could find it in /switch/Moonlight-Switch/settings.json)
  • --appid - ID of the app to launch
  • --appname - The name of the app without any spacings

example: --host=a2:34:de:ad:12:3b --appid=1233211234 --appname=Steam

Localization

  • English (100%)
  • Russian (100%)
  • German (86%)
  • Spanish (72%)
  • Japanese (70%)
  • Chinese (simplified) (86%)
  • Czech (70%) - unsupported yet, as HOS has no such system language

Contribution

If you'd like to improve existing language, or add a new one, follow the instruction:

  1. Ask a permission to modify language here
  2. Notify me by creating an issue with title "[Localization] - {Name of language}", in description write your nickname on POEditor
  3. After translation is done, notify me in issue created earlier

You have 2 options to add that translation:

  1. If you'd like your profile in "contributors" section, you could add that localization by creating a PR
  2. If you don't care, I could do that by myself

If you'd like to test your translation, you could follow build instructions, or ask me to create a build with your localization, I'll attach that build in issue.

ATTENTION! Currently there is no way to select language inside of app, it takes from system settings, so it is impossible to add locatization, that HOS doesn't support (that happend with Czech language).

Build Moonlight-Switch

cd 'folder/to/store/the/sources'

# Clone this repo with submodules
git clone https://github.com/XITRIX/Moonlight-Switch.git --recursive
cd Moonlight-Switch

Switch

To build for Switch, a standard development environment must first be set up. In order to do so, refer to the Getting Started guide.

cmake -B build/switch -DPLATFORM_SWITCH=ON
make -C build/switch Moonlight.nro -j$(nproc)

PC (Windows/Linux/MacOS)

To build for PC, the following components are required:

  • cmake/make build system
  • A C++ compiler supporting the C++17 standard

Please refer to the usual sources of information for your particular operating system. Usually the commands needed to build this project will look like this:

cmake -B build/pc -DPLATFORM_DESKTOP=ON -DCMAKE_BUILD_TYPE=Release
make -C build/pc -j$(nproc)

Also, please note that the resources folder must be available in the working directory, otherwise the program will fail to find the shaders.

iOS:

# build libromfs generator
./build_libromfs_generator.sh

# prepare vcpkg
./extern/vcpkg/bootstrap-vcpkg.sh

# install packages
./extern/vcpkg/vcpkg install --triplet arm64-ios mbedtls
./extern/vcpkg/vcpkg install --triplet arm64-ios jansson
./extern/vcpkg/vcpkg install --triplet arm64-ios ffmpeg
./extern/vcpkg/vcpkg install --triplet arm64-ios "curl[mbedtls]"
./extern/vcpkg/vcpkg install --triplet arm64-ios libpng
./extern/vcpkg/vcpkg install --triplet arm64-ios opus

1. Build for arm64 iphoneOS

# 1. Generate a Xcode project
# IOS_CODE_SIGN_IDENTITY: code is not signed when IOS_CODE_SIGN_IDENTITY is empty
# IOS_GUI_IDENTIFIER: optional, default is com.borealis.demo
cmake -B build/ios -G Xcode -DPLATFORM_IOS=ON

# 2. open project in Xcode
open build/ios/*.xcodeproj

# 3. Set up Team and Bundle Identifiers in Xcode, then connect devices to run.

Credits

Thanks a lot to Rock88 and his Moonlight-NX, lots of streaming code has been lend from it 👍.

Xfangfang for maintaining Borealis library. iOS port would not be possible without it.

Also thanks to Averne for NVDEC implementation into FFmpeg and useful guidance of how to enable it

moonlight-switch's People

Contributors

ddinghoya avatar takumi-trbl avatar xitrix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moonlight-switch's Issues

Box arts not loaded

Hi! Since release v0.10 personalized box arts (downloaded on steamgriddb.com) do not show properly. I do not know why but it may be due to the size of the image files. Cheers!

Crashes when populating game list

After the first connection to my PC Moonlight crashes when populating my list of games. This usually happens as soon it gets to the third row of games. On the latest Atmosphere and FW.

[Bug] Overlay combo can only be set in portable mode

When trying to configure the in-game overlay button combo with the Switch docked to the TV, there is no way to exit the dialog box or confirm the combination. Pressing a button just adds it to the combination. The only way to exit is to pick up the Switch and use the touch screen to close it.

Suggestions:

  • add an exclusive shortcut to close this box
  • warn the user that opening the dialog box should only be done in portable mode

Bad network connection

Not sure what I'm doing wrong here, trying to play with:

  • a laptop connected with gigabit ethernet to a LAN and
  • the switch with 5GHz Wi-Fi about 5m away from the router

and it says I've got bad connection and lags too much. Using an Android phone with the moonlight app from Android doesn't complain and there's virtually zero lag.

Any ideas?

Crashing on fw13.0 and ams1.10

Moonlight is crashing back to the switch homescreen on connection to my system. It briefly connects and starts to load my games and their icons then crashes.

Same happens on the 0.8 and the 0.7 bugfix release

[enhancement] Improved mouse input mode + gyro mouse

For people who use Moonlight for their desktop, the experience is less than ideal.

The mouse input mode is the only one where the mouse cursor moves slowly enough to hit targets. The mouse input mode needs to be enabled from the side menu on session start, and puts a big button guide on top of the stream while you're using it. The mode can also be enhanced with more precise pointer/gyro controls.

Suggestions:

  • make the button guide appear in the side menu or separate options page, instead of overlaid on the stream
  • allow mouse input mode to be set as the default mode for the entire application or for specific apps
  • add option to enable gyro mouse controls (as the default mode for the entire application or for specific apps)

Add it to the homebrew appstore

Hey! Love your app!
Please add it to the app store, so it's easier to update it.
Also, I have an idea, idk where to submit it.
Would it be possible to implement touchscreen? Is it possible to create an additional server application that'll be running on a PC and that will be communicating with a running alongside functionality in the app, and this way it'll be possible to process the touch?
And also motion control support.
This way, it'll be possible to throw cemu's Wii u gamepad image on switch by moonlighting a virtual/additional monitor to switch and kinda making a Wii u setup like that.

Controller doesn't work as gamepad: Button Press Blocked

Configuration:

I'm on Atmosphere 1.1.1 HOS 13.0, using latest version of Moonlight-Switch (v0.10) with switch docked.

Problem

I can successfully connect to host machine, but no input is registered unless I switch to mouse mode. I turned on the Debug view and it gives me the following logs when I press buttons on the controller (and not in mouse mode):

0 button press blocked (tokens=1)
1 button press blocked (tokens=1)
19 button press blocked (tokens=1)

The number at the beginning of each line changes depending on the button/input.

info when runing Game: Mode 1280*720*30 not supported

PC server is OpenStream
I enter the IP , I can see the PC, and I choice OpenStream, normally at all ,choice Game(Desktop) at Open Stream ,then the moonlight client displays me the following message : "Mode 128072030 not supported"
I tryied change resolution at PC or switch , it shows the same meesage:" 1920108060" not supported

Switch info: 13.2.0|AMS 1.2.5
Moonlight info: v0.11

Thank you for Moonlight on switch

Screen problem with resolutions under 1080p in desktop

Hello! First of all, awesome work with this fork, works like a charm and the ui it's awesome!
I've been playing for a couple of months streaming games to my switch at 720p with no problem, but the underlying desktop resolution was 1080p. Today I've tried to change the desktop resolution to 720p as it had no point to be greater, and encountered this strange issue, as you can see in the picture of the next link:
https://imgur.com/a/bjhL24e
I would say it's like the app thinks the switch display is 1080p and when it tries to output 720p fails to do it at fullscreen. Also the mouse won't go further than the cropped desktop, as if that was the full screen size.
If I can provide anything to help you further ask for it! Thank you!

Can not run app

I am using moonlight-nx and decide give this app a try. I clear all moonlight folder, install nro into new moonlight folder. I can add host, but when start streaming I got error: app enter error and quit
Os: 12.1.0
Atmosphere: 0.9.5
I guess you need to recompile nro for newest os version to work.

[Enhancement] keyboard arrow keys

It would be nice to be able to input the keyboard arrow keys.

Scenario:
When loading some games (example genshin impact), they popup the "Do you want to allow this app to make changes to your device?". The mouse cursor disappears (this happens for all moonlight ports) and so a keyboard arrow keys input allows the user to easily select "Yes"

Gamepad control

gamepad control stop working after few minutes and only can control with touchscreen.

Key bindigs

Please add the possibility of in-game change Key bindigs like Xbox.

I have changed bindings in Switch like a=b and y=x, but when I run games through Moonlight only Nintendo's standard option is available

2 controllers issue

I can't use TWO controllers (a pair of loycons + Pro compatible controller.
In the PC devices panel i see onle ONE "Virtual USB Device".
BOTH controlles works fine with Moonlight as SINGLE (or 1st controller in system).
Both controllers works file at the SAME time in SkyNX, but not with Moonlight.

Minor Issue "DRM protected contect" no message pop-up

When I try to run a game and there is DRM protected content on my PC, the client crashes without any message, and the launcher shows the game is running (and looking at my PC that is the case).

If I do the same thing, on say, my Nvidia Shield, I get a warning pop-up saying "unable to stream due to DRM portected content"

It's not really a biggie, but would be nice to get that alert, rather than just being dumped back to the launcher.

[Feature Request] Emulate Switch Pro Controller or Dualshock 4 for Gyro

Thank you for your brilliant work so far!
Would it be possible to let the Switch show up as an Switch Pro Controller or Dualshock 4 with Gyro/Motion Support on Windows?
Or maybe another Way to send Gyro Data?
It would be Awesome to use that feature for Gyro Aiming etc.
I think SkyNX and Chiaki for Switch have Gyro Features.
Cheers!

Mouse buttons are not working in 0.5

Not sure what I'm doing wrong but I can't click anything with either the touchscreen taps or the Z-buttons (L or R). I also notice when I'm remoted in to my host desktop from my laptop via chrome remote desktop that when I am moving the mouse cursor with the touchpad on the switch that the mouse cursor isn't being moved on the actual desktop. I can see icons being highlighted when I am moving the mouse via touchpad but cannot left or right mouse click.

[Bug] Freezing on playing with 1080p

Hi,

I am using moonlight since ages and just got that nice hackable switch console. While my other devices (android, macos, android tv clients) are working fine, the switch version crashes once I try to connect to my gamestream server.

I can see the server and do enter the required pin, then the moonlight client displays me the following message : "problem with the local ssl certificate". then the app crashes. (the app only). and I'm sent back to the home screen.

Next time I will try to connect my GS server, it actually crashes atmosphere completely, with error code : 2168-0002 (0x4a8) Program 010000000000100D

I'm running firmware 12.1.0 and atmosphere M 0.19.5
Moonlight version is the latest 0.6

only option I then do have is to press the volume + button to restart my switch.
any clue ?

Thanks !

[Localization] - German

Could help with german localization.
My POEditor name is lulle2007200, already opened a request to edit german translation.

low volume scale

I really appreciate to you about making this as a good UI,
but sound volume scale is too low although I turned volume up on my switch.
I wish rock88 would correct this problem, but no updated.
Please solve this problem. I think it might be problem about audio render.

[enhancement] keyboard combo hotkeys/buttons

I think a cool feature would be some buttons above the on-screen keyboard for common keyboard combos (alt + enter, shift + tab, etc.).

Hotkeys for keyboard combos would also be cool, like moonlight-nx, but I would really love on-screen buttons for them.

Error "timeout was reached"

My PC is connected to my network by ethernet, my switch by wifi.

When I enter the ipv4 on my PC Into moonlight and try to connect I get "error timeout was reached" message on screen.

App crashes after connecting to host or right after starting it

I have been using Moonlight-NX for a long while without any issues besides the unpolishedness of this particular app and the lack of continued development.
After discovering Moonlight-Switch I decided to "switch".
Initially I was running FW 12.1.0 and Atmosphere 0.19.5 and I encountered the following issue:
After installing Version 0.11 from the HB App Store and launching it via Title Redirection (for FULL RAM access) I had the issue that the App would crash as soon as I tried to connect to the Moonlight host (Windows10VM in my LAN). The crash happened with no particular error message besides the standard Message from the Switch "The software was closed because an error occurred." after the described crash in most cases the App would begin crashing directly after launch until I rebooted the Switch into Atmosphere again.
Btw. Moonlight streaming from above host works flawlessly with the MacOS and the Android client.
What did I try:

  1. I noticed that the crashes after trying to connect to the host often did not happen instantly but after 1-2 seconds. So I sometimes could see parts of the game library and how the cover thumbnails populated. After inspecting the boxart folder on the switch I noticed that there where some really big cover pictures (like 1-2MB). So I thought that might be the issue and I changed the cover pictures of every game in my library to a minuscule png (about 4KB) but that didn't help at all.
  2. I removed Moonlight-Switch and Moonlight-NX via the HB App Store and deleted all remaining moonlight directories within /switch. After that I created /switch/Moonlight-Switch and put the latest version in there myself -> same issue
  3. I updated my FW and Atmosphere to 13.2.1 and 1.2.6 -> same issue
  4. I tried every suggestion in #7 -> same issue

To be honest I am out of clues and I would appreciate any help. Thanks upfront.

Cemu through moonlight

Hey there,

I was wondering if it was possible to control cemu at all through Moonlight.

I've naturally tried it but it doesn't seem like any of the inputs register in cemu from the switch, any idea how to fix this or if I did anything wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.