Page 1 of 1

PS2 TCP/IP observations and problems

Posted: Sat Aug 07, 2004 3:16 am
by 606u
Hi,

I made a quick and dirty PS2 streaming TCP/IP test suite and I would like to share some observations:
1) moving 80MB (40MB send and 40MB received) between PC and PS2 (there is a 100Mbit hub in between) takes about 6:45 minutes, which makes average speed of 200KBps (however up-speed is not the same as down-speed, so it is *not* 2 times 100KBps);
2) receiving 4MB on the PC side (that is 4MB send from the PS2) takes almost 4 minutes, or that is 18KBps average;
3) sending 40MB from the PC to the PS2 takes about 1:30 minutes, or about 500KBps.

It looks like traffics are quite asymmetric (when count individually), however, if the data flows in both directions PS2 to PC data moves much quicker.

Secondly, if 1st test (2x40MB) is run several times PS2 would freeze (or at least TCP/IP layer would freeze), PC client will stop and PS2 could no longer be ping'd. It is not *a rule*, but during my tests two runs were usually enough to kill the PS2.

That might be the same problem as with PS2FTPD (not possible to transfer more than a few files, because server dies) and PS2 Reality Media Player (sometimes freezes after 10-20 minutes when playing movie via network).

If someone is interested to repeat this experiment the source is available here - http://606u.dir.bg/ps2/tcpip_test/tcpip_test.tgz, about 75KB (PC-side builds with CYGWIN; for Linux a minor changes would be necessary).

The IRX files that are included are taken from ps2link-1.22.

Regards, b.

Posted: Sat Aug 07, 2004 12:48 pm
by Oobles
The ps2ip story goes back a long way.. and has been hit and miss the whole time. There are atleast four different versions of ps2ip all with differing qualities. I believe the ps2link version is the one tagged PS2IP_062 and available in CVS. This is based on the lwip code of 0.6.2.

Since that version there have been a number of attempts to improve it. Boman666 at one point provided some good updates which were incorporated and put into PS2SDK. This also brought lwip up to version 0.7.1. I do not know of anyone who has extensively tested the ps2sdk version, so to me its still of unknown quality.

The lack of unit and integration tests in our CVS code is a big problem, and is one of the things that really causes a lot of this confusion. It boils down to not having a big community with the resources in time and interest to really fix these problems.

Run your tests on the ps2sdk version and let us know of the results.

Oobles.

Posted: Sat Aug 07, 2004 6:31 pm
by 606u
Ok, I will. Here are the CVS paths I'm planning to use:

* iomanx.irx from ps2sdk/iop/system/iomanx
* ps2dev9.irx from ps2sdk/iop/dev9/dev9
* ps2atad.irx (by some reason tcpip_test.irx does not load with -203 if I skip this one?) from ps2sdk/iop/dev9/atad
* ps2ip.irx from ps2sdk/iop/tcpip/tcpip
* ps2ips.irx (altough I'm still missing the purpose of this one) from ps2sdk/iop/tcpip/tcpips
* ps2smap.irx ... could be found in ps2drv/iop/ps2smap or ps2eth/smap

Please, direct me if I should use a particular tag for any of those. Thanks.

Posted: Sat Aug 07, 2004 7:10 pm
by Oobles
Sounds good. I'd suggest using the latest head of CVS for these tests. I don't think any changes have been made to these areas since I released the ps2sdk 1.0alpha version.

the ps2ips.irx is the iop RPC server for calling ps2ip from the EE. programs that open sockets directly from the EE will be infact linking with a basic stub library on the EE which calls the methods on the IOP via ps2ips. This then calls the functions on ps2ip.irx.

There was a problem with ps2smap being ported directly into ps2sdk. Its license is GPL and is incompatible with ps2sdk. You should use the ps2eth/smap version. This corresponds with the required interfaces of ps2ip in ps2sdk.

Hope that helps,
Oobles.

Posted: Sun Aug 08, 2004 2:18 am
by 606u
Here are the new results:

(Legend :-) PS2 is the server, hence downstream is PS2 => PC and upstream is PC => PS2)

tcpip_test.elf executed via naplink, all IRX files were included in the ELF. poweroff, iomanx, ps2dev9, ps2atad & ps2ip were taken from the ps2sdk CVS and smap were from ps2eth CVS. During about half an hour test I found no problems at all with streaming TCP/IP networking :-)

1. upstream + downstream, 80MB (2x40MB), about 2:50 minutes, avg speed 490KBps, +290KBps compared to the previous time;
2. downstream, 4MB, about 3,5 seconds, avg speed 1,13MBps, +1,13MBps compared to the previous time;
3. upstream, 40MB, about 2 minutes, avg speed 350KBps, -150KBps compared to the previous time.

However, sometimes test 3 goes to 700KBps (twice the normal speed) and the ACT light on the NA lights constantly instead of pulsing as normal. I could not find a reasonable explanation about this, nor I found how to trigger that "turbo mode".

But now I have a new problem. If I load PS2HDD (the fresh one, compiled from the CVS) the orange HDD LED would light up and the PS2 would freeze on "Checking log..." debug message. I've tried zeroing the HDD and formatting the HDD with DMS HDD Format tool, but there were no change at all.

Here is napClient log for ps2drv/ee/samples/directorysample (with a minor change to load modules from the host instead of mc0:):

Code: Select all

Send execute command.
loadelf: fname host:/exec/elf secname all
loadelf version 3.30
Input ELF format filename = host:/exec/elf
0 00100000 00006a48 .
Loaded, host:/exec/elf
start address 0x100008
gp address 00000000
loadmodule: fname rom0:SIO2MAN args 0 arg 
loadmodule: id 27, ret 0
loadmodule: fname rom0:MCMAN args 0 arg 
loadmodule: id 28, ret 0
loadmodule: fname rom0:MCSERV args 0 arg 
loadmodule: id 29, ret 0
loadmodule: fname host:IOMANX.IRX args 0 arg 
Open file "IOMANX.IRX".
Local path is "D:\p\ps2\tcpip_test\irx\IOMANX.IRX".
loadmodule: id 30, ret 0
loadmodule: fname host:FILEXIO.IRX args 0 arg 
Open file "FILEXIO.IRX".
Local path is "D:\p\ps2\tcpip_test\irx\FILEXIO.IRX".
fileXio: fileXio RPC Server v1.00
Copyright (c) 2003 adresd
loadmodule: id 31, ret 0
loadmodule: fname host:PS2DEV9.IRX args 0 arg 
Open file "PS2DEV9.IRX".
Local path is "D:\p\ps2\tcpip_test\irx\PS2DEV9.IRX".

DEV9 device driver v1.0 - Copyright (c) 2003 Marcus R. Brown

dev9_driver: SPEED chip '(unknown)', revision 0x13
dev9_driver: CXD9611 (Expansion Bay type) initialized.
dev9_driver: Driver loaded.
loadmodule: id 32, ret 0
loadmodule: fname host:PS2ATAD.IRX args 0 arg 
Open file "PS2ATAD.IRX".
Local path is "D:\p\ps2\tcpip_test\irx\PS2ATAD.IRX".
ATA device driver v1.1 - Copyright (c) 2003 Marcus R. Brown
atad_driver: Driver loaded.
loadmodule: id 33, ret 0
loadmodule: fname host:PS2HDD.IRX args 11 arg -o
Open file "PS2HDD.IRX".
Local path is "D:\p\ps2\tcpip_test\irx\PS2HDD.IRX".
ps2hdd: PS2 APA Driver v1.1 (c) 2003 Vector
ps2hdd: max open = 4, 20 buffers
ps2hdd: 04:48:59 08/08/2004
ps2hdd: disk0: 0x02645f97 sectors, max 0x00100000
ps2hdd: checking log...
Sample works fine with IRX files from ps2link-1.22 and ps2sdk-1.0alpha_bin (only ps2smap.irx build locally from CVS).

Any help welcome.

Thanks in advance.

PS2: I'm using gcc-3.2.2 build by toolchain automated script.

