Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medal Of Honor Heroes infrastructure regression #19841

Closed
5 tasks done
Double-0-seven7 opened this issue Jan 9, 2025 · 19 comments
Closed
5 tasks done

Medal Of Honor Heroes infrastructure regression #19841

Double-0-seven7 opened this issue Jan 9, 2025 · 19 comments

Comments

@Double-0-seven7
Copy link

Double-0-seven7 commented Jan 9, 2025

Game or games this happens in

Medal of Honor: Heroes (Region doesn't matter)

What area of the game / PPSSPP

The game seems to connect to EA servers for awhile until you get a message that the EA servers are not available.
Previously , the game worked with the infrastructure implementation from here : anr2me#21

If you want to connect to the revived server you either need to use this CWcheat but be warned as its buggy :

_C1 DNS with SSL [region free]
_L 0x20497305 0x6F6C6261
_L 0x20497309 0x6C65646E
_L 0x2049730D 0x6E64642E
_L 0x20497311 0x656E2E73
_L 0x20497315 0x00000074

Or add the following lines to your OS hosts file :

86.223.243.173 pspmoh07.ea.com
86.223.243.173 pspmoh08.ea.com
86.223.243.173 tos.ea.com

Using the DNS option doesn't work yet.
The game also got sound issues on the old implementation.

What should happen

The game should connect and work fine as it worked beforehand at least on non-Windows and Linux.
I also tried previous versions after the infra code got merged but none worked for me.

Logs

16:581 user_main    W[SCENET]: HLE/sceNet.cpp:1068 UNTESTED sceNetApctlConnect(1)
31:16:581 user_main    I[SCENET]: HLE/sceNetAdhoc.cpp:2840 sceNetAdhocctlConnect(INFRA) at 08b6e908
31:16:646 user_main    I[SCENET]: HLE/proAdhoc.cpp:1442 Received 7 Bytes of Data from Adhoc Server
31:16:647 user_main    I[SCENET]: HLE/proAdhoc.cpp:1461 FriendFinder: Incoming OPCODE_CONNECT_BSSID [dc:62:5c:0b:c2:ba]
31:23:101 user_main    W[SCENET]: HLE/sceNetInet.cpp:423 UNTESTED sceNetInetSocket(2, 1, 0) at 08a8cb54
31:23:101 user_main    W[SCENET]: HLE/sceNetInet.cpp:445 UNTESTED sceNetInetSetsockopt(2, 65535, 4105, 09fff000, 4) at 08a8cbc8
31:23:101 SocketLookup W[SCENET]: HLE/sceNetResolver.cpp:179 UNTESTED sceNetResolverCreate(09fbd690[-1], 09fbd698, 1024) at 08a8c6f4
31:23:102 SocketLookup I[SCENET]: HLE/sceNetResolver.cpp:123 NetResolver_StartNtoA - Hostname: pspmoh07.ea.com => IPv4: 86.223.243.173
31:23:102 user_main    W[SCENET]: HLE/sceNetResolver.cpp:205 UNTESTED sceNetResolverStop(1) at 08a8c690
31:23:102 user_main    E[SCENET]: HLE/sceNetResolver.cpp:210 8041040a=sceNetResolverStop(1): Resolver Already Stopped (Id: 1)
31:23:102 SocketLookup W[SCENET]: HLE/sceNetResolver.cpp:217 UNTESTED sceNetResolverDelete(1) at 08a8c78c

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

AMD Van Gough (Steam Deck GPU)

PPSSPP version affected

v1.18.1-742

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@hrydgard
Copy link
Owner

hrydgard commented Jan 9, 2025

Can you clarify whether it is expected to work without the dns entries, and now needs them - or if regardless of the dns entries, it doesn't work at all in the latest builds?

@Double-0-seven7
Copy link
Author

It never worked with the DNS option even with the previous fork but it still worked with what I already mentioned.

@hrydgard
Copy link
Owner

hrydgard commented Jan 9, 2025

Sorry, I mean hosts. So now it doesn't work even with the hosts.

@anr2me
Copy link
Collaborator

anr2me commented Jan 10, 2025

Since it use sceNetResolverCreate, you will need to add the DNS mapping to g_Config.mHostToAlias, not sure whether this list can be easily edited through ppsspp.ini ([HostAliases] section?) or through the source code (it's not something i made)

static int sceNetResolverInit() {
    ERROR_LOG(Log::sceNet, "UNTESTED %s()", __FUNCTION__);
    g_Config.mHostToAlias["socomftb2.psp.online.scea.com"] = "67.222.156.250";
    g_Config.mHostToAlias["socompsp-prod.muis.pdonline.scea.com"] = "67.222.156.250";
    SceNetResolver::Init();
    return 0;
}

Edit: it can be edited/added at ppsspp.ini

[HostAliases]
socomftb2.psp.online.scea.com = 67.222.156.250
socompsp-prod.muis.pdonline.scea.com = 67.222.156.250

EDIT by hrydgard:

So for this game:

pspmoh07.ea.com = 86.223.243.173
pspmoh08.ea.com = 86.223.243.173
tos.ea.com = 86.223.243.173

but that doesn't work on ANR2ME's old infra2 branch.

@hrydgard
Copy link
Owner

hrydgard commented Jan 10, 2025

I think I'll have to add a file that the emulator downloads from ppsspp.org to autoconfig, with such mappings. And also will need to add UI for host mapping in case you want to manually config..

Anyway, first we need to solve the regression.

Hm, there are some strange delays in bootup of this game, will need to look into that too...

Some notes of commits, tested on Windows:

  • Current master: Spams recvFrom, gets NONBLOCKING error
  • 1e3e5c4 (before ANR2ME's version, but with WhiteBloodCell's socket impl): Just lots of errors.
  • a0f3963 (Before I merged WhiteBloodCells impl): Errors on "Resolver not created"

Oh right, it has never worked on the master branch so that was a waste of time.

@Double-0-seven7
Copy link
Author

Double-0-seven7 commented Jan 10, 2025

Yeah this is similar to #19812 where the game could only connect correctly on Linux (or just non-Windows in general).
by the way here is the log of the game working under Linux with the other fork :

35:36:027 user_main    W[SCENET]: HLE/sceNet.cpp:763 sceNetInit(poolsize=131072, calloutpri=32, calloutstack=0, netintrpri=32, netintrstack=0) at 08a8c94c
35:36:027 user_main    E[SCENET]: HLE/sceNet.cpp:1882 UNIMPL sceNetInetInit()
35:36:027 user_main    E[SCENET]: HLE/sceNet.cpp:3365 UNIMPL sceNetResolverInit()
35:36:027 user_main    W[SCENET]: HLE/sceNet.cpp:1943 UNTESTED sceNetApctlInit(12288, 48
5:47:479 user_main    W[SCENET]: HLE/sceNet.cpp:2508 UNTESTED sceNetInetSocket(2, 1, 0) at 08a8cb54
35:47:479 user_main    W[SCENET]: HLE/sceNet.cpp:2533 UNTESTED sceNetInetSetsockopt(28, 65535, 4105, 09fff000, 4) at 08a8cbc8
35:47:479 SocketLookup W[SCENET]: HLE/sceNet.cpp:3457 UNTESTED sceNetResolverCreate(09fbd690[-1], 09fbd698, 1024) at 08a8c6f4
35:47:479 SocketLookup W[SCENET]: HLE/sceNet.cpp:3417 UNTESTED sceNetResolverStartNtoA(1, 08e43230, 09fbd694, 0, 5) at 08a8c734
35:47:480 SocketLookup I[SCENET]: HLE/sceNet.cpp:3408 NetResolver_StartNtoA - Hostname: pspmoh07.ea.com => IPv4: 86.223.243.173
35:47:480 user_main    W[SCENET]: HLE/sceNet.cpp:3482 UNTESTED sceNetResolverStop(1) at 08a8c690
35:47:480 user_main    E[SCENET]: HLE/sceNet.cpp:3488 8041040a=sceNetResolverStop(1): Resolver Already Stopped (Id: 1)
35:47:480 SocketLookup W[SCENET]: HLE/sceNet.cpp:3496 UNTESTED sceNetResolverDelete(1) at 08a8c78c
35:47:480 user_main    W[SCENET]: HLE/sceNet.cpp:2702 UNTESTED sceNetInetConnect(28, 09ffeff0, 16) at 08a8ceec
35:47:554 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefcc, 09ffefdc)
35:47:554 user_main    I[SCENET]: HLE/sceNet.cpp:2504 52=sceNetInetSend(28, 08e3b1a8, 00000034, 00000000)
35:47:555 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:560 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:593 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:663 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:47:664 user_main    I[SCENET]: HLE/sceNet.cpp:2481 74=sceNetInetRecv(28, 08e3f1ad, 0000004a, 00000000)
35:47:665 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:678 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:711 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:47:711 user_main    I[SCENET]: HLE/sceNet.cpp:2481 673=sceNetInetRecv(28, 08e3f1ad, 000002a1, 00000000)
35:47:728 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:47:728 user_main    I[SCENET]: HLE/sceNet.cpp:2481 4=sceNetInetRecv(28, 08e3f1ad, 00000004, 00000000)
35:47:929 user_main    I[SCENET]: HLE/sceNet.cpp:2504 137=sceNetInetSend(28, 08e3b1a8, 00000089, 00000000)
35:47:929 user_main    I[SCENET]: HLE/sceNet.cpp:2504 6=sceNetInetSend(28, 08e3b1a8, 00000006, 00000000)
35:47:929 user_main    I[SCENET]: HLE/sceNet.cpp:2504 61=sceNetInetSend(28, 08e3b1a8, 0000003d, 00000000)
35:47:929 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:934 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:968 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:47:000 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:034 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:067 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:101 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:134 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:48:134 user_main    I[SCENET]: HLE/sceNet.cpp:2481 1=sceNetInetRecv(28, 08e3f1ad, 00000001, 00000000)
35:48:134 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:167 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:201 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:48:201 user_main    I[SCENET]: HLE/sceNet.cpp:2481 56=sceNetInetRecv(28, 08e3f1ad, 00000038, 00000000)
35:48:202 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:202 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefc0, 09ffefe0)
35:48:202 user_main    W[SCENET]: HLE/sceNet.cpp:2289 UNTESTED sceNetInetGetsockname(28, 09ffefc0, 09ffefe0)
35:48:202 user_main    I[SCENET]: HLE/sceNet.cpp:2504 44=sceNetInetSend(28, 08e3b1a8, 0000002c, 00000000)
35:48:203 user_main    I[SCENET]: HLE/sceNet.cpp:2504 113=sceNetInetSend(28, 08e3b1a8, 00000071, 00000000)
35:48:300 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:48:300 user_main    I[SCENET]: HLE/sceNet.cpp:2481 28=sceNetInetRecv(28, 08e3f1ad, 0000001c, 00000000)
35:48:367 user_main    I[SCENET]: HLE/sceNet.cpp:2481 5=sceNetInetRecv(28, 08e3f1a8, 00000005, 00000000)
35:48:367 user_main    I[SCENET]: HLE/sceNet.cpp:2481 59=sceNetInetRecv(28, 08e3f1ad, 0000003b, 00000000)
35:48:368 user_main    W[SCENET]: HLE/sceNet.cpp:2773 UNTESTED sceNetInetShutdown(28, 1) at 08a8cc64
35:48:368 user_main    W[SCENET]: HLE/sceNet.cpp:2791 UNTESTED sceNetInetClose(28) at 08a8cc6c
35:48:401 user_main    W[SCENET]: HLE/sceNet.cpp:2508 UNTESTED sceNetInetSocket(2, 1, 0) at 08a8cb54
35:48:401 user_main    W[SCENET]: HLE/sceNet.cpp:2533 UNTESTED sceNetInetSetsockopt(28, 65535, 4105, 09fff000, 4) at 08a8cbc8
35:48:401 user_main    W[SCENET]: HLE/sceNet.cpp:2702 UNTESTED sceNetInetConnect(28, 09ffeff0, 16) at 08a8ceec
35:48:477 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefcc, 09ffefdc)
35:48:477 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(28, 09ffefec, 09ffeffc)
35:48:477 user_main    W[SCENET]: HLE/sceNet.cpp:2289 UNTESTED sceNetInetGetsockname(28, 09ffefc0, 09ffefe0)
35:48:478 user_main    I[SCENET]: HLE/sceNet.cpp:2504 43=sceNetInetSend(28, 08e386e4, 0000002b, 00000000)
35:48:478 user_main    I[SCENET]: HLE/sceNet.cpp:2504 40=sceNetInetSend(28, 08e386e4, 00000028, 00000000)
35:48:478 user_main    I[SCENET]: HLE/sceNet.cpp:2504 28=sceNetInetSend(28, 08e386e4, 0000001c, 00000000)
35:48:565 user_main    I[SCENET]: HLE/sceNet.cpp:2481 12=sceNetInetRecv(28, 08e36474, 0000000c, 00000000)
35:48:665 user_main    I[SCENET]: HLE/sceNet.cpp:2481 12=sceNetInetRecv(28, 08e36474, 0000000c, 00000000)
35:48:665 user_main    I[SCENET]: HLE/sceNet.cpp:2481 39=sceNetInetRecv(28, 08e366f0, 00000027, 00000000)
35:48:667 user_main    I[SCENET]: HLE/sceNet.cpp:2481 12=sceNetInetRecv(28, 08e36474, 0000000c, 00000000)
35:48:667 user_main    I[SCENET]: HLE/sceNet.cpp:2481 231=sceNetInetRecv(28, 08e366f0, 000000e7, 00000000)
35:48:674 user_main    I[SCENET]: HLE/sceNet.cpp:2504 40=sceNetInetSend(28, 08e386e4, 00000028, 00000000)
35:48:783 user_main    I[SCENET]: HLE/sceNet.cpp:2481 12=sceNetInetRecv(28, 08e36474, 0000000c, 00000000)
35:48:783 user_main    I[SCENET]: HLE/sceNet.cpp:2481 23=sceNetInetRecv(28, 08e366f0, 00000017, 00000000)

