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

RetroAchievements on PS Vita prevents any games from loading. #14156

Open
tomrwaller opened this issue Jul 8, 2022 · 72 comments
Open

RetroAchievements on PS Vita prevents any games from loading. #14156

tomrwaller opened this issue Jul 8, 2022 · 72 comments

Comments

@tomrwaller
Copy link

RetroAchievements on PS Vita prevents any games from loading.

On the latest build with a PS Vita with a fresh install of 3.65 h-encore2, everytime a game is launched (tried both gpSP and SNES 2005 Plus cores) with RetroAchievements enabled, the game will not load. The screen hangs with the image of the console gamepad and banner that usually displays the game title, with a graphical popup stuck coming into the bottom of the screen. Turning off RA enhancements like sound on achievement or hardcore mode has no effect. The only way to get games to launch again is via disabling RA. I have also tried turning off graphical widgets but this has no effect.

Expected behavior

Games to launch with RetroAchievements enabled.

Actual behavior

Game does not launch.

Steps to reproduce the bug

  1. Enable RetroAchievements and provide username and password.
  2. Launch a game.
  3. Game will hang.

Version/Commit

You can find this information under Information/System Information

  • RetroArch: 1.10.3

Environment information

  • OS: PS Vita 2000 (3.65 Henkaku 2)
@Jamiras
Copy link
Contributor

Jamiras commented Jul 8, 2022

Sounds like an issue with the threading/task code. The only changes I see that seem possibly related are de-macroifying the slock_ calls. Can you provide a log and/or narrow down when this started happening?

I was unable to reproduce on the latest Windows build. What flags is the Vita build compiled with?

@LibretroAdmin
Copy link
Contributor

@tomrwaller Please bisect the issue and tell us a version where this did not yet happen. And preferably not too far back.

@tomrwaller
Copy link
Author

Sounds like an issue with the threading/task code. The only changes I see that seem possibly related are de-macroifying the slock_ calls. Can you provide a log and/or narrow down when this started happening?

I was unable to reproduce on the latest Windows build. What flags is the Vita build compiled with?

I just used the existing VPK - I didn't compile myself.

@tomrwaller
Copy link
Author

@LibretroAdmin - apologies, not entirely sure I understand. Do you mean try a previous version? I sure can do that no problem.

@LibretroAdmin
Copy link
Contributor

@LibretroAdmin - apologies, not entirely sure I understand. Do you mean try a previous version? I sure can do that no problem.

Yes, guess it's better than absolutely nothing. Go through the previous nightly versions first. If you've exhausted those, then try the latest stable.

@tomrwaller
Copy link
Author

@LibretroAdmin - OK, version 1.9.10 stable seems to work. At least I can launch games with RetroAchievements enabled. I do however get an error message 'Error retrieving achievement data: Credentials invalid (0)'. I assume that is because I copied my config from latest stable, but certainly seems to launch games fine.

@LibretroAdmin
Copy link
Contributor

Have you tried any more recent version? Because that is a very long time ago. Backtracking that would be nearly impossible going back that far.

@tomrwaller
Copy link
Author

Have you tried any more recent version? Because that is a very long time ago. Backtracking that would be nearly impossible going back that far.

I can go newer, not a problem. Do you know what stable build number was before the de-macrofying slock stuff was? Maybe that would be a good version to test.

@LibretroAdmin
Copy link
Contributor

LibretroAdmin commented Jul 8, 2022

Do you know what stable build number was before the de-macrofying slock stuff was?

I highly doubt it is that. And it is after 1.10.3 stable anyway (the most current version).

@LibretroAdmin
Copy link
Contributor

any feedback yet?

@cthulhu-throwaway you might want to keep an eye on this thread too since its networking related

@tomrwaller
Copy link
Author

tomrwaller commented Jul 9, 2022 via email

@tomrwaller
Copy link
Author

@LibretroAdmin - Tried a newer release. 1.10.0. This one also crashes (with a clean install and config file to be sure). Although this crash exhibits slightly differently. This time I launch a game, and I get a pop-up indicating I have sucessfully signed in to RetroAchievements, but then I get a full Vita game crash, as opposed to it just hanging. The message reads:

