Skip to content

fix(libSceVoice): return the module's initialization errors - #8059

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
KernelPanicNT:fix/voice-not-init-codes
Oct 20, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
KernelPanicNT:fix/voice-not-init-codes

Conversation

@KernelPanicNT

@KernelPanicNT KernelPanicNT commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

libSceVoice now returns the module's own errors for its initialization state: a second sceVoiceInit returns 0x804E0802, and sceVoiceStart, sceVoiceCreatePort and sceVoiceGetPortInfo return 0x804E0801 while the library is not initialized, before they look at any argument. On main all four throw.

Source of the behaviour. prosper's reading of the shipped libSceVoice.sprx, added in prosper#4473 and rated "CONFIDENCE: HIGH (read from the shipped module)":

  • "its real already-initialised code is 0x804E0802 (Init with a live context, module VA 0x14517)";
  • "every port/lifecycle entry point checks the library context first and returns SCE_VOICE_ERROR_LIBVOICE_NOT_INIT (0x804E0801) before touching any argument ... (e.g. Start 0x146e0 -> 0x14764, CreatePort 0x15d90 -> 0x15e1f, GetPortInfo 0x161b0 -> 0x161dc)".

On main:

Only the three entry points the source gives a module address for change. The other port and lifecycle calls keep throwing when the library is not initialized, so that no code is applied without its own evidence (see #4183). After initialization every argument and port check throws exactly as before. A null sceVoiceInit param still throws first, because the source does not say whether the module checks it before its state.

Changes:

  • Export.cpp: the two codes; sceVoiceInit returns 0x804E0802; Start, CreatePort and GetPortInfo check the state first.
  • guest_voice, new TestNotInitialized, run before sceVoiceInit and again after sceVoiceEnd:
    • null, invalid and valid arguments all return 0x804E0801;
    • CreatePort leaves *port_id and GetPortInfo leaves *info untouched;
    • a second sceVoiceInit returns 0x804E0802.
  • docs/dev/debt/libSceVoice.md: a new entry for what the source does not cover.

Tested

Linux (GitHub Codespace, 4 cores, native build of this branch on 7a015c094):

  • guest_voice: 5/5 runs pass.
  • Negative control: with Export.cpp from main, guest_voice aborts (sceVoiceStart: invalid argument); 5/5 pass again after restoring it.

Windows (fork CI, run 39292746672, this branch on 7a015c094): build and the full test suite pass, 1683/1683.

Checks:

Checklist

  • Based on current main (7a015c094); no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

A second sceVoiceInit returns 0x804E0802, and sceVoiceStart,
sceVoiceCreatePort and sceVoiceGetPortInfo return 0x804E0801 before
checking any argument while the library is not initialized, as the
shipped module does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestVoice.cpp

@wachi35676

Copy link
Copy Markdown
Contributor

Windows run: Windows 11 Home 26300, Ryzen 5 9600X, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. This PR merged onto main 9127ea3 (clean).

  • guest_voice passes 3/3.
  • Negative control (libSceVoice/Export.cpp from main, new test kept): it aborts (0xc0000409).
  • I checked the source at ed42e49, hle_audio.cpp L4697-L4713:
    • 0x804E0802 for Init with a live context (module VA 0x14517);
    • 0x804E0801 before any argument for Start, CreatePort and GetPortInfo (0x146e0, 0x15d90, 0x161b0).
      These match the three entry points changed here.
  • prosper says "every port/lifecycle entry point" checks the context first, but it gives addresses only for these three, so the narrower scope here follows the source.

AI-assisted: yes (Claude Code); results above were run on this machine.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 20, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
# Conflicts:
#	docs/dev/debt/libSceVoice.md
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (3fd1cc393, authorship unchanged). One debt-entry conflict with main's PausePort/ResumePort entry, unioned.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; 1672/1675 — green apart from the three known main failures (#7584 BDA, #7784 guest-memory, tessellation), none from this PR; conventions pass.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/8059
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 552fcdfbd.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 20, 2026
@oneandonlydean
oneandonlydean merged commit 661f8b7 into boykopovar:main Oct 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants