fix(voiceqos): return the console's sceVoiceQoSInit argument errors #1407

Merged
hugodearaujo merged 1 commit from upstream-pr/1407 into main 2026-10-08 05:23:39 +00:00
hugodearaujo commented 2026-10-08 02:42:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:42:06Z.


What

sceVoiceQoSInit used to throw for every argument it rejected, because its error codes were unknown (TechnicalDebt). I measured them on a PS5 (firmware 13.60) by loading libSceVoiceQoS.sprx with dlopen from a homebrew payload and calling the real export. The 4 MiB block was filled with 0xAA before each call, to check whether the call writes to it.

Call Console
sceVoiceQoSEnd() before any init 0x804E0901 (LIBVOICEQOS_NOT_INIT)
null block (any size, any type) 0x804E0902 (LIBVOICEQOS_ARGUMENT_INVALID)
size 0, 1, 0x100 … 0x3FFFF 0x804E0902
size 0x40001, 0x80000, 0x100000, 0x400000, 0xFFFFFFFF 0x804E0902
type 0, 1, 0x08000000, 0x20000001, 0x30000000, 0x40000000, 0x80000000, -1 0x804E0902
size 0x40000, type 0x20000000 or 0x10000000 accepted: the call goes on into the voice service and never returns inside a payload

So the size must be exactly 0x40000, and the block is never touched when the call is refused. This branch returns 0x804E0902 in all of those cases, instead of throwing.

prosper read the same checks from the module (mem_size != 0x40000, the two app types, the null block), and they match every measured case. It also reads that the init flag is checked first and refused with 0x804E0905 (LIBVOICEQOS_INITIALIZED). That case cannot be measured, because a valid init never returns in a payload, so this branch takes it from prosper and the TechnicalDebt entry says so. The code names come from the Vita SDK error table, which uses the same 0x804E09xx VoiceQoS range.

Title: Propagation: Paradise Hotel (PPSA15878) calls sceVoiceQoSInit(block, 0x40000, 0x20000000) from one direct call site in the game executable, and branches on a nonzero result. The existing entry also names PPSA14632 (0x20000000) and PPSA26344 (0x10000000).

Tested

  • PS5 firmware 13.60, libSceVoiceQoS.sprx through dlopen: every case in the table. The probe source and the raw output are in the comment below.
  • Linux: build, libs, full CTest 408/408. guest_voice_qos now checks every refused case and the untouched block, then a valid init, then a second init.
  • Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: build, libs, CTest 0 failed of 406 (GPU execution tests skipped, the VM has no GPU).
  • Mutation check: 9 mutations (size < or == 0 instead of !=, dropping the null, type, or init-flag check, moving the init-flag check after the argument check, swapping the error code, not setting the flag) each make a guest_voice_qos variant fail.

Checklist

  • Based on current main; 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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4781051753 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1407). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-08T02:42:06Z. --- ### What `sceVoiceQoSInit` used to throw for every argument it rejected, because its error codes were unknown (TechnicalDebt). I measured them on a PS5 (firmware 13.60) by loading `libSceVoiceQoS.sprx` with `dlopen` from a homebrew payload and calling the real export. The 4 MiB block was filled with `0xAA` before each call, to check whether the call writes to it. | Call | Console | |---|---| | `sceVoiceQoSEnd()` before any init | `0x804E0901` (`LIBVOICEQOS_NOT_INIT`) | | null block (any size, any type) | `0x804E0902` (`LIBVOICEQOS_ARGUMENT_INVALID`) | | size `0`, `1`, `0x100` … `0x3FFFF` | `0x804E0902` | | size `0x40001`, `0x80000`, `0x100000`, `0x400000`, `0xFFFFFFFF` | `0x804E0902` | | type `0`, `1`, `0x08000000`, `0x20000001`, `0x30000000`, `0x40000000`, `0x80000000`, `-1` | `0x804E0902` | | size `0x40000`, type `0x20000000` or `0x10000000` | accepted: the call goes on into the voice service and never returns inside a payload | So the size must be exactly `0x40000`, and the block is never touched when the call is refused. This branch returns `0x804E0902` in all of those cases, instead of throwing. [prosper](https://github.com/mattias800/prosper/blob/debe081ed9afd1409ccfc12e01c121ce3b06f81e/prosper/src/hle/audio/hle_audio.cpp) read the same checks from the module (`mem_size != 0x40000`, the two app types, the null block), and they match every measured case. It also reads that the init flag is checked first and refused with `0x804E0905` (`LIBVOICEQOS_INITIALIZED`). That case cannot be measured, because a valid init never returns in a payload, so this branch takes it from prosper and the TechnicalDebt entry says so. The code names come from the Vita SDK error table, which uses the same `0x804E09xx` VoiceQoS range. Title: Propagation: Paradise Hotel (PPSA15878) calls `sceVoiceQoSInit(block, 0x40000, 0x20000000)` from one direct call site in the game executable, and branches on a nonzero result. The existing entry also names PPSA14632 (`0x20000000`) and PPSA26344 (`0x10000000`). ### Tested - PS5 firmware 13.60, `libSceVoiceQoS.sprx` through `dlopen`: every case in the table. The probe source and the raw output are in the comment below. - Linux: build, `libs`, full CTest 408/408. `guest_voice_qos` now checks every refused case and the untouched block, then a valid init, then a second init. - Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: build, `libs`, CTest 0 failed of 406 (GPU execution tests skipped, the VM has no GPU). - Mutation check: 9 mutations (size `<` or `== 0` instead of `!=`, dropping the null, type, or init-flag check, moving the init-flag check after the argument check, swapping the error code, not setting the flag) each make a `guest_voice_qos` variant fail. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hugodearaujo commented 2026-10-08 02:42:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:42:14Z.