Posted: Fri Sep 24, 2004 7:44 pm
by redcoat
My understanding, and experience, is that ps2dev9.irx and ps2hdd.irx don't play nice together. I suggest you trying excluding ps2dev9.irx from the list of modules you load.

I've experienced the same problem with ps2hdd.irx freezing on the "Checking log..." message. This also happens when I've used ps2link v1.24b--thou this has been updated recently, but I haven't tried using these updates.

Posted: Sat Sep 25, 2004 2:32 am
by mrbrown
ps2hdd relies on ps2dev9 indirectly - ps2hdd uses ps2atad which uses ps2dev9 - so if they aren't playing nice together then there's a serious problem.

I would suggest trying a previous stable release of ps2dev9, or building ps2link with the 2.8.1 IOP toolchain and not 3.2.2. If ps2link is already running, then you shouldn't be loading ps2dev9 at all since ps2link loads it for the network adapter..

Posted: Sat Sep 25, 2004 4:57 am
by redcoat
mrbrown wrote:ps2hdd relies on ps2dev9 indirectly - ps2hdd uses ps2atad which uses ps2dev9 - so if they aren't playing nice together then there's a serious problem.
ps2atad uses ps2dev9!?

So how have I been able to successfully access the HDD (directory listings, copying files to/from HDD) without having ps2dev9 loaded?

Edit: I'm using ps2link v1.22 when I refer to the HDD access.

Posted: Sat Sep 25, 2004 6:03 am
by Drakonite
redcoat wrote: So how have I been able to successfully access the HDD (directory listings, copying files to/from HDD) without having ps2dev9 loaded?

Edit: I'm using ps2link v1.22 when I refer to the HDD access.
mrbrown wrote:If ps2link is already running, then you shouldn't be loading ps2dev9 at all since ps2link loads it for the network adapter..

Posted: Sat Sep 25, 2004 6:32 am
by mrbrown
Even still, AFAIR if ps2dev9 is already loaded and you try to load it again, it should detect this and exit without trying to reinitialize anything. If that's not what it's doing perhaps someone should take a look at it?

Posted: Sat Sep 25, 2004 6:36 am
by pixel
I am not skilled at all about that, but, I'd say the following code doesn't do previous installation detection:

Code: Select all

int _start(int argc, char **argv)
{
        USE_DEV9_REGS;
        int res = 1;
        u16 dev9hw;

        printf(BANNER, VERSION);

        dev9hw = DEV9_REG(DEV9_R_REV) & 0xf0;
        if (dev9hw == 0x20) {           /* CXD9566 (PCMCIA) */
                dev9type = 0;
                res = pcmcia_init();
        } else if (dev9hw == 0x30) {    /* CXD9611 (Expansion Bay) */
                dev9type = 1;
                res = expbay_init();
        }

        if (!res) {
                if (RegisterLibraryEntries(&_exp_dev9) != 0) {
                        res = 1;
                        goto out;
                }

                /* Add dev9 fs driver for devctl().  */
                DelDrv("dev9x");
                if (AddDrv(&dev9x_fsdev) != 0) {
                        res = 1;
                        goto out;
                }

                /* Normal termination.  */
                M_PRINTF("Driver loaded.\n");
        }

out:
        return res;
}

Posted: Sat Sep 25, 2004 6:51 am
by redcoat
Gak! Another of my mistakes pointed out to me by Drakonite! :P

OK, I double-checked the ps2link v1.22 source code and yes I'm completely wrong, v1.22 does load the ps2dev9 module.

*Hangs head in shame and sobs quietly in the corner.

So...what this all means is loading ps2dev9.irx a second time (via ps2client for example) must FUBAR something up which then causes ps2hdd.irx to wedge at the "checking log..."!

Hmmm, interesting through pain, suffering, and public humilitation I've gained enlightment :D

Edit: mrbrown & pixel must have posted there comments while I was typing mine...interesting that my educated guess appears to be correct ;)

Posted: Sat Sep 25, 2004 6:52 pm
by blackdroid
uhm because ps2link already loads ps2dev9.