@hrydgard
Copy link
Owner

Yeah I just got it working on the fork too on Mac.

Some various excerpts from the log, should be similar:

03:52:722 user_main    W[ME]: HLE/sceMpeg.cpp:1787 Audio end reach. pts: 105968 dts: 2555553
Setting enabled state to 1
Setting enabled state to 1
03:55:735 PspMpegStrea I[SCEKERNEL]: HLE/sceKernelThread.cpp:2151 sceKernelExitThread(0)
03:55:770 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:2314 sceKernelTerminateDeleteThread(437)
03:55:781 user_main    I[ME]: HLE/sceMpeg.cpp:1719 sceMpegFinish(...)
03:57:909 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:1999 440=sceKernelCreateThread(NetLibIdle, 08a89eec, 00000010, 32768, 00000000, 00000000)
03:57:909 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:2096 0=sceKernelStartThread(440, 0, 00000000)
03:57:909 user_main    W[SCENET]: HLE/sceNet.cpp:763 sceNetInit(poolsize=131072, calloutpri=32, calloutstack=0, netintrpri=32, netintrstack=0) at 08a8c94c
03:57:909 user_main    D[SCENET]: HLE/sceNet.cpp:773 0=sceNetInit(00020000, 00000020, 00000000, 00000020, 00000000)
03:57:909 user_main    E[SCENET]: HLE/sceNet.cpp:1882 UNIMPL sceNetInetInit()
03:57:909 user_main    E[SCENET]: HLE/sceNet.cpp:3365 UNIMPL sceNetResolverInit()
03:57:909 user_main    W[SCENET]: HLE/sceNet.cpp:1943 UNTESTED sceNetApctlInit(12288, 48)
03:57:909 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:1999 441=sceNetApctlInit(12288, 48)
03:57:909 user_main    I[SCENET]: HLE/sceNetAdhoc.cpp:1309 sceNetAdhocctlInit(12288, 48, 08db5200) at 08a8c97c
03:57:909 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:1999 442=sceNetApctlInit(12288, 48)
03:57:909 user_main    I[SCENET]: HLE/proAdhoc.cpp:1380 FriendFinder: Begin of Friend Finder Thread
03:57:976 idle0        D[SCENET]: HLE/proAdhoc.cpp:2237 InitNetwork: Connecting to AdhocServer
03:58:020 idle0        D[SCENET]: HLE/proAdhoc.cpp:2280 InitNetwork: Sending LOGIN OPCODE 1
03:58:020 idle0        I[SCENET]: HLE/proAdhoc.cpp:1413 FriendFinder: Network [RE]Initialized
03:58:032 idle0        D[SCENET]: HLE/sceNetAdhoc.cpp:395 Returning (WaitID: 1, error: 00000000) Result (00000000) of sceNetAdhocctl - Opcode: 1, State: 0
03:58:032 user_main    I[SCENET]: HLE/sceNet.cpp:2190 sceNetApctlAddHandler(08a8c20c, 08e344c0)
03:58:032 user_main    D[SCENET]: HLE/sceNet.cpp:2177 Added Apctl handler(8a8c20c, 8e344c0): 0
03:58:032 user_main    D[SCENET]: HLE/sceNet.cpp:811 0=sceWlanGetEtherAddr(08e344dc)
03:58:032 user_main    D[SCENET]: HLE/sceNet.cpp:832 sceNetEtherNtostr(08e344dc, 09fff1e0) at 08a8c9b8
03:58:944 user_main    W[SCENET]: HLE/sceNet.cpp:2508 UNTESTED sceNetInetSocket(2, 3, 1) at 08a8cb54
03:58:944 user_main    D[SCENET]: HLE/sceNet.cpp:2509 Socket: Domain = AF_INET, Type = SOCK_RAW, Protocol = IPPROTO_ICMP
03:58:944 user_main    E[SCENET]: HLE/sceNet.cpp:2513 ffffffff=sceNetInetSocket(2, 3, 1): errno = 1
03:58:954 user_main    W[SCENET]: HLE/sceNet.cpp:2508 UNTESTED sceNetInetSocket(2, 2, 0) at 08a8cb54
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2509 Socket: Domain = AF_INET, Type = SOCK_DGRAM, Protocol = IPPROTO_UNSPEC (DEFAULT?)
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2529 20=sceNetInetSocket(2, 2, 0)
03:58:954 user_main    W[SCENET]: HLE/sceNet.cpp:2533 UNTESTED sceNetInetSetsockopt(20, 65535, 32, 09fff130, 4) at 08a8cb8c
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2535 SockOpt: Level = SOL_SOCKET, OptName = SO_BROADCAST, OptValue = 1
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2586 0=sceNetInetSetsockopt(20, 65535, 32, 09fff130, 4)
03:58:954 user_main    W[SCENET]: HLE/sceNet.cpp:2533 UNTESTED sceNetInetSetsockopt(20, 65535, 4105, 09fff130, 4) at 08a8cbc8
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2535 SockOpt: Level = SOL_SOCKET, OptName = SO_NBIO, OptValue = 1
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2541 0=sceNetInetSetsockopt(20, 65535, 4105, 09fff130, 4)
03:58:954 user_main    W[SCENET]: HLE/sceNet.cpp:2651 UNTESTED sceNetInetBind(20, 09fff140, 16) at 08a8cea0
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2668 Bind: Address Replacement = 0.0.xx.0 => 192.168.1.205
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2673 Bind: Family = AF_INET, Address = 192.168.1.205, Port = 0
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2698 0=sceNetInetBind(20, 09fff140, 16)
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
03:58:954 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
03:58:962 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
03:58:962 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
03:58:962 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
03:58:962 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
03:58:975 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130

...

04:02:244 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:02:244 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:02:244 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:02:244 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:02:281 user_main    W[SCENET]: HLE/sceNet.cpp:3154 UNTESTED sceNetApctlConnect(1)
04:02:281 user_main    I[SCENET]: HLE/sceNetAdhoc.cpp:2886 sceNetAdhocctlConnect(INFRA) at 08b6e908
04:02:281 user_main    D[SCENET]: HLE/sceNetAdhoc.cpp:2893 00000000=sceUtilityNetconfUpdate(2): 
04:02:281 user_main    D[SCENET]: HLE/sceNet.cpp:3170 00000000=sceUtilityNetconfUpdate(2): connect = 0
04:02:281 ApctlThread  D[SCENET]: HLE/sceNet.cpp:650 ApctlCallback [ID=0][OldState=0][NewState=2][Event=3][Error=00000000][ArgsPtr=08e344c0]
04:02:313 idle0        D[SCENET]: HLE/sceNetAdhoc.cpp:365 sceNetAdhocctl[19]: Sending OPCODE 2
04:02:313 idle0        D[SCENET]: HLE/sceNetAdhoc.cpp:395 Returning (WaitID: 19, error: 00000000) Result (00000000) of sceNetAdhocctl - Opcode: 2, State: 0
04:02:313 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:02:313 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:02:313 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:02:313 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:02:315 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:02:315 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:02:315 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:02:315 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:02:348 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:02:348 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:02:348 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:02:348 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:02:351 idle0        I[SCENET]: HLE/proAdhoc.cpp:1479 Received 139 Bytes of Data from Adhoc Server
04:02:351 idle0        I[SCENET]: HLE/proAdhoc.cpp:1584 FriendFinder: Incoming OPCODE_CONNECT [e8:87:51:80:fc:5b][90.225.xx.25][PPSSPP]
04:02:376 idle0        I[SCENET]: HLE/proAdhoc.cpp:1479 Received 7 Bytes of Data from Adhoc Server
04:02:376 idle0        I[SCENET]: HLE/proAdhoc.cpp:1498 FriendFinder: Incoming OPCODE_CONNECT_BSSID [e8:87:51:80:fc:5b]
04:02:382 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:02:382 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:02:382 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:02:382 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:02:415 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1

