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

sceNet #2060

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

sceNet #2060

wants to merge 17 commits into from

Conversation

georgemoralis
Copy link
Collaborator

New implementation still initial

@georgemoralis georgemoralis marked this pull request as draft January 5, 2025 09:34
@fer-marino

This comment was marked as off-topic.

@georgemoralis
Copy link
Collaborator Author

ok it should start getting some shape now ;D

@chronicer
Copy link

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code!
Unknown level =65535 optname =32

in NFS Hot Pursuit Remastered

@georgemoralis
Copy link
Collaborator Author

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code! Unknown level =65535 optname =32

in NFS Hot Pursuit Remastered

done

@C4ndyF1sh
Copy link

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code!
Unknown level =65535 optname =4608

For Superliminal

@Gabe205
Copy link

Gabe205 commented Jan 6, 2025

[Debug] posix_sockets.cpp:SetSocketOptions:53: Unreachable code!
Unknown level =65535 optname =4357

For Tony Hawk's Pro Skater 5

@C0rn3j
Copy link
Contributor

C0rn3j commented Jan 6, 2025

Peggle 2 tries the ORBIS_NET_SOCK_DGRAM_P2P codepath and crashes - this seems expected, though a bit surprising as you had it launching with the previous implementation - is there a way to improptu hack it up on my side til then?

[Lib.Net] <Error> net.cpp:sceNetSocket:1077: name = RakNet family = 2 type = 6 protocol = 0
[Debug] <Critical> net.cpp:sceNetSocket:1087: Unreachable code!
we don't support P2P

My attempt to hack it together in with the previous switch statement ended up with this, which is likely useless, but in case it's not:

[Debug] <Critical> posix_sockets.cpp:SetSocketOptions:53: Unreachable code!
Unknown level =1 optname =4098

@Missake212
Copy link

Wasn't sure if it was relevant information so I asked Fmod on Discord and he told me to post it. Far Cry 4 CUSA00462 behaves differently when using this PR, it basically spams net related logs on launch for a long time, and Fmod told me to mention this one in particular cause "the socket function is not implemented, some games use it directly instead of sceNetSocket but it's the same thing":
[Core] stubs.cpp:CommonStub:42: Stub: socket (nid: TU-d9PfIHPM) called, returning zero to 0x9026c063e
[Lib.Net] net.cpp:sceNetBind:132: socket id is invalid = 0

@georgemoralis
Copy link
Collaborator Author

Wasn't sure if it was relevant information so I asked Fmod on Discord and he told me to post it. Far Cry 4 CUSA00462 behaves differently when using this PR, it basically spams net related logs on launch for a long time, and Fmod told me to mention this one in particular cause "the socket function is not implemented, some games use it directly instead of sceNetSocket but it's the same thing": [Core] stubs.cpp:CommonStub:42: Stub: socket (nid: TU-d9PfIHPM) called, returning zero to 0x9026c063e [Lib.Net] net.cpp:sceNetBind:132: socket id is invalid = 0

yes it is similar but it goes through other module , can you send me a log using this branch?

@georgemoralis georgemoralis force-pushed the sceNet branch 3 times, most recently from caef372 to 6780ca3 Compare January 7, 2025 12:08
@chronicer
Copy link

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code! Unknown level =65535 optname =32
in NFS Hot Pursuit Remastered

done

again

[Debug] posix_sockets.cpp:SetSocketOptions:53: Unreachable code!
Unknown level =65535 optname =4608

@georgemoralis
Copy link
Collaborator Author

[Debug] posix_sockets.cpp:SetSocketOptions:53: Unreachable code! Unknown level =65535 optname =4357

For Tony Hawk's Pro Skater 5

That should be ok now

@georgemoralis
Copy link
Collaborator Author

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code! Unknown level =65535 optname =32
in NFS Hot Pursuit Remastered

done

again

[Debug] posix_sockets.cpp:SetSocketOptions:53: Unreachable code! Unknown level =65535 optname =4608

4608 is a bit tricky can you add a complete log file?

@kalaposfos13
Copy link
Contributor

  uVar8 = recvfrom(*(int *)(param_1 + 0xa8),*(void **)(param_1 + 0xb0),0x640,0x80,&local_868,
                   &local_86c);

LBP3 uses this (the posix variant, but neither is implemented yet), and gets stuck in an infinite loop after setting the brightness

@Djipi71
Copy link

Djipi71 commented Jan 9, 2025

i have this error: maybe it's not the good thread if it's the case sorry about that. BGE have this:

[Core] stubs.cpp:CommonStub:42: Stub: sceWebBrowserDialogGetStatus (nid: CFTG6a8TjOU) called, returning zero to 0x9003596a9

@georgemoralis
Copy link
Collaborator Author

i have this error: maybe it's not the good thread if it's the case sorry about that. BGE have this:

[Core] stubs.cpp:CommonStub:42: Stub: sceWebBrowserDialogGetStatus (nid: CFTG6a8TjOU) called, returning zero to 0x9003596a9

that is not from sceNet module is a different error :D

@Djipi71
Copy link

Djipi71 commented Jan 9, 2025

ok sorry about that :)

@georgemoralis
Copy link
Collaborator Author

Added more implementation for sceNetEpollControl,sceNetEpollDestroy

@kalaposfos13
Copy link
Contributor

With the new epoll functions, LBP3 now does this and instead of getting stuck in an infinite loop, it crashes:
shad_log.txt
This has the equeue hack and a hack in image_info.cpp that is also required for the game to run (for me, at least, I have not seen this error from other people): adding this line: case (AmdGpu::TilingMode)9: under this:

case AmdGpu::TilingMode::Display_Linear: {

and also a patch to break out of the infinite recvfrom loop.

@georgemoralis
Copy link
Collaborator Author

With the new epoll functions, LBP3 now does this and instead of getting stuck in an infinite loop, it crashes: shad_log.txt This has the equeue hack and a hack in image_info.cpp that is also required for the game to run (for me, at least, I have not seen this error from other people): adding this line: case (AmdGpu::TilingMode)9: under this:

case AmdGpu::TilingMode::Display_Linear: {

and also a patch to break out of the infinite recvfrom loop.

that log is quite interesting i will come back with some fixes :D

@chronicer
Copy link

[Debug] posix_sockets.cpp:SetSocketOptions:56: Unreachable code!
Unknown level =65535 optname =4608

NFS HP Remastered again:((((

@C0rn3j
Copy link
Contributor

C0rn3j commented Jan 9, 2025

@chronicer did you ever add that log? #2060 (comment)

@chronicer
Copy link

[Debug] posix_sockets.cpp:SetSocketOptions:50: Unreachable code! Unknown level =65535 optname =32
in NFS Hot Pursuit Remastered

done

again
[Debug] posix_sockets.cpp:SetSocketOptions:53: Unreachable code! Unknown level =65535 optname =4608

4608 is a bit tricky can you add a complete log file?

Here

shad_log.txt

@georgemoralis
Copy link
Collaborator Author

Peggle 2 tries the ORBIS_NET_SOCK_DGRAM_P2P codepath and crashes - this seems expected, though a bit surprising as you had it launching with the previous implementation - is there a way to improptu hack it up on my side til then?

[Lib.Net] <Error> net.cpp:sceNetSocket:1077: name = RakNet family = 2 type = 6 protocol = 0
[Debug] <Critical> net.cpp:sceNetSocket:1087: Unreachable code!
we don't support P2P

My attempt to hack it together in with the previous switch statement ended up with this, which is likely useless, but in case it's not:

[Debug] <Critical> posix_sockets.cpp:SetSocketOptions:53: Unreachable code!
Unknown level =1 optname =4098

Although i am not sure what makes peggle2 such an interesting game for request , it should work now with latest commit

@C0rn3j
Copy link
Contributor

C0rn3j commented Jan 10, 2025

Although i am not sure what makes peggle2 such an interesting game for request

I love the first one and I've been wanting to play it for a literal decade :)

The sequel turns out not as amazing as its predecessor, but I am grateful nonetheless for having it working now - thank you! :D

@ElBread3
Copy link
Contributor

ElBread3 commented Jan 10, 2025

Although i am not sure what makes peggle2 such an interesting game for request

Probably the best point would be since this game is only for PS4, Xbox One and 360, we now have an emulated HD version of this game (the only way to play this game otherwise would be with Xenia.) But this convo is a little bit off topic.

@Hermiten Hermiten mentioned this pull request Jan 11, 2025
5 tasks
@isshininu
Copy link

isshininu commented Jan 11, 2025

This pull requests partially fixes log spam in #2127 as well as adds new entries.

for DARK SOULS III NETWORK STRESS TEST VER. (CUSA03387) clears 6 out of 11 spam entries.
Now spams endlessly with:

[Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9
[Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called
[Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called
[Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called
[Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0
[Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called

and only written in the log once:
[Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0
[Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4
[Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called
[Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0

for Bloodborne™ Alpha Test (CUSA01322) it mostly fixes oversized log spam completely, but remaining entries are mostly new or different:

(same as DS3 NT):
[Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9
[Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called
[Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called
[Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called
[Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0
[Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called
(unique):
[Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = ResolveDomainName size = 4096 flags = 0
[Lib.Net] net.cpp:sceNetResolverCreate:955: (DUMMY) name = resolver memid =0 flags=0
[Lib.Net] net.cpp:sceNetResolverStartAton:972: rid = 100 , hostname_len =256 timeout=0 retry=0 flags=0
[Lib.Net] net.cpp:sceNetResolverDestroy:960: (STUBBED) called
[Lib.Net] net.cpp:sceNetPoolDestroy:899: (STUBBED) called

and written in the log only once (same as ds3 nt):
[Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0
[Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4
[Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called
[Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0

ds3nt.zip
bbnt.zip

@georgemoralis
Copy link
Collaborator Author

This pull requests partially fixes log spam in #2127 as well as adds new entries.

for DARK SOULS III NETWORK STRESS TEST VER. (CUSA03387) clears 6 out of 11 spam entries. Now spams endlessly with:

[Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9 [Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called [Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called [Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called [Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0 [Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called

and only written in the log once: [Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0 [Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4 [Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0

for Bloodborne™ Alpha Test (CUSA01322) it mostly fixes oversized log spam completely, but remaining entries are mostly new or different:

(same as DS3 NT): [Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9 [Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called [Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called [Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called [Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0 [Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called (unique): [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = ResolveDomainName size = 4096 flags = 0 [Lib.Net] net.cpp:sceNetResolverCreate:955: (DUMMY) name = resolver memid =0 flags=0 [Lib.Net] net.cpp:sceNetResolverStartAton:972: rid = 100 , hostname_len =256 timeout=0 retry=0 flags=0 [Lib.Net] net.cpp:sceNetResolverDestroy:960: (STUBBED) called [Lib.Net] net.cpp:sceNetPoolDestroy:899: (STUBBED) called

and written in the log only once (same as ds3 nt): [Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0 [Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4 [Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0

ds3nt.zip bbnt.zip

sceNetAccept creates a new socket so it is normal to fail after , next in my todo list

@georgemoralis
Copy link
Collaborator Author

This pull requests partially fixes log spam in #2127 as well as adds new entries.
for DARK SOULS III NETWORK STRESS TEST VER. (CUSA03387) clears 6 out of 11 spam entries. Now spams endlessly with:
[Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9 [Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called [Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called [Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called [Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0 [Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called
and only written in the log once: [Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0 [Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4 [Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0
for Bloodborne™ Alpha Test (CUSA01322) it mostly fixes oversized log spam completely, but remaining entries are mostly new or different:
(same as DS3 NT): [Tty] logger.cpp:log_flush:60: [stdout] sceNetEpollControl(ADD) Failed: errno=0x9 [Lib.Net] net.cpp:sceNetSocketClose:1176: (STUBBED) called [Lib.Net] net.cpp:sceNetAccept:68: (STUBBED) called [Lib.Net] net.cpp:sceNetGetsockname:759: (STUBBED) called [Lib.Net] net.cpp:sceNetEpollControl:574: socket id is invalid = 0 [Lib.Net] net.cpp:sceNetErrnoLoc:644: (STUBBED) called (unique): [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = ResolveDomainName size = 4096 flags = 0 [Lib.Net] net.cpp:sceNetResolverCreate:955: (DUMMY) name = resolver memid =0 flags=0 [Lib.Net] net.cpp:sceNetResolverStartAton:972: rid = 100 , hostname_len =256 timeout=0 retry=0 flags=0 [Lib.Net] net.cpp:sceNetResolverDestroy:960: (STUBBED) called [Lib.Net] net.cpp:sceNetPoolDestroy:899: (STUBBED) called
and written in the log only once (same as ds3 nt): [Lib.Net] net.cpp:sceNetSocket:1149: name = FsnioTCPServerSocket family = 2 type = 1 protocol = 0 [Lib.Net] net.cpp:sceNetSetsockopt:1051: s = 1 level = 65535 optname = 4 optlen = 4 [Lib.Net] net.cpp:sceNetInit:845: (DUMMY) called [Lib.Net] net.cpp:sceNetPoolCreate:894: (DUMMY) name = FD4HttpMan size = 16384 flags = 0
ds3nt.zip bbnt.zip

sceNetAccept creates a new socket so it is normal to fail after , next in my todo list

sceNetAccept has been added so hopely we get better results

@isshininu
Copy link

isshininu commented Jan 13, 2025

sceNetAccept has been added so hopely we get better results

log.zip
this fixes completely DS3 NT and BB NT, now log for both games barely reach 1 Mb in a minute
they still crash, but for unrelated to log size reasons 👍
also fixes Elden Ring Network Test

@georgemoralis
Copy link
Collaborator Author

sceNetAccept has been added so hopely we get better results

log.zip this fixes completely DS3 NT and BB NT, now log for both games barely reach 1 Mb in a minute they still crash, but for unrelated to log size reasons 👍

I don't get any crash on bloodborne alpha , do you have crashes to main as well?

@isshininu
Copy link

yes, crash on main nightly as well

@brad0demx
Copy link

sceNetAccept has been added so hopely we get better results

log.zip this fixes completely DS3 NT and BB NT, now log for both games barely reach 1 Mb in a minute they still crash, but for unrelated to log size reasons 👍

I don't get any crash on bloodborne alpha , do you have crashes to main as well?

Sorry I know you weren't asking me, but I also crash on bloodborne alpha using this PR and using main. I can progress to around the fountain area before I crash.

I crash around the same point on windows and Linux, I get no error on windows but I get this on Linux.

[Debug] <Critical> signals.cpp:SignalHandler:85: Unreachable code!
Unhandled access violation in thread 'GXWorker:5' at code address 0xa1002d04e: Write to address 0x0

shad_log.txt

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

Successfully merging this pull request may close these issues.