usbd_mini: restore FreeUsbd for WoC USB regression (#908) - #911
usbd_mini: restore FreeUsbd for WoC USB regression (#908)#911horizonends wants to merge 1 commit into
Conversation
OPL embeds usbd_mini; the post-b1f7ff96 rewrite breaks Wrath of Cortex over USB (TD completes never wake WaitSema). Hardware shows old FreeUsbd usbd + modern usbmass works. Give usbd_mini its own FreeUsbd sources (from 2dc6b32) and keep the SCE rewrite for full usbd. Export table stays 1.2 with stubs for reboot/report/multi-isoc.
|
Hardware confirm: OPL with this |
|
Normally, the app is designed and built with a specific SDK version in mind, which is not really what our homebrew world does because our SDK contains modules that are based on modules from different SDK versions. Sony does not change the default IOP module versions, even when they release new PS2 models. But I don't think we should be maintaining another project's dependencies in the SDK. Otherwise, we could have N copies of the source code, for N homebrew software. I excused myself from working on PS2 homebrew software for about 8 years now. I recall that the USB module code was originally in OPL's repository. Then the new maintainers probably relocated them here, to avoid duplicating the code - which IMO is a good move. But if we are going to undo that, then the correct way may be to store the code back in OPL's repository, not here. A greater concern may be whether this is a sign of instability. When I fixed the original USBD for correct operation on some console (I forgot what), I did that my comparing the logic against the assembly of the similar module. One problem is that we're not the hardware developers and built the module without Sony's support. Any hardware and software bugs or limitations are undocumented. So my solution was to make the SDK libraries work as similarly as possible to the original, to avoid such issues. |
|
There have been issues ever since this PR (#661) from 2 years ago. It's a complete rewrite / reverse engineered usbd module. Perhaps it's better to revert the entire commit, becouse the old usbd was carefully fixed over many years, but the new usbd seems totally unsupported. @uyjulian what's your thoughts? For neutrino I use my own ps2sdk neutrino branch where I revert (309ebcd) it. |
|
The only thing I really didn't like about that PR, was how the structure changed so much. So much that we cannot easily compare the 2, to have an idea what the differences are. Unless this actually meant that Sony possibly did a major rewrite too (which is possible, seeing the way MCMAN worked before and after some point at SDK 2.x). I wrote the "instability" remark because the author mentioned some hang on some internal logic, in the OPL-side PR. However, not every malfunction necessarily means we wrote bad code because games could have undetected bugs too. If @uyjulian strongly believes that this new structure and version is very much better to have, I guess we can still try to move forward with it. We just need to be sure that the I/O logic (previously in hcd.c and a little more) are correct. The PS2 has a OHCI USB controller so most of the USB logic is in hardware. |
|
If we deem that this version of USBD is good and the issue lies with this game, then I would say either:
|
|
It fixed some things (e.g. games requiring the isosynchronous interfaces) but also broke some things. It would be nice to figure out what exactly is the issue. I suspect thread stack space due to the added features but not entirely sure. Needs further debugging. (but my DTL-T system doesn't work consistently right now so slowly working on improving alternatives) |
Summary
@2dc6b32f, pre-b1f7ff96) as the implementation ofusbd_minionlyiop/usb/usbdon the SCE rewrite (HID report descriptors, multi-isochronous, etc.)usbdReboot/sceUsbdGetReportDescriptor/sceUsbdMultiIsochronousTransfer(USB_RC_NOSUPPORT/ no-op)Fixes the hardware regression in #908: Crash Bandicoot: Wrath of Cortex over USB in OPL (embeds
usbd_mini). Symptom: mid-transfer hang withfail_count=0(TD submitted, completion never wakes). Standalone usbstress does not reproduce.Isolation
b1f7ff96)So modern
usbmass_bdis fine; the rewrite’susbd_minipath is not. Many FreeUsbd-vs-rewrite A/Bs on the rewrite were tried (HCD bring-up, WDH/DoneHead, dual TD queues, embedded ED, hub flush, SetAddress timing, attach/transferedBytes, timerdelay-=1, etc.) — none restore play after the cutscene. Dead list on #908.This does not claim to fix the rewrite; it restores the known-good driver for the mini module OPL actually ships.
Related
Test plan
make -C iop/usb/usbd_minibuildsusbd_mini+ SDKusbmass_bd_mini→OPNPS2LD-freeusbd-mini.ELFstaged for hardware