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

NetPlay support? #501

Open
Revolution641 opened this issue Aug 7, 2023 · 6 comments
Open

NetPlay support? #501

Revolution641 opened this issue Aug 7, 2023 · 6 comments

Comments

@Revolution641
Copy link

Will this ever get Netplay support?

@m4xw
Copy link
Collaborator

m4xw commented Aug 8, 2023

It already has

@retropieuser
Copy link

retropieuser commented Oct 15, 2023

Screenshot 2023-10-15 at 14 35 50

Heya, does it not work on 64bit or Mac? As I get this error message when attempting to load with netplay

@wildonrio
Copy link

It already has

What platform are you on? It doesn’t work for iOS, says “Core does not support netplay”

@m4xw
Copy link
Collaborator

m4xw commented Mar 7, 2024

It already has

What platform are you on? It doesn’t work for iOS, says “Core does not support netplay”

its a compile time setting in the core and you need to hardcode the ip and spin up a server instance, hence its not officially supported yet

@fragsalat
Copy link

fragsalat commented Dec 12, 2024

I did compile it with netplay and adjusted the retroarch core info files to tell it about deterministic savestates (not sure if it really supports it). On desktop it runs fine but on my rg40xx-h I just have 1GB memory available and when starting the core with netplay, it seem to use way to much memory and gets SIGKILLed by the system. Any chance of improving this?

Edit: I see retroarch with this core uses ~300Mb in normal mode and 2.2Gb with Netplay. Any idea why that is the case and how this can be improved?

@fragsalat
Copy link

fragsalat commented Dec 15, 2024

Hey there, posting it here as well. I need some help because the core is using an tremendous amount of memory when using netplay. I did debug that a bit and boiled it down but could need your support.
First of all this seem to be retroarch internals but maybe you understand why that happens.

I have the problem that starting this core with netplay causes a memory allocation of ~2Gb which is way too much for handheld devices. I debugged that down to the netplay_init_buffers and netplay_init_serialization and currently don't know how to move on as I don't know the reasons for the code etc.
When debugging I found out that basically netplay->buffer_size = (NETPLAY_MAX_STALL_FRAMES + 2) * 2 (2 because its the host). So the buffer_size is 124. In the netplay_init_serialization function then the condition if (netplay->modus == NETPLAY_MODUS_CORE_PACKET_INTERFACE) is falsy because netplay->modus = NETPLAY_MODUS_INPUT_FRAME_SYNC (not sure where the mode is determined). Looking at the code the CORE_PACKET_INTERFACE modus seem to use 641024*2 = 128Kb per buffer (frame?) while the INPUT_FRAME_SYNC seem to use 16788288 + 1024 + 4 + 4096 = 16.8Mb as defined in size_t retro_serialize_size (void). So the 16.8Mb are allocated 124 times which leads to 2Gb memory allocation. So here are my questions:

  1. What are the different modes meant for?
  2. How is determined whether a core supports either?
  3. Why does the INPUT_FRAME_SYNC` mode require 16Mb per buffer / frame o.O?
    Is there anything I / we can do about this?

Memory dump
Screenshot 2024-12-15 212435

Thanks in advance <3

Edit: Just recognized (did oversee while debugging), the retro_serial_size is a libretro interface implemented by this core. So how did you determine the size of that and can it be shrinked somehow?

size_t retro_serialize_size (void)
{
    return 16788288 + 1024 + 4 + 4096;
}

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

No branches or pull requests

5 participants