NTRViewer icon indicating copy to clipboard operation
NTRViewer copied to clipboard

Debian Linux Black Screen

Open cdelorme opened this issue 7 years ago • 9 comments

Not sure what linux the instructions are for, but they fell short on debian stretch and the code failed to compile.

First, the missing turbojpeg.h comes from the libturbojpeg0-dev package. I had literally every other turbo package installed, and it did not work until I added that one.

Next, I encountered this error:

‘PIX_FMT_RGB24’ was not declared in this scope

Apparently the ffmpeg I use has the same updates as the apple version? Not sure if there is a better way to detect the function availability, but basically changing line 28 to include the AV_ prefix (eg. AV_PIX_FMT_RGB24) fixed my problem.

While I was able to compile, and it connects to NTR CFW 3.5, I get a black screen and:

$ ./ntrviewer -a 192.168.1.25
connected. 
sent ping packet.
sent ping packet.
sent ping packet.
init SDL...
SDL_Init done.
[21:15:46] screenSurface: 0x561c9530faa0, pixels: 0x561c95333e90
[21:15:46] set buff size: 425984
[21:15:47] recv failed or timeout.
[21:15:48] recv failed or timeout.
[21:15:49] recv failed or timeout.
[21:15:50] recv failed or timeout.
[21:15:51] recv failed or timeout.
[21:15:52] recv failed or timeout.
[21:15:53] recv failed or timeout.

While I hope this information helps others with debian linux compilation, I would love to know where to go from here in order to deal with the black screen.

cdelorme avatar Jun 30 '17 01:06 cdelorme

Just taking a stab in the dark based on some google search results, but if the old 3DS is not supported it might be good to add that to the readme.

I did clear my iptables before trying this, so it's not a firewall problem afaik.

If I did something else wrong, and anyone has an ideas how to resolve it, let me know. If it is that the old 3ds is not supported I am happy to close the ticket.

cdelorme avatar Jun 30 '17 01:06 cdelorme

unfortunately the streaming feature won't work on o3ds currently. https://github.com/44670/BootNTR/wiki/Video-Streaming

44670 avatar Jul 03 '17 06:07 44670

Thank you for the reply and the link.

I actually tried it yesterday on a New 3DS with the same results.

I have reviewed the documentation. Unfortunately I only own a Linux desktop and Mac laptops, so I can't run the debugger. However I did experience the same problems on both OSX and Debian.

I am using Luma 8.1 /w Boot NTR Launcher to load 3.5. Your instructions suggest the NTR Debugger during the connection, but is that a requirement?

I wasn't sure if maybe the viewer was behind NTR Boot, since the commit history shows more recent changes to that project.

Should I be enabling Input Redirection from the rosalina menu? If so, should it be done before or after launching NTR 3.5?

If there is any information I can collect or something I should be checking please let me know. I'll try to spend some time reviewing how NTR Boot actually transmits so I can try tinkering a bit.

cdelorme avatar Jul 03 '17 07:07 cdelorme

When -a argument is passed, NTRViewer will act as a debugger client to activate the streaming feature of the NTR CFW, there are no requirements for a NTR Debugger. If the streaming was sucessfully activated, the 3ds's upper screen with flash pink color for a short time. If can observe that on your 3ds but the NTRViewer won't work. I guess the udp packets sent by 3ds may be blocked by some means (maybe you can use tcpdump or wiresharks to check if any udp packets has transmitted to you computer).

44670 avatar Jul 03 '17 08:07 44670

While I was trying with iptables disabled, I just added these rules to my iptables:

-A INPUT -p udp -m udp --dport 8001 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3000 -j ACCEPT

I verified that neither 3000 nor 8001 were in use with netstat -an | grep.

When I start the viewer the top screen on the N3DS flashes pink, then blue, then back to the normal picture.

However, on my machine I see a black screen, and the console logs show recv failed until I terminate it:

$ ./ntrviewer -a 192.168.1.15
connected. 
sent ping packet.
sent ping packet.
sent ping packet.
init SDL...
SDL_Init done.
[11:04:07] screenSurface: 0x559c6475c440, pixels: 0x559c6477fe90
[11:04:07] set buff size: 425984
[11:04:09] recv failed or timeout.
[11:04:10] recv failed or timeout.
[11:04:11] recv failed or timeout.
[11:04:12] recv failed or timeout.

A second attempt to launch the viewer does not flash on the 3DS.

I just installed tcpdump and am going to try to identify traffic coming from the 3DS to see if it's a problem with accepting the packets. However, in the meantime I'll post two questions:

  • Is the blue flash expected or is that an indication that maybe it crashed?
  • Will connecting a new NTRViewer work, and should it show the same pink->blue flash?

This time I did not enable the InputRedirection feature. After the second connection failed with no response on the 3DS, I tried to relaunch the NTR CFW loader, and it failed then locked up (says press any key to reboot, but it is frozen when that message is displayed).


Update: I captured these results from a tcpdump:

