feat(libSceVoice): implement mute-all, bitrate and port update #8989

Merged
simonbronk merged 2 commits from upstream-pr/8989 into main 2026-10-22 23:13:14 +00:00
simonbronk commented 2026-10-21 08:46:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T08:46:54Z.


What

Implements 3 libSceVoice exports that threw, on the existing port model:

  • sceVoiceSetMuteFlagAll(bool): a library-wide flag that makes sceVoiceGetMuteFlag report every port as muted without changing the ports' own flags, as the PS Vita documentation in VitaSDK describes (RPCS3 also leaves the port flags alone); sceVoiceEnd clears it.
  • sceVoiceSetBitRate(uint32_t, uint32_t): encoded voice ports only, as sceVoiceGetBitRate already requires.
  • sceVoiceUpdatePort(uint32_t, const VoicePortParam*): updates mute, volume and, on encoded voice ports, the bitrate; a different port type throws, since VitaSDK documents that the type cannot change.

The debt file listed these as "unknown signature"; the signatures are in the Orbital type database and match VitaSDK, the source the library already cites for sceVoicePausePort/sceVoiceResetPort. Those three lines are removed and replaced by one entry stating what is not measured, including that any bitrate is stored (as sceVoiceCreatePort already does) where the Vita accepts only SceVoiceBitRate values. libSceVoice goes from 23 to 26 of 36 in tools/progress.py.

sceVoicePausePortAll and sceVoiceResumePortAll are left to #8852, which was opened first and implements them.

Tested

macOS 27 (Apple silicon), clang, C++20: libSceVoice/Export.cpp and the tests compiled outside CMake, since the full build does not run on macOS. guest_voice (core/libs/tests/GuestVoice.cpp, extended here with mute-all, bitrate, update, rejected type change and the reset after sceVoiceEnd) and guest_voice_port_attr pass. The CMake/ctest build on Linux and Windows was not run locally. check_conventions.py is clean. Export.cpp and the test merge cleanly with #8852; docs/dev/debt/libSceVoice.md has an adjacent-line conflict with it, resolved by keeping both entries. No title tested.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4948890651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T08:46:54Z. --- ### What Implements 3 libSceVoice exports that threw, on the existing port model: - `sceVoiceSetMuteFlagAll(bool)`: a library-wide flag that makes `sceVoiceGetMuteFlag` report every port as muted without changing the ports' own flags, as the PS Vita documentation in VitaSDK describes (RPCS3 also leaves the port flags alone); `sceVoiceEnd` clears it. - `sceVoiceSetBitRate(uint32_t, uint32_t)`: encoded voice ports only, as `sceVoiceGetBitRate` already requires. - `sceVoiceUpdatePort(uint32_t, const VoicePortParam*)`: updates mute, volume and, on encoded voice ports, the bitrate; a different port type throws, since VitaSDK documents that the type cannot change. The debt file listed these as "unknown signature"; the signatures are in the Orbital type database and match VitaSDK, the source the library already cites for `sceVoicePausePort`/`sceVoiceResetPort`. Those three lines are removed and replaced by one entry stating what is not measured, including that any bitrate is stored (as `sceVoiceCreatePort` already does) where the Vita accepts only `SceVoiceBitRate` values. libSceVoice goes from 23 to 26 of 36 in `tools/progress.py`. `sceVoicePausePortAll` and `sceVoiceResumePortAll` are left to #8852, which was opened first and implements them. ### Tested macOS 27 (Apple silicon), clang, C++20: `libSceVoice/Export.cpp` and the tests compiled outside CMake, since the full build does not run on macOS. `guest_voice` (`core/libs/tests/GuestVoice.cpp`, extended here with mute-all, bitrate, update, rejected type change and the reset after `sceVoiceEnd`) and `guest_voice_port_attr` pass. The CMake/ctest build on Linux and Windows was not run locally. `check_conventions.py` is clean. `Export.cpp` and the test merge cleanly with #8852; `docs/dev/debt/libSceVoice.md` has an adjacent-line conflict with it, resolved by keeping both entries. No title tested. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-21 08:47:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T08:47:46Z.


Progress report (cc00785 → bec1289)

📈 System libraries: 43.26% (+0.03%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceVoice sceVoiceSetBitRate
libSceVoice sceVoiceSetMuteFlagAll
libSceVoice sceVoiceUpdatePort
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6311913581 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6311913581). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T08:47:46Z. --- <!-- progress-report --> ### Progress report (cc00785 → bec1289) 📈 **System libraries**: 43.26% (+0.03%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceVoice | `sceVoiceSetBitRate` | | libSceVoice | `sceVoiceSetMuteFlagAll` | | libSceVoice | `sceVoiceUpdatePort` | </details>
clairtonmichel commented 2026-10-21 09:09:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T09:09:51Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran the complete voice and QoS test suite (guest_voice, guest_voice_chat, guest_voice_qos, port attributes, etc.): 100% passed successfully (8/8 green in 0.02s).
  • Mute-all, bitrate adjustments, port updates, and pause/resume-all features behave correctly on host. Ready to merge!
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312314892 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6312314892). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-21T09:09:51Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran the complete voice and QoS test suite (`guest_voice`, `guest_voice_chat`, `guest_voice_qos`, port attributes, etc.): **100% passed successfully (8/8 green in 0.02s)**. - Mute-all, bitrate adjustments, port updates, and pause/resume-all features behave correctly on host. Ready to merge!
simonbronk commented 2026-10-21 14:36:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T14:36:03Z.


Rebased on main after #8852 was merged: \sceVoicePausePortAll/\sceVoiceResumePortAll\ and their debt entry and tests are now main's, so this PR only adds \sceVoiceSetMuteFlagAll, \sceVoiceSetBitRate\ and \sceVoiceUpdatePort\ (one commit). Windows 11, WinLibs GCC, CMake/ctest: \guest_voice, \guest_voice_chat\ and \guest_voice_port_attr\ pass; \check_conventions.py --base upstream/main\ is clean.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6318684623 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6318684623). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T14:36:03Z. --- Rebased on main after #8852 was merged: \sceVoicePausePortAll\/\sceVoiceResumePortAll\ and their debt entry and tests are now main's, so this PR only adds \sceVoiceSetMuteFlagAll\, \sceVoiceSetBitRate\ and \sceVoiceUpdatePort\ (one commit). Windows 11, WinLibs GCC, CMake/ctest: \guest_voice\, \guest_voice_chat\ and \guest_voice_port_attr\ pass; \check_conventions.py --base upstream/main\ is clean.
simonbronk commented 2026-10-21 18:17:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-21T18:17:00Z.


Linux run of c51727f14 merged onto main 99844c7ee (clean merge).

Environment: Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, RelWithDebInfo, BUILD_TESTING=ON, ANYPS5_ENABLE_ASAN=ON. ASan builds dynamic executables, so this is not the CI configuration.

Results: the full build has no errors. the 8 tests matching voice, including guest_voice: all pass, with no AddressSanitizer report.

