forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSPLinkusb not working in linux with libusb [Fix]

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
elyk1212



Joined: 08 Jun 2007
Posts: 4

PostPosted: Mon May 10, 2010 7:41 am    Post subject: PSPLinkusb not working in linux with libusb [Fix] Reply with quote

Hi folks,

Just an FYI and warning to those on Linux. I could not get psplinkusb to work, until some moderate percussive maintenance :D

(my system: Mandriva 2009.1, vmlinuz-2.6.29.6-desktop-3mnb, libusb0.1_4-0.1.12-12mdv2009.1,
Japanese PSP: 1000)

I had to modify the usbhostfs_pc source code and eliminate the vendor ID check.

The vendor id was showing up on my system as: 0x6472, while usbhostfs_pc was expecting:
#define SONY_VID (0x54C). The product ID remained the same: 0x01c9.

Of course the tool would not connect to my PSP since it would not even attempt without the correct ID numbers. I commented out the check for SONY_VID and kept the correct Product id and this fixed the problem.... several hours later I decided to look into wrestling their code lol.

Here's how libusb was reporting things:

May 8 16:58:39 localhost klogd: usb 1-1.3: New USB device found, idVendor=6472, idProduct=01c9


This could actually be an issue with my libusb version... I am not certain. But anyhow, it may be a good idea to parameterize these ID value so the user can add them on the command line. Quick fix. Maybe I'll do that since he just uses optarg stuff, which is totally nice. But maybe later.....

For now here is the simple patch. And btw I added readline by default, why would anyone not want readline searching and history? Hmm...

But anyhow if you don't want that change, just take out the readline stuff of the "patch".


Code:

[#USER#@localhost usbhostfs_pc]$ svn diff
Index: main.c
===================================================================
--- main.c   (revision 2493)
+++ main.c   (working copy)
@@ -47,10 +47,8 @@
 #include <sys/statvfs.h>
 #endif
 
-#ifdef READLINE_SHELL
 #include <readline/readline.h>
 #include <readline/history.h>
-#endif
 
 #include "psp_fileio.h"
 
@@ -260,8 +258,8 @@
 
       for(dev = bus->devices; dev; dev = dev->next)
       {
-         if((dev->descriptor.idVendor == SONY_VID)
-            && (dev->descriptor.idProduct == g_pid))
+         if((dev->descriptor.idProduct == g_pid))
+                            //&& (dev->descriptor.idVendor == SONY_VID)
          {
             hDev = usb_open(dev);
             if(hDev != NULL)
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue May 11, 2010 2:47 am    Post subject: Reply with quote

Sounds like your idstorage is fucked, you might want to fix that instead :)
Back to top
View user's profile Send private message
elyk1212



Joined: 08 Jun 2007
Posts: 4

PostPosted: Tue May 11, 2010 4:20 am    Post subject: Reply with quote

Any recommend tools? I was thinking I might have a diff id value due to having a Japan psp , but I guess they're all the same.

Thanks!
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue May 11, 2010 7:29 am    Post subject: Reply with quote

I think http://dl.qj.net/psp/homebrew-applications/keycleaner-v14.html is supposed to fix idstorage keys. However I have never personally tried it (never needed to) so use at your own risk :)
Back to top
View user's profile Send private message
elyk1212



Joined: 08 Jun 2007
Posts: 4

PostPosted: Tue May 11, 2010 10:40 am    Post subject: Reply with quote

Functionaly, is there any issues you could foresee if I left it as-is? Other than the id hiccup, I guess. I mean I haven't run into any noticeable use issues.

I'll have to read more docs on idstorage it would seem.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue May 11, 2010 11:38 am    Post subject: Reply with quote

I don't recall there being any really significant problems with a broken idstorage, at least broken in this fashion. You could leave it as is if you wanted to.
Back to top
View user's profile Send private message
elyk1212



Joined: 08 Jun 2007
Posts: 4

PostPosted: Tue May 11, 2010 2:05 pm    Post subject: Reply with quote

Thanks for all your help, and for the cool tool (usbhostfs_pc).

This is probably redundant, since I found this to be a common issue. But for search engines:

I was using a Ta-082 Japanese PSP, and idstorage was likely corrupted by a special 82 "downgrader".

Funny how common this issue is. I thought maybe I did something extraordinarily sweet to break stuff :P.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group