hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.03k stars 2.15k forks source link

Misc Ad-hoc issues #14641

Open ghost opened 3 years ago

ghost commented 3 years ago

What happens?

Didn't wanna group them as one but also didn't want to have seperate issues. This is probably the last time I gonna report any issues for awhile though. Super Pocket Tennis - After the 2nd player joins the game disconnects. Rush- Game freezes after a 2nd player joins the game. WHO WANTS TO BE A MILLIONAIRE - PARTY EDITION - similar to Rush, freeze on both instances. Vulcanus: Seek & Destroy - Similar to Rush , but the game freezes when someone just hosts a game instead. Gensan - Similar to Rush , the game will freeze on both instances. Bomberman Panic Bomber - After the 2nd player joins the game disconnects. Shinseiki GPX Cyber Formula VS - disconnects after starting game. All tried locally by using "localhost" as IP. I remember trying with a higher timeout for some of the games but I don't remember if i did for all of them. The result was still the same though.

What are you using? What hardware / device and operating system? OS: Windows 10 CPU:Intel 8550U

What graphics card (GPU) or mobile phone model? GPU:Radeon 530

What PPSSPP version (standalone/official), and did it work before? Didn't notice but I dont think they worked on the latest stable release.

Which game or games?

ghost commented 3 years ago

The Super Pocket Tennis issue seems to be similar to the Def Jam issue... You need to accept pretty fast for it to work , and it will work only sometimes.

anr2me commented 3 years ago

Vulcanus Seek And Destroy is japanese only isn't? how to get to multiplayer?

Edit: nevermind, found it Hmm.. it's strange, just trying to host it will get timeout, and it stuck with 0/0 FPS unable to cancel/go back to previous menu.

This is where the issue is starting: image It first use blocking PdpRecv with infinite timeout on socket fd number 2 on thread "Thread" followed by non-bocking PdpRecv on socket fd number 1 (belonged to AdhocMatching) on thread "Thread"... if the thread supposed to be blocked it shouldn't be able to call another PdpRecv... unless it was a different thread but with the same name. Looked like an issue with blocking simulation or AdhocMatching (because current AdhocMatching is running on real thread instead of PSPThread)

Edit: That socket error 10014 seems to be the main issue, and it can be tricky as it's related to invalid buffer address or size. According to this https://stackoverflow.com/questions/861154/winsock-error-code-10014 Apparently Winsock doesn't like buffers to be located on the stack, there is also a possible issue related to memory address alignment.

ghost commented 3 years ago

Added another game : Gensan.

ghost commented 3 years ago

@ANR2ME was the problem with some games getting 0 FPS not a socket buffer size issue? Seeing as you talked about it here: https://github.com/hrydgard/ppsspp/issues/13648#issuecomment-727175047 Not talking about Vulcanus but the other ones here. They seem to get lower fps gradually until 0 FPS...

anr2me commented 3 years ago

For Vulcanus, based on the logs the blocking socket simulation is behaving strange, it's an issue related to blocking socket simulation.

Most 0 FPS issue are probably because the game is waiting for something that takes a very long time (or endlessly) before it can update/render the frame, for example when loading some files.

The only game i know where FPS could dropped significantly due to socket buffer was Warriors Orochi 2, but it only dropped to 4/4 FPS at most, never reached 0/0 FPS. This game is the only game i know that have a strange netcode, it won't update the frame as long there is available data to be received in the buffer, so the game will try to repeatedly recv the data until there is no more sufficient data to be recved (about 700-736 bytes per recv) and then continue to render the frame, thus using a small buffer size will cause some incoming packets to be dropped (and need to be resent) but giving the receiver time to render the frame (due to 0 available data in buffer after the first recv), while using larger buffer will cause the game to render less frames per second (due to continuous incoming data being queued in buffer).

While the issue on PSP2/PSP2i that was related to buffer size were related to VPN (it seems some VPN doesn't worked well with small buffer size)

ghost commented 3 years ago

Why we can't see and fight each other on ppsspp latest dev apk multiplayer function Tekken 6 :( Screenshot_2021-08-10-21-53-37-752_org ppsspp ppsspp Im only using mobile data 😅 Any tips and guide? Sir @ANR2ME

anr2me commented 3 years ago

Why we can't see and fight each other on ppsspp latest dev apk multiplayer function Tekken 6 :( Screenshot_2021-08-10-21-53-37-752_org ppsspp ppsspp Im only using mobile data 😅 Any tips and guide? Sir @ANR2ME

If this is happened recently, check your Port Offset value, the most recent update related to network is related to Port Offset (i think)

There are also other issue related to mobile: 1). If you're using mobile data without VPN it will most-likely to fail, as most mobile data provider doesn't allow port-forwarding. 2). If you're on Android there is a possibility of getting "incorrect port" issue, did you see any message saying this with orange color?

