Homebrew [Release] TinyVNC (VNC viewer for Nintendo 3DS)

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
319
Trophies
0
Location
under the bridge
XP
2,481
Country
Tokelau
upload_2020-10-12_16-42-18.png


This ist release 2.0 of TinyVNC, a VNC viewer for Nintendo 3DS. TinyVNC is made up of multiple components:
  • two VNC clients, one for top, one for bottom screen
  • a streaming audio client (mp3 over HTTP) to transfer sounds from the VNC server
  • A Cemuhook server and vJoy UDP feeder client to send controller information to the VNC server
All components can be configured to run standalone (even without a VNC connection or without a VNC server), so TinyVNC can be used as "just" a web radio player or "just" a controller for PC-Games, Cemu/Yuzu/etc. Personally, I use the Cemuhook-server a lot standalone. Using your 3DS as a controller makes playing games with Yuzu/Cemu/etc so much more fun.

Taking all components together, you can connect to any computer running a VNC server, see the screen contents, hear the system sounds and control it with your 3DS.

VNC clients
From Wikipedia: "VNC (Virtual Network Computing) is a graphical desktop-sharing system [...] to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical-screen updates back in the other direction, over a network". Contrary to RDP (which is Microsoft only), it is platform-independent and thus works with Windows, Linux, MacOS, Android and many more ...!

