Forum: PS2 Homebrew/Dev & Emu Scene - Topics relating to homebrew PS2 development and emulation. Stay current and up to date on the latest homebrew releases from the best devs on the scene.


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Thread: USB Mass Device driver (USBHDFSD) compatibility fix for some USB devices
  

Results 1 to 8 of 8
  1. #1 USB Mass Device driver (USBHDFSD) compatibility fix for some USB devices 
    SP193's Avatar
    SP193 is offline The fallen spartan...
    Join Date
    May 2009
    Location
    シンガポール
    Posts
    1,958
    Downloads
    0
    Uploads
    0
    Mentioned
    14 Post(s)
    Tagged
    3 Thread(s)
    Likes Given
    33
    Likes Received
    212
    Today, I plugged in my new 500GB OVATiON USB HDD into my PS2 to try it out.

    Unfortunately, not only did most (If not all) of the homebrew software (uLE, FMCB etc) out there seem to occasionally have problems detecting it without me re-plugging my disk into my PS2.... I can't play PS2 games without using discs as PS2ESDL v0.802 (BSOD after selecting a game) and OPL v0.8 (Freezes at a yellow screen, and v0.7 gives a BSOD) both fail to load any games.

    I debugged USBD, and found that by doing either of these two I could get my device working (Comments in code will describe what I changed):

    1.
    Code:
    In hubSetFuncAddressCB() of hub.c
            } else {
    		ep->hcEd.hcArea |= dev->functionAddress & 0x7F;
    		dev->deviceStatus = DEVICE_READY;
    		addTimerCallback(&dev->timer, (TimerCallback)hubPeekDeviceDescriptor, req, 80); /* SP193: Increase the delay from 10 to 80. */
    	}
    2.
    Code:
    In requestDeviceDescriptor() of hub.c
    	Endpoint *ep = req->correspEndpoint;
    	Device *dev = ep->correspDevice;
    
    	dev->staticDeviceDescEndPtr = dev->staticDeviceDescPtr;
    
    	killDevice(dev, ep); /* SP193: Reset the device first. */
    
    	doControlTransfer(ep, &dev->ioRequest,
    		USB_DIR_IN | USB_RECIP_DEVICE, USB_REQ_GET_DESCRIPTOR, USB_DT_DEVICE << 8, 0, length, dev->staticDeviceDescEndPtr,
    		requestDevDescrptCb);
    OK - although I have solved my problem by the use of workarounds, I'll like to know what my fixes really solve (Or rather, what kind of problem USBD has here), and whether anyone here has a better solution.

    Given that I don't know much about the USB OHCI specification, I can't answer this. But I'm guessing that my USB enclosure somehow isn't responding fast enough to USBD's requests.
    Last edited by SP193; 12-21-2010 at 12:19 PM.
    Unmodified SCPH-77006 with SM 3.6
    SCPH-39006 with M-chip modchip, SCPH-10281 NA and refurb Seagate 80GB HDD
    SCPH-10000 v1.00 with SCPH-10190 PCMCIA NA and SCPH-20400 HDD unit
    PS2ESDL v0.823B

    やっほー 汗がひかる♪
    Reply With Quote  

  2. #2  
    dlanor is offline Member
    Join Date
    Sep 2004
    Location
    Sweden
    Posts
    10,107
    Downloads
    5
    Uploads
    0
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)
    Likes Given
    0
    Likes Received
    126
    Quote Originally Posted by SP193 View Post
    OK - although I have solved my problem by the use of workarounds, I'll like to know what my fixes really solve (Or rather, what kind of problem USBD has here), and whether anyone here has a better solution.

    Given that I don't know much about the USB OHCI specification, I can't answer this. But I'm guessing that my USB enclosure somehow isn't responding fast enough to USBD's requests.
    Since your first modification was just to increase a response delay, I agree with your guess that the main cause for failure with the unmodified driver was that this USB HDD has response delays beyond what that driver allows for.

    Perhaps that is the explanation for why some flash drive brands are so highly inconsistent with the PS2 (like Kingston), if the average response delay of their design is somewhere close to the response delay limit of our drivers. That could cause some of their models to fail while others work fine.

    Your second modification seems more related to 'cleanup', so I'm not sure if that was really what was needed. Perhaps it simply caused a compensating delay as a side effect, thus giving the same result as the first modification.

    In choosing between the two I'd definitely prefer the first one, where the changed response timing is explicit, rather than a side effect...

    But either way it would be best if some others who are familiar with these drivers also check this out, with a view towards making a new official driver update, if that is called for. USB drive compatibility has always been a weak spot in PS2 homebrewing, so any driver fix which can improve that situation is definitely worth some effort.

    Best regards: dlanor
    Reply With Quote  

  3. #3  
    SP193's Avatar
    SP193 is offline The fallen spartan...
    Join Date
    May 2009
    Location
    シンガポール
    Posts
    1,958
    Downloads
    0
    Uploads
    0
    Mentioned
    14 Post(s)
    Tagged
    3 Thread(s)
    Likes Given
    33
    Likes Received
    212
    Quote Originally Posted by dlanor View Post
    Since your first modification was just to increase a response delay, I agree with your guess that the main cause for failure with the unmodified driver was that this USB HDD has response delays beyond what that driver allows for.

    Perhaps that is the explanation for why some flash drive brands are so highly inconsistent with the PS2 (like Kingston), if the average response delay of their design is somewhere close to the response delay limit of our drivers. That could cause some of their models to fail while others work fine.

    Your second modification seems more related to 'cleanup', so I'm not sure if that was really what was needed. Perhaps it simply caused a compensating delay as a side effect, thus giving the same result as the first modification.

    In choosing between the two I'd definitely prefer the first one, where the changed response timing is explicit, rather than a side effect...
    I too, prefer the 1st fix.
    The second one resets the device - and I have no idea what side effects it would cause... especially when the OHCI specification had stated that "resetting the devices should be avoided as some of them take a long time to be reset".

    But I should probably add that my issues only seem to occur on my unmodified SCPH-77006 console... and not on any of my fat PS2s (Both the unmodified SCPH-10000 and modified SCPH-39006 console).

    Although I had previously stated that I had only increased the delay from 10 to 80, the device performs more reliably (I don't have to remove and plug in the device again to make it "appear" to the USBD driver as often) when I set the delay to some large number like 190 instead.

    But either way it would be best if some others who are familiar with these drivers also check this out, with a view towards making a new official driver update, if that is called for. USB drive compatibility has always been a weak spot in PS2 homebrewing, so any driver fix which can improve that situation is definitely worth some effort.
    Agreed. But unfortunately, such individuals seem to be rather uncommon to meet.

    Maybe I should compile a copy of the modified driver, post it here, and see what feedback the community gives. Would that be a good idea?
    Unmodified SCPH-77006 with SM 3.6
    SCPH-39006 with M-chip modchip, SCPH-10281 NA and refurb Seagate 80GB HDD
    SCPH-10000 v1.00 with SCPH-10190 PCMCIA NA and SCPH-20400 HDD unit
    PS2ESDL v0.823B

    やっほー 汗がひかる♪
    Reply With Quote  

  4. #4  
    dlanor is offline Member
    Join Date
    Sep 2004
    Location
    Sweden
    Posts
    10,107
    Downloads
    5
    Uploads
    0
    Mentioned
    1 Post(s)
    Tagged
    2 Thread(s)
    Likes Given
    0
    Likes Received
    126
    Quote Originally Posted by SP193 View Post
    Although I had previously stated that I had only increased the delay from 10 to 80, the device performs more reliably (I don't have to remove and plug in the device again to make it "appear" to the USBD driver as often) when I set the delay to some large number like 190 instead.
    I'm not even fully sure what kind of units we're counting here (milliseconds ?).
    Nor am I sure whether this really has any significant delaying effect on other work of the PS2.
    That's one reason we'd need someone more familiar with this driver, to evaluate side effects.

    Agreed. But unfortunately, such individuals seem to be rather uncommon to meet.
    Indeed. It's been some time since we saw either Herben or radad posting here...

    Maybe I should compile a copy of the modified driver, post it here, and see what feedback the community gives. Would that be a good idea?
    Sure, why not ?

    Just make it clear (even in filename) that the driver in that download is an experimental beta.

    Best regards: dlanor
    Reply With Quote  

  5. #5  
    SP193's Avatar
    SP193 is offline The fallen spartan...
    Join Date
    May 2009
    Location
    シンガポール
    Posts
    1,958
    Downloads
    0
    Uploads
    0
    Mentioned
    14 Post(s)
    Tagged
    3 Thread(s)
    Likes Given
    33
    Likes Received
    212
    This is a prototype USBD.irx module that was modified to support USB mass storage devices (Not multi-function devices) that were previously incompatible with the PS2.

    HOWEVER, THERE MIGHT BE UNKNOWN SIDE-EFFECTS. USE IT AT YOUR OWN RISK.

    Other than applying that fix, this module was also performance-tuned (Optimized, resulting in a smaller footprint and possibly better performance).

    Maybe some PS3 users that have trouble with uLE detecting their USB devices would like to try this too?

    If you have tested this module with your incompatible USB Mass Storage Device - please post here to share with us your experience.

    Downloads/links
    Performance tuned (And fixed) USBD.irx: Download Prototype_USBD.7z from Sendspace.com - send big files the easy way
    Source code: Download Performance_Tuned_USBD_IRX.7z from Sendspace.com - send big files the easy way

    Please do NOT mirror/re-upload the files anywhere else - this is to spare newbies the pain of using something that's potentially dangerous.
    Unmodified SCPH-77006 with SM 3.6
    SCPH-39006 with M-chip modchip, SCPH-10281 NA and refurb Seagate 80GB HDD
    SCPH-10000 v1.00 with SCPH-10190 PCMCIA NA and SCPH-20400 HDD unit
    PS2ESDL v0.823B

    やっほー 汗がひかる♪
    Reply With Quote  

  6. #6  
    misfire is offline Modern Robin Hood
    Join Date
    Jul 2004
    Location
    Germany
    Posts
    139
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    1
    Likes Received
    6
    I suggest that you set up a source code repository to keep track of your changes.

    GitHub is a good choice. It also allows you to upload binaries.
    Reply With Quote  

  7. #7  
    yot
    yot is offline Member
    Join Date
    Apr 2005
    Posts
    47
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    is this the usbd.irx which is used in ps2esdl?
    tragedia4life
    Reply With Quote  

  8. #8  
    SP193's Avatar
    SP193 is offline The fallen spartan...
    Join Date
    May 2009
    Location
    シンガポール
    Posts
    1,958
    Downloads
    0
    Uploads
    0
    Mentioned
    14 Post(s)
    Tagged
    3 Thread(s)
    Likes Given
    33
    Likes Received
    212
    Quote Originally Posted by yot View Post
    is this the usbd.irx which is used in ps2esdl?
    It's used in PS2ESDL v0.804 (Private development builds) and later, and not on older builds.
    But it'll probably be used in the public v0.810 release though.

    @all: So does this fixed driver solve and create any problems?
    Some feedback on this driver would be appreciated (To see whether it's a "good" creation, or one that should be abandoned).
    Unmodified SCPH-77006 with SM 3.6
    SCPH-39006 with M-chip modchip, SCPH-10281 NA and refurb Seagate 80GB HDD
    SCPH-10000 v1.00 with SCPH-10190 PCMCIA NA and SCPH-20400 HDD unit
    PS2ESDL v0.823B

    やっほー 汗がひかる♪
    Reply With Quote  

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •