feat(libSceVoice): implement sceVoiceResetPort and sceVoiceWriteToIPort #4302

Closed
utkuhalis wants to merge 1 commit from upstream-pr/4302 into main
utkuhalis commented 2026-10-12 05:18:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by utkuhalis on 2026-10-12T05:18:07Z.


What

  • sceVoiceResetPort(uint32_t port_id) checks that the library is initialized and that the port exists, then returns 0. An uninitialized library or an unknown port throws, as sceVoiceDeletePort does. Ports here buffer nothing and are always READY, so there is nothing to clear; volume, mute flag, bit rate and connections stay as they are.
    • Signature from the PS4 prototype in Orbital; the PS5 export udAxvCePkUs is listed by ps5rs.
    • What a reset does comes from the vitasdk description (clears buffered data, an ACTIVE port becomes IDLE). That the other port settings survive is inferred; RPCS3's cellVoiceResetPort also only validates the port.
  • sceVoiceWriteToIPort accepts data written to a PCM or voice input port and drops it: nothing reaches a host output, so sceVoiceReadFromOPort still reports no data. The size is left as given. A null data or size pointer is an invalid argument; writing to a port that is not a PCM or voice input port throws.

Both assumptions are recorded in docs/dev/TechnicalDebt.md (the write path under silent stubs), and sceVoiceResetPort is removed from the list of PPSA23566 imports without a signature.

The new guest_voice test (registered in a new libSceVoice/CMakeLists.txt, following the other libraries) covers reset before and after init, unknown and deleted ports, settings surviving a reset, and a PCM write followed by an empty read from the connected output port.

Tested

  • The implementation comes from my fork, where it was built and tested on macOS x86-64 under Rosetta 2. Upstream's full build does not compile on macOS.
  • On this branch: check_conventions.py --base upstream/main passes; Export.cpp and GuestVoice.cpp pass clang++ -std=gnu++20 -fsyntax-only; the test, compiled on the host together with libSceVoice/Export.cpp (a small shim standing in for NotImplemented_nid_no_patch), exits 0.
  • Not built or run on Linux or Windows; CI covers those.

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

Overlap

The overlap check lists #3747, #3795, #4089 and #4165 for neighbouring lines in docs/dev/TechnicalDebt.md only. None of them implements sceVoiceResetPort or sceVoiceWriteToIPort, and they share no exports or new files with this PR. Whichever lands first, I will rebase the other side's TechnicalDebt lines.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4825236366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4302). Originally posted by [utkuhalis](https://github.com/utkuhalis) on 2026-10-12T05:18:07Z. --- ### What - `sceVoiceResetPort(uint32_t port_id)` checks that the library is initialized and that the port exists, then returns 0. An uninitialized library or an unknown port throws, as `sceVoiceDeletePort` does. Ports here buffer nothing and are always `READY`, so there is nothing to clear; volume, mute flag, bit rate and connections stay as they are. - Signature from the PS4 prototype in [Orbital](https://github.com/AlexAltea/orbital/blob/master/tools/ida/db_types.json); the PS5 export `udAxvCePkUs` is listed by [ps5rs](https://github.com/claimore22/ps5rs/blob/0df6569edcb87972226ec02c71c49506e2375f66/data/stubs/by_library/libSceVoice.txt). - What a reset does comes from the [vitasdk](https://github.com/vitasdk/vita-headers/blob/master/include/psp2/voice.h) description (clears buffered data, an ACTIVE port becomes IDLE). That the other port settings survive is inferred; RPCS3's `cellVoiceResetPort` also only validates the port. - `sceVoiceWriteToIPort` accepts data written to a PCM or voice input port and drops it: nothing reaches a host output, so `sceVoiceReadFromOPort` still reports no data. The size is left as given. A null data or size pointer is an invalid argument; writing to a port that is not a PCM or voice input port throws. Both assumptions are recorded in `docs/dev/TechnicalDebt.md` (the write path under silent stubs), and `sceVoiceResetPort` is removed from the list of PPSA23566 imports without a signature. The new `guest_voice` test (registered in a new `libSceVoice/CMakeLists.txt`, following the other libraries) covers reset before and after init, unknown and deleted ports, settings surviving a reset, and a PCM write followed by an empty read from the connected output port. ### Tested - The implementation comes from my fork, where it was built and tested on macOS x86-64 under Rosetta 2. Upstream's full build does not compile on macOS. - On this branch: `check_conventions.py --base upstream/main` passes; `Export.cpp` and `GuestVoice.cpp` pass `clang++ -std=gnu++20 -fsyntax-only`; the test, compiled on the host together with `libSceVoice/Export.cpp` (a small shim standing in for `NotImplemented_nid_no_patch`), exits 0. - Not built or run on Linux or Windows; CI covers those. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 ### Overlap The overlap check lists #3747, #3795, #4089 and #4165 for neighbouring lines in docs/dev/TechnicalDebt.md only. None of them implements sceVoiceResetPort or sceVoiceWriteToIPort, and they share no exports or new files with this PR. Whichever lands first, I will rebase the other side's TechnicalDebt lines.
github-actions[bot] commented 2026-10-12 05:18:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T05:18:28Z.