I tested TinyVNC with Windows and with multiple VNC servers. TightVNC (https://www.tightvnc.com/) server seems to work best. Even streaming videos or games works well (as can be seen in my controversial video playing "Breath of the Wild" on my 3DS).

As a rule of thumb: the larger the server display resolution, the worse the performance. This is because the server display is transferred to the 3DS in full and TinyVNC scales the image to fit the 400x240px 3DS screen. Server side scaling is supported if the server supports it (AFAIK only UltraVNC). TightVNC server gives the possibility to share only parts of the screen, which is a nice feature if you want to play games with TinyVNC.

From my experience, a server resolution of 800x480 is great for web browsing etc, but for video- or game streaming, the server should have a display resolution of 400x240px or even less.

During first start, TinyVNC will write its config files to the SD card. You can customize the file /3ds/TinyVNC/keymap to customize button mappings for the VNC-connection. Preconfigured button mappings are:
  • A: a-key
  • B: b-key
  • X: x-key
  • Y: y-key
  • L: Left mouse button
  • R: w-key
  • ZL, ZR: 1, 2-keys
  • C-Pad: Cursor up, down, left, right
  • D-Pad: t, g, f, h-keys
  • C-Stick: i, k, j, l-keys
  • SELECT: Shift-key
  • START: Open quick command menu
  • SELECT + START: Disconnect
The touch screen acts as a touchpad for mouse control (tap-to-click, double-tap-to-double-click, tap-and-drag)

Audio streaming
Audio streaming is supported (mp3 over HTTP) but requires an additional server software running on the VNC server machine. This can be easily setup using VLC media player (https://www.videolan.org/vlc/). Below is a short tutorial how to do that.
I. Set up an audio device that captures all your system sounds
  1. Go to Start Menu and search for "Control Panel", open the Control Panel
  2. Go to menu "Hardware and Sound" -> "Manage audio devices" and choose tab "Recording"
  3. Right-click in the list of recording devices and check "Show disabled devices"
  4. Check if you have a "Stereo Mix" device. If yes, right-click the device and click on "Enable". This recording device will now record all your sounds that your system plays and provide it to whatever program is interested.
  5. If you don't have a "Stereo Mix" device, you can install something similar using VB-Cable https://vb-audio.com/Cable/. After installing this software, you need to choose the playback device "CABLE Input" as your default.
II. Set up VLC to provide your system sounds in a stream
  1. Start VLC and choose "Media"->"Stream"
  2. Choose Tab "Capture Device", set "Capture Mode" to "DirectShow", set "Video Device Name" to "None" and set "Audio Device Name" to the audio capture device from Section I. Click on button "Stream"
  3. In the "Source"-Screen, click Next
  4. In "Destination Setup", select "HTTP" as New Destination and click "Add". In the next screen, port 8080 and path "/" are normally fine - this is what you need to specify in TinyVNC settings as well. Now click "Next"
  5. In "Transcoding Options", check "Activate Transcoding", choose Profile "Audio - MP3" and click on the little wrench to the right of the dropdown box
  6. In Tab "Encapsulation", choose "MP3". In Tab"Audio Codec", choose Codec "MP3" and a desired bitrate (96 should be ok, choose 64 or lower if you have isses with the bandwidth). Click on "Save", then "Next", then "Stream"
  7. Now VLC will stream all audio coming from the above audio capture device (which is ideally set up to capture all your system sounds) via HTTP-server on port 8080, path "/" as MP3 to clients who are interested in hearing. You can test this by directing your browser to http://<servername>:8080/, where <servername> should be the IP address of the computer you're running VLC on.
Last but not least, you need to configure the port and path (8080 and "/" if you followed the instructions above) in TinyVNC server settings.
Voilà, you're done and should hear your systems audio when conneting to the VNC server :D

Cemuhook-server
Controller information is already transferred to the server as keyboard or mouse events using the VNC connection (this can be disabled or enabled in the connection options tough). However, the VNC-connection has limitations: The analogue 3DS-joysticks are only transferred as digital values up, down, left and right. Additionally, no gyro and accelerometer info is sent via the VNC connection. This is why a Cemuhook-server is now included into TinyVNC, which can be enabled in the connection properties. To actually use this Cemuhook server for example in Cemu, you will have to add serverIP = 3DS.IP.ADDRESS.HERE (and serverPort = XXXXX if you've changed it from the default 26760 value) under the [Input] section of cemuhook.ini (inside your CEMU installation directory).
The mappings are as follows:
C-Pad: Left Stick
C-Stick: Right Stick
SELECT + START: HOME
SELECT + D-Pad Up: Plus (+)
SELECT + D-Pad Down: Minus (-)
SELECT + D-Pad Left: Left Stick Push
SELECT + D-Pad Right: Right Stick Push
all other buttons have the default mapping (A -> A etc.)

vJoy-UDP-feeder-client
The vJoy-UDP-feeder-client is an additional way to transfer controller information to the VNC server. It needs one or two vJoy-UDP-feeder (https://github.com/klach/vjoy-udp-feeder) running on the VNC server machine. All buttons and joysticks are transferred to one UDP feeder, motion data (gyro, accelerometer) is transferred to another UDP feeder.
The 3DS SELECT-button acts as a Shift-Key, so pressing SELECT + A on your 3DS sends a different button to vJoy than just pressing A.

Download here: https://github.com/badda71/TinyVNC/releases

Installation:
Install CIA with FBI or run 3dsx from homebrew launcher (put 3dsx file in /3ds/TinyVNC dir).

Current version is 2.0
v2.0
  • support of 2nd VNC connection on bottom screen
  • added vJoy-UDP-feeder clients: one for buttons and joysticks, another for motion controls
  • added Cemuhook server: sends motion controls, buttons and joysticks to clients (Cemu, Yuzu etc.)
  • added server (if supported) or client side scaling. Now, screens >1024px size are scaled automatically.
  • TinyVNC can now be run without VNC-connection (e.g. only cemuhook server or only mp3 stream client)
  • added quick command menu to control connection settings
  • added "shift"-key to enable button combinations
  • lots of minor optimizations and bugfixes
v1.0
  • CIA/3DS version
  • added streaming audio support (mp3 via HTTP)
  • added on-screen keyboard
  • configurable scaling (on/off)
  • key value to toggle bottom backlight (8)
v0.9
  • Initial version
Any bugs can be reported here or on https://github.com/badda71/TinyVNC/issues

Have fun!
 
Last edited by Badda,
D

Deleted User

Guest
it'd be nice if games worked better in 800x480, since the 3ds lacks antialiasing maybe running games in a hugher resolution in citra could work as a makeshift AA
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
319
Trophies
0
Location
under the bridge
XP
2,481
Country
Tokelau
it'd be nice if games worked better in 800x480, since the 3ds lacks antialiasing maybe running games in a hugher resolution in citra could work as a makeshift AA
You can run WiiU games in Cemu scaled down to 400x240px. Cemu handles the scaling, antialiasing and everything. This is what I did when playing BotW on my 3DS and it works like a charm :-)
 
Last edited by Badda,
D

Deleted User

Guest
You can run WiiU games in Cemu scaled down to 400x240px. CEMU handles the scaling, antialiasing and everything. This is what I did when playing BotW on my 3DS and it works like a charm :-)
does citra do the same? i just want to know how 3ds games could've looked like w/antialiasing, if not i can just go with my original plan: record gameplay and crush down the resolution, then import the video into the 3ds
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
319
Trophies
0
Location
under the bridge
XP
2,481
Country
Tokelau
does citra do the same? i just want to know how 3ds games could've looked like w/antialiasing, if not i can just go with my original plan: record gameplay and crush down the resolution, then import the video into the 3ds
Nope, citra just emulates a 3DS - nothing more and nothing less. If you increase the window size in Citra, the original 3DS image is just upscaled - if you downscale it agein, you get the original image (or even worse, depending on your scaling algorithm) :D
 
D

Deleted User

Guest
Nope, citra just emulates a 3DS - nothing more and nothing less. If you increase the window size in Citra, the original 3DS image is just upscaled - if you downscale it agein, you get the original image (or even worse, depending on your scaling algorithm) :D
i was talking about internal resolution, not screen resolution, i remember a lot of "pokemon in 4k" videos using citra. Crushing down a higher resolution picture into a lower one (SSAA) is not a very efficient form of Antialiasing performance-wise, though it certainly produces some of the best looking results
 

Zense

Well-Known Member
Member
Joined
Apr 20, 2008
Messages
1,977
Trophies
2
XP
4,380
Country
Italy
Personally I wouldn't stress too much about getting audio going since there's always the very viable bluetooth way of connecting to your pc or even using your phone to get audio from your device.

Of course getting audio on the 3ds would be great and a welcome convenience. I'm just saying this to give some alternatives at least for the moment and some advice.
 
  • Like
Reactions: Badda

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
319
Trophies
0
Location
under the bridge
XP
2,481
Country
Tokelau
I repeat: how? Where that menu?
View attachment 225844
You need to change the resolution of your server machine (not the server software) to something not larger than 1024px width and height. If you are using Windows 10:
  1. Click the Start button.
  2. Select the Settings icon.
  3. Select System.
  4. Click Advanced display settings.
  5. Click on the menu under Resolution.
  6. Select the option you want (on a real machine, the options are limited, lowest resolution is 800x600, thats why I recommend using a virtual machine)
  7. Click Apply.
EDIT: Another possibility is to share only parts of your screen. In TightVNC-server, this is configurable under Tab "Extra Ports". Make sure that the screen area you are sharing does not exceed 1024px width or height.
 
Last edited by Badda,

placebo_yue

Well-Known Member
Member
Joined
Aug 7, 2019
Messages
739
Trophies
0
Age
33
XP
1,265
Country
Argentina
is there an easy way to share not the whole screen but just an app window? i'd love to stream some non-emulated on 3DS games and somehow send the input back to the computer so it feels like playing Wii U on 3DS. Can i map 3DS controls to keyboard to play stuff too? sorry for asking dumb stuff
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
319
Trophies
0
Location
under the bridge
XP
2,481
Country
Tokelau
is there an easy way to share not the whole screen but just an app window? i'd love to stream some non-emulated on 3DS games and somehow send the input back to the computer so it feels like playing Wii U on 3DS.
This fully depends on your VNC server software. TightVNC server has options to share the whole screen or specific areas of it, not specific windows however. I don't know about other VNC servers - maybe you could do some research and share your results here :-)
Can i map 3DS controls to keyboard to play stuff too? sorry for asking dumb stuff
Yes, you need to edit file /3ds/TinyVNC/keymap on your SD card.
Hope that helps :D
 
  • Like
Reactions: placebo_yue

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Yes companies look at average costs of what people can afford to sale products
  • Veho @ Veho:
    And there's no competition?
  • HUNTERFOX @ HUNTERFOX:
    Competition in companies here are like crazy
  • K3Nv2 @ K3Nv2:
    Sure but competition does the same if anything at lower rates because they don't have the same resources
  • K3Nv2 @ K3Nv2:
    Usually like a 10-20% difference
  • Veho @ Veho:
    I was told the market would "self regulate".
  • K3Nv2 @ K3Nv2:
    I still feel as if prices would've gone up in America regardless of whose in office
  • Veho @ Veho:
    Of course they would, both your parties are spineless corporate stooges.
  • BigOnYa @ BigOnYa:
    What about companies that are nationwide. Do you think they charge in that states stores based on state economic situation. No they charge the same, but taxes per state make the price difference. (Exception maybe Alaska, Hawaii)
  • K3Nv2 @ K3Nv2:
    Once you minimize cost of living a $500 gaming console could feel like a $1,000 console to a average home
  • K3Nv2 @ K3Nv2:
    But even they look at data charts and mostly have contacts in other country wide offices that talk to each other to make a fair msrp
  • Veho @ Veho:
    BigOnYa, taxes are calculated at checkout in Murrika so it's easy to compare.
    +1
  • K3Nv2 @ K3Nv2:
    That's how China sales so cheap each baby out the womb is given a soldering iron and told good luck
    +1
  • BigOnYa @ BigOnYa:
    I have a family member that lives near the Ohio/Kentucky border in Cincinnati, Ohio, he goes across the border to Kentucky to buy most things because they're sales tax is lower in Kentucky.
  • BigOnYa @ BigOnYa:
    I went down there last summer and helped him run electric in a pole barn he built, and he saved over $300 buying electrical supplies at HomeDepot in Kentucky instead of in Ohio. Weird but true.
  • N @ NarutoClassicsYT:
    hello, is there any discord server
    ?
  • HUNTERFOX @ HUNTERFOX:
    Fnaf fans?
  • Xdqwerty @ Xdqwerty:
    @HUNTERFOX, why do you ask?
  • HUNTERFOX @ HUNTERFOX:
    I'm a fan
    HUNTERFOX @ HUNTERFOX: I'm a fan