...

04:08:250 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:08:250 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:08:250 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:08:286 user_main    D[SCENET]: HLE/sceNet.cpp:179 Returning (WaitID: 5, error: 00000000) Result (00000000) of sceNetApctl - Event: 4, State: 4
04:08:286 ApctlThread  D[SCENET]: HLE/sceNet.cpp:134 AfterApctlMipsCall::run [ID=0][OldState=0][NewState=4][Event=4][Error=0][ArgsPtr=08e344c0] [cbId: 1][retV0: 00000000]
04:08:287 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:08:287 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:08:287 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:08:287 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8

...

04:09:356 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff130) at 08a8c828
04:09:356 user_main    D[SCENET]: HLE/sceNet.cpp:2818 ffffffff=sceNetInetRecvfrom(20, 09fff1d0, 128, 0, 09fff120, 09fff130): errno = 35
04:09:356 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d2e4
04:09:356 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:09:453 user_main    D[SCENET]: HLE/sceNet.cpp:2012 UNTESTED sceNetApctlGetInfo(8, 09ffdfd0) at 08a8c3c4
04:09:453 user_main    D[SCENET]: HLE/sceNet.cpp:2078 ApctlInfo - IP: 192.168.1.205
04:09:453 user_main    D[SCENET]: HLE/sceNet.cpp:2148 0=sceNetApctlGetInfo(8, 09ffdfd0)
04:09:455 user_main    W[SCENET]: HLE/sceNet.cpp:2508 UNTESTED sceNetInetSocket(2, 1, 0) at 08a8cb54
04:09:455 user_main    D[SCENET]: HLE/sceNet.cpp:2509 Socket: Domain = AF_INET, Type = SOCK_STREAM, Protocol = IPPROTO_UNSPEC (DEFAULT?)
04:09:455 user_main    D[SCENET]: HLE/sceNet.cpp:2529 22=sceNetInetSocket(2, 1, 0)
04:09:455 user_main    W[SCENET]: HLE/sceNet.cpp:2533 UNTESTED sceNetInetSetsockopt(22, 65535, 4105, 09fff000, 4) at 08a8cbc8
04:09:455 user_main    D[SCENET]: HLE/sceNet.cpp:2535 SockOpt: Level = SOL_SOCKET, OptName = SO_NBIO, OptValue = 1
04:09:455 user_main    D[SCENET]: HLE/sceNet.cpp:2541 0=sceNetInetSetsockopt(22, 65535, 4105, 09fff000, 4)
04:09:467 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:1999 479=sceKernelCreateThread(SocketLookup, 08a8c6c8, 00000010, 8192, 00000000, 00000000)
04:09:467 user_main    I[SCEKERNEL]: HLE/sceKernelThread.cpp:2096 0=sceKernelStartThread(479, 4, 09fff020)
04:09:467 SocketLookup W[SCENET]: HLE/sceNet.cpp:3457 UNTESTED sceNetResolverCreate(09fbd690[-1], 09fbd698, 1024) at 08a8c6f4
04:09:467 SocketLookup W[SCENET]: HLE/sceNet.cpp:3417 UNTESTED sceNetResolverStartNtoA(1, 08e43230, 09fbd694, 0, 5) at 08a8c734
04:09:481 SocketLookup I[SCENET]: HLE/sceNet.cpp:3408 NetResolver_StartNtoA - Hostname: pspmoh07.ea.com => IPv4: 86.223.243.173
04:09:482 user_main    W[SCENET]: HLE/sceNet.cpp:3482 UNTESTED sceNetResolverStop(1) at 08a8c690
04:09:482 user_main    E[SCENET]: HLE/sceNet.cpp:3488 8041040a=sceNetResolverStop(1): Resolver Already Stopped (Id: 1)
04:09:482 SocketLookup W[SCENET]: HLE/sceNet.cpp:3496 UNTESTED sceNetResolverDelete(1) at 08a8c78c
04:09:482 SocketLookup I[SCEKERNEL]: HLE/sceKernelThread.cpp:2187 sceKernelExitDeleteThread(0)
04:09:482 user_main    W[SCENET]: HLE/sceNet.cpp:2702 UNTESTED sceNetInetConnect(22, 09ffeff0, 16) at 08a8ceec
04:09:482 user_main    D[SCENET]: HLE/sceNet.cpp:2708 Connect: Address = 86.223.xx.173, Port = 11181
04:09:525 user_main    D[SCENET]: HLE/sceNet.cpp:2730 0=sceNetInetConnect(22, 09ffeff0, 16)
04:09:525 user_main    D[SCENET]: HLE/sceNet.cpp:2413 UNTESTED sceNetInetPoll(09ffefc4, 1, 0) at 08a8d6e0
04:09:525 user_main    D[SCENET]: HLE/sceNet.cpp:2460 1=sceNetInetPoll(09ffefc4, 00000001, 0)
04:09:525 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(22, 09ffefcc, 09ffefdc)
04:09:525 user_main    D[SCENET]: HLE/sceNet.cpp:2274 Getpeername: Family = AF_INET, Address = 86.223.xx.173, Port = 11181
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2485 UNTESTED sceNetInetSend(22, 08e3b1a8, 52, 00000000) at 08a8d1d4
04:09:526 user_main    I[SCENET]: HLE/sceNet.cpp:2504 52=sceNetInetSend(22, 08e3b1a8, 00000034, 00000000)
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2464 UNTESTED sceNetInetRecv(22, 08e3f1a8, 5, 00000000) at 08a8c890
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2471 ffffffff=sceNetInetRecv(22, 08e3f1a8, 00000005, 00000000): errno = 35
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d324
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2464 UNTESTED sceNetInetRecv(22, 08e3f1a8, 5, 00000000) at 08a8c890
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2471 ffffffff=sceNetInetRecv(22, 08e3f1a8, 00000005, 00000000): errno = 35
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8d324
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:1858 11=sceNetInetGetErrno():  at 08a8c0f8
04:09:526 user_main    W[SCENET]: HLE/sceNet.cpp:2260 UNTESTED sceNetInetGetpeername(22, 09ffefec, 09ffeffc)
04:09:526 user_main    D[SCENET]: HLE/sceNet.cpp:2274 Getpeername: Family = AF_INET, Address = 86.223.xx.173, Port = 11181
04:09:527 user_main    D[SCENET]: HLE/sceNet.cpp:2806 UNTESTED sceNetInetRecvfrom(20, 09fff1d0, 128, 00000000, 09fff120, 09fff

@hrydgard
Copy link
Owner

Looking at logs, the most likely culprit is sceNetInetPoll. I had troubles with making socket mapping work with select, so no surprise poll might have bugs :) let me take a look.