Not run: the static CI configuration, native x86-64 hardware, GPU tests, a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323254323 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6323254323). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-21T18:17:00Z. --- Linux run of c51727f14 merged onto `main` 99844c7ee (clean merge). **Environment:** Ubuntu 24.04 x86-64 container under Rosetta on Apple Silicon (Colima), GCC 13, `RelWithDebInfo`, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_ASAN=ON`. ASan builds dynamic executables, so this is not the CI configuration. **Results:** the full build has no errors. the 8 tests matching `voice`, including `guest_voice`: all pass, with no AddressSanitizer report. **Not run:** the static CI configuration, native x86-64 hardware, GPU tests, a title. AI-assisted (Claude Code).
simonbronk commented 2026-10-22 09:07:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-22T09:07:12Z.


Rebased on main d6eafa54d. main has since rewritten libSceVoice to return the module's codes (0x804E0801 not initialized, 0x804E0804 port above 127, 0x804E0807 missing port) instead of throwing, so I redid the three functions on that model instead of carrying the old ones over:

  • sceVoiceSetMuteFlagAll(bool) returns 0x804E0801 before sceVoiceInit. Otherwise it sets a library-wide flag that makes sceVoiceGetMuteFlag report every port muted, without changing the port flags. sceVoiceEnd clears it.
  • sceVoiceSetBitRate(port, bitrate) and sceVoiceUpdatePort(port, param) return the same not-initialized, port-range and missing-port codes as the other port calls. Bitrates go through the table sceVoiceCreatePort uses, which I moved into a shared helper, so the port's frame size follows the new bitrate.
  • A non-voice port, an unsupported bitrate, a null param and a different port type throw, because the console's codes for them are unknown. The debt entry says so.

Tested: Linux, Ubuntu 24.04 x86-64 container under Rosetta (Colima), GCC 13, RelWithDebInfo with ASan, merged onto main d6eafa54d: all 8 voice tests pass, no ASan reports. check_conventions.py --base origin/main passes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337027192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6337027192). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-22T09:07:12Z. --- Rebased on `main` d6eafa54d. `main` has since rewritten libSceVoice to return the module's codes (0x804E0801 not initialized, 0x804E0804 port above 127, 0x804E0807 missing port) instead of throwing, so I redid the three functions on that model instead of carrying the old ones over: - `sceVoiceSetMuteFlagAll(bool)` returns 0x804E0801 before `sceVoiceInit`. Otherwise it sets a library-wide flag that makes `sceVoiceGetMuteFlag` report every port muted, without changing the port flags. `sceVoiceEnd` clears it. - `sceVoiceSetBitRate(port, bitrate)` and `sceVoiceUpdatePort(port, param)` return the same not-initialized, port-range and missing-port codes as the other port calls. Bitrates go through the table `sceVoiceCreatePort` uses, which I moved into a shared helper, so the port's frame size follows the new bitrate. - A non-voice port, an unsupported bitrate, a null param and a different port type throw, because the console's codes for them are unknown. The debt entry says so. **Tested:** Linux, Ubuntu 24.04 x86-64 container under Rosetta (Colima), GCC 13, RelWithDebInfo with ASan, merged onto `main` d6eafa54d: all 8 `voice` tests pass, no ASan reports. `check_conventions.py --base origin/main` passes. AI-assisted: yes
simonbronk commented 2026-10-22 09:47:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-22T09:47:56Z.


A correction to my comment above: the Tested line there was wrong. My new checks in GuestVoice.cpp redeclared bitrate, which main's tests further down also declare, so guest_voice_tests didn't compile in that run. The "8 tests pass" came from binaries of an older build. Sorry for the noise.

bec128911 renames the variable in my checks to portBitrate.

Tested again, building the targets explicitly and checking the exit code: Linux, Ubuntu 24.04 x86-64 container (Colima/Rosetta), GCC 13, ASan, merged onto main 7e2ba73e4. cmake --build --target libSceVoice guest_voice_tests exits 0 and guest_voice passes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337800543 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8989#issuecomment-6337800543). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-22T09:47:56Z. --- A correction to my comment above: the **Tested** line there was wrong. My new checks in `GuestVoice.cpp` redeclared `bitrate`, which `main`'s tests further down also declare, so `guest_voice_tests` didn't compile in that run. The "8 tests pass" came from binaries of an older build. Sorry for the noise. bec128911 renames the variable in my checks to `portBitrate`. **Tested** again, building the targets explicitly and checking the exit code: Linux, Ubuntu 24.04 x86-64 container (Colima/Rosetta), GCC 13, ASan, merged onto `main` 7e2ba73e4. `cmake --build --target libSceVoice guest_voice_tests` exits 0 and `guest_voice` passes. AI-assisted: yes
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!8989
No description provided.