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

PS Vita Multiplayer Freezing on August Build and later. #1820

Open
Haasman0 opened this issue Oct 1, 2024 · 33 comments
Open

PS Vita Multiplayer Freezing on August Build and later. #1820

Haasman0 opened this issue Oct 1, 2024 · 33 comments
Assignees
Labels
PSVita Issues specific to PSVita platform

Comments

@Haasman0
Copy link

Haasman0 commented Oct 1, 2024

The Multiplayer works fine in the March builds and lower, but on the August and later builds, the engine freezes when trying to search for an online match then I have to close the app with the ps button.

It would be great if the issue can get resolved.

@a1batross
Copy link
Member

What if you enter "voice_enable 0" in console?

@a1batross
Copy link
Member

Before joining the server, of course.

@a1batross
Copy link
Member

As an alternative, you could try joining old protocol servers. They won't try to initialize microphone access (which seems to cause problems over many platforms) and voice codecs.

I can't think of anything else what could cause freezes. Downloading resources maybe?

@a1batross a1batross added the PSVita Issues specific to PSVita platform label Oct 1, 2024
@Haasman0
Copy link
Author

Haasman0 commented Oct 1, 2024

As an alternative, you could try joining old protocol servers. They won't try to initialize microphone access (which seems to cause problems over many platforms) and voice codecs.

I can't think of anything else what could cause freezes. Downloading resources maybe?

It cant even list the servers, as soon as I press multiplayer, the menu tone loops and no servers listed and it freezes and keeps playing the sound.

@Haasman0
Copy link
Author

Haasman0 commented Oct 1, 2024

I even tried compiling it myself, still causes the same bug.

@a1batross
Copy link
Member

Oh, that's sounds like a DNS problem. When the engine tries to resolve the master server, it asks the system to convert a domain into an IP address using getaddrinfo or more legacy gethostbyname C functions. On usual platforms, these calls are made in a separate thread to not block the main one, but it's disabled for PSVita and Switch platforms.

Can you try entering clearmasters and addmaster 135.181.76.187:27010 in console and open the server browser?

@Haasman0
Copy link
Author

Haasman0 commented Oct 1, 2024

Oh, that's sounds like a DNS problem. When the engine tries to resolve the master server, it asks the system to convert a domain into an IP address using getaddrinfo or more legacy gethostbyname C functions. On usual platforms, these calls are made in a separate thread to not block the main one, but it's disabled for PSVita and Switch platforms.

Can you try entering clearmasters and addmaster 135.181.76.187:27010 in console and open the server browser?

Is there a way to enable it?

@a1batross
Copy link
Member

@Haasman0 you can try setting NO_ASYNC_RESOLVE to False in root wscript under conf.env.DEST_OS == 'psvita' check.

If current Vita homebrew SDK implements POSIX threads it should work as is.

If not, you can try porting it to platform-specific Vita multithreading APIs in engine/common/net_ws.c file. It already supports Windows APIs so it must be obvious where to add more platform-specific code.

@Haasman0
Copy link
Author

Haasman0 commented Oct 1, 2024

@Haasman0 you can try setting NO_ASYNC_RESOLVE to False in root wscript under conf.env.DEST_OS == 'psvita' check.

If current Vita homebrew SDK implements POSIX threads it should work as is.

If not, you can try porting it to platform-specific Vita multithreading APIs in engine/common/net_ws.c file. It already supports Windows APIs so it must be obvious where to add more platform-specific code.

Is it possible for you to set this for the ps vita in a new commit?

@a1batross
Copy link
Member

I'm not a PSVita port maintainer and don't know if it has POSIX threads support or it's own threading functions. Better ask @fgsfdsfgs for that.

We could as well use SDL2 threading functions, if it's implemented in SDL2 port for PSVita.

@Haasman0
Copy link
Author

Haasman0 commented Oct 1, 2024

I'm not a PSVita port maintainer and don't know if it has POSIX threads support or it's own threading functions. Better ask @fgsfdsfgs for that.

We could as well use SDL2 threading functions, if it's implemented in SDL2 port for PSVita.

@fgsfdsfgs

@a1batross
Copy link
Member

I published a PR at #1821.

Can you try if it fixes the issue for you?

Though, don't expect that you will instantly see a server list full of servers. If it stops freezing, then it's good already. But if you have generic DNS issues, I don't think it's possible to do anything further from our side.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

I published a PR at #1821.

Can you try if it fixes the issue for you?

Though, don't expect that you will instantly see a server list full of servers. If it stops freezing, then it's good already. But if you have generic DNS issues, I don't think it's possible to do anything further from our side.

I use 1.1.1.1 and 1.0.0.1 and sometimes 8.8.8.8 and 8.8.4.4

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

I published a PR at #1821.

Can you try if it fixes the issue for you?

Though, don't expect that you will instantly see a server list full of servers. If it stops freezing, then it's good already. But if you have generic DNS issues, I don't think it's possible to do anything further from our side.

Ok now it does not freeze anymore, but it still cant find any servers.

@a1batross
Copy link
Member

Check your DNS settings then.

Try to leave the default value, maybe it will try to use default DNS provided by your ISP.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

Check your DNS settings then.

Try to leave the default value, maybe it will try to use default DNS provided by your ISP.

How come it works flawlessly on older versions, but does not work on newer versions?

@a1batross
Copy link
Member

Dunno, what could we've changed?

Maybe it stucks resolving IPv6 master server?

Can you try entering clearmasters and then addmaster mentality.rip:27015 in console, so there is no IPv6 only masters?

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

Dunno, what could we've changed?

Maybe it stucks resolving IPv6 master server?

Can you try entering clearmasters and then addmaster mentality.rip:27015 in console, so there is no IPv6 only masters?

It says Server IPv4 address loopback

@a1batross
Copy link
Member

That's not what I'm asking you to do.

Type those two commands (first removes all hardcoded master servers, second adds master server) and try to open server browser.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

That's not what I'm asking you to do.

Type those two commands (first removes all hardcoded master servers, second adds master server) and try to open server browser.

That is what I did, I entered clearmasters and then addmaster mentality.rip:27015 after running the first command.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

It still did not work when trying to find a server.

@a1batross
Copy link
Member

a1batross commented Oct 2, 2024

Still, fix your DNS. I don't know what else could've caused it.

Since you're mentioned compiling port yourself and I'm assuming you know how to do it, you could use git bisect to find breaking change.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

Still, fix your DNS. I don't know what else could've caused it.

Since you're mentioned compiling port yourself and I'm assuming you know how to do it, you could use git bisect to find breaking change.

I just followed this https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/psvita.md
Before I updated xash3d with vitadb, the build was 3347.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

Is there not like a logging feature in the port?

@a1batross
Copy link
Member

The console output is the log. It can be saved to file by passing "-log" command line argument. PSVita platform code references something called Developer Mode button in LiveArea:

        // got empty args, which means that we're probably coming from LiveArea
        // construct argv based on which button the user pressed in the LiveArea launcher
        if( PSVita_GetLaunchParameter( tmp ))
        {
                if( !Q_strcmp( tmp, "dev" ))
                {  
                        // user hit the "Developer Mode" button, inject "-log" and "-dev" arguments
                        fake_argv[fake_argc++] = "-log";
                        fake_argv[fake_argc++] = "-dev";
                        fake_argv[fake_argc++] = "2";
                }
        }

It will enable verbose logging and create engine.log in game root directory.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

Dunno, what could we've changed?

Maybe it stucks resolving IPv6 master server?

Can you try entering clearmasters and then addmaster mentality.rip:27015 in console, so there is no IPv6 only masters?

Ok so it actually works now, but when I want to search again, then it does not work. It only works once until I reboot the app. When I use addmaster mentality.rip:27015, does it save it in a config or is it only temp?

@a1batross
Copy link
Member

It's temporary. Only custom master servers are saved to xashcomm.lst.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

It's temporary. Only custom master servers are saved to xashcomm.lst.

Hmm, then it was not that command that fixed it.

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

So it works once, until you reboot again, anyway to fix that too?

@SNMetamorph
Copy link
Member

So it works once, until you reboot again, anyway to fix that too?

Add string master mentality.rip:27015 to file valve/xashcomm.lst

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

So it works once, until you reboot again, anyway to fix that too?

Add string master mentality.rip:27015 to file valve/xashcomm.lst

The file does not exist, should I create it?

@SNMetamorph
Copy link
Member

So it works once, until you reboot again, anyway to fix that too?

Add string master mentality.rip:27015 to file valve/xashcomm.lst

The file does not exist, should I create it?

Yes

@Haasman0
Copy link
Author

Haasman0 commented Oct 2, 2024

So it works once, until you reboot again, anyway to fix that too?

Add string master mentality.rip:27015 to file valve/xashcomm.lst

The file does not exist, should I create it?

Yes

It did not do anything :(

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

No branches or pull requests

4 participants