ghost commented 3 years ago

Why we can't see and fight each other on ppsspp latest dev apk multiplayer function Tekken 6 :( Screenshot_2021-08-10-21-53-37-752_org ppsspp ppsspp Im only using mobile data 😅 Any tips and guide? Sir @ANR2ME

If this is happened recently, check your Port Offset value, the most recent update related to network is related to Port Offset (i think)

There are also other issue related to mobile: 1). If you're using mobile data without VPN it will most-likely to fail, as most mobile data provider doesn't allow port-forwarding. 2). If you're on Android there is a possibility of getting "incorrect port" issue, did you see any message saying this with orange color?

Didn't see any incorrect port warning Here's my settings. Screenshot_2021-08-10-21-13-39-483_org ppsspp ppsspp Screenshot_2021-08-10-21-13-44-205_org ppsspp ppsspp Screenshot_2021-08-10-21-39-50-439_org ppsspp ppsspp

I tried also local lan multiplayer but also failed :( Screenshot_2021-08-10-22-38-38-599_org ppsspp ppsspp

anr2me commented 3 years ago

Your friends will need to check their settings too, because if they use a different port offset or have a blocked port, you won't be able to connect to them.

ghost commented 3 years ago

I tried also local lan multiplayer but also failed :( Screenshot_2021-08-10-22-38-38-599_org ppsspp ppsspp

Nevermind this local lan multiplayer is working but super lag on both phones 🤣 unlike before when we play local lan multiplayer is smooth.

ghost commented 3 years ago

Your friends will need to check their settings too, because if they use a different port offset or have a blocked port, you won't be able to connect to them.

We have the same settings 😅

anr2me commented 3 years ago

I tried also local lan multiplayer but also failed :( Screenshot_2021-08-10-22-38-38-599_org ppsspp ppsspp

Nevermind this local lan multiplayer is working but super lag on both phones 🤣 unlike before when we play local lan multiplayer is smooth.

I tested the latest dev build just now on localhost using the same settings on your screenshot on PC (my phone is full recently so i don't play game on it anymore) and it worked fine, full speed 60 FPS.

If it gets lag on recent builds, could you find out which revision was the last time it worked properly from https://buildbot.orphis.net/ppsspp/index.php?m=fulllist so that we can investigate which update causing it, because it shouldn't lag at least on LAN.

ghost commented 3 years ago

I had no issue with Tekken 6 locally either. Well in general i do get lower fps with multiple instances on the other instance. But that seems like a Windows scheduler/gpu scheduling issue that makes it lower on the non active window... I know that issue on another emulator already.

ghost commented 3 years ago

Local lan is now smooth just need to delete some files on my Redmi note 9 🤣

But online mobile net still failed 😭 Screenshot_2021-08-11-14-27-18-304_org ppsspp ppsspp

ghost commented 3 years ago

Stick to LAN. I bet you get errors because of the port offset (needs to be higher then 1024) but even then the game is exteremly sensitive to lag and it makes the game not worth to bother with. It's the most sensitive to lag game I ever saw even on hardware (35-40 ms ping is slow).

ghost commented 3 years ago

Screenshot_2021-08-24-22-41-16-223_org ppsspp ppsspp Naruto Shippuden Ultimate Ninja Impact Lan Multiplayer Doesn't Work anymore :(

anr2me commented 3 years ago

It worked fine on localhost, that error code 0 is strange, may be you weren't connected to AdhocServer? Did you see "Network initialized" message on screen? (which indicate that you're successfully connected to AdhocServer)

image

ghost commented 3 years ago

Well Hammerin Hero/Gensan seems to work: https://www.youtube.com/watch?v=0AcZMJpFOP0 And I tried it know and it worked but on my other PPSSPP folder. So it could be my main folder acting up again or something changed on the latest PPSSPP builds lol. The main folder issue is weird if its that tho.

anr2me commented 3 years ago

Btw @MojoJojoDojo could you test Vulcanus Seek And Destroy on Linux and see whether it's generating similar issue (ie. the log filled with a lot of sceNetAdhocPdpRecv Errors) I might have a clue what's going on, at least on windows, not sure about other platform tho.

~And also, do you still remember which game was it, where i said the game couldn't handle partially received TCP/PTP data properly? I might have a clue about that too, but can't remember which game was it >.< i don't even remembered whether it was Adhoc game or Infrastructure game.~ It was CCCR - SF2, and the issue is the opposite of what i thought it was :( I might have a clue if the game couldn't handle partially received data, but it seems SF2 couldn't handle multiple TCP data being merged/combined, and i haven't found a clue how to separate those TCP data (other than reducing the buffer size that is, since we use larger buffer than what the game set)

ghost commented 3 years ago

Returning to the Hammerin Hero issue it seems like a regression on the latest builds. Latest stable build 1.11.2 seems to work fine with the game so maybe other games should play nice too. I will try Vulcanus and edit this post later. EDIT: Vulcanus at least seems to be able to host on Linux with one of the latest builds. I don't know about joining because I can never seem to get multiple instances to work on Linux lol. The log will show these messages on linux:

07:47:441 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2104 0=sceNetAdhocMatchingStart(1, 54, 7168, 54, 0, 56, 08bfab20) 07:47:473 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2006 443=sceKernelCreateThread(Thread, 08946908, 00000020, 4096, 00000000, 00000000) 07:47:474 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2104 0=sceKernelStartThread(443, 4, 08d44808) 08:56:465 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2322 sceKernelTerminateDeleteThread(443) 09:00:364 game I[SCEIO]: HLE/sceIo.cpp:1166 stdout: [i3NetworkContext::ConnectAdhoc] Start 09:00:434 game I[SCEIO]: HLE/sceIo.cpp:1166 stdout: [i3NetworkContext::CreateLobby] Start 09:00:434 game I[SCEIO]: HLE/sceIo.cpp:1166 stdout: [i3NetworkContext::CreateLobby] End 09:00:434 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2006 454=sceNetAdhocMatchingStart(1, 54, 7168, 54, 0, 56, 08bfab20) 09:00:434 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2104 0=sceNetAdhocMatchingStart(1, 54, 7168, 54, 0, 56, 08bfab20) 09:00:434 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2006 455=sceKernelCreateThread(Thread, 08946908, 00000020, 4096, 00000000, 00000000) 09:00:434 game I[SCEKERNEL]: HLE/sceKernelThread.cpp:2104 0=sceKernelStartThread(455, 4, 08d44808)

It seems like you will get an error if you try to run PPSSPP as sudo/admin: image

anr2me commented 3 years ago

I see, i had a feeling it's something that happen on windows only (ie. received data size not allowed to be initialized to -1 while it's okay on PSP apparently) Thanks for testing it.

Regarding Hammerin Hero, it would be nice if you know how to bisects it :) not even working on the earliest 1.11.3 ?

ghost commented 3 years ago

I see, i had a feeling it's something that happen on windows only (ie. received data size not allowed to be initialized to -1 while it's okay on PSP apparently) Thanks for testing it.

