emukidid / swiss-gc

Swiss - The swiss army knife of GameCube homebrew
GNU General Public License v2.0
1.23k stars 93 forks source link

Unable to launch iso over FSP #757

Closed killkong1211 closed 1 year ago

killkong1211 commented 1 year ago

I just got a DOL015 today and set to work getting FSP working.

I am able to see the contents of the folder on my server from the GC and can launch the software, but after the GC Splash screen it comes up with the generic GC error message "An Error has occurred" 'Try switching off' etc.

I've got game video settings set to defaults, in SWISS & memory card emulation disabled. I can load games from the SD just not FSP, same ISO's on both for testing.

FSP is running on the same subnet under docker. My compose file: version: "3" services: fsp: image: frenskefrens/fsp-server container_name: fsp ports: - 2100:21/udp volumes: - /srv/Games/GC:/fspserver/fspdata/data

I can also see in the FSP logs I'm getting the following when Swiss tries to start a game

Tue Nov 29 09:41:36 2022 192.168.0.226 GETPRO /swiss/patches Tue Nov 29 09:41:36 2022 192.168.0.226 GETDIR // Tue Nov 29 09:41:36 2022 192.168.0.226 STAT //swiss/opening.bnr

Hoping I might just be overlooking something simple.

sral97 commented 1 year ago

I don't have any FSP set up my self, but from what I've been lurking here often such issues seem related to file/folder permissions.

killkong1211 commented 1 year ago

Yeah I was wondering that myself actually as it never seemed to write the swiss files noted in the FSP log, and I was unable to copy an ISO from SD to server via FSP just now.

killkong1211 commented 1 year ago

Also I should mention to that end I've checked the folder and permissions are set for Everyone to have modify access

j117-esc commented 1 year ago

I also just got the same FSP docker setup and tried testing with my newly acquired broadband adapter with the same 'Error Occurred' message when games are loading. Weirdly, I found two games so far that work: Animal Crossing & Mario Kart.

I am using GCLoader with firmware 2.0.0.BETA.

Extrems commented 1 year ago

Docker is not supported since it uses NAT. The in-game network stack relies upon the server being in the same broadcast domain, as the first packet is sent out using a broadcast MAC address.

j117-esc commented 1 year ago

I'm not familiar with networking but is there a reason why some titles work through the docker? So far I found the following games seem to work:

LOZ: Wind Waker Grooverider: Slot Car Thunder Animal Crossing Mario Kart Mario Party 4 (Reboots during CGI intro)

The games above do not always load so they definitely are not 100% working. I also noticed that titles that have some kind of CGI intro either don't load at all or in the case of Mario Party 4, reboots during the video or prior to the video.

Extrems commented 1 year ago

If the in-game network stack catches a ARP reply for the server's IP address from another client within the allotted time, it'll pick up its associated MAC address. So it's up to random chance.

killkong1211 commented 1 year ago

Going on what you've said Extrems this could be purely anecdotal, but I tried pushing the FSP docker into network: host and was able to boot into a game. This only worked on the first try however, so not sure if it's pure coincidence. But this was first successful netboot of a game.

Edit: As per Docker's documentation it seems that host mode does not use NAT.

Edit: Was able to launch Pokemon XD once only, tested Mario Kart as j117 had success with this, I was not able to get this to boot. All software is Aus (PAL/EU) version.

Extrems commented 1 year ago

You need layer 2 bridging. Docker will not work, period.

j117-esc commented 1 year ago

If the in-game network stack catches a ARP reply for the server's IP address from another client within the allotted time, it'll pick up its associated MAC address. So it's up to random chance.

Thanks for the explanation, that explains why games that seemed to work all of sudden stopped working.

Is there a preferred method to get FSP setup? I tried using GoobyCorp/fspd python script but it didn't work out either. I got the script placed in the location of my OMV NAS games directory, and got the swiss folder added along with the required '.FSP ' folders, but the script runs very slow when patching files and eventually I get the error 'Failed to setup the file (too fragmented?)'.

