feat(voice): implement sceVoiceWriteToIPort #571

Closed
Phi1ow wants to merge 2 commits from upstream-pr/571 into main
Phi1ow commented 2026-10-04 22:38:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:38:47Z.


What

sceVoiceWriteToIPort was the last throwing stub in libSceVoice. It mirrors the existing
sceVoiceReadFromOPort: it checks the data and size pointers, takes the lock, and requires the
port to be an input port. There is no network, so the written frames are accepted and discarded
(the same way reads return no frames), and size is left as the amount written. shadPS4 likewise
returns ORBIS_OK without consuming anything.

Adds a CMakeLists.txt so the library can carry its guest test.

Tested

New test core/libs/tests/GuestVoice.cpp (registered as guest_voice) initializes the library,
creates a PCM input port, and writes to it.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_voice passes.
On main the stub throws not implemented, so the test aborts without the change.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4738156896 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T22:38:47Z. --- ### What `sceVoiceWriteToIPort` was the last throwing stub in `libSceVoice`. It mirrors the existing `sceVoiceReadFromOPort`: it checks the `data` and `size` pointers, takes the lock, and requires the port to be an input port. There is no network, so the written frames are accepted and discarded (the same way reads return no frames), and `size` is left as the amount written. shadPS4 likewise returns `ORBIS_OK` without consuming anything. Adds a `CMakeLists.txt` so the library can carry its guest test. ### Tested New test `core/libs/tests/GuestVoice.cpp` (registered as `guest_voice`) initializes the library, creates a PCM input port, and writes to it. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_voice` passes. On `main` the stub throws `not implemented`, so the test aborts without the change. ### 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
github-actions[bot] commented 2026-10-04 22:39:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:39:09Z.


Progress report (5fc8755 → 7a89455)

📈 System libraries: 87.11% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceVoice sceVoiceWriteToIPort
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985227784 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-5985227784). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T22:39:09Z. --- <!-- progress-report --> ### Progress report (5fc8755 → 7a89455) 📈 **System libraries**: 87.11% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceVoice | `sceVoiceWriteToIPort` | </details>
oneandonlydean commented 2026-10-04 23:43:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:59Z.


Thanks. The NID recomputes (YeJl6yDlhW0 is sceVoiceWriteToIPort), and the checks mirror sceVoiceReadFromOPort (null pointers, the lock, the port direction). The new CMakeLists follows libSceRtc's pattern, and the test fails on main where the function throws.

Two small things:

  1. The written frames now go nowhere. That's consistent with sceVoiceReadFromOPort always returning no frames on main, but together they mean that a PCM input port connected to an output port with sceVoiceConnectIPortToOPort never delivers anything, which is audio, not UI. Neither behaviour is listed in docs/dev/TechnicalDebt.md yet. Could you add a "Silent stubs" line for libSceVoice saying that ports carry no audio (writes are dropped, reads return no frames)? That covers the existing read side as well.
  2. IsInput also accepts the device port (type 0, the microphone). Writing PCM to a microphone port doesn't look meaningful, and I don't know what the console returns for it. Unless you have a source, I'd only accept the PCM and voice input ports here and throw for the device port, with a test row for it.

PPSA21564 doesn't import this function. #338 adds sceVoiceSetMuteFlag right after it in the same file; the two merge cleanly.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985702466 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-5985702466). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:59Z. --- Thanks. The NID recomputes (YeJl6yDlhW0 is sceVoiceWriteToIPort), and the checks mirror `sceVoiceReadFromOPort` (null pointers, the lock, the port direction). The new CMakeLists follows libSceRtc's pattern, and the test fails on main where the function throws. Two small things: 1. The written frames now go nowhere. That's consistent with `sceVoiceReadFromOPort` always returning no frames on main, but together they mean that a PCM input port connected to an output port with `sceVoiceConnectIPortToOPort` never delivers anything, which is audio, not UI. Neither behaviour is listed in docs/dev/TechnicalDebt.md yet. Could you add a "Silent stubs" line for libSceVoice saying that ports carry no audio (writes are dropped, reads return no frames)? That covers the existing read side as well. 2. `IsInput` also accepts the device port (type 0, the microphone). Writing PCM to a microphone port doesn't look meaningful, and I don't know what the console returns for it. Unless you have a source, I'd only accept the PCM and voice input ports here and throw for the device port, with a test row for it. PPSA21564 doesn't import this function. #338 adds `sceVoiceSetMuteFlag` right after it in the same file; the two merge cleanly.
Phi1ow commented 2026-10-06 21:52:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-06T21:52:21Z.