Regarding Hammerin Hero, it would be nice if you know how to bisects it :) not even working on the earliest 1.11.3 ?

I only checked for commits by you and the last one that worked was 1 commit before this one : https://github.com/hrydgard/ppsspp/pull/14466 Tested commit v1.11.3-669-g29ae351a5 .. didn't take a lot of time because you didn't have a lot of changes since stable lol.

anr2me commented 3 years ago

Hmm.. that PR doesn't seems to do anything odd other than checking whether the socket is null or not during blocking-socket simulation, which could happen when the socket was deleted from a different PSPThread, thus avoid access violation.

Since the game worked before this crash fix, that means the socket never null on Hammerin Hero, thus never reached the code that returned ERROR_NET_ADHOC_SOCKET_DELETED, which mean that crash fix shouldn't affect Hammerin Hero.. so it's strange...

Is the issue persistant and can always be reproduced using the build with that crash fix? (v1.11.3-672-gf1bf596f5)

So v1.11.3-669-g29ae351a5 is the last working version?

Also, previously you said Hammerin Hero/Gensan worked with the latest version on another folder. I assume you're using default settings on this folder (ie. freshly extracted/installed)? So may be the issue is something related to some settings you've changed from default (either system/networking settings usually)? can also be some changes on compat.ini

Btw, regarding PPSSPP with sudo on Vulcanus, did you see any "failed to bind" error message with sudo? It would be nice if you can show the log when using sudo, so i can compare it with your previous log to see whether there are any difference or not.