@anr2me
Copy link
Collaborator

anr2me commented Jan 10, 2025

Well since both logs (the failed one and the success one on linux) already resolves to the correct IP pspmoh07.ea.com => IPv4: 86.223.243.173, it's probably not DNS issue.

If it only works on Non-Windows on my fork it's most likely due to the native windows socket ids were higher than 255 and the sceNetInetSelect can only works if it uses the last socket (which is the workaround that only works with one socket on Windows), while on Non-Windows most of the time less than 256.
So, basically if my infra2 branch doesn't works only on Windows, most likely due to socket id issue and the game is using more than one sockets.

However, we should already solved the socket id issue by remapping it, and this game seems to use sceNetInetPoll instead of sceNetInetSelect, and i'm not sure about the consistency of sceNetInetPoll across platforms either (may be need to uncomment some of the POLL/EPOLL flags on the result conversion)

@hrydgard
Copy link
Owner

Fixed a bug in sceNetInetPoll, now it gets slightly further but gets disconnected, so there's another problem :)

@hrydgard
Copy link
Owner

hrydgard commented Jan 10, 2025

Hm, it does seem to work on Mac now, but not Windows! Hm.

Anyway, if it works on Linux now, I think we can consider the regression fixed. However, it would of course be ideal to make it work on Windows too... But I don't understand how there can be a difference now that we remap sockets.