An error has occured in the following application.
(C2-12828-1)
Saved Core File Succeeded.
ux0:data/psp2core-1657533667-0x0008472bf5-snes9x2005_plus_libretro.
self.psp2dmp
RetroArch

@ghost
Copy link

ghost commented Jul 11, 2022

Try the current unstable instead of the stable build.
There were a bunch of issues with the networking code for the Vita written by the previous contributor to this platform.

I don't have a Vita nor do I develop for it, so I never tested whether my fixes were enough to solve all networking related problems for the platform.

@tomrwaller
Copy link
Author

Try the current unstable instead of the stable build. There were a bunch of issues with the networking code for the Vita written by the previous contributor to this platform.

I don't have a Vita nor do I develop for it, so I never tested whether my fixes were enough to solve all networking related problems for the platform.

@cthulhu-throwaway, @LibretroAdmin - Tried the latest nightly (2022-07-12_RetroArch.vpk) and it exhibits the same issue as the latest Stables. Launch game, hangs on horizontal game title bar (with no text, just the console logo) and the graphical widget half in the screen at the bottom.

@ghost
Copy link

ghost commented Jul 12, 2022

Could you try netplaying (with NAT Traversal enabled) and see if that works? Using the nightly, of course.
Make sure to disable achievements, though.

@tomrwaller
Copy link
Author

Could you try netplaying (with NAT Traversal enabled) and see if that works? Using the nightly, of course. Make sure to disable achievements, though.

@cthulhu-throwaway - Unfortunately I don't really have a way to test this as I don't have any content available matching people on Netplay - however, if it helps, I could see other users in the lobby list.

@ghost
Copy link

ghost commented Jul 13, 2022

There is a SNES test suite available from the Content Downloader.
You can use snes9x to run it and then host it from the Vita, while using another device to connect through the Lobby to see if it works. You can switch controllers between devices by moving one device to spectator, so it's generally a decent tool to test netplay.

With that being said, I don't think your problem is caused by my networking changes, as I am pretty sure the HTTP code doesn't use them (HTTP is how you get the lobby list and how you communicate with RetroAchievements).
The reason 1.9.10 doesn't deadlock is likely because it fails to complete authentication with RetroAchivements and abort achievements initialization altogether.

@FinalSlice
Copy link

hey i just wanted to say my vita works fine on latest stable build with retro achievements...but i cant get netplay to work ...i can provide any other information as requested.

@ghost
Copy link

ghost commented Jul 17, 2022

hey i just wanted to say my vita works fine on latest stable build with retro achievements...but i cant get netplay to work ...i can provide any other information as requested.

Netplay will likely not work without my fixes available in the unstable build.
Vita's netplay tests should therefore be performed on the unstable build, with all stable networking issues ignored as many of Vita's networking code on stable is outright broken.

@FinalSlice
Copy link

FinalSlice commented Jul 18, 2022

are you fixes in the nightly builds or do you have a precompiled vpk with your fixes I could try? how could i addd your fixes to the latest stable build is that possible? TIA

@FinalSlice
Copy link

latest nightly on vita system freeze when netplay host is selected, have to force exit retroarch then reload

@FinalSlice
Copy link

https://github.com/quyen194/RetroArch/releases