ghost commented 3 years ago

Nah thats definitly a regression... I tried it on a fresh folder. I sm not sure its a adhoc change by you that made it regress though because later I tried some later builds and they still worked. It's somewhere between 672 and 742 , 742 was your change with HLE delays. Also it should be the reverse on linux - I should see a failed to bind error without sudo. But I used a high port offset either way and didnt get that error.

ghost commented 3 years ago

Ah wait @ANR2ME I just noticed the game is GameMode so the commit that caused it is from https://github.com/hrydgard/ppsspp/pull/14492 i couldn't notice its gamemode from logs because it didnt see it clearly from all the other logs lol. Maybe now its fixable? and maybe the other freezing games are GameMode too....

ghost commented 3 years ago

Ah man why I feel like i always kill responds in issues like that lol.

anr2me commented 3 years ago

Vulcanus Seek and Destroy should be fixed by this PR https://github.com/hrydgard/ppsspp/pull/14849

ghost commented 3 years ago

Anything about the other games? Well updated that game for now. You know when I think about it someone could just patch out the game sending the all zero mac address first and the buffer size thing lol.

anr2me commented 3 years ago

For Hammerin, The Host side seems to be alright, i can see "Initiating GameMode Scheduler" image

While on the Guest side, i didn't see it :( So that's probably the main issue image

PS: Those Kernel Warnings are spamming the logs way too much LOL

ghost commented 3 years ago

Because i heard that GameMode games connect simiarly to how Nintendo DS games are connecting and I also know how MelonDS with them I thought to uncap the frame rate of one instance while keeping the other on normal speed but it seems like it wont help here lol. For MelonDS you have to do it because its hard to keep up the sync between the instances when connecting. If someone wants a good game that works online (somewhat) on MelonDS then you got Medarot DS its a bit laggy online but somewhat works.

Even GBATEK is mentioning Master and Replica (called Slave here though) as terms , I saw the GameMode code mention UpdateMaster and UpdateReplica instead though (and is mentioning beacon frames as a way to announce wireless commuincation) : https://problemkaputt.de/gbatek.htm#dswirelesscommunications

anr2me commented 3 years ago

The issue on Hammerin was, because the GameMode Scheduler (which is the one handling the syncing) is not running on the Guest side, thus they couldn't communicate, while the thread is being blocked for initial sync, thus frozen forever.

anr2me commented 3 years ago

This PR https://github.com/hrydgard/ppsspp/pull/14852 should fix Hammerin' Hero, please try this on other GameMode games that were having freezing issue.

ghost commented 3 years ago

You could never know if games are GameMode sometimes until after you progress from the lobby so its a bit hard to know. Rush seems like it's using AdhocMatching and it got something to do with sceNetAdhocMatchingGetPoolMaxAlloc() in the logs (?) its the same issue as hammerin hero but its not fixed. WHO WANTS TO BE A MILLIONAIRE - PARTY EDITION seems like its no longer even runs on PPSSPP anymore might need a seperate issue for that one. Super Pocket Tennis seems to be the same issue as Def Jam but I have no clue if its GameMode.. That's what I got with some of the logs on that game: 15:57:051 idle0 I[SCENET]: HLE\proAdhoc.cpp:437 Removing Friend Peer 00:02:02:02:02:02 [127.0.0.2] 16:02:326 user_main W[SCENET]: HLE\sceNetAdhoc.cpp:4402 UNTESTED sceNetAdhocMatchingStop(1) at 088572fc 16:02:330 user_main I[SCENET]: HLE\sceNetAdhoc.cpp:7331 InputLoop: End of InputLoop[1] Thread 16:02:337 user_main I[SCENET]: HLE\sceNetAdhoc.cpp:7064 EventLoop: End of EventLoop[1] Thread 16:02:338 user_main W[SCENET]: HLE\sceNetAdhoc.cpp:4475 UNTESTED sceNetAdhocMatchingDelete(1) at 08857314 16:02:338 user_main W[SCENET]: HLE\sceNetAdhoc.cpp:4519 UNTESTED sceNetAdhocMatchingTerm() at 08857400 16:02:338 user_main I[SCENET]: HLE\sceNetAdhoc.cpp:2342 Marked for Timedout Peer List (1) 16:02:338 user_main I[SCENET]: HLE\sceNetAdhoc.cpp:2378 00000000=sceNetAdhocctlDisconnect() at 088558d4 [group=] 16:02:342 user_main I[SCENET]: HLE\proAdhocServer.cpp:998 AdhocServer: PPSSPP (MAC: ec:84:97:0f:00:cd - IP: 127.0.0.1) left ULES00619 group