Done. sceVoiceWriteToIPort now accepts only the PCM and voice input ports and throws for the microphone device port, and the test creates a voice input port as well. Added a libSceVoice "Silent stubs" line covering the dropped writes and the empty reads. (The device-port throw isn't a test row: like the other throwing paths it aborts the guest process rather than returning, so it can't be a Require.) guest_voice passes here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026127053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-6026127053). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-06T21:52:21Z. --- Done. sceVoiceWriteToIPort now accepts only the PCM and voice input ports and throws for the microphone device port, and the test creates a voice input port as well. Added a libSceVoice "Silent stubs" line covering the dropped writes and the empty reads. (The device-port throw isn't a test row: like the other throwing paths it aborts the guest process rather than returning, so it can't be a Require.) guest_voice passes here.
oneandonlydean commented 2026-10-06 22:40:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:40:44Z.


Thanks for doing both points: only the PCM and voice input ports accept writes, and the libSceVoice silent-stubs line covers the dropped writes and empty reads.

One question remains, which the owner has since asked us to check on every PR: which title calls sceVoiceWriteToIPort? A silent stub is allowed only when it unblocks a title. If you know one, please name it with the log line where it stops on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026767360 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-6026767360). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T22:40:44Z. --- Thanks for doing both points: only the PCM and voice input ports accept writes, and the libSceVoice silent-stubs line covers the dropped writes and empty reads. One question remains, which the owner has since asked us to check on every PR: which title calls `sceVoiceWriteToIPort`? A silent stub is allowed only when it unblocks a title. If you know one, please name it with the log line where it stops on main.
oneandonlydean commented 2026-10-07 01:20:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T01:20:41Z.


Following up on the question above: do you know which title calls sceVoiceWriteToIPort? The code itself looks fine now; the title (with the log line where it stops on main) is the last thing needed before it can be merged.

If no title needs it yet, we'd rather close it for now and reopen it once one does.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6028820086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-6028820086). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-07T01:20:41Z. --- Following up on the question above: do you know which title calls `sceVoiceWriteToIPort`? The code itself looks fine now; the title (with the log line where it stops on `main`) is the last thing needed before it can be merged. If no title needs it yet, we'd rather close it for now and reopen it once one does.
adriadam10 commented 2026-10-07 15:47:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T15:47:43Z.

Review: CHANGES_REQUESTED


Thanks for the earlier fixes; the code and the TechnicalDebt line look fine.

  • Still open from @oneandonlydean's two questions: which title calls sceVoiceWriteToIPort? Please name it, with the log line where it stops on main. A silent stub is only accepted when it unblocks a title.
  • We couldn't find one either: Astro's Playroom doesn't import libSceVoice (only libSceVoiceChat), and PPSA21564 doesn't import this function.

If no title needs it yet, we'll close it and it can be reopened once one does.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5444776138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#pullrequestreview-5444776138). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T15:47:43Z. **Review:** CHANGES_REQUESTED --- Thanks for the earlier fixes; the code and the TechnicalDebt line look fine. - Still open from @oneandonlydean's two questions: which title calls `sceVoiceWriteToIPort`? Please name it, with the log line where it stops on `main`. A silent stub is only accepted when it unblocks a title. - We couldn't find one either: Astro's Playroom doesn't import `libSceVoice` (only `libSceVoiceChat`), and PPSA21564 doesn't import this function. If no title needs it yet, we'll close it and it can be reopened once one does.
oneandonlydean commented 2026-10-10 18:08:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:17Z.


Closing for now: the points from 2026-10-07 are still open. If you pick it back up, please comment here and it can be reopened.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100603816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/571#issuecomment-6100603816). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T18:08:17Z. --- Closing for now: the points from 2026-10-07 are still open. If you pick it back up, please comment here and it can be reopened.

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