Progress report (e013f8c → 99e367b)

📈 System libraries: 86.61% (+0.06%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceVoice sceVoiceResetPort
libSceVoice sceVoiceWriteToIPort
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118228449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4302#issuecomment-6118228449). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T05:18:28Z. --- <!-- progress-report --> ### Progress report (e013f8c → 99e367b) 📈 **System libraries**: 86.61% (+0.06%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceVoice | `sceVoiceResetPort` | | libSceVoice | `sceVoiceWriteToIPort` | </details>
github-actions[bot] commented 2026-10-12 05:27:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T05:27:03Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3747 docs/dev/TechnicalDebt.md L379-380
#3795 docs/dev/TechnicalDebt.md L379-380
#4089 docs/dev/TechnicalDebt.md L49
#4165 docs/dev/TechnicalDebt.md L103-104
#4326 docs/dev/TechnicalDebt.md L49
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118314860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4302#issuecomment-6118314860). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T05:27:03Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3747 | `docs/dev/TechnicalDebt.md` [L379-380](https://github.com/boykopovar/AnyPS5/blob/8c4a295ffb7bc471a5bcee2287fd38e499d003a2/docs/dev/TechnicalDebt.md#L379-L380) | | | | #3795 | `docs/dev/TechnicalDebt.md` [L379-380](https://github.com/boykopovar/AnyPS5/blob/8c4a295ffb7bc471a5bcee2287fd38e499d003a2/docs/dev/TechnicalDebt.md#L379-L380) | | | | #4089 | `docs/dev/TechnicalDebt.md` [L49](https://github.com/boykopovar/AnyPS5/blob/8c4a295ffb7bc471a5bcee2287fd38e499d003a2/docs/dev/TechnicalDebt.md#L49) | | | | #4165 | `docs/dev/TechnicalDebt.md` [L103-104](https://github.com/boykopovar/AnyPS5/blob/8c4a295ffb7bc471a5bcee2287fd38e499d003a2/docs/dev/TechnicalDebt.md#L103-L104) | | | | #4326 | `docs/dev/TechnicalDebt.md` [L49](https://github.com/boykopovar/AnyPS5/blob/8c4a295ffb7bc471a5bcee2287fd38e499d003a2/docs/dev/TechnicalDebt.md#L49) | | |
oneandonlydean commented 2026-10-12 08:29:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:29:20Z.


Closing: PPSA23566 imports sceVoiceResetPort but no run stops in it or in sceVoiceWriteToIPort, and the write would become a silent drop. Reopen with the log line when a title reaches one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120594790 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4302#issuecomment-6120594790). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T08:29:20Z. --- Closing: PPSA23566 imports `sceVoiceResetPort` but no run stops in it or in `sceVoiceWriteToIPort`, and the write would become a silent drop. Reopen with the log line when a title reaches one.

Pull request closed

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!4302
No description provided.