Skip to content

usbd: fix ClearFeature pipe-id remap and IoReq byte count (#908) - #909

Closed
horizonends wants to merge 1 commit into
ps2dev:masterfrom
horizonends:fix/usbd-clear-halt-908
Closed

usbd: fix ClearFeature pipe-id remap and IoReq byte count (#908)#909
horizonends wants to merge 1 commit into
ps2dev:masterfrom
horizonends:fix/usbd-clear-halt-908

Conversation

@horizonends

@horizonends horizonends commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Restore m_transferedBytes = 0 in attachIoReqToEndpoint() (present in pre-rewrite FreeUsbd, missing after b1f7ff96)
  • Remap sceUsbdClearEndpointFeature index from pipe id → bEndpointAddress (usbmass_bd passes pipe ids; wire protocol needs ep address + USB_DIR_IN), and clear host Halted/ToggleCarry

Candidate fix for #908 (WoC over USB in OPL: multi-minute load → black screen).

Test plan

  • Hardware: OPL Beta-2245 + this usbd_mini + stock modern usbmass_bd_mini — WoC USB load/play
  • Compare vs stock modern USBD (broken) and pre-b1f7ff96 pin (known good)
  • Spot-check other USB mass usage still enumerates

Test ELF prepared locally as OPNPS2LD-v1.2.0-Beta-2245-sdk908.ELF.

After the USBD rewrite, attachIoReqToEndpoint no longer zeroed
m_transferedBytes (FreeUsbd did). Also, sceUsbdClearEndpointFeature
is commonly called with a pipe id (usbmass_bd), but wIndex must be
bEndpointAddress — remap and reset host toggle on HALT clear.

Candidate fix for Crash Bandicoot WoC USB slowdown in OPL (ps2dev#908).
@fjtrujy

fjtrujy commented Jul 29, 2026

Copy link
Copy Markdown
Member

@uyjulian can you review this PR?

@horizonends

Copy link
Copy Markdown
Author

Hardware result

This candidate does not fix #908 — it makes things worse.

On both OPL and wOPL test ELFs built with this usbd_mini change, the console could not read or write USB mass storage or memory cards at all (basic I/O broken, not the WoC-only slow-load/black-screen failure).

Closing this PR. #908 remains open; next candidates will avoid remap/clear-Halted-at-submit in doControlTransfer.

@horizonends

Copy link
Copy Markdown
Author

Closing: hardware shows this change breaks USB/MC I/O entirely rather than fixing WoC.

@horizonends

Copy link
Copy Markdown
Author

Clarifying hardware results for this closed PR:

  • OPL sdk908 ELF: WoC black screen (candidate did not fix the game; not a total loss of USB on OPL).
  • wOPL sdk908 ELF: USB stick not recognised; settings save fails (MC likely unseen).

Sorry for the earlier overstated “both lost USB+MC” summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants