PSP as a USB HID GAMEPAD

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

Moderators: cheriff, TyRaNiD

DanielC
Posts: 40
Joined: Fri Jul 11, 2008 8:10 pm
Location: Australia

Post by DanielC »

Yeah I know aye man, sorry I know barely anything about C/C++... and nothing about PSP.... I can recognize some code elements for debugging pffft...

You've already posted what you are stuck with hey, so I honestly have no idea why nobody is interested. Which is a damn shame =(
Regards,
Daniel C
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

yeah, it really IS a shame!
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

all we need to do right know is to find out how that unknown function works. how it sends the data and in particular how we can send TWO interface descriptor.
I really don't know how one may find this out :(
The way to figure it out is to disassemble the firmware and see what it does. That's something you'll have to do, I don't think you should wait for someone else to do it for you.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

actually it IS a disassembled function (by Tyranid I think).
but since there is no doc around I was waiting for someone to help me.
User avatar
hardhat
Posts: 17
Joined: Thu Mar 02, 2006 9:42 am
Contact:

Post by hardhat »

TyRaNiD said much earlier in this thread that he no longer has any notes on the mysterious missing function, so either he or someone else will have to do that work again. If you're interested, then you should do it right away.
hnaves
Posts: 30
Joined: Tue Feb 03, 2009 3:01 am

Re: I'm back

Post by hnaves »

elynx wrote:Hello, I'm finally back on this project since I have some time to spend on it.

To let you know what is done so far, you'll see what the program "lsusb" tells me.

Here are the current results for the psp:

Code: Select all

[elynx@abo-126-43-69 sbin]$ ./lsusb -v -s 3:3

Bus 003 Device 003: ID 054c:01ca Sony Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x054c Sony Corp.
  idProduct          0x01ca
  bcdDevice            1.00
  iManufacturer           1 Sony
  iProduct                2 PSP Type C
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Connection timed out
Device Status:     0x0001
  Self Powered
And here is what It should look like (it's the result for my GP32):

Code: Select all

[elynx@localhost sbin]$ ./lsusb -v -s 1:13

Bus 001 Device 013: ID 0eb6:3241
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        16
  idVendor           0x0eb6
  idProduct          0x3241
  bcdDevice            1.00
  iManufacturer           1 GamePark
  iProduct                2 GP32
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      47
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              32
cannot read device status, Broken pipe (32)
I've modified the usbhostfs driver to obtain a HID interface
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
And now, under linux only, I get some output from usb_request:

Reqtype-----Request ----Value----- Index----- length
128--------------6----------300---------0-----------FF
128--------------6----------301------- 409----------FF
128--------------6----------300---------0------------FF
128--------------6----------302--------409----------FF
128--------------6----------600---------0------------A
128--------------6----------A00---------0------------4

basically, from what I know of the usb specs,

Reqtype=128 and Request=6 means "Descriptor request"
and the Value should be the type of the descriptor.

To get my Hid driver working, I have to send a HID Device Descriptor and a Report Descriptor, which types are 0x33 and 0x34, but has you can see, It hasn't been requested yet... Instead some strange descriptor types are requested (0x300, 0x301, 0x302, 0x600, etc...)

I'm reading the specs to figure out what are thoses descriptors, but If someone knows anything, Just let me know.

For the Endpoints, I don't know yet if I can just modify the driver to only keep one Endpoint Descriptor and to modify It so it look like
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 32
I'll try this soon and I will post the results here.

I'm Also creating a "psp hid mouse driver" which should help me figuring out how to manage HID stuff on the psp.

see you later!

[EDIT]my last pb is solved and doesn't need to appear in this post any more
I managed to implement the HID descriptor.

http://ifile.it/1qwfehc
Post Reply