Skip to content

feat(libSceVoiceQoS): keep connection attributes and read stored attributes back - #8656

Closed
nikowolf123 wants to merge 1 commit into
boykopovar:mainfrom
nikowolf123:feat/voiceqos-attributes
Closed

nikowolf123 wants to merge 1 commit into
boykopovar:mainfrom
nikowolf123:feat/voiceqos-attributes

Conversation

@nikowolf123

@nikowolf123 nikowolf123 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

sceVoiceQoSSetConnectionAttribute threw not implemented. It now stores attributes per connection through the locked SetAttribute helper that sceVoiceQoSSetLocalEndpointAttribute and sceVoiceQoSSetRemoteEndpointAttribute use. sceVoiceQoSGetRemoteEndpointAttribute and sceVoiceQoSGetConnectionAttribute, which threw for every call, now read back what the two setters stored, through the GetAttribute helper of sceVoiceQoSGetLocalEndpointAttribute; for an attribute that was never set or was cleared they still throw.

  • sceVoiceQoSSetConnectionAttribute(connectionId, attributeId, value, size) stores size bytes from value for that connection. A non-positive size clears the attribute and returns 0, as the endpoint setters do.
  • sceVoiceQoSGetRemoteEndpointAttribute(remoteId, attributeId, value, size) and sceVoiceQoSGetConnectionAttribute(connectionId, attributeId, value, size) copy at most size bytes of a stored attribute and zero-fill the rest of the buffer, as the local getter does.
  • For an attribute that was never set, or was cleared by a non-positive size, both getters write nothing and call NotImplemented_nid_no_patch(__func__) once the library lock is released, because what the console reports there is unknown. A new GetStoredAttribute helper reads through GetAttribute but reports an unset attribute instead of zero-filling, so GetAttribute and sceVoiceQoSGetLocalEndpointAttribute, which reads such an attribute as zeros since feat(libSceVoiceQoS): implement packet and local endpoint attribute functions to unblock Aliens: Fireteam Elite #7727, are unchanged.
  • Errors: 0x804E0901 (not initialized) before sceVoiceQoSInit and after sceVoiceQoSEnd; 0x804E0902 (ARGUMENT_INVALID) for an unknown id or a null value, and from a getter also for size <= 0. A getter checks these before it looks at the attribute, so they are also returned for an unset attribute. No output is written on an error.
  • Each connection has its own attributes, also when two connections join the same endpoints. sceVoiceQoSConnect starts them empty; sceVoiceQoSDisconnect and sceVoiceQoSEnd drop them. Deleting a remote endpoint drops its attributes, as before.

Why the getters stay partly unimplemented: #7321 kept them as throwing stubs because "endpoint and connection attribute storage is unverified on hardware", and AGENTS.md forbids a made-up success. This PR keeps the read it has no source for, the value of an attribute nobody stored, on NotImplemented_nid_no_patch. It only reads back what the library's own setters stored, with the storage model that the merged setters (#6026, #7231) and GetAttribute (#7727) already use. tools/progress.py therefore counts only sceVoiceQoSSetConnectionAttribute as newly done.

Sources:

