libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.28k stars 1.83k forks source link

(Netplay) Host-Client ROM/Core synchronization buggy #6872

Open vencabot opened 6 years ago

vencabot commented 6 years ago

Description

Two local machines, both running RetroArch 1.7.3, with core bsnes (performance) v094, both using the same ROM, scanned into the same playlist (default filename and location, I mean), cannot initialize netplay together. I've spent all night diagnosing this bug and have come up with some interesting results.

BUG 1: All ROMs must be loaded manually, because 'filename matching' isn't working. BUG 2: When ROM and Core are loaded manually and Host is selected from Room List while in game, "a suitable core cannot be found" (even though we're currently running the core we want).

Interestingly, the game can be started if (and, as far as I can tell, only if) the Client selects the Host from the Room List before loading a game, triggering BUG 1. When the game and core are then manually loaded, afterward, the Client and Host connect successfully.

[Aside: This UI choice is bizarre and it took me a while to realize what was happening, here: when a connection fails from the Room List, RetroArch remembers this and will try to connect when content is loaded next. What's this about? How am I, as a user, supposed to realize that RetroArch is now in a state where it's waiting for me to manually load a game for the express purpose of connecting to netplay? I didn't even realize I was still in the middle of the netplay-connection process. If I change my mind and go to load any other random game, I'm given a surprising error message about netplay when I thought I was done screwing around with netplay. If the UI really wants me to manually load a file to continue with a process that I'd started, it should immediately bring up the 'load content' screen rather than just an error message.]

I began diagnosing this bug because, despite having the same version of RetroArch, the same version of the core, and the exact same ROM file, a friend and I couldn't netplay over the internet, regardless of which of us was the client or host. I've since been testing using two local machines, and the results are the same.

If, for whatever reason, this bug cannot be reproduced, please tell me what further information I can provide with regards to diagnosing this issue further.

Expected behavior

When selecting a Host from the Room List who is playing a ROM that the client has Scanned using a Core that the client has installed, Netplay should immediately start.

Actual behavior

BUG 1: If no Core or ROM is loaded, an error message appears: "Content not found, try manual load or disconnect from host."

RetroArch verbose log reports: " [INFO] [lobby] testing crc matching for: 777777777|crc [INFO] [lobby] current content crc: 0|crc [INFO] [lobby] testing filename matching for: MyRomName [INFO] [lobby] filename matching for: MyRomName failed "

How can this "filename matching" fail? The ROM by that name is in the client's recently-played-games list and is scanned into the appropriate playlist, where it can be selected and will run normally. Why isn't this working?

BUG 2: If the appropriate Core and ROM are manually loaded and the Host is subsequently selected from the Room List, an error message appears: "Couldn't find a suitable core or content file, load manually."

RetroArch verbose log reports: " [INFO] [lobby] testing CRC matching for: 777777777|crc [INFO] [lobby] current content crc: 777777777|crc [INFO] [lobby] CRC match 777777777|crc with currently loaded content [INFO] Couldn't find a suitable core "

How is this possible? I'm literally using a suitable core right now. The same exact core that the host is using.

Steps to reproduce the bug

HOST

  1. Launch RetroArch
  2. Load a ROM into a Core.
  3. Using the RetroArch UI, "Start netplay host"
  4. Wait for connections

CLIENT (BUG 1)

  1. Launch RetroArch
  2. Using the RetroArch UI, "Refresh room list"
  3. Select the appropriate Host
  4. Receive error message about having no suitable content files.

OR

CLIENT (BUG 2)

  1. Launch RetroArch.
  2. Load the appropriate ROM into the appropriate Core.
  3. Using the RetroArch UI, "Refresh room list".
  4. Select the appropriate Host.
  5. Receive error message about having no suitable cores.

Version/Commit

Environment information

inactive123 commented 6 years ago

@GregorR Can you reproduce these issues?

GregorR commented 6 years ago

None of the room/lobby/matching stuff is mine. I've never touched that code. I'm in charge from the moment netplay connects, no sooner.

The bug about it going into a "netplay connecting mode" I can diagnose tho: If you attempt a manual connection before loading the core and content, it will tell you that netplay will connect once you've loaded the core and content. I assume it's getting into that same mode when it can't find the content, but with less useful messages.

andres-asm commented 6 years ago

I can't reproduce at all. And actually it tells you "load content manually". That's the hint that tells you it's gonna connect when you do it

andres-asm commented 6 years ago

Ok I can. But only with bsnes. I think it may be a problem with the core info files because the core is not identifiable because some mismatch between info files and the core name.

[INFO] [netplay] announcing netplay game...
[INFO] [netplay] announcing netplay game...
[INFO] [netplay] announcing netplay game...
[INFO] [discovery] query received on common interface: 192.168.1.241/192.168.1.241 (theirs / ours)
[INFO] [discovery] sending reply to 192.168.1.241
[INFO] [discovery] query received on common interface: 169.254.60.10/169.254.60.10 (theirs / ours)
[INFO] [discovery] sending reply to 169.254.60.10
[INFO] [discovery] query received on common interface: 169.254.14.147/169.254.14.147 (theirs / ours)
[INFO] [discovery] sending reply to 169.254.14.147
[INFO] [netplay] announcing netplay game...
[INFO] [netplay] announcing netplay game...
[INFO] [netplay] announcing netplay game...
[INFO] [lobby] testing CRC matching for: CD80DB86|crc
[INFO] [lobby] current content crc: CD80DB86|crc
[INFO] [lobby] CRC match CD80DB86|crc with currently loaded content
[INFO] Couldn't find a suitable core
andres-asm commented 6 years ago

Yup that did the trick:

display_name = "Nintendo - SNES / Famicom (bsnes Balanced)"
authors = "byuu"
supported_extensions = "sfc|smc|bml"
corename = "bsnes/higan Balanced"
manufacturer = "Nintendo"
categories = "Emulator"
systemname = "Super Nintendo Entertainment System"
database = "Nintendo - Super Nintendo Entertainment System|Nintendo - Super Nintendo Entertainment System Hacks|Nintendo - Sufami Turbo"
license = "GPLv3"

corename = "bsnes/higan Balanced" -> this doesn't match the internal (announced) core name

If you change it to bsnes it works, which poses a new issues, the internal core name for all the bsnes cores is... bsnes, it should change depending on profile to bsnes-balanced or bsnes-performance (with the corresponding changes to the info files).

This is the problem with not having any standards :P

andres-asm commented 6 years ago

Anyway, this is not an issue here, it's an issue with the bsnes internal core name and the info files, you can close it.

vencabot commented 6 years ago

I'm sorry; I should've mentioned what core I was using (it was indeed bsnes). But does this resolve the issue with ROM names not being matched (what I was referring to as 'BUG 1')? This part, in the log file:

[INFO] [lobby] testing crc matching for: 777777777|crc [INFO] [lobby] current content crc: 0|crc [INFO] [lobby] testing filename matching for: MyRomName [INFO] [lobby] filename matching for: MyRomName failed

Although I only tried using bsnes (and SNES roms), I did try multiple SNES ROMs (Kirby Super Star and Monopoly), and they both had the same problem. Like I mentioned above, I don't see how 'filename matching' should fail when the game is scanned in on both machines. It appears to be searching for the correct filename, although it doesn't show the file extension (I don't know how RetroArch handles the searching or the log output, so this may be irrelevant). Where is it searching for the filename, if not in the scanned playlists?

andres-asm commented 6 years ago

That part I wasn't able to reproduce.

vencabot commented 6 years ago

Alright, I'll do some further investigation.

LibretroAdmin commented 2 years ago

@Cthulhu-throwaway Thoughts on this?