fix(voice): accept valid worker priorities and affinities in sceVoiceSetThreadsParams #9730
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9730"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-22T10:17:42Z.
What
sceVoiceSetThreadsParamsmode 1 has thrown for every input sincefe4016f61. Grand Theft Auto V (PPSA04264) calls it right aftersceVoiceInitand aborts on currentmain(7e2ba73e4):The call is at eboot
0x22eb355. It runs aftersceVoiceInit({app_type 0x10000000}, 100)and passes mode 1 with priority 700 (0x2bc) and affinity mask0x7ffor all three workers.Mode 1 now returns 0 when every priority is in 256-767 and every affinity mask is non-zero and within
0x1fff. This is the range a PS5 thread takes, and the rangesceVideoOutOpenalready accepts for its service thread (VIDEO_OUT_SERVICE_THREAD_PRIORITY_HIGHEST/LOWEST,VIDEO_OUT_SERVICE_THREAD_AFFINITY_ALL). LikesceVideoOutOpenandsceUserServiceInitialize2, the values reach no host scheduling: AnyPS5 runs no voice worker threads, as the existingsceVoiceStartdebt entry says. Other priorities and masks still throw, because the console's result for them is unknown. The debt entry is cut down to that gap.Tested
Windows 11 Pro, Intel Core i9-14900K, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release.
ctest -R '^guest_voice$', which now covers GTA V's values, the range edges, and each out-of-range priority and mask in each of the three slots:main'sExport.cpp:Exit code 0xc0000409(the mode-1 throw);Passed.guest_voice_port_attr,guest_voice_chat,guest_voice_qos,guest_voice_qos_app_type_0x10000000andpatched_librariespass.check_test_registrationandcheck_conventionsare clean.mainstops at the line above, 2 of 2 runs: at +271 s with empty caches, after the first-launch shader precompile, and at +14 s with warm caches.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:57:19Z.
The implementation keeps valid mode-1 settings from affecting host scheduling and retains throwing behavior outside the evidenced range; the focused boundary tests and the GTA V red/green run are useful evidence. I checked the exact head: conventions and whitespace pass, and it merges cleanly, but current
mainis 4 commits ahead of the branch. Please refresh it and rerunguest_voiceplus the overlap check before merge. The hosted full Linux/Windows jobs are skipped on this PR.Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-22T13:01:13Z.
A Linux data point, on the other region of GTA V (PPSA04263 01.010.002): Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, GCC Release build.
Without this change, main
a6dcea927aborts at start-up the same way (exit code 134):With it, main
4777caca3+ed8a900caboots, loads the Story from Resume Story and runs the prologue: six sessions of 2.5 to 4 minutes, with no voice error in the log. The arguments of the call were not logged here.Not tested: voice chat itself.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:40:05Z.
Review: APPROVED
Checked against main
8b3e39832a, shadPS4 c1b26558 (voice.cpp) and ps5-payload-dev/sdk a7685ce8:8b3e39832a, and main has no libSceVoice commits since your base, so the refresh asked for earlier should be a no-op.scePthreadAttrSetschedparam(libkernel/Pthread/src/Attr.cpp) andVIDEO_OUT_SERVICE_THREAD_PRIORITY_HIGHEST/LOWEST, and masks withinDEFAULT_THREAD_AFFINITY/sceKernelGetAvailableCpumask()= 0x1FFF, non-zero as insceVideoOutOpen. libkernel's POSIX sched path also accepts 896..959; those still throw here, which is the safe side.VoiceThreadsParamslayout inSceTypes.hppmatches the 9-field initialisers in the new tests.libSceVideoOut.mdlists the same "validated but not applied" priority/affinity case under### Silent stubs. It might be worth a### Silent stubsheading inlibSceVoice.mdfor consistency, thoughlibSceUserService.mddoes it the way you did, so either seems defensible.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T15:18:11Z.
Review: APPROVED
The mode-1 validation is narrowly bounded to the reported PS5 priority and affinity ranges, preserves mode-0 behavior, and still rejects unsupported values without applying host scheduling. The new tests cover each worker slot and the pre/post-start state behavior. I found no blocking defect.
Local checks on exact head
ed8a900caf92bbc7f5de356d1cdd727361b184d8:g++ -std=c++20 -fsyntax-onlypassed forExport.cppandGuestVoice.cpp;git diff --checkand conventions passed. The current-main merge tree is clean, and no commits since the PR base changed the touched files. Runtime CTest and GTA V A/B results are author-reported, not local runs. Hosted product Linux/Windows jobs are skipped on this PR.