Next I tried copying over patched files my SD card to my OMV NAS, and I was able to get the game to boot, but I just got a black screen. I assume there is something going on with the speed of transferring the files as the patches themselves were getting applied, but very slowly.

Extrems commented 1 year ago

I recommend the official fspd on either a baremetal or virtual machine (that isn't Docker), in a FreeBSD jail with VNET (TrueNAS), or using RetroNAS (Raspberry Pi 4 minimum requirement).

j117-esc commented 1 year ago

Got it, I'll see how installing the official package goes as I am already on an Open Media Vault box which handles all my needs (transmission, sonarr, radarr, lidarr, ps3netsrv, etc.). I do got a few RockPro64s laying around but it seems RetroNAS only supports the raspberry pi 4 when it comes to ARM boards.

Thanks for the clarification on things!

Extrems commented 1 year ago

Make sure whatever SBC you use doesn't have a USB-based Ethernet controller. The FSP client is very sensitive to latency for good throughput.

j117-esc commented 1 year ago

I believe the RockPro64GB does not have that issue but my goal is to get everything running on my OMV NAS which shouldn't be a problem as I am using a Mini ITX Intel board (Z690I AORUS ULTRA LITE DDR4) with a LAN port that is rated up to 2500Mbps.

I'll make this work somehow, that BBA is not cheap at all so I need to justify the purchase one way or another :).

killkong1211 commented 1 year ago

@j117-esc if you managed to get it up and running please shoot through the details, I'm running an OMV box too so would be a big help I'll be giving it a try too so if I make any headway I'll do the same

j117-esc commented 1 year ago

@j117-esc if you managed to get it up and running please shoot through the details, I'm running an OMV box too so would be a big help I'll be giving it a try too so if I make any headway I'll do the same

Will do.

j117-esc commented 1 year ago

Referenced Materials

I was able to get it working, I essentially looked at how RetroNAS installed/configured FSP and followed the steps. Here are the files I referenced:

Step 1: Install Dependencies

  1. The first thing I had to do was to install missing dependencies with sudo apt install. On my system they were scons, flex, git, gcc, build-essential. You can look at install_fsp.yml to see what packages are used.

Step 2: Create Directories

  1. Create install directory: sudo mkdir -p /opt/bin/fsp/etc
  2. Create build directory: sudo mkdir -p /opt/src
  3. Change to build directory: cd /opt/src

Build and Install from Source

  1. Clone project: sudo git clone https://git.code.sf.net/p/fsp/code fsp
  2. Go inside cloned project folder: cd fsp
  3. Install FSP to install directory: sudo scons prefix=/opt/bin/fsp install

Setup Configuration Files

  1. Copy fspd configuration file from source folder to install location (assuming you are still in /opt/src/fsp): sudo cp fspd.conf /opt/bin/fsp/etc

  2. Edit fspd.conf as necessary: sudo nano /opt/bin/fsp/etc/fspd.conf Note that you can use the configuration settings provided by spd.conf.j2. Here is what I have set: ########################################### port 2121 listenaddress 0.0.0.0 packetsize 1024 homedir /srv/mergerfs/MergerFsDisks/Games/GameCube homedir_restricted no use_access_files yes permit_passwordless_owners off tmpdir ./tmp <-- I created a 'tmp' folder under my '/GameCube' folder pidlogname /tmp/fspd.pid grabcommand on vercommand on dircache 500 statcache 160 statcache_timeout 20 filecache 160 logfile ./logs/logfile <-- I created a 'logs' folder under my '/GameCube' folder log all xferlog ./logs/xferlog setuid 1000 <-- I have this set as I have folders locked down to specific users setgid 100 <-- I have this set as I have folders locked down to specific groups daemonize off ###########################################

  3. Create Systemd service for FSPD (Use fspd.service.j2 for reference): sudo nano /usr/lib/systemd/system/fspd.service Here is what I have set: ########################################### [Unit] Description=FSP File Service Protocol Documentation=http://fsp.sourceforge.net Requires=network-online.target After=network-online.target [Service] User=YourUserName(pi, admin, etc.) Type=simple Environment="PATH=/opt/bin/fsp:$PATH" ExecStart=/opt/bin/fsp/bin/fspd TimeoutStopSec=10 Restart=on-failure [Install] WantedBy=default.target ###########################################

Start and Enable FSPD Systemd Service

  1. Reload Systemd: sudo systemctl daemon-reload
  2. Start FSPD Service: sudo systemctl start fspd.service
  3. Check that status active: sudo systemctl status fspd.service
  4. Enable service so it starts up during boot: sudo systemctl enable fspd.service

Notes/Tips

Hope that helps and if you find more stable settings, please let me know.

Edit: Updated fspd.conf values with my current settings and updated Notes/Tips section with new findings on packet size 1024.

Extrems commented 1 year ago

Using a packet size larger than 1460 is no longer recommended and will only work if the server supports jumbo frames.

Extrems commented 1 year ago

I think you might have a broadcast storm problem. The BBA only has a 2 KiB receive buffer and a slower interface than the actual Ethernet link, so it's prone to overruns. I recommend using a dedicated VLAN for the GameCube.

j117-esc commented 1 year ago

So if I had a broadcast storm, wouldn't my entire network have connection issues or are you saying that the GameCube itself is experiencing a broadcast storm due to the small receive buffer? I don't know what other devices would be trying to contact the GameCube besides the FSPD service.

A few changes I made:

  1. The first thing I tried was enabling IGMP snooping on my router so that it improves network efficiency by identifying multicast groups so that packets are forwarded to the intended network device. Nothing changed but I wanted to give it a shot to see if anything changed.
  2. The next thing I did was lower the packet size on the fspd.conf file from 1460 to 1024 and this definitely made a difference. So far no games have crashed and the stuttering on videos I was experiencing before significantly reduced. Even if the video does stutter, it is minimal and would not cause the game to crash.

Another option I see on a managed switch on my network is the ability to turn on storm control by port. I might try plugging in my GamecCube here and see what values I can play with to see if it helps out any but I assume with the packet size being reduced to 1024, this helps out the BBA from being overloaded?

At some point I will setup a VLAN as I do have dozens of devices doing all sorts of things, and with everything I have been reading, VLANs are definitely recommended. Thanks for pointers, I'm not well versed on networking so any guidance is much appreciated.

killkong1211 commented 1 year ago

Was just able to test this out today myself and your solution was spot on @j117-esc You're an absolute legend.

I haven't had any issues with video stutter in my tests so far. I've tested with Pokemon XD and NFS Most Wanted, what games were you experiencing stutter with just for comparison sake.

Also I've noticed in both games I'm getting quite a bit of chirping in the audio that normally would't be there. For XD I noticed it during the opening video in the story mode. On NFS it was noticeable whilst driving and in the menus when moving between menu options (as there is an associated sound when you do).

Have you had similar behavior?

Extrems commented 1 year ago

It's not necessarily traffic targeted at the GameCube, but everything on the local link. Like ARP, DHCP, STP, mDNS, various neighbor discovery protocols, etc.

j117-esc commented 1 year ago

@killkong1211, I tested out the two games you mentioned and I have not encountered no issue in the audio. I used to have that issue when I was using a packet size value of 1460 & 1990, but ever since reducing that to 1024, I have not experienced that.

For the stuttering, I tested Baten Kaitos & Monster 4X4 - Masters of Metal as they have a heavy intro video.

@Extrems, that makes sense. Luckily everything has been really stable ever since reducing the packet size to 1024 & I'm wondering if enabling the IGMP snooping actually did something. After I restarted my router a night ago, I noticed that playing games over FSPD seem to be a bit more stable, before I was getting some minor stuttering but I rarely get that now.

killkong1211 commented 1 year ago

@j117-esc hm interesting, I tried dropping the packet size to 1024 and was still getting the chirping in my audio

j117-esc commented 1 year ago

Maybe your current copy in your OMV box is somehow corrupted? You might try replacing it with a new copy, I assume your SD version works fine?

Other than that it sounds like maybe packets are being dropped, have you tried playing the game when network traffic is low to see if it runs better?

Extrems commented 1 year ago

Fixed in c8ac3fc (r1443).