$ tcpdump -n src host 192.168.1.15
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s25, link-type EN10MB (Ethernet), capture size 262144 bytes
11:20:13.388854 ARP, Request who-has 192.168.1.47 tell 192.168.1.15, length 46
11:20:13.390721 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [S.], seq 499660755, ack 834782586, win 8192, options [mss 1360,nop,nop,sackOK], length 0
11:20:13.392303 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 85, win 8108, length 0
11:20:16.026818 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 169, win 8024, length 0
11:20:16.027633 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 169, win 8024, length 0
11:20:16.027817 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 169, win 8024, length 0
11:20:16.028032 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 169, win 8024, length 0
11:20:16.028246 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [P.], seq 1:85, ack 169, win 8024, length 84
11:20:16.029078 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [P.], seq 85:421, ack 253, win 7940, length 336
11:20:16.031459 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [P.], seq 421:505, ack 253, win 7940, length 84
11:20:16.460754 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [.], ack 337, win 7856, length 0
11:20:16.461328 IP 192.168.1.15.8000 > 192.168.1.47.55605: Flags [P.], seq 505:589, ack 337, win 7856, length 84

After the (sdl?) window launched no further communication was sent, so maybe NTR CFW is crashing?


Alright, last update and then I'll stop spamming sorry, but attempting a second time indicates that it is still running (this time I added some flags; -p 2 -j 80 -q 100 ):

11:22:41.829690 ARP, Request who-has 192.168.1.47 (d0:50:99:47:b5:55) tell 192.168.1.15, length 46
11:23:12.899355 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [S.], seq 1374841731, ack 4282943551, win 8192, options [mss 1360,nop,nop,sackOK], length 0
11:23:12.901243 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [.], ack 85, win 8108, length 0
11:23:13.920398 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [.], ack 169, win 8024, length 0
11:23:13.921126 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [P.], seq 1:85, ack 169, win 8024, length 84
11:23:13.923184 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [P.], seq 85:142, ack 169, win 8024, length 57
11:23:14.944205 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [.], ack 253, win 7940, length 0
11:23:14.945125 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [P.], seq 142:226, ack 253, win 7940, length 84
11:23:15.969224 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [.], ack 337, win 7856, length 0
11:23:15.969455 IP 192.168.1.15.8000 > 192.168.1.47.43329: Flags [P.], seq 226:310, ack 337, win 7856, length 84

cdelorme avatar Jul 03 '17 15:07 cdelorme

The blue flash is an expected behavior. It won't show twice unless the 3ds reboots.

However, according to the log, the udp packets does not arrived to the pc (only the tcp packets on port 8000 comes).

What's the firmware version of your 3ds and what's the version of the NTR CFW?

44670 avatar Jul 03 '17 15:07 44670

Per the instructions I setup TCP 3000 and UDP 8001:

  1. Configure the Windows Firewall to allow listen on TCP port 3000 and UDP port 8001.

Same results with iptables disabled:

$ tcpdump -n src host 192.168.1.15
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s25, link-type EN10MB (Ethernet), capture size 262144 bytes
11:40:38.030497 ARP, Request who-has 192.168.1.47 tell 192.168.1.15, length 46
11:40:38.032155 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [S.], seq 3177008692, ack 1871288883, win 8192, options [mss 1360,nop,nop,sackOK], length 0
11:40:38.033601 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 85, win 8108, length 0
11:40:40.735594 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 169, win 8024, length 0
11:40:40.735742 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 169, win 8024, length 0
11:40:40.735987 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 169, win 8024, length 0
11:40:40.736218 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 169, win 8024, length 0
11:40:40.736453 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [P.], seq 1:85, ack 169, win 8024, length 84
11:40:40.738365 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [P.], seq 85:421, ack 169, win 8024, length 336
11:40:40.738818 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 253, win 7940, length 0
11:40:40.740432 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [P.], seq 421:505, ack 253, win 7940, length 84
11:40:41.034224 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [.], ack 337, win 7856, length 0
11:40:41.035113 IP 192.168.1.15.8000 > 192.168.1.47.33715: Flags [P.], seq 505:589, ack 337, win 7856, length 84

The system version shows 11.4.0-37U, and I have Luma8.1 installed (I used the system transfer instructions from the old 3DS I used initially).

I installed Boot NTR Selector via FBI, and it is launching NTR 3.5.

selector

I am going to see about resetting my wireless router next.

Should I try installing and launching NTR 3.5 directly?

cdelorme avatar Jul 03 '17 15:07 cdelorme

I guess the version of NTR CFW and 3ds firmware should be ok.

Interesting.

44670 avatar Jul 03 '17 15:07 44670

I reset my router to ensure no custom port mappings were in place, switched to a-class network scheme (10.x), set a fixed ip to the n3ds (10.0.0.8), and disabled Protected Management Frames on the router, then also iptables on my system.

The exact same behavior as before, pink > blue on 3ds, black-screen and no further traffic from tcpdump.

Any other ideas for me to check?

Update: I compiled and tried ntrviewer from a macbook with the same results, so I am pretty confident that the 3DS is not sending information. Should I try reinstalling the loader, or is there maybe something else I can test to figure out why?

Update 2

I previously was only trying to connect while on the home menu. This time I tried launching OoT3D and received a connection failed timeout error.

I decided to remove the cia via fbi, ran tiksweep, and tried installing the bin and cia directly from the latest releases page, but that simply resulted in a timeout on the home screen. After reinstalling the selector, I encountered the same pink>blue with black-screen and no tcpdump messages after the initial connection.

The only other thing I can think of is maybe something in gm9 was oddly tweaked, or the latest luma 8.1 /w b9s is incompatible or something? I am using "incognito mode", which maybe due to activity log is causing a problem?

These are all completely random thoughts, I have no basis to support them, but if they are valid concerns or if there is anything else I can try let me know and thank you for all your help so far.

cdelorme avatar Jul 03 '17 18:07 cdelorme