PSPLINK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Not true, make release does not build pcterm or usbhostfs_pc ;) But then again if you could build it to begin with it really isn't hard to build with cygwin. Of course you dont actually need pcterm, you could just use putty to connect to the psp, alternatively put those VC++ skills to work and write a windows based tool to do that same thing ;)
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

:p

but thanks i'll look into putty :)
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD:
My application runs fine when I load and execute it with psplink, but when I load it from memstick it fails when it is supposed to load streaming media via wlan.

What can be the reason for this? Could it be my app chokes in the many fprintf(stdout, .....) lines which I have there for debugging purposes?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

How are you loading the wifi modules ?

Doing printfs to stdout shouldn't cause you an issue as when there is no handlers attached for printf output it should go to a dummy fileio device which just discards the data and doesn't send it anywhere. I dont immediately see that is likely to be an issue.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Found it, turns out I'm not waiting long enough for the ringbuffer to be filled which then causes an assertion. With psplink the timing is different and the buffer is usually full enough.

Many thanks for your time and magnificent dev tool! I hope some time it'll support kernel app gdb debugging tho.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well what sort of kernel apps are we talking about ? If the whole app needs kernel mode I am not sure ill ever support such a configuration, it would require too many cludges (and gdb is fairly large, with kernel memory fairly limited). However if you only want to debug the hybrid case where you have a kernel module but the main threads run as user mode ones (think an example would be an SDL app) then all I should need to do is ensure the module can be referred which is a fairly simple trick to do as it is only that fact which prevents it being used. A full kernel mode app sitting in user space has the main issue that the addresses in kernel space do not tie in with the addresses as presented in the ELF.

When it comes down to it imo all apps should really now be user mode only with kernel based support prxes if kernel mode is needed (with exports so that the user mode portion can call into it). If you want me to add support for SDL like stuff then I can do so.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD wrote:Well what sort of kernel apps are we talking about ?
It's a PMP media player where I have integrated a VLC (videolan client) to support streaming media via wifi. Yes, I can finally watch live tv on PSP without the need for additional hw :)

The app contains ME code, afaik that's the main reason why it runs in kernel mode. I don't know other reasons why the app must run in kernel mode.
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

uhm how exactly do i use putty to connect to my psp? i use it through USB not wifi since i have no wifi

(or maybe someone can post the pcterm program :D)
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

ip 127.0.0.1 port 10000 select raw and press enter
Last edited by weltall on Fri Jun 09, 2006 2:48 pm, edited 1 time in total.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

here is pcterm binary executable for windows just in case
http://www.yousendit.com/transfer.php?a ... A41D9D30D6
10011011 00101010 11010111 10001001 10111010
ahman
Posts: 22
Joined: Wed May 31, 2006 10:57 am

Post by ahman »

Hi TyRaNiD,

The original usbhostfs_pc has a compatibility issue with some homebrews, such as neogeocd. Some homebrews rely on the failed return code when trying to open a directory as normal file. Example, using sceIoOpen on a directory file will have a negative return code in PSP. However, Linux will return a valid file descriptor and this will crash some of the homebrews. I've made a quick fix in usbhostfs_pc open_file() function as follows. Maybe you'll want to add this or similar handling in usbhostfs_pc. Thanks!

PS: I noticed the lastest version # of PSPLINK is now 0.9g. However, the version that I downloaded 2 weeks ago was 0.9h. Is there something wrong with the version #? Isn't 0.9h newer than 0.9g? I'm just curious.

Code: Select all

        if(mode & PSP_O_EXCL)
        {
                real_mode |= O_EXCL;
        }

        // Added return error when trying to open directory as a file
        struct stat filestat;
        int dir = 0;
        if (stat(fullpath, &filestat) == 0) {
                if (S_ISDIR(filestat.st_mode))
                        dir = 1;
        }
        if (!dir)
                fd = open(fullpath, real_mode, mask & ~0111);
        else
                fd = -1;

        if(fd >= 0)
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well there are always going to be incompatibilities between the host driver and the ms driver primarily due to their use of different underlying file systems. Probably it would be better behaviour to not open directories with the file open call, ironically though I found out the other day that calling sceIoDopen on a file on the ms actually works which is something the host driver does not do so that is the same thing in reverse (and never will :P)

Ill fix it when I also fix the return codes, they really should be set to 0x8001XXXX where XXXX is the errno code otherwise it doesn't work correctly in newlib, not that errno is really ever of a concern to most devs.

And I wondered when someone would notice that I screwed up the version number on the latest psplink, haven't been arsed to change it ;)
moontan77
Posts: 13
Joined: Tue Jun 20, 2006 10:56 pm

Post by moontan77 »

@jockyw2001

what device are you streaming live tv from? dreambox maybe/hopefully ;) ? works great streaming from that to my wireless laptop with vlc.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

dbox2 -> neutrinoTV (VLC) -> PSP

Works great for both live TV and playback of recorded TS files. Actually you can play any format supported by VLC/ffmpeg. Dreambox will work even better for those DVB-S channels broadcasting close to 10mb (dbox2 has this 10mb nic bottleneck).

I'm streaming with 900kbs DIV3 video, 2*64kb mp3 audio and 20fps. For me quality is more than acceptable, I find it very good.

I'll release it soon. Just have to get rid of an annoying ffmpeg bug in the ogg container code.

And if psplink wouldn't exist it would probably never be released :)
moontan77
Posts: 13
Joined: Tue Jun 20, 2006 10:56 pm

Post by moontan77 »

good to hear, i had a feeling it was gonna be dreambox/dbox2 related :)

anyways keep up the good work
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

moontan77 wrote:good to hear, i had a feeling it was gonna be dreambox/dbox2 related :)
Well only because I happen to have a Dbox2 it is somewhat related. The PMPVLC player can play any livestream transcoded and casted by VLC 0.8.4a
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

Anyone found a way to get usbhostfs working in windows xp x64?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Nope, I did look around for ports of libusb to x64 and there was some around and I _could_ build one but as I do not have x64 xp at home, not do I use windows on a regular basis at home or even have a 64bit capable machine youll have to wait until someone decides to do something about it.
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

This is my first time using psplink (Only used windows debuggers) and I'm not quite sure how to debug the following...

Code: Select all

host0:/> Exception - FPU Exception (IUZ)
Thread ID - 0x0280E72B
Th Name   - user_main
Module ID - 0x039A2D1F
Mod Name  - OpenBOR
EPC       - 0x0890FAE8
Cause     - 0x0000003C
BadVAddr  - 0x00000000
Status    - 0x60008613
zr:0x00000000 at:0x0008FF00 v0:0x08980000 v1:0x092FBB50
a0:0x00000000 a1:0x08990000 a2:0x00000003 a3:0x08B33C54
t0:0x08F92030 t1:0x00000000 t2:0x09370B90 t3:0x0000000C
t4:0x00000004 t5:0x408B9800 t6:0x00000000 t7:0x00000000
s0:0x08F92030 s1:0x08B30000 s2:0x08B30000 s3:0xFFFFFFFF
s4:0x08990000 s5:0x08990000 s6:0x08B30000 s7:0x08990000
t8:0x00000000 t9:0x01BECAAE k0:0x09FFEF00 k1:0x00000000
gp:0x08993870 sp:0x09FFEB68 fp:0xFFFFFFE0 ra:0x08910024
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

using psp-addr2line is a quick way:

psp-addr2line --exe=myprogram.elf
(using the elf file you are running on psplink)

Then just enter the memory addresses and it will track down the lines (if you built with debug enabled, -g)
The addresses you want to search are the EPC which should be the line it crashed on, and the RA (return address) which should be the line that called the function that contains the crash.

so in your case:

Code: Select all

psp-addr2line --exe=openbor.elf
0x0890FAE8
something.c&#58; someline << output
0x08910024
something.c&#58; someline << output
Hope that helps.
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

Thank you TyRaNiD for the PM reply and danzel for your quick reponse! I love this tool! Problem fixed... moving on.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD, many thanks for the 1.0 release of your wonderful tool!

(Just by chance I noticed it in the news section which I normally, like many others I fear, never read)
gr8dane
Posts: 16
Joined: Thu Aug 18, 2005 11:10 am

Insight+GDB issues

Post by gr8dane »

First of all I want to thank Tyranid for making PSPLink. An awesome tool! Thank you!!

I little info about my setup.. I am using the latest PSPSDK running under Cygwin on a WinXP box.

I have PSPLink working fine using the USB method. I then wanted to try out Insight+GDB, I downloaded the sources and applied the patch.

During compile I get interesting warnings like below:

gcc -c -g -O2 -Wall -Wconversion -I"../.././tcl/win/../generic" -I"../.././tcl
/win" -mnop-fun-dllimport -mwin32 -DHAVE_NO_SEH=1 -DEXCEPTION_DISPOSITION=int
-DBUILD_tcl "../.././tcl/win/../generic/tclPosixStr.c" -o tclPosixStr.o
In file included from ../.././tcl/win/../generic/../win/tclWinPort.h:72,
from ../.././tcl/win/../generic/tclPort.h:22,
from ../.././tcl/win/../generic/tclPosixStr.c:18:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/winsock2.h:103:2: w
arning: #warning "fd_set and associated macros have been defined in sys/types.
This may cause runtime problems with W32 sockets
"

It's the warning in bold above that concerns me. I get this with several source files but the warning is identical so I have only included one here.

Everything actually compiles and I end up with both a psp-gdb.exe and a psp-insight.exe.

When I run psp-gdb.exe with my ELF file as an argument it starts up just fine.

I then do the "target remote:10001" command and this is what I get:

(gdb) target remote:10001
Remote debugging using :10001
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
(gdb)

The usbhostfs_pc.exe window shows me:
Accepting gdb connection from 127.0.0.1

I am assuming (I could be wrong) that the reason I am getting the packet errors is due to the compiler warning about the W32 sockets.

Does anybody have any idea of how to fix this?

Any help is greatly appreciated and thanks in advance!

- gr8dane


EDIT:

I solved the problem above. Getting it to compile without the W32 sockets warning was a matter of adding -D__USE_W32_SOCKETS to the tcl and tk makefiles.

As for the packet error... Well, lets just say it was user error :-)

Tyranid you rock! Should we ever meet the drinks will be on me.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Just got my 1.5 PSP (Woohooo!), can someone tell me please if there are prebuilt verions of psplink? Specifically the pc side for windows? I can't install cygwin on my box(not enough hd space) so I'd appreciate it if someone had a link.

edit-Ok I tried to install cyngwin and to my surprise it installed in less than ten minutes. And took up little diskspace. (I remember it taking hours??)
but when I ran the pcterm make file, this is all she sung,

Code: Select all


C&#58;\pspdev\psplink_1.0\pc\pcterm>make
gcc -Wall -g -DSERIAL_SUPPORT   -c -o pcterm.o pcterm.c
gcc&#58; installation problem, cannot exec 'cc1'&#58; No such file or directory
make&#58; *** &#91;pcterm.o&#93; Error 1

Did I download an old/incompatible cygwin? (I couldn't find a download link on the main site. Also searched my cygwin dir but no CC1 to be found.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Cygwin must not include all the dev stuff... Or... please tell me you are in a cygwin bash shell and not executing that crap from a windows command prompt? ...
Shoot Pixels Not People!
Makeshift Development
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

please tell me you are in a cygwin bash shell and not executing that crap from a windows command prompt?
shouldnt matter - cygwin's make always uses bash as its subshell unless you explicitly tell it not to :)
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Drakonite wrote:Cygwin must not include all the dev stuff... Or... please tell me you are in a cygwin bash shell and not executing that crap from a windows command prompt? ...
Command prompt. But the cc1 .exe is nowhere to be found in the cygwin dir so I fail to see how a change of shell will magically make it work :) But I will try, once I work out what a bash shell is.

Any idea why the installation isn't installing the C tools?
-

Could someone please e-mail the pc windows tool they've built?
[email protected] I'd really appreciate, I hate having to reboot my psp every time I make a build. Thanks.
SSpeare
Posts: 63
Joined: Tue May 23, 2006 11:45 pm
Contact:

Post by SSpeare »

Default Cygwin installation doesn't include gcc. You need to go under Development and select the gcc package to get it installed. Select the one that says something like "package to help get the right versions" or something along those lines.
Kojima
Posts: 275
Joined: Mon Jun 26, 2006 3:49 am

Post by Kojima »

Thanks, got it and it all compiled fine. But upon compiling I saw the readme for pcterm and found it out it's only for serial and wifi not usb.
Are there any pc apps for psplink like ps2client for the ps2?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

that is just a screw up in the readme, it works on usb, just build it, run up usbhostfs and run pcterm with no args and it should work ;)
Post Reply