Unverified, recorded in a new Functional entry in docs/dev/debt/libSceVoiceQoS.md: what the console reports for an attribute that was never set or was cleared (both getters throw there), which attribute ids it accepts on each object (any id is accepted here; in RPCS3's PS Vita enumeration id 4 is DESIRED_OUT_BIT_RATE), whether it checks a value or its size, and how it reads a stored attribute into a buffer of another size. Nothing here was measured on a PS5, and this PR names no title that makes these three calls. PPSA04159 imports sceVoiceQoSSetConnectionAttribute, which is why #4314 exported it as a stub; no call to it is known, so Unblocks stays none.

Other debt edits: the sceVoiceQoSSetConnectionAttribute entry (throwing stub, signature unknown) is removed. The firmware exports entry is cut to sceVoiceQoSGetStatus and the six parameterless calls; its sentence that the two getters "remain throwing stubs as endpoint and connection attribute storage is unverified on hardware" goes with them, and the new entry records what is still unverified and which reads still throw. In the sceVoiceQoSInit entry, Aliens: Fireteam Elite (PPSA03393) now "uses the calls named above" instead of "all implemented calls", because that wording would now include the calls changed here.

Open #6044 renames core/libs/tests/GuestVoiceQoS.cpp to core/libs/tests/media/GuestVoiceQoS.cpp; whichever of the two lands second rebases.

Tested

  • Linux: WSL2 Ubuntu 26.04, GCC 15.2.0, Release, BUILD_TESTING=ON. Built the libSceVoiceQoS and guest_voice_qos_tests targets; ctest -R '^guest_voice_qos' runs guest_voice_qos and guest_voice_qos_app_type_0x10000000, and both pass, also at 8e2de02 on main 2c4b116.
  • GuestVoiceQoS.cpp now checks: both getters throw <function name> not implemented for an attribute never set and for one cleared by a non-positive size, without writing the buffer; their argument errors (null value, size 0, size -1, unknown id) return 0x804E0902 with the output left untouched while the attribute is unset; a remote attribute read back, and the error after the remote endpoint is deleted; a 2-byte read of a connection attribute that leaves the rest of the buffer alone and an 8-byte read that zero-fills it; a second connection between the same endpoints that starts unset, reads back its own value and leaves the first one's unchanged; both connection calls failing after sceVoiceQoSDisconnect; the setter's null value and unknown-id errors, size 0 clearing the attribute and size -1 accepted; after sceVoiceQoSEnd, the three calls return 0x804E0901 without writing, and a connection attribute set before sceVoiceQoSEnd is gone after a new sceVoiceQoSInit. These replace the two NotImplemented checks for the remote and connection getters.
  • The same test file against main's library (main 2185dbf plus only this GuestVoiceQoS.cpp): both tests abort with what(): sceVoiceQoSGetRemoteEndpointAttribute not implemented.
  • tools/check_conventions.py --base origin/main: 0 errors and one debt-length warning for the sceVoiceQoSInit entry, which is 1702 characters, as on main; this PR changes one phrase in it. The new entry is 982 characters.
  • tools/progress.py --module libSceVoiceQoS: 16 of 25 functions done (15 on main); sceVoiceQoSSetConnectionAttribute is the new one. sceVoiceQoSGetRemoteEndpointAttribute and sceVoiceQoSGetConnectionAttribute stay todo, because their unset path calls NotImplemented_nid_no_patch.
  • Windows: not built.
  • No title was run.

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 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

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Progress report (cecb540 → 8e2de02)

📈 System libraries: 42.11% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceVoiceQoS sceVoiceQoSSetConnectionAttribute

@ycbuzi

ycbuzi commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Windows run of d81593d merged onto main ec7eacc (9cab18f552, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceVoiceQoS and guest_voice_qos_tests with no errors or warnings; ctest --repeat until-fail:2 on guest_voice_qos and guest_voice_qos_app_type_0x10000000: each passes on both repeats. Not run: the negative control against main's library, a title.

…ibutes back

sceVoiceQoSSetConnectionAttribute threw "not implemented". It now stores
the attribute through the locked SetAttribute helper that the endpoint
setters use, and each connection keeps its own attributes from
sceVoiceQoSConnect until sceVoiceQoSDisconnect or sceVoiceQoSEnd. As for
the endpoint setters, an unknown id or a null value returns 0x804E0902,
a non-positive size clears the attribute, and the call returns
0x804E0901 before sceVoiceQoSInit.

sceVoiceQoSGetRemoteEndpointAttribute and
sceVoiceQoSGetConnectionAttribute now read back what
sceVoiceQoSSetRemoteEndpointAttribute and
sceVoiceQoSSetConnectionAttribute stored, through the GetAttribute
helper of sceVoiceQoSGetLocalEndpointAttribute: at most size bytes are
copied and the rest of the buffer is zero-filled, an unknown id, a null
value or a non-positive size returns 0x804E0902, and 0x804E0901 comes
before sceVoiceQoSInit. What the console reports for an attribute that
was never set or was cleared is unknown, so for it both getters still
call NotImplemented_nid_no_patch without writing the buffer; the local
getter keeps its zero-fill.

The signatures are the PS4 SDK prototypes in Orbital's
tools/ida/db_types.json (lines 2436, 2440 and 2444 at b321fcd), which
mark the remote getter's value pointer const; it receives the attribute
here, as in the local getter. The unknowns are recorded in the library's
debt file.

GuestVoiceQoS checks that both getters report not implemented under
their own names for an attribute never set or cleared and leave the
buffer untouched, that their argument errors come first, a remote
attribute read back, a short and a long read of a connection attribute,
that a second connection between the same endpoints keeps its own
attributes, every error path with the output left untouched, that
Disconnect, End and deleting the remote endpoint drop the attributes,
and the not-initialized result after End.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nikowolf123
nikowolf123 force-pushed the feat/voiceqos-attributes branch from d81593d to 8e2de02 Compare October 21, 2026 15:10
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 22, 2026
@akkadbakkad89

Copy link
Copy Markdown
Contributor

Cross-checked these against a decrypted libSceVoiceQoS.sprx (firmware 4.03) — the attribute surface is narrower and typed, not generic key-value storage:

Local endpoint (sceVoiceQoSGetLocalEndpointAttribute @0x1530, ...SetLocal...@0x1460): localId must be 0; attributes 0-3 only for the setter (0/2 = 4-byte float via vmovss, 1/3 = 1-byte via movzx), written through PLT accessors into two port objects (globals near 0xd4f4/0xd4f8) — i.e. volume/mute on real voice ports, matching the maintainer's "throw until voice-port volume/mute forwarding" note in the debt file. The getter accepts attrs 0-8, but 4 and 7 jump to the 0x804E0902 path; 5 (size 1), 6 (size 4), 8 (size 2) read read-only sub-fields 1001/1002/1003 of the port objects.

Remote endpoint (set @0x1300, get @0x13b0): remoteId bounds are 0 <= id < 7|15 from the flags & 0x1008 app-type test; only attribute 7, size 1, byte valid, on per-remote 0x844-byte records.

Connection (get @0x1980, set @0x1660): connectionId same bounds; attributes 4 and 9, size 4 (dword fields on 0x160-byte connection records) — any other attr is 0x804E0902. So SetConnectionAttribute accepting arbitrary attrIds/sizes diverges from firmware.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@nikowolf123 I checked akkadbakkad89’s firmware 4.03 report against 8e2de02. It changes my assessment: the generic byte-map behavior is broader than the reported API. Connection attributes are reported as IDs 4 and 9 with size 4; the remote surface is attribute 7 with size 1. The current code accepts arbitrary IDs and sizes, and the tests require remote attribute 3 plus partial or oversized connection reads to succeed. Please reconcile those paths with the reported typed validation, preserve unsupported voice-port behavior where its semantics are still unknown, and replace the generic round-trip assumptions with supported typed cases and invalid-argument checks. Please also remove the new ReportsNotImplemented assertions that pin unset attributes to an unimplemented throw. Current main already contains typed local/remote validation, so the rebase should retain it and its debt rather than restoring the old generic setters. I have not independently run the firmware module; the report is the new evidence being checked here.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@nikowolf123 This PR now conflicts with main in core/libs/prx/libSceVoiceQoS/Export.cpp, core/libs/tests/GuestVoiceQoS.cpp, docs/dev/debt/libSceVoiceQoS.md. Main’s VoiceQoS connection and attribute implementation overlaps this PR’s stored-attribute and connection logic. Main now requires each exported function to be declared once, in the library's public header (checked by the public_headers tests). Could you reconcile the connection lifecycle and attribute behavior with the implementation now on main?

@akkadbakkad89

Copy link
Copy Markdown
Contributor

Heads-up on overlap: #14277 implements sceVoiceQoSGetLocalEndpointAttribute from the 4.03 libSceVoiceQoS.sprx export (eZu2RP0Ma3w#D#A). The module's actual behavior differs from the stored-attribute model this PR assumes for the endpoint getters: after the init check it requires localId == 0 and non-null output, accepts only selectors 0-3, 5, 6, 8 (4 and 7 are always invalid) with fixed sizes 4/1/4/1/1/4/2, and valid reads forward to voice-port parameter getters keyed by two global port handles rather than reading back bytes stored by the setters. sceVoiceQoSSetLocalEndpointAttribute similarly forwards to port-parameter setters instead of storing. If this PR is revived it will need rebasing onto the current Export.cpp (the base revision's store-and-read-back model no longer exists on main) and aligning the getter paths with the module's port-forwarding semantics.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thank you for your work on this. Main has moved, and the PR now conflicts in:

  • core/libs/prx/libSceVoiceQoS/Export.cpp
  • core/libs/tests/GuestVoiceQoS.cpp
  • docs/dev/debt/libSceVoiceQoS.md

Could you merge current main into your branch or rebase onto it, keeping the existing review fixes? The points from our earlier review are also still open.

Thank you!

@oneandonlydean oneandonlydean added the stale Conflicting with main and no activity for 7 days label Nov 1, 2026
@github-actions github-actions Bot removed the stale Conflicting with main and no activity for 7 days label Nov 11, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@nikowolf123 I read 8e2de02. Removing the SetConnectionAttribute stub is wanted, since PPSA04159 imports it and fails to load without it. The generic byte store is the part I would change.

The branch now conflicts with main in Export.cpp, tests/GuestVoiceQoS.cpp and docs/dev/debt/libSceVoiceQoS.md. Main rewrote the model (typed local setter, endpointLimit, declarations in Api.hpp) and this PR is built on the removed std::map store, so it needs a real rebase onto main's guards.

@akkadbakkad89's firmware 4.03 report shows the console accepts only connection attributes 4 and 9 at size 4, and remote attribute 7 at size 1. Please accept exactly those, return ARGUMENT_INVALID otherwise, keep unsupported voice port paths throwing, and drop the arbitrary size tests and the ReportsNotImplemented asserts. Update the debt doc to match. I will review the new head.

@github-actions

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 22619 core/libs/prx/libSceVoiceQoS/Export.cpp
core/libs/tests/GuestVoiceQoS.cpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The change adds per connection attributes and reads back stored remote and connection attributes at head 8e2de02b9ad8cc1458b3b00ca6d9346f37c549f3; no concrete defect was verified, though behavior remains unverified on console hardware.

What I ran

No commands or tests were run. I read the prepared diff and changed files through repo_read.py.

Results

Check Result Note
Source review passed Changed implementation and tests read
Build and tests not run Only author reported results are available
Console behavior not run No title or console run was reported

Negative control

Not run by this review. The description reports that the updated test file aborts against the main library, but that result was not independently checked.

Findings

Blocking

None verified.

Non-blocking

  • The pointer signature for sceVoiceQoSGetRemoteEndpointAttribute differs from the cited PS4 SDK prototype, and console behavior is not verified. The PR documents the inference that the pointer is an output, following the local getter. Retain that limitation until validated against console behavior. Changed lines: core/libs/prx/libSceVoiceQoS/Export.cpp:196.

Sources

  • Changed implementation: core/libs/prx/libSceVoiceQoS/Export.cpp.
  • Changed tests: core/libs/tests/GuestVoiceQoS.cpp.
  • Changed behavior notes: docs/dev/debt/libSceVoiceQoS.md.

Not verified

  • Build, tests, Windows, and PS5 console behavior were not run in this review. The description reports Linux build and test success, but that is author supplied.
  • Read all three changed files listed as reviewed in manifest.json. No files were excluded (files.json was not present in the prepared material read here).

To get this to a good state

Nothing is required. The pointer direction and unset attribute behavior remain documented as unverified on hardware.

@nikowolf123

Copy link
Copy Markdown
Contributor Author

Superseded: 35e7ddd on main implements the connection attributes from the PS4 module, and the remote endpoint setter this getter read back no longer stores anything.

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

Labels

docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants