fix(libSceVideoOut): return RESOURCE_BUSY when a bus is opened twice #4863
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4863"
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 babyhuey on 2026-10-13T00:31:50Z.
What
sceVideoOutOpenon a bus that is already open now returnsSCE_VIDEO_OUT_ERROR_RESOURCE_BUSY(0x80290009) instead of throwingVideoOut: port already open.VideoOutDriver::Openreturns -1 for an open bus, andsceVideoOutOpenturns that into the error. It already mapped a negative handle toVIDEO_OUT_ERROR_RESOURCE_BUSY, but threw it.ORBIS_VIDEO_OUT_ERROR_RESOURCE_BUSYwhen its main port is already open. The PS5 result is unverified, and that's recorded under Functional indocs/dev/debt/libSceVideoOut.md.guest_video_out_output_modechecks that a second open of the main bus returns the error while the first handle stays open.Where a title reaches it
Porpoise (PPSA99764, Porpoise 3.0) opens the main bus twice. On
main1c5e6287+ #4690 (/dataat start-up, which it needs to get past its jailbreak check), Windows 11 (WinLibs GCC 15.2, RTX 3080):PlayStation 5 GPU (RADV NAVI21)) and stops atVideoOut: port already open.test/verify-busystack52ec5e4f) the second open returns the error and Porpoise carries on. It logsvk: the console outputs 0x0 (handle 0x80290009, status 0xffffffff)for its own display probe, then creates its swapchain (1920x1080, 3 images), presents through the first handle (vk: VideoOut output 1 for V-Sync) and renders. In two 60 s runs it kept up about 60 GPU submissions per second (radv/ps5 submissions: window count=600), with no throw.On Linux the title doesn't get this far in a headless run.
Tested
On the PR head
c15e9f2a, Release:guest_video_out_output_mode5/5 (--repeat until-fail:5) withANYPS5_REQUIRE_DISPLAY=1, so the open and the second open ran with a real window.guest_video_out_output_mode5/5. The display part is skipped there, as before.Output.cpp,VideoOutDriver.cpporGuestVideoOutOutputMode.cpp.check_conventions.pypasses.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)main)Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T00:34:46Z.
Ran the rest of the VideoOut tests on
c15e9f2aagainst a real display (Windows 11, RTX 3080, WinLibs GCC 15.2), since headless they mostly skip:ANYPS5_REQUIRE_DISPLAY=1under ctest, these pass:agc_driver_flip,agc_driver_flip_compute,video_out_output_mode_policy,guest_video_out_high_frame_rate,video_out_flip_decode,guest_video_out_wqhd_detection,guest_video_out_resolution_status,guest_video_out_output_mode.SDL_VIDEODRIVER=${ANYPS5_VIDEO_OUT_TEST_DRIVER}(offscreen in this build), so I ranvideo_out_flip_tests.exedirectly withSDL_VIDEODRIVER=windows, one process per mode.lifetime,reopen,controls,overlay,unopenedanddecodeall printedVideoOut flip tests passedand exited 0, each with a real 1920x1080 window.reopenis the one closest to this change, and it's unaffected: a bus can still be opened again after it's closed.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T03:29:30Z.
#4690 has merged, so Porpoise now reaches this on plain
main. Onmainc13dc7e6, Windows 11 (RTX 3080, WinLibs GCC 15.2), it gets past its jailbreak check, brings up its Vulkan stack and stops at:With this PR on the same base it carries on and renders, as described above. I've updated "Depends on" to none.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T06:58:11Z.
Porpoise (PPSA99764, DolphinPS5) on Windows. Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0, Release. Head
c15e9f2a3merged ontomain88107b7de, relinked with--windows --trap-sdk-syscall-stubs.main:VideoOut: port already open, exit0xc0000409after 5 s.Porpoise (DolphinPS5)) stays up for the full 60-second run.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-13T08:41:42Z.
Linux test with a display (Arch, Intel Arc B390 on Mesa 26.2.2 ANV, Xwayland, GCC 16.2.1, Release), this PR merged onto
main7e181fcc3together with #4863, #4040 and #4930 (clean merges):guest_video_out_output_modepasses 3 of 3 withANYPS5_REQUIRE_DISPLAY=1on a real X display, so the open and the second open ran with a window on Linux too (the Linux run above was headless). The fivevideo_out_flip_testsmodes also pass on the display with the three PRs merged.Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:10:54Z.
Title run with this PR: Windows 11, MinGW GCC 15.2.0 (WinLibs), Release. Built on
main3faa9cb40merged with this PR and the other open PRs that the catalog titles need (#4377, #4379, #4374, #4383, #3798, #4863, #4105, my #5013/#5061/#5078/#5098/#5009 and the carries #5183/#5186, plus screamm'schrootbranch from #3632); every title converted from its catalog release,eboot.binkept inapp0, 60 s runs.main(with itschrootimport from #3632's branch) it stops withVideoOut: port already openabout 2 s in, on Windows and on Linux. With this PR it runs the whole 60 s with no exception.AI-assisted (Claude Code).