flycast icon indicating copy to clipboard operation
flycast copied to clipboard

Broken network for NAOMI/NAOMI 2 games (regression)

Open anchounio opened this issue 2 years ago • 20 comments

Platform / OS / Hardware: Windows 10

Github hash:

Hardware: 2 i5 PC's connected in LAN.

Description of the Issue

I've connected 2 computers in LAN. Network mode for Naomi games is broken since version 3d5fd61 (09 of april). Before that it worked perfectly. The only game that still works is Alien Front. It seems this one sets up the network differently. Wave Runner GP link fails randomly since this version and later april versions. Later, in may versions, it never links. Initial D 3 and other games just stop linking since this version.

Link will always work if you manually go to test mode and exit at the same time in both computers. Anyway, this was not neccesary in 20302cd version 07-april (master) and previous versions. Linking worked automatically there.

anchounio avatar Jun 13 '22 16:06 anchounio

There might be some confusion with versions and dates because there hasn't been any change related to network between april 7th (20302cd3781eb37db637722e27c28dad2a33968e) and april 9th (3d5fd61285a2b57ed4ac7b2b25bc2b830cf43d57). The only change was on the dev branch (naomi 2 support), which was merged into master on april 16th (d732140bf9f6affe10ee300ec6cc1181d4db2329). Initial D, and Naomi 2 games in general, weren't supported on the master branch before that date.

flyinghead avatar Jun 13 '22 16:06 flyinghead

I can confirm initial D3 is not linking automatically in the last master versions. In fact I haven't found any version doing it. It requires to enter-exit Test menu on each PC at the same time.

Wave Runner link is broken since master 09 april-master version. It fails randomly. Worked perfect in 07-april-master and previous versions.

anchounio avatar Jun 13 '22 16:06 anchounio

I'm gonna check the dev versions too. Maybe I'm confusing dev versions with master versions.

anchounio avatar Jun 13 '22 16:06 anchounio

On the dev branch, the new naomi network protocol was committed on march 27 (6c38295d6277646d02c56704d9b96abf0ffeb9b6)

flyinghead avatar Jun 13 '22 16:06 flyinghead

I've just tested dev version 05-april e0058c1 with Wave Runner GP. This is the same error I got on master versions where linking doesn't work. The error shows on slave computer: https://youtu.be/IUs1sLeCRdI

anchounio avatar Jun 13 '22 17:06 anchounio

I've tried to test https://github.com/flyinghead/flycast/commit/6c38295d6277646d02c56704d9b96abf0ffeb9b6 version (dev, march 27), but I always get the same error when net loading any game: "receive error: errno 10035"

anchounio avatar Jun 13 '22 17:06 anchounio

it's a development branch so issues are to be expected, especially for such a significant change.

flyinghead avatar Jun 13 '22 17:06 flyinghead

I'll get back then to my original message here, reporting the issue with the master versions.

  • Naomi1 Wave Runner GP not linking since 3d5fd61
  • Naomi2 games not linking ever.

In all cases manually entering test menu on both PC's and then exiting at the same time will make the link work.

In the server PC, NAOMI title screen always appear a second before appearing in the client PC. Could this be related to the link failing?

anchounio avatar Jun 13 '22 17:06 anchounio

There's probably an issue on your end. The title screens should appear approximately at the same time on client and server if they're correctly synchronized.

Here is a video I took a month ago linking 2 android devices on Wave Runner GP: https://youtu.be/YL3FU2pDAw0

It sometimes take several attempts to synchronize at boot but once it's done it's quite stable.

flyinghead avatar Jun 13 '22 17:06 flyinghead

!!!!!! So it is a problem of one of my computers..... I've got to figure out how to solve this! (it would be useful for others with the same problem). I've tested about 10 master versions from march to june and they always have about one second of difference starting between master and slave computer. This is the delay: https://www.youtube.com/shorts/1569L4ruZV0

I have the same general configurations on both PC's:

1 2

anchounio avatar Jun 13 '22 18:06 anchounio

I've had no problems in making model2 emulator sync with 4 pc's, supermodel3, virtua racing in MAME, some teknoparrot games like outrun2, mario kart dx, sega rally3.....

But I found no way to fix this. Client PC simply takes a little bit more to start than server's. It's weird. The network between both PC's has no problems as well.

anchounio avatar Jun 13 '22 19:06 anchounio

Your settings look good. If clients and server PCs are on the same local network, you can disable UPnP, which can introduce some delay.

flyinghead avatar Jun 13 '22 20:06 flyinghead