anr2me commented 3 years ago

For games that have timing issue like Def Jam (where you can sometimes play multiplayer successfully) will be difficult to fix without knowing a better/more accurate timing, since changing the timing at will could cause regression on other games, so i won't be fixing it any time soon as it's too risky.

And yeah, in order to see GameMode in the log you usually need to start multiplayer game, some games also use AdhocMatching for the lobby and then initiate GameMode when the multiplayer mission started.

Regarding WHO WANTS TO BE A MILLIONAIRE - PARTY EDITION, if it can't even boot anymore you should open a new issue, it could be an important issue to be fixed.

ghost commented 3 years ago

OK got that millionaire party edition game to work. I think it freezes for other reasons though on Ad-Hoc: 47:28:808 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:808 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK! 47:28:809 idle0 E[CPU]: core\core.cpp:479 BREAK!

I checked if this happens on single player too but seems to be a multiplayer only issue. Good thing you can also play that game with hotseat so you dont need ad-hoc.

You didn't comment on Rush which I have no idea whats its issue is because it never progressed past the lobby and the other player joining. Seems to be about UNIMPL sceNetAdhocMatchingGetPoolMaxAlloc() though.

Tried another GameMode game that didn't work after the regression but seems to work now at least (Hot Wheels).

unknownbrackets commented 3 years ago

"BREAK" happens in scenarios like this:

int result = sceNetDoSomething();
assert(result == 0);

It most likely means the game assumed something would happen some way and it went a different way.

-[Unknown]

ghost commented 3 years ago

On the 2nd window it showed the errors as ATRAC instead of idle0 too if I rembmer.

anr2me commented 3 years ago

"BREAK" happens in scenarios like this:

int result = sceNetDoSomething();
assert(result == 0);

It most likely means the game assumed something would happen some way and it went a different way.

-[Unknown]

Btw, does BREAK supposed to appeared multiple times like that? usually CPU execution halted there until resumed isn't?

@MojoJojoDojo i'll check Rush and millionaire party edition later, may be tomorrow

unknownbrackets commented 3 years ago

If you have "ignore illegal memory access" enabled, then it also ignores BREAK.

-[Unknown]

anr2me commented 3 years ago

Hmm.. I can't really tells what's wrong with Rush, since both side were able to communicate (send & recv) successfully, even when the screen looked frozen the game is still trying to sync their data, so it could be something to do with the content of the data being synced considered as invalid by the game, thus the game keep trying to sync it over and over and ended frozen (some games might shows a communication error dialog after a certain elapsed time in this case)

However, if i started from the Joining side first (instance 1 choose join and waited for a room to appear) and then Hosting on instance 2, and immediately join, and immediately accept the player, i was able to get into the game image So there is a possibility that this game might have timing issue, may be there is a timestamp value in the data being synced.

anr2me commented 3 years ago

Regarding Who Wants to be A Millionaire, it seems to be AdhocMatching issue.. The game is trying to compare the Optional Size/Length with sizeof(something), and it didn't matched :( As i remembered the optional data is given by the game and appended at the end of the normal packet, not sure why it didn't matched.. image That assert might be occurred within AdhocMatching's callback/mipscall, this is going to be tricky to fix :( since the optional data were provided by the game, they should matched