Netplay seems to work in this older modded version....but i dont have another device with 1.8.9 ...I could see the vita as host but my other device is on retoarch 10.0.3 so i was unable to connect to the vita.....can someone please merge (https://github.com/quyen194/RetroArch/releases)...with the latest release? and i can try it on the vita TIA

@ghost
Copy link

ghost commented Jul 18, 2022

latest nightly on vita system freeze when netplay host is selected, have to force exit retroarch then reload

What do you mean by "when host is selected"?
Does it freeze when you try to join a host through the lobby or when you try to host netplay?

@FinalSlice
Copy link

FinalSlice commented Jul 18, 2022 via email

@ghost
Copy link

ghost commented Jul 18, 2022

https://github.com/quyen194/RetroArch/releases

Netplay seems to work in this older modded version....but i dont have another device with 1.8.9 ...I could see the vita as host but my other device is on retoarch 10.0.3 so i was unable to connect to the vita.....can someone please merge (https://github.com/quyen194/RetroArch/releases)...with the latest release? and i can try it on the vita TIA

Those changes are super outdated and they either have already been implemented in a better way or they are personal choices (like changing the default port for the Vita).

Only two things could be taken from that repo:

  1. Enable HAVE_NETPLAYDISCOVERY for Vita builds, this way you can scan your LAN for hosts.
  2. Add net_ifinfo support for the Vita. Won't affect netplay, but you will be able to see your network address in "Network Information".

@ghost
Copy link

ghost commented Jul 18, 2022

When I go to the netplay option I select the option to be the host and the whole application freezes..

Try one of the solutions from this comment: #13869 (comment)

See if that fixes the issue.

@FinalSlice
Copy link

FinalSlice commented Jul 18, 2022 via email

@tomrwaller
Copy link
Author

tomrwaller commented Jul 19, 2022

I'm still having the same issue with hang up when RetroAchievements is enabled. I just tried to disable the option for 'Publically announce host' in Settings > Network but to no avail. Here is a screenshot of where it hangs after attempting to load a game. I am back on the latest stable now.

https://imgur.com/a/JiLZeHg

@tomrwaller
Copy link
Author

FWIW - I also tried the fix in the comment referenced above (#13869 (comment)). Still no joy.

@ghost
Copy link

ghost commented Jul 19, 2022

Still freezing with the suggestions on the latest nightly

Network -> Settings: Try with both Use Relay Server ON (picking a relay server in the list below) and Use Relay Server OFF. Tell me if one of these works.
Does the freezing happens when content is loaded or even when there is no content loaded and you just enable netplay hosting?

Tagging @quyen194. Can you see anything in the current RetroArch's codebase that would cause netplay/network problems for the Vita?

@ghost
Copy link

ghost commented Jul 20, 2022

'Failed to initialize netplay' is the message i get with the relay server selected....no matter the port #

I noticed that none of my other devices are saying UPnp successful when a few days ago they did....they’re still connecting with relay on or off but im not getting the UPnP with ip address like i was a few days ago so I'm not sure whats up with that.

Port is ignored when using relays because you are not listening for connections. You connect to the relay server with the OS binding an ephemeral port for you and then you receive connection requests through this connection.
UPnP is also always disabled when using relay servers for the same reason mentioned above.

Right, I forgot that HAVE_SOCKET_LEGACY platforms don't show this notification.

I don't own a Vita nor do I develop for it. I could attempt a fix for the early freezing and netplay not starting when started before content, but to fix functions relying on epoll (client connection, relay servers, etc), I'll need someone able to compile RetroArch so that I can better debug the situation.
Are you able to compile it?

@FinalSlice
Copy link

I don't think I can do that....I haven’t been formally trained in this. I'm a server admin trying to learn new things....4 kids and a wife don't make it simple.

Is it something I can do in visual studio code? I usually make adjustments to source code I download from github for my 3d printer FW... I learned how to do that from youtube. not sure if what you’re asking would be along the same lines.

@ghost
Copy link

ghost commented Jul 20, 2022

I don't think I can do that....I haven’t been formally trained in this. I'm a server admin trying to learn new things....4 kids and a wife don't make it simple.

Is it something I can do in visual studio code? I usually make adjustments to source code I download from github for my 3d printer FW... I learned how to do that from youtube. not sure if what you’re asking would be along the same lines.

https://docs.libretro.com/development/retroarch/compilation/psvita/

Vita SDK and instructions can be found here: https://vitasdk.org/

Also, can you give me the log for those "netplay disconnected" when connecting through the LAN?

@ghost
Copy link

ghost commented Jul 20, 2022

Either way, it's going to be a pain to support netplay for the Vita.
It seems to freeze on core reloads, which is a feature needed for some newer netplay features (separate savefiles for clients, core updater, etc).

The core updater isn't available for the Vita (since RetroArch is statically linked to each core), but core/content reload is standardized to happen regardless.
Without a forced core update when starting netplay, we also run the risk of running into this: #14149

Those console platforms are nothing but trouble when it comes to networking/netplay, and depending on those "netplay disconnected" logs, I might decide to go for a "won't fix" and suggest to deprecate and hide netplay for the Vita until someone who actually develops for those platforms can come along and try to fix this.

@FinalSlice
Copy link

FinalSlice commented Jul 20, 2022

Funny that you mentioned #14149 I had read through it the other night...and I meant to ask you if that could be the current possible issue...the build you sent ...does it have different cores then stable?.... should I be using a nightly data folder based on the build you sent..... maybe the nightly has different cores from stable???

I like the idea you proposed in #14149 seems like it would be the most logical way....but I can also understand people not wanting to increase their work load. I think a way to solve it is to remove the functionality to update cores from the UI...do beta release with disclaimer for users that want to test out....and stable build with the function removed from the UI ....like the vita currently

@ghost
Copy link

ghost commented Jul 20, 2022

Funny that you mentioned #14149 I had read through it the other night...and I meant to ask you if that could be the current possible issue...the build you sent ...does it have different cores then stable?.... should I be using a nightly data folder based on the build you sent..... maybe the nightly has different cores from stable???

I don't know. I need the logs from both the host and the client to figure this out, although if this is a core incompatibility issue, the log from the client is enough.

Content reload can be disabled for the Vita, since content is always going to be initialized with netplay enabled (assuming I patch the process's fork to include netplay arguments), but then we still have those netplay disconnected errors and epoll not working.
Moreover, Vita wouldn't be capable of using the special ".netplay" save directory for clients, if we allow it to start client netplay on already running content.

@FinalSlice
Copy link

well it sound like RIP.... vita netplay :(

well if anything comes up let me know, I'll always be down to get netplay working on the vita. its by far my favorite portable its almost perfect portable console imo...netplay with retro games is the only thing its lacking.

@ghost
Copy link

ghost commented Jul 21, 2022

Well, I've asked for those logs three times now; I can't do anything on platforms that I don't have access to while those reporting issues won't follow with my requests.

@FinalSlice
Copy link

LAN logs with port 19426 one with port 55435 and one where I tried relay again.

[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================
[ERROR] [Netplay] Failed to bind port.
[ERROR] [Netplay] Failed to set up netplay sockets.
[ERROR] [Netplay] Failed to initialize netplay.
[ERROR] [Netplay] Failed to connect to relay server.
[ERROR] [Netplay] Failed to set up netplay sockets.
[ERROR] [Netplay] Failed to initialize netplay.
[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================

@FinalSlice
Copy link

ps vita as client freeze the system content loaded or not loaded

[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================

@FinalSlice
Copy link

maybe a little success.....this is VITA as LAN host with NES core....most of my testing is always on a genesis core....but for some reason it was only one player maybe i have a 1player version of a two player rom???

[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================
[ERROR] [State]: Failed to load state from "ux0:/data/retroarch/savestates/Teenage Mutant Ninja Turtles II - The Arcade Game.state.auto".
[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================

@FinalSlice
Copy link

this is the log of the client device that was able to connect to the vita with TMNT 2 a google pixel 3

=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================

@FinalSlice
Copy link

genesis core on client device trying to connect to vita......worked on NES core

=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================
[Netplay] Failed to connect to host 10.0.0.102 on port 19426.
[Netplay] Failed to set up netplay sockets.
[Netplay] Failed to initialize netplay.
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================

@ghost
Copy link

ghost commented Jul 21, 2022

Are you manually trimming those logs? There is no way the logs are this short.

Also, Genesis Plus GX is platform dependent: https://github.com/ekeeke/Genesis-Plus-GX/blob/master/libretro/libretro.c#L3379
You can't netplay between two different platforms with it, but you would've been able to connect to it, eventually erroring out here:

if (netplay->quirks & NETPLAY_QUIRK_PLATFORM_DEPENDENT)
{
if (ntohl(header[1]) != netplay_platform_magic())
{
dmsg = msg_hash_to_str(MSG_NETPLAY_PLATFORM_DEPENDENT);
RARCH_ERR("[Netplay] %s\n", dmsg);
if (netplay->is_server)
return false;
else
goto error;
}
}

@FinalSlice
Copy link

no im not touching the logs at all just copy and paste

here is the genesis core loaded on the vita in lan wheni tried to connect the pixel 3

[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================
[ERROR] [Netplay] This core does not support inter-architecture netplay

@FinalSlice
Copy link

when VITA isa in LAN host mode i can not direct connect from client with vita ip...for some reason i see the vita in the relay list as anonymous ...is that normal to not see it in the lan list but in the relay list with other host?

@ghost
Copy link

ghost commented Jul 21, 2022

This core does not support inter-architecture netplay

Not a bug, just like I explained above:

RetroArch/intl/msg_hash_us.h

Lines 11638 to 11641 in 3cf7e88

MSG_HASH(
MSG_NETPLAY_PLATFORM_DEPENDENT,
"This core does not support inter-architecture netplay"
)

@ghost
Copy link

ghost commented Jul 21, 2022

when VITA isa in LAN host mode i can not direct connect from client with vita ip...for some reason i see the vita in the relay list as anonymous ...is that normal to not see it in the lan list but in the relay list with other host?

Yes. Vita doesn't have netplay LAN discovery enabled.

@FinalSlice
Copy link

so two vitas in the same LAN or even with relay should play nice together ?....i have another vita i can try but ill have to order a new battery for it ...so it might be a few days. let me know in the mean time if i can provide anything else.

@ghost
Copy link

ghost commented Jul 21, 2022

so two vitas in the same LAN or even with relay should play nice together ?....i have another vita i can try but ill have to order a new battery for it ...so it might be a few days. let me know in the mean time if i can provide anything else.

Relay servers have nothing to do with how a core operates. It merely forwards data through a relay server in the middle in order to bypass NAT, CGNAT and firewalls; it's nothing more than a tunnel.

And no, you don't need to go through all this trouble; just run a core that doesn't exhibit the platform dependent quirk when netplaying through different (incompatible) platforms.

@ghost
Copy link

ghost commented Jul 21, 2022

retroarch_vita.zip

Can you try this? I've disabled reloading of content for the host, but make sure you start netplay before loading content.
This should give you an UPnP message now (make sure relay is disabled).

Only Snes9x2010 is packed for obvious size reasons.

@FinalSlice
Copy link

FinalSlice commented Jul 21, 2022

i didn't get the UPnP message ...the Vita log file comes out blank....i started host before loading content but when the content loaded i didnt get any messages....i then went to the RA menu with content loaded and started host....it told me i joined as player 1 waiting for client ...then a few seconds says my room is not reachable from the internet .....i tried to connect by direct ip from my pixel 3 and i got a core mis match message....(FYI i had to DL the core on pixel 3 this morning as i did not already have it).......

vita log
[INFO] === Build =======================================
[INFO] Capabilities: NEON
[INFO] Built: Jul 7 2022
[INFO] Version: 1.10.3
[INFO] =================================================

pixel 3 log
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================
[Netplay] A netplay peer is running a different core. Cannot connect.
=== Build =======================================
Capabilities: ASIMD
[INFO] Built: May 2 2022
[INFO] Version: 1.10.3
[INFO] Git: 102abb0
[INFO] =================================================

I just accidentally noticed that the zip you sent installed a separate version of RA... usually it just writes over the current... anyways.... when I tried it I did notice the core you mentioned preload at the bottom left ... but....when you try to load a SNES ROM it says no core available.... browsing around the menu and it says the same thing no core installed although you can see it says SNES 2010 etc etc at the bottom left... pretty weird.
When click host is says netplay will start when content is loaded...but with no core no content will load.

@ghost
Copy link

ghost commented Jul 21, 2022

@FinalSlice I've opened a new issue for this, since this is clearly netplay-related only and it's stealing the focus for the original issue here.
Please, move our conversation there from now on: #14193

I'll post new instructions there in a bit about the problem you've described above.

@ghost
Copy link

ghost commented Aug 24, 2022

@tomrwaller is this issue still around with the latest nightly? Many changes have occurred since that could have an impact on your issue.

@tomrwaller
Copy link
Author

@tomrwaller is this issue still around with the latest nightly? Many changes have occurred since that could have an impact on your issue.

Thanks @cthulhu-throwaway - I'll try it out later tonight. Haven't had a chance to test recently.

@LibretroAdmin
Copy link
Contributor

@tomrwaller Tested it yet?

@LibretroAdmin
Copy link
Contributor

@tomrwaller Did you test the latest stable version yet? 11.1.1?

@FinalSlice
Copy link

FinalSlice commented Oct 11, 2022 via email

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

No branches or pull requests

4 participants