Open-PS2-Loader icon indicating copy to clipboard operation
Open-PS2-Loader copied to clipboard

[FR] udpbd support

Open DanTheMan827 opened this issue 4 years ago • 9 comments

From what I understand, SMB uses a lot of the IOP memory resulting in some games crashing.

Wouldn't it be possible to make a custom protocol that takes less memory and doesn't have as much overhead?

Something without authentication or writing that has only a couple commands like:

List games Select game Read bytes x from offset x

I would personally much rather prefer a protocol with better game compatibility that requires a small server app than one that doesn't need a custom server but isn't as compatible with games.

DanTheMan827 avatar Oct 27 '20 17:10 DanTheMan827

The most basic and memory saving thing would be to simply transfer ethernet frames (like https://sourceforge.net/projects/etherdfs/ does for DOS PCs) - but it's so basic that it lacks the required throughput for PS2. And it requires a custom programme on the server side. So you'd have to invent a protocol (maybe adapt ATA-over-ethernet or something similar) and write client and server.

Faster and easier would be something like NBD (Network Block Device). It is standardized, and there are already client and server implementations. But only for Linux, which would leave quite some OPL users behind.

Here (https://github.com/ps2homebrew/Open-PS2-Loader/issues/86) is something in the works that could cut the required space for SMB in half. I believe that's the most promising track.

citronalco avatar Oct 27 '20 20:10 citronalco

At the moment, udpbd is a lighter weight protocol which has been implemented and works correctly independently, but it does not work correctly when used with OPL. Progress is in GitLab SaaS in ps2max/Open-PS2-Loader repo in bdm-2020 branch.

uyjulian avatar Nov 06 '20 06:11 uyjulian

UDPBD (UDP Block Device) is designed specifically for the PS2. It aligns the data inside each packet so that the IOP can use DMA to transfer 128byte blocks directly from the network cards fifo into the application buffer. The protocol is very simple and defined here (inside the modified SMAP driver): https://gitlab.com/ps2max/ps2sdk/-/blob/udpbd/iop/network/smap/src/udpbd.h And here (inside the pc/server side test application: https://gitlab.com/ps2max/udpbd-server/-/blob/master/udpbd.h

Consider it a proof of concept that was never finished into something usefull. It worked a few yeas ago, but I'm not sure it will still compile and run with all the changes there have been to ps2sdk. IOP CPU and memory usage was very low. And speeds (for the first time ever I think) where true 100Mbps.

rickgaiser avatar Nov 07 '20 09:11 rickgaiser

udpbd sounds exactly like what I was describing

DanTheMan827 avatar Nov 09 '20 23:11 DanTheMan827

@citronalco there is https://cloudbase.it/ceph-for-windows/ and other, btw i quite finish the nbd server on OPL.

bignaux avatar Apr 22 '21 14:04 bignaux

Since NBD server is merged in OPL, i invite you to setup a nbd client and try it!

bignaux avatar May 15 '21 09:05 bignaux

The samba improvements in recent versions did fix compatibility with a game that previously didn't work (Amplitude)

DanTheMan827 avatar May 17 '21 17:05 DanTheMan827

@rickgaiser : it could be good to have udpbd to replace smb but what about turn it to a compliant tftp client ?

bignaux avatar Sep 09 '21 10:09 bignaux

udpbd uses a special alignment (2 bytes extra to align the data to a 4 byte boundary), that make it incompatible with all standard protocols. But basically it's UDP with 2 dummy bytes, making (zero copy) DMA tansfers possible.

rickgaiser avatar Sep 09 '21 11:09 rickgaiser