PS: That UNIMPL sceKernelStopUnloadSelfModuleWithStatus error is flooding the logs way too much :( PPS: Disregard those HLE\sceNetAdhoc.cpp:1787 80410709=someHLEhere..., that someHLEhere supposed to be sceNetAdhocPdpRecv which is being called from a different real thread which ended appeared within another HLE on the Emu thread, thus hleLog... is showing that HLE function instead of sceNetAdhocPdpRecv, those AdhocMatching threads need to be moved into PSPThread to fix this logging issue.

anr2me commented 3 years ago

Regarding Super Pocket Tennis, it seems to be AdhocMatching issue too, the game is trying to join twice in row and ended with an error image

Hmm.. may be some of AdhocMatching HLE need to be blocking the thread until the callback/mipscall fully executed, this might also prevent the callback from getting the wrong optional data (on games that didn't checked the Event code within the callback handler)

ghost commented 3 years ago

Shame about the other games issues being complicated to solve.. Seems like it always either an AdhocMatching or GameMode issue but I would say that GameMode is in a kinda good spot now then before.

@ANR2ME was the problem with some games getting 0 FPS not a socket buffer size issue? Seeing as you talked about it here: #13648 (comment) Not talking about Vulcanus but the other ones here. They seem to get lower fps gradually until 0 FPS...

Just noticed i was actually right about this from the start lol (one of the few times I am).

anr2me commented 3 years ago

Since we're close to release 1.12 i'll probably make one more PR which is to handle the "incorrect port" issue better on AdhocMatching and GameMode too, by keeping track of the new port being detected for replying data.

I'll probably try to move AdhocMatching threads to PSPThreads afterwards, probably not for 1.12 since it have a risk of breaking many AdhocMatching games, followed by testing whether some AdhocMatching HLE supposed to be blocking current thread or not.

LOL i haven't even had the chance to work on the infrastructure code yet, so i won't be able to make PR for it yet, since it have a risk of corrupting memory due to using socket id higher than 255 (which is probably why i often seeing invalid memory access while testing infrastructure)

ghost commented 3 years ago

If the moving to PSPThreads gonna break a lot of games maybe move it to a seperate option for people that want more stability on certain games. Shame about infrastructure not making it in though.

anr2me commented 3 years ago

It's not supposed to be an option, because AdhocMatching threads were supposed to be running as PSPThread in the first place. It seems the first person who created it was porting it directly from pro-online plugin directly, thus threads that supposed to be running on PSP side ended running on the emulator side (PPSSPP).

ghost commented 2 years ago

Guess no matter what Android to PC issues gonna bother this emulator lol. The most common way to see it is in adhocmatching games that lets you invite players in 2 directions. Tried a game called Hokuto no Ken: Raoh Gaiden and couldnt even play with an Android user at all lol. Last time I tried this was a LAN issue as well though. I wonder why it happens after you choose a character there though... it just disconnets and saves the game, Just what it does after the character select that give it that result hmm... PC to PC is fine as always.

anr2me commented 2 years ago

Whenever i had issue playing Android vs PC, usually having the slower one (in this case my Android is having slower performance than PC) as the Host/room creator, it will have higher chance to succeed, may be AdhocMatching syscalls really need to block the current thread so that it can at least waited for the packet & event before progressing too far, but there will be another issue, since AdhocMatching is using PDP/UDP in the case the packet got lost the one waiting may need to wait longer before it realized the packet was lost.

PS: since sceNetAdhocMatchingSelectTarget is being called from user_main which is usually the main thread which is used for rendering too, that thread is probably not being blocked to avoid the screen to look frozen, but it depend how the game developer design the netcode, as some games seems to prefer to froze the screen while waiting for packets.

anr2me commented 2 years ago

Btw i tried Super Pocket Tennis on JPCSP+prx to find out what kind of error code should be returned from sceNetAdhocMatchingSelectTarget but apparently it failed on the first attempt to join, with an undocumented error code (probably an internal error)

sceNetAdhocMatchingSelectTarget matchingId=0x1, macAddress=0x08B332BC(00:01:4a:b8:80:d0), optLen=0xBC, optData=0x09A77674
sceNetAdhocMatchingSelectTarget returning 0x9C8B44C

So i never know whether the game supposed to call sceNetAdhocMatchingSelectTarget twice like what happen on PPSSPP or that syscall supposed to be blocking and only called once.

PS: with JPCSP HLE i couldn't even find the game room

anr2me commented 2 years ago

After checking the logs on Super Pocket Tennis again, although the Joining side is showing a strange usage of sceNetAdhocMatchingSelectTarget, but it seems the main issue is on the Host side :( the game is kicking the joining player (by calling sceNetAdhocMatchingCancelTarget) within the callback handler for some reason... something that happened between timestamp 21:744 and 21:773 (hmm.. 29ms.. that sounds familiar) image PS: AdhocMatchingCallback: is indicating the start of a mipscall callback, while AfterMatchingMipsCall::run is indicating the end of the callback