FWGS / xash3d-fwgs

Xash3D FWGS engine.
1.54k stars 233 forks source link

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

Open Haasman0 opened 2 weeks ago

Haasman0 commented 2 weeks ago

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 commented 2 weeks ago

What if you enter "voice_enable 0" in console?

a1batross commented 2 weeks ago

Before joining the server, of course.

a1batross commented 2 weeks ago

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?

Haasman0 commented 2 weeks ago

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 commented 2 weeks ago

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

a1batross commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

@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 commented 2 weeks ago

@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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

Check your DNS settings then.

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

Haasman0 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

a1batross commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

Is there not like a logging feature in the port?

a1batross commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

Haasman0 commented 2 weeks ago

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

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

Haasman0 commented 2 weeks ago

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

SNMetamorph commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 :(