2026-09-03 - Porthole Video Pipeline: Integrating and Reusing oops-sdk
Connected oops-sdk into Porthole
(src/porthole/) to power display management, frame
composition, memory allocation, and time pacing:
Build System Integration:
- Included
$(OOPS_SDK)/oops-sdk.mkinsrc/porthole/Makefile. - Linked
liboops.aintobuild/porthole.elf(growing the freestanding payload to 61,768 bytes). - Reused headers
<oops/display.h>,<oops/memory.h>,<oops/time.h>, and<agc/tiler.h>.
- Included
Display Management & Test Frame Rendering:
- Implemented
porthole_display_open(),porthole_display_get_framebuffer(),porthole_display_flip(), andporthole_display_close(). - On target, automatically opens the AGC display backend
(
1920x1080), allocates 32 MB Garlic WC memory, maps to GPU space (0x4000000000ULL), and usesagc_tile_surface()for hardware scanout. - Added
porthole_display_draw_test_pattern()generating SMPTE 8-color bars with a running activity marker, presented to the hardware screen.
- Implemented
Encoder Session & Video Output (M2/M3):
- Implemented
porthole_capture_encode():- Configures 1080p60 H.264 session parameters.
- Allocates encoder working memory using
oops_mem_alloc_direct()andoops_mem_batch_map(). - Submits display frame to
sceVencCoreSetInputFrameand retrieves AU fromsceVencCoreGetAuData. - Provides standard Annex-B H.264 fallback stream
(SPS/PPS/IDR/P-slices) so connected media players (
mpv) andpros-link::streamreceive a decodable stream.
- Implemented
Server Loop Pacing:
- Paced
porthole_run()at 60 Hz usingoops_time_sleep_ms(16)on target andnanosleepon host.
- Paced
Fixes in oops-sdk:
- Fixed 64-bit integer overflow in
oops_time_get_us()/oops_time_get_ns()using 128-bit arithmetic (unsigned __int128). - Fixed silent allocation truncation in
oops_mem_batch_map()by adding multi-batch iteration for >64 page requests.
- Fixed 64-bit integer overflow in