I've disabled it. It still doesn't work anyway :( I think the log files look OK too.

Log file of server PC:

00:17:322 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 512MB 00:17:334 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 00007ff4804d0000 RAM(16 MB) 00007ff48c4d0000 VRAM64(8 MB) 00007ff4844d0000 ARAM(2 MB) 00007ff4a04d0000 00:17:344 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 512MB 00:17:371 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 00007ff4804d0000 RAM(32 MB) 00007ff48c4d0000 VRAM64(16 MB) 00007ff4844d0000 ARAM(8 MB) 00007ff4a04d0000 00:24:912 hw/naomi/naomi_cart.cpp:582 N[NAOMI]: NAOMI GAME ID [INITIAL D Ver.3] region fe players 1 vertical 1 00:24:912 emulator.cpp:212 N[BOOT]: Game ID is [INITIAL D Ver.3] 00:24:921 hw/naomi/naomi_flashrom.cpp:206 N[NAOMI]: EEPROM: horizontal monitor orientation 00:24:930 network/naomi_network.cpp:96 N[NETWORK]: Waiting for slave connections 00:44:932 network/naomi_network.cpp:117 N[NETWORK]: Master starting: 1 slaves 03:07:555 rend/dx11/dx11_renderer.cpp:167 N[RENDERER]: DX11 renderer terminating 03:07:561 rend/dx11/dx11context.cpp:169 N[RENDERER]: DX11 Context terminating 03:07:563 rend/dx11/dx11_shaders.cpp:681 N[RENDERER]: Saved 164 shaders to C:\Master1\FLYCAST\data\dx11_shader_cache.bin

Log file of client PC: 00:12:263 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 512MB 00:12:275 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 00007ff4c7d00000 RAM(16 MB) 00007ff4d3d00000 VRAM64(8 MB) 00007ff4cbd00000 ARAM(2 MB) 00007ff4e7d00000 00:12:285 hw/mem/_vmem.cpp:494 N[VMEM]: Info: nvmem is enabled, with addr space of size 512MB 00:12:310 hw/mem/_vmem.cpp:589 N[VMEM]: BASE 00007ff4c7d00000 RAM(32 MB) 00007ff4d3d00000 VRAM64(16 MB) 00007ff4cbd00000 ARAM(8 MB) 00007ff4e7d00000 00:18:372 hw/naomi/naomi_cart.cpp:582 N[NAOMI]: NAOMI GAME ID [INITIAL D Ver.3] region fe players 1 vertical 1 00:18:372 emulator.cpp:212 N[BOOT]: Game ID is [INITIAL D Ver.3] 00:18:379 hw/naomi/naomi_flashrom.cpp:206 N[NAOMI]: EEPROM: horizontal monitor orientation 00:18:389 network/naomi_network.cpp:165 N[NETWORK]: Connecting to server 02:31:529 rend/dx11/dx11_renderer.cpp:167 N[RENDERER]: DX11 renderer terminating 02:31:533 rend/dx11/dx11context.cpp:169 N[RENDERER]: DX11 Context terminating 02:31:534 rend/dx11/dx11_shaders.cpp:681 N[RENDERER]: Saved 150 shaders to C:\Slave2\FLYCAST\data\dx11_shader_cache.bin

anchounio avatar Jun 13 '22 20:06 anchounio

What about pressing START when the emulator tells me to do it while detecting client PC ? I never press it because it doesn't work, neither the start button assigned to the wheel controller I set up, nor the START button asigned to the keyboard or mouse. Am I missing something here? press start

anchounio avatar Jun 13 '22 20:06 anchounio

Nothing strange in your log files.

Pressing Start doesn't work with the keyboard (it's a bug). It does work if you press Start on a gamepad though. If you don't press Start, the server will wait for 30 sec and then notify the clients and start the game. It shouldn't affect the connection between client and server.

Are the client and server PC very different? Have you tried switching roles?

flyinghead avatar Jun 14 '22 08:06 flyinghead

Server PC is an Intel Core i5-2500 CPU, 3.30 GHz with 16 GB of RAM.

Client PC is an Intel Core i7-8750H, 2,20GHz with 8 GB of RAM.

Despite the GHz, difference, client PC (i7) is much faster as I've checked it MAME... but maybe for loading apps the Server PC (old i5) runs faster .....
May the diffence in RAM make a difference while loading the emulator in network ?

I'll switch roles this afternoon and inform you about the results.

anchounio avatar Jun 14 '22 12:06 anchounio

8 GB of RAM is more than enough for Flycast so it should be fine.

You don't need the same specs for client and server but if one machine is severely under-powered it will certainly cause issues.

flyinghead avatar Jun 14 '22 12:06 flyinghead

I've switched roles and the behaviour is the same. The intel core i5 PC will start the game one second before the i7. No matter if it is the server or the client.

By the way, the i7 computer is a laptop. It has never had overheating problems, never turned off, never done any strange thing.....

Both computers are running Windows 10.

To sum up:

2 computers connected in LAN, both running Windows 10 and both running on SSD hard disks

PC 1: Intel Core i5-2500 CPU, 3.30 GHz with 16 GB of RAM.

PC 2: Intel Core i7-8750H, 2,20GHz with 8 GB of RAM. It is a laptop computer.

The Intel Core i5 will always start the game a second before the Intel Core 7 PC. No matter if it is running as server or client.

anchounio avatar Jun 14 '22 17:06 anchounio

I'm installing updates for win10 in the laptop... also uninstalling useless apps.... let's see

anchounio avatar Jun 14 '22 18:06 anchounio

Nothing... the issue is still there. Running both PC's with almost no apps running the issue is still there. Pressing START doesn't fix it either. Now I really don't know what to do :(

anchounio avatar Jun 14 '22 20:06 anchounio