Probe and raw output. It is a ps5-payload-sdk v0.43 payload (prospero-clang -O1 -rdynamic) that loads libSceVoiceQoS.sprx with dlopen. It was run several times, with the cases that could block placed last each time. The source below is the last version, and the raw output combines the runs. The runs stopped at the valid calls size=0x40000, type=0x20000000 and type=0x10000000, which never returned within 300 s and 60 s.

voiceqos_main.c
#include "../probe/probe.h"
#include <dlfcn.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef int (*InitFn)(void*, uint32_t, int32_t);
typedef int (*EndFn)(void);
static InitFn qosInit;
static EndFn qosEnd;
static unsigned char* block;
#define BLOCK_SIZE (4u << 20)
static size_t touched(void) {
    size_t last = 0;
    for (size_t i = 0; i < BLOCK_SIZE; ++i) if (block[i] != 0xAA) last = i + 1;
    return last;
}
static void tryInit(const char* label, void* mem, uint32_t size, int32_t type, int end) {
    memset(block, 0xAA, BLOCK_SIZE);
    printf("STEP init %s size=0x%x type=0x%x\n", label, size, (unsigned)type); fflush(stdout);
    int rc = qosInit(mem, size, type);
    printf("INIT|%s|size=0x%x|type=0x%x|rc=%08x|touched=0x%zx", label, size, (unsigned)type, (unsigned)rc, touched());
    if (end && rc == 0) printf("|end=%08x", (unsigned)qosEnd());
    printf("\n");
    fflush(stdout);
}
int main(void) {
    int client = probe_begin();
    if (client < 0) return 1;
    printf("STEP dlopen\n"); fflush(stdout);
    void* lib = dlopen("libSceVoiceQoS.sprx", RTLD_LAZY);
    if (!lib) { printf("dlopen failed: %s\n", dlerror()); probe_end(client); return 1; }
    qosInit = (InitFn)dlsym(lib, "sceVoiceQoSInit");
    qosEnd = (EndFn)dlsym(lib, "sceVoiceQoSEnd");
    printf("dlsym Init=%p End=%p\n", (void*)qosInit, (void*)qosEnd);
    if (!qosInit || !qosEnd) { probe_end(client); return 1; }
    block = aligned_alloc(0x10000, BLOCK_SIZE);
    static const uint32_t big[] = {0x40001, 0x40004, 0x41000, 0x80000, 0x100000, 0x400000, 0xffffffffu};
    for (size_t i = 0; i < sizeof(big) / sizeof(big[0]); ++i) tryInit("big size", block, big[i], 0x20000000, 1);
    probe_end(client);
    return 0;
}
raw output
dlsym Init=8004842d0 End=8004848b0
END|without init|rc=804e0901
INIT|null block|size=0x40000|type=0x20000000|rc=804e0902|touched=0x0
INIT|null+zero|size=0x0|type=0x20000000|rc=804e0902|touched=0x0
INIT|null+badtype|size=0x40000|type=0x0|rc=804e0902|touched=0x0
INIT|zero size|size=0x0|type=0x20000000|rc=804e0902|touched=0x0
INIT|zero+badtype|size=0x0|type=0x0|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x0|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x1|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x8000000|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x20000001|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x30000000|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x40000000|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0x80000000|rc=804e0902|touched=0x0
INIT|type sweep|size=0x40000|type=0xffffffff|rc=804e0902|touched=0x0
INIT|small+badtype|size=0x100|type=0x0|rc=804e0902|touched=0x0
INIT|unaligned +1 small|size=0x100|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x1|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x100|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x1000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x4000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x8000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x10000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x18000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x20000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x28000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x30000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x38000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x3c000|type=0x20000000|rc=804e0902|touched=0x0
INIT|size sweep|size=0x3ffff|type=0x20000000|rc=804e0902|touched=0x0
PROBE TIMEOUT: connection still open after 300s (the payload is probably stuck in the last call shown)
dlsym Init=8004842d0 End=8004848b0
INIT|type 0x10000000 size 0x3ffff|size=0x3ffff|type=0x10000000|rc=804e0902|touched=0x0
PROBE TIMEOUT: connection still open after 60s (the payload is probably stuck in the last call shown)
dlsym Init=8004842d0 End=8004848b0
INIT|big size|size=0x40001|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0x40004|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0x41000|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0x80000|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0x100000|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0x400000|type=0x20000000|rc=804e0902|touched=0x0
INIT|big size|size=0xffffffff|type=0x20000000|rc=804e0902|touched=0x0
PROBE DONE
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051082212 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1407#issuecomment-6051082212). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-08T02:42:14Z. --- Probe and raw output. It is a ps5-payload-sdk v0.43 payload (`prospero-clang -O1 -rdynamic`) that loads `libSceVoiceQoS.sprx` with `dlopen`. It was run several times, with the cases that could block placed last each time. The source below is the last version, and the raw output combines the runs. The runs stopped at the valid calls `size=0x40000, type=0x20000000` and `type=0x10000000`, which never returned within 300 s and 60 s. <details><summary>voiceqos_main.c</summary> ```c #include "../probe/probe.h" #include <dlfcn.h> #include <stdint.h> #include <stdlib.h> #include <string.h> typedef int (*InitFn)(void*, uint32_t, int32_t); typedef int (*EndFn)(void); static InitFn qosInit; static EndFn qosEnd; static unsigned char* block; #define BLOCK_SIZE (4u << 20) static size_t touched(void) { size_t last = 0; for (size_t i = 0; i < BLOCK_SIZE; ++i) if (block[i] != 0xAA) last = i + 1; return last; } static void tryInit(const char* label, void* mem, uint32_t size, int32_t type, int end) { memset(block, 0xAA, BLOCK_SIZE); printf("STEP init %s size=0x%x type=0x%x\n", label, size, (unsigned)type); fflush(stdout); int rc = qosInit(mem, size, type); printf("INIT|%s|size=0x%x|type=0x%x|rc=%08x|touched=0x%zx", label, size, (unsigned)type, (unsigned)rc, touched()); if (end && rc == 0) printf("|end=%08x", (unsigned)qosEnd()); printf("\n"); fflush(stdout); } int main(void) { int client = probe_begin(); if (client < 0) return 1; printf("STEP dlopen\n"); fflush(stdout); void* lib = dlopen("libSceVoiceQoS.sprx", RTLD_LAZY); if (!lib) { printf("dlopen failed: %s\n", dlerror()); probe_end(client); return 1; } qosInit = (InitFn)dlsym(lib, "sceVoiceQoSInit"); qosEnd = (EndFn)dlsym(lib, "sceVoiceQoSEnd"); printf("dlsym Init=%p End=%p\n", (void*)qosInit, (void*)qosEnd); if (!qosInit || !qosEnd) { probe_end(client); return 1; } block = aligned_alloc(0x10000, BLOCK_SIZE); static const uint32_t big[] = {0x40001, 0x40004, 0x41000, 0x80000, 0x100000, 0x400000, 0xffffffffu}; for (size_t i = 0; i < sizeof(big) / sizeof(big[0]); ++i) tryInit("big size", block, big[i], 0x20000000, 1); probe_end(client); return 0; } ``` </details> <details><summary>raw output</summary> ``` dlsym Init=8004842d0 End=8004848b0 END|without init|rc=804e0901 INIT|null block|size=0x40000|type=0x20000000|rc=804e0902|touched=0x0 INIT|null+zero|size=0x0|type=0x20000000|rc=804e0902|touched=0x0 INIT|null+badtype|size=0x40000|type=0x0|rc=804e0902|touched=0x0 INIT|zero size|size=0x0|type=0x20000000|rc=804e0902|touched=0x0 INIT|zero+badtype|size=0x0|type=0x0|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x0|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x1|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x8000000|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x20000001|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x30000000|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x40000000|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0x80000000|rc=804e0902|touched=0x0 INIT|type sweep|size=0x40000|type=0xffffffff|rc=804e0902|touched=0x0 INIT|small+badtype|size=0x100|type=0x0|rc=804e0902|touched=0x0 INIT|unaligned +1 small|size=0x100|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x1|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x100|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x1000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x4000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x8000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x10000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x18000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x20000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x28000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x30000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x38000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x3c000|type=0x20000000|rc=804e0902|touched=0x0 INIT|size sweep|size=0x3ffff|type=0x20000000|rc=804e0902|touched=0x0 PROBE TIMEOUT: connection still open after 300s (the payload is probably stuck in the last call shown) dlsym Init=8004842d0 End=8004848b0 INIT|type 0x10000000 size 0x3ffff|size=0x3ffff|type=0x10000000|rc=804e0902|touched=0x0 PROBE TIMEOUT: connection still open after 60s (the payload is probably stuck in the last call shown) dlsym Init=8004842d0 End=8004848b0 INIT|big size|size=0x40001|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0x40004|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0x41000|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0x80000|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0x100000|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0x400000|type=0x20000000|rc=804e0902|touched=0x0 INIT|big size|size=0xffffffff|type=0x20000000|rc=804e0902|touched=0x0 PROBE DONE ``` </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1407
No description provided.