Hacking [Rel] Improved (hopefully) NTR streamer for N3DS (XL/LL)

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
This is a side question.

I would love to try to combine the NTRviewer and input redirection into one Python code. For the Input Redirection part, I think I have some success.

Do you think analyzing the UDP packet from your NTR-HR and generating a frame of picture in Python is an easy job? I'm new to streaming coding work and still doing research.

BTW, I am still using your 20240106-2 version. For now, this is the most stable version for my purpose (both on N3DS and N2DS).
 

zbash92

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2022
Messages
46
Trophies
0
Age
32
Location
NB
XP
224
Country
Canada
The networking part should be fairly straightforward: each udp packet (1448 bytes in size except for the last one in a frame) has a four-byte header. Parse those headers and check for dropped packets (by looking at seq id). Concat the actual data part of packets together and decode the jpeg image.

Then there may be python library to handle displaying the decoded image, with maybe bilinear upscaling.

Talking to NTR to start remote play is in TCP and should be quite straightforward as well.

Not sure about input redirection but I'd imagine it's not complicated either.
 
  • Like
Reactions: u93132

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
The networking part should be fairly straightforward: each udp packet (1448 bytes in size except for the last one in a frame) has a four-byte header. Parse those headers and check for dropped packets (by looking at seq id). Concat the actual data part of packets together and decode the jpeg image.

Then there may be python library to handle displaying the decoded image, with maybe bilinear upscaling.

Talking to NTR to start remote play is in TCP and should be quite straightforward as well.

Not sure about input redirection but I'd imagine it's not complicated either.
Oh I see. The 3DS side is sending a frame of jpeg with several blocks of 1448-4 bytes?
 

zbash92

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2022
Messages
46
Trophies
0
Age
32
Location
NB
XP
224
Country
Canada
Oh I see. The 3DS side is sending a frame of jpeg with several blocks of 1448-4 bytes?

Pretty much yes. The relevant code from NTR can be found here

First byte in the header is frame id (increasing sequentially and wrap around at 255, counted separately for top and bottom screen)
Second byte is 1 if it's top screen, 0 if it's bottom.
Third byte is always 2 (presumably used to denote format)
Fourth byte is seq id in frame, starting from 0 for each frame and increase by 1 for each packet.

Should be much simpler than input redirection haha.
 
  • Like
Reactions: u93132

nkTemp

Member
Newcomer
Joined
Jan 19, 2024
Messages
6
Trophies
0
Age
124
XP
13
Country
United States
Hey yall. Thanks for all the help from before but I'm running into a new problem using Snickerstream's HR remote play feature. It seems to work just fine on 3ds games but now when I use Virtual Console games my FPS goes straigh to zero and I know its not an internet usage thing. Could someone please help me out with this? Or is there a reason it does this in my settings?
 

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
Hey yall. Thanks for all the help from before but I'm running into a new problem using Snickerstream's HR remote play feature. It seems to work just fine on 3ds games but now when I use Virtual Console games my FPS goes straigh to zero and I know its not an internet usage thing. Could someone please help me out with this? Or is there a reason it does this in my settings?
I somehow believe the streaming only supports 3ds games.
 

flanter21

Active Member
Newcomer
Joined
Aug 21, 2017
Messages
34
Trophies
0
XP
540
Country
United Kingdom
Hey yall. Thanks for all the help from before but I'm running into a new problem using Snickerstream's HR remote play feature. It seems to work just fine on 3ds games but now when I use Virtual Console games my FPS goes straigh to zero and I know its not an internet usage thing. Could someone please help me out with this? Or is there a reason it does this in my settings?
i think vc games should work except gba (use mgba instead). however i don’t own any myself so i can’t test. if not emulators seem to work fine.
 

zbash92

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2022
Messages
46
Trophies
0
Age
32
Location
NB
XP
224
Country
Canada
@nkTemp

What @Flanter said, VC games except for GBA games should work. However it's possible that emulation of old games is outputted in a format that NTR currently doesn't support (RGB5A1 or RGB4). I'll have to update it to make it work if that's the case.
Post automatically merged:

@nkTemp

Give v0.1.1 a try https://github.com/xzn/ntr-hr/releases/tag/v0.1.1

If it doesn't work (assuming you are not trying to stream GBA VC games) let me know and I'll try getting RGB4 to work as well.
 
Last edited by zbash92,
  • Like
Reactions: u93132

nkTemp

Member
Newcomer
Joined
Jan 19, 2024
Messages
6
Trophies
0
Age
124
XP
13
Country
United States
Whaaaat they work again now! Thank you zbash! Youre a genius!
AND they dont have that nasty ass yellow tint anymore! AMAZING
 

zbash92

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2022
Messages
46
Trophies
0
Age
32
Location
NB
XP
224
Country
Canada
Whaaaat they work again now! Thank you zbash! Youre a genius!
AND they dont have that nasty ass yellow tint anymore! AMAZING
Btw if you experience audio crackling, go into NTR menu then the remote play menu, you can increase Encoder Priority to max nice value (which is 63). I'm not sure how intensive the emulated games are so this may help.
 

nkTemp

Member
Newcomer
Joined
Jan 19, 2024
Messages
6
Trophies
0
Age
124
XP
13
Country
United States
Btw if you experience audio crackling, go into NTR menu then the remote play menu, you can increase Encoder Priority to max nice value (which is 63). I'm not sure how intensive the emulated games are so this may help.
Havent so yet, but I appreciate the tip! I dont even care about the music at this point. This has been the easiest time I've had setting up snickerstream so far. I'm so happy and even more so if its this easy every time.
 

flanter21

Active Member
Newcomer
Joined
Aug 21, 2017
Messages
34
Trophies
0
XP
540
Country
United Kingdom
@zbash I've been trying for a while but i can't seem to replicate the bottom screen issues in chokistream anymore. Also thinking more about it, i realised it might just be chokistream itself like the fps issue since I have never been able to replicate it in any other streamer. I was wondering though, is it possible to wirelessly stream audio too because normally I like to plug my laptop into the tv and play with the 3ds in my hand, away from the tv and it just feels odd looking at the screen but having the sound coming from the 3ds. I bought a 3.5mm to bluetooth adapter for the audio so it hopefully isn't going to be an issue for me.
 

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
Pretty much yes. The relevant code from NTR can be found here

First byte in the header is frame id (increasing sequentially and wrap around at 255, counted separately for top and bottom screen)
Second byte is 1 if it's top screen, 0 if it's bottom.
Third byte is always 2 (presumably used to denote format)
Fourth byte is seq id in frame, starting from 0 for each frame and increase by 1 for each packet.

Should be much simpler than input redirection haha.
I made a small python-based program for shiny hunting in USUM


How it handles error:


Found a shiny pokemon:

Post automatically merged:

The networking part should be fairly straightforward: each udp packet (1448 bytes in size except for the last one in a frame) has a four-byte header. Parse those headers and check for dropped packets (by looking at seq id). Concat the actual data part of packets together and decode the jpeg image.

Then there may be python library to handle displaying the decoded image, with maybe bilinear upscaling.

Talking to NTR to start remote play is in TCP and should be quite straightforward as well.

Not sure about input redirection but I'd imagine it's not complicated either.
Thanks for ya help, lol. My dream finally came true.
 
  • Like
Reactions: zbash92

zbash92

Well-Known Member
OP
Newcomer
Joined
Mar 2, 2022
Messages
46
Trophies
0
Age
32
Location
NB
XP
224
Country
Canada
@u93132 Don't mean to bother you but why is it crashing in the second video though? Which build are you using? (Not that I know how to look into it, that PC register is at the end of the world..)

Edit:

Oh yeah you may have figured this out already, The second byte in header for each packet is also or'ed with 0x10 if it's the last packet in a frame. So you'd know it's the last packet even if it's 1448 in size.
 

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
@u93132 Don't mean to bother you but why is it crashing in the second video though? Which build are you using? (Not that I know how to look into it, that PC register is at the end of the world..)

Edit:

Oh yeah you may have figured this out already, The second byte in header for each packet is also or'ed with 0x10 if it's the last packet in a frame. So you'd know it's the last packet even if it's 1448 in size.
Both 20240106-2 (in the video) and the latest version you posted here (0.2.1, crashed once today and I will keep testing) sometimes still randomly crash when soft reset.

I also noticed that when soft reset, your latest version of NTR-HR sometimes will stop sending packets related to the lower screen and never come back again unless I restart the 3DS (I remember this issue already exists in ver. 2024012x). Never had this issue in earlier versions (not in 20240106-2).
Post automatically merged:

@u93132 Don't mean to bother you but why is it crashing in the second video though? Which build are you using? (Not that I know how to look into it, that PC register is at the end of the world..)

Edit:

Oh yeah you may have figured this out already, The second byte in header for each packet is also or'ed with 0x10 if it's the last packet in a frame. So you'd know it's the last packet even if it's 1448 in size.
Now, I think the lower screen issue is solved in 0.6.1. I will keep testing. Next time, I will send an issue on Github if I find something weird.

Edit: Sorry... Seems not fixed yet.
 
Last edited by u93132,

flanter21

Active Member
Newcomer
Joined
Aug 21, 2017
Messages
34
Trophies
0
XP
540
Country
United Kingdom
I made a small python-based program for shiny hunting in USUM


How it handles error:


Found a shiny pokemon:

Post automatically merged:


Thanks for ya help, lol. My dream finally came true.

Do you reckon you could share the program?
 

u93132

Member
Newcomer
Joined
Jan 2, 2024
Messages
17
Trophies
0
Age
31
XP
68
Country
Taiwan
Do you reckon you could share the program?
I plan to but as you see there are two Pokemon options blacked out for now, which means it is not completed yet. I have to finish another run on Ultra Sun so that I can test Poipole/Type: Null.

You play USUM also?
 

flanter21

Active Member
Newcomer
Joined
Aug 21, 2017
Messages
34
Trophies
0
XP
540
Country
United Kingdom
I plan to but as you see there are two Pokemon options blacked out for now, which means it is not completed yet. I have to finish another run on Ultra Sun so that I can test Poipole/Type: Null.

You play USUM also?
Ah no. The cutscenes ruin gen 7 for me unfortunately. I wish there was a code to skip them. It’s moreso I want to see how you achieved it, maybe look into seeing if I can bring it to gen 6 if i’m ambitious.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Lol rappers still promoting crypto