@Double-0-seven7
Copy link
Author

Yeah this seems to work now on Linux OS.
Hopefully this could be solved on Windows as well one day as the game supports up to 32 players and it will be beneficial to get a large player base for it.

@hrydgard
Copy link
Owner

I'm closing this issue since it's about a regression, but I'll open a new one with known platform differences.

@anr2me
Copy link
Collaborator

anr2me commented Jan 11, 2025

The communication difference between Windows and Linux is,
On Windows it immediately close the socket after sending 44 bytes + 113 bytes:
image

While on Linux, after sending 44+113 bytes, it received 5+28+5+59 bytes before closing the socket:
image

So there is something that triggers the immediate closure of the socket after it send those data, may be some kind of socket/connection state? or timing issue may be.

Edit: This is what happened between the last send and the socket shutdown on Windows (seems to only involves socket id=3):
image

Meanwhile, there are a lot more Recv attempt (involving other sockets too) on Linux after sending the 113 bytes:
image

@hrydgard
Copy link
Owner

a timing issue would be strange, it shouldn't be so sensitive...

@anr2me
Copy link
Collaborator

anr2me commented Jan 11, 2025

I couldn't see any kind of state checking like select/poll, and the raw socket shouldn't be an issue with admin/sudo, so this is going to be tough to fix, unless it was related to the content of the data being received/sent.

@anr2me
Copy link
Collaborator

anr2me commented Jan 12, 2025

Btw, there is something strange with sceNetInetGetErrno, once a while it's returning 0 without calling any other sceNetInet* syscall
image

@hrydgard
Copy link
Owner

hrydgard commented Jan 12, 2025

hm that's interesting! Maybe something should be logging but isn't ....

In fact, I think I'm going to refactor the inet errno so it always keeps the PSP errno rather than the host errno, and also, it will log when set.

@hrydgard
Copy link
Owner

I think this is not a good idea, inside sceNetInetGetErrno:

	if (inetLastErrno == 0)
		inetLastErrno = socket_errno;

So I'm removing that with my refactor...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants