Skip to content

fix(libSceVideoOut): overlay-bus flips no longer replace the main output - #2142

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
MathiasDevelopes:fix/videoout-overlay-bus-flips
Oct 10, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
MathiasDevelopes:fix/videoout-overlay-bus-flips

Conversation

@MathiasDevelopes

Copy link
Copy Markdown
Contributor

What

sceVideoOutOpen accepts the overlay bus (busType 1), and each bus gets its own port. [VideoOutDriver::processFlip](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp) presented every flip on every port as a whole frame in the one window. A title that flips both a main and an overlay port therefore made the window alternate between the two buses.

Planet Coaster (PPSA01736) opens both. Traced with temporary logging in sceVideoOutOpen and sceVideoOutRegisterBuffers2:

sceVideoOutOpen bus 0 index 0 -> handle 1
RegisterBuffers2 handle 1 set 0 start 0 num 2 first 0x327c00000
sceVideoOutOpen bus 1 index 0 -> handle 2
RegisterBuffers2 handle 2 set 0 start 0 num 2 first 0x329000000

It shows its intro on the main bus and leaves the overlay empty, and it flips both every frame. Without this change, the intro blinks black on every other frame. In 373 presented frames dumped with APS5_DUMP_FRAMES, the picture switched between black and image 178 times, and every black frame was a flip of the overlay buffers at 0x329000000/0x329a00000.

Overlay-bus flips now complete like main-bus flips. They still wait for their vblank and flip rate, and they signal the flip event, flip status, flip arg and buffer reuse as before. They no longer reach the presenter. The port remembers its bus type from sceVideoOutOpen. Main and sub bus flips are presented as before.

Because an overlay flip is not presented, it is marked GPU-complete without waiting for the GPU work that rendered into its buffer, which the present path does for a shown buffer. The buffer is never read for display, so the only effect is that the title may get the buffer back for reuse earlier than after a real present.

Compositing the overlay over the main output is not implemented. It is recorded in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#functional), so a title that draws UI on the overlay will not show it yet. No public reference I found describes how the PS5 composites the overlay bus. [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/videoout/video_out.cpp) supports only the main bus and asserts on any other.

Tested

Windows 11, MinGW-w64 15.2.0, RTX 3060.

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
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 9, 2026
@MathiasDevelopes
MathiasDevelopes force-pushed the fix/videoout-overlay-bus-flips branch from 0469e5f to 4b1cdad Compare October 10, 2026 00:41
@github-actions github-actions Bot added build and removed needs rebase Conflicts with main, rebase needed labels Oct 10, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux, this head rebased on main: build and the libSceVideoOut ctest tests. video_out_flip_overlay skips on the offscreen driver (no Vulkan window), so the new case is only exercised on a machine with a display; the code path (overlay ports mark the flip GPU-complete, signal events as before, skip the presenter) reads correct.

Added by us on your branch:

  • Moved the Overlay output bus TechnicalDebt line off the end of the Functional section, to avoid adjacency conflicts with other PRs.

Merging once CI is green.

@adriadam10
adriadam10 force-pushed the fix/videoout-overlay-bus-flips branch from 4b1cdad to 16eaf96 Compare October 10, 2026 06:13
MathiasDevelopes and others added 2 commits October 10, 2026 08:48
A title that opens a main and an overlay port flips both, and every flip
was presented as a whole frame, so the window alternated between the two
buses: PPSA01736 shows its intro on the main bus and an empty overlay,
and the intro blinked black on every other frame. Overlay flips now
complete and signal their events without being shown. Compositing the
overlay over the main output is not implemented.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased on current main (conflicts in VideoOutDriver.cpp, the flip test list and TechnicalDebt.md). The overlay branch of processFlip keeps the CheckAlive()/Closed() handling main now has, and overlay joins the registered flip modes.

Checked on Linux: build and the libSceVideoOut ctest tests pass; the video_out_flip_* cases skip on the offscreen driver (no Vulkan window).

Added by us on your branch:

  • Rebase onto main.
  • The Overlay output bus TechnicalDebt line stays off the end of the Functional section.

Merging once CI is green.

@adriadam10
adriadam10 force-pushed the fix/videoout-overlay-bus-flips branch from 16eaf96 to 9883944 Compare October 10, 2026 06:50
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@adriadam10
adriadam10 merged commit 40a5b8f into boykopovar:main Oct 10, 2026
14 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…-overlay-bus-flips

fix(libSceVideoOut): overlay-bus flips no longer replace the main output
@MathiasDevelopes
MathiasDevelopes deleted the fix/videoout-overlay-bus-flips branch October 10, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants