GitHub Vita Lite - Wolff's Store
Code / README | Releases | Issues
WolffsRoom/YouTubeOnVita / experiments / cobalt / vita

COBALT_BOOT_STATUS_2026-11-17b.md

24548 bytes · Original / download

Cobalt boot: second session (17/11/2026)

Test title: YTVCB0001 (diagnostic only, NOT a functional app). Runner: tools/test_cobalt_boot_vita3k.ps1 [-Seconds N] [-TitleId T -Vpk V] (syncs every changed VPK file into the installed title, captures cobalt_boot.log, starboard15.log and vita3k.log to tools/capture/cobalt-boot-<timestamp>/, reports SELF_EXIT/EXIT_CODE, and never touches other Vita3K instances).

Root causes found and fixed (in order)

# Symptom Cause Fix
1 Start hung after eglCreateContext SbEglInterface.eglCreatePbufferSurface (and 21 other slots) were null; Cobalt's GraphicsContextEGL calls it right after creating the context, so it jumped to 0 port_graphics.cpp: real EGL 1.4 layer over VitaGL: pbuffer registry, per-thread current context (EGL_BAD_ACCESS across threads), per-thread errors, every slot filled (real call or proper EGL error)
2 GXM was never initialized VitaGL's eglInitialize is a facade; vglInit was never called eglInitialize brings up VitaGL once (RAM pool capped at 48 MiB)
3 Rasterizer spun on null+0x64 Skia rejected the GL interface: glInsertEventMarkerEXT missing although VitaGL advertises GL_EXT_debug_marker; GLES2 core funcs missing (glBlendColor, glGetShaderPrecisionFormat, ...) Our eglGetProcAddress serves marker + EGL overrides; GLES2 core slots implemented (shader precision = SGX fp32; renderbuffer/texture parameter queries tracked)
4 abort() during font init Evergreen CRX ships an empty fonts.xml; platform must give system fonts tools/stage_vita_system_fonts.py stages Cobalt's official 'limited' package (65 files, 2.9 MiB) to system_fonts/; SbSystemGetPath(FontDirectory/FontConfigurationDirectory) = app0:/system_fonts
5 glLinkProgram hung, then Vita3K crashed VitaGL's GLSL preprocessor hangs on Cobalt's #pragma array (a build-time directive of generate_shader_impl.py) glShaderSource bridge drops pragmas GLSL ES requires drivers to ignore (keeps #pragma STDGL). Reproduced/validated in graphics test
6 V8 fatal "ignored" SbMemoryMap(flags=0) (kSbMemoryMapProtectReserved) rejected, and partial SbMemoryUnmap (musl alignment trim) rejected Reserve = memblock + PROT_NONE; page-granular unmap with bitmap; map table 64 → 1024
7 Memory budget Evergreen's malloc is musl over SbMemoryMap, not newlib newlib heap 8 → 64 MiB (uses ~3-4 MiB), main stack 4 MiB, default thread stack 1 MiB; ~105 MiB left for Cobalt maps
8 TLS rejected every server (no CA lookup) SbDirectoryGetNext required a buffer of 256 but Cobalt passes kSbFileMaxName = 255, so ssl/certs listed as empty accept >= kSbFileMaxName

Proven in Vita3K (build 4242)

Not achieved yet

Diagnostics left in the code

Update (same day, later): first frames and the YouTube device gate

Fixed: - GLES2 pixel store: VitaGL's glPixelStorei only accepts GL_UNPACK_ROW_LENGTH; GL_UNPACK/PACK_ALIGNMENT raised GL_INVALID_ENUM and Cobalt's GL_CALL aborted (it was a rasterizer CHECK, not V8). Bridge now keeps alignment/row-length state and repacks uploads/readbacks. - GL_DITHER (glEnable/glDisable/glIsEnabled), GL_IMPLEMENTATION_COLOR_READ_FORMAT/TYPE (RGBA/UNSIGNED_BYTE) and GL_NUM_PROGRAM_BINARY_FORMATS (0: VitaGL never names its format) answered by the bridge. - With a diagnostic wrapper that checks glGetError after every GLES call (YTV_GL_TRACE): 0 GL errors in a full Cobalt run. - Graphics test 33/33 (pixel-store coverage added). Probe pump duration configurable via ux0:data/youtubevita/pump_seconds.txt.

Observed: - Cobalt presents frames (eglSwapBuffers from the browser). GL trace of frame 1/2: clear with 0.157,0.157,0.157 (= page background #282828), splash images 426x96 and 540x540, glyph atlas 2048x2048 + text draws — i.e. the guest renders the real page. - The Vita3K window nevertheless shows plain white (OpenGL backend). Guest-side readback of display buffers returns zeros in Vita3K, so it cannot be used as evidence. Vulkan could not be selected (--backend-renderer Vulkan and the yml key were not applied by build 4242 in these runs). Pending: the Vita3K presentation fix the user applied for Darkest Dungeon; validation on real hardware. - YouTube device gate: www.youtube.com/tv answers this honest device identity (Sony / PlayStation Vita / GAME_CONSOLE) with the page "O YouTube não está disponível neste dispositivo" (QR to yt.be/tv-devices); the TV app bundle is never requested. Reproduced from the PC with a Cobalt 25/Starboard 15 style User-Agent. Getting the real TV app would require presenting as a certified device; NOT done (user decision, service terms).

Tools: tools/capture_vita3k_window.ps1 (PrintWindow of the test title's window), runner options -Config, -Backend.

Update: official YouTube TV UI rendered in Vita3K

Update: controller input and navigation

v0.19 (after first real-hardware test)

Hardware report: distorted audio, very low UI FPS, slow input, ~225/256 MB used, black screen at start when logged in, login not kept. - LiveArea from the owner (assets/livearea → sce_sys/livearea/contents), TITLE "YouTube", APP_VER 00.19. - Memory: param.sfo ATTRIBUTE2=12 (extended memory), SbSystemGetTotalCPUMemory 265 MiB. - Audio: one SceAudioOut MAIN port per sink (no singleton), high-priority kernel feeder thread, continuous output (silence on underrun), 0 dB volume, 2048-frame min buffer. - Performance: main loop event-driven (all due tasks, wake on SbEventSchedule, 8 ms input cadence; was fixed 16.7 ms sleep with 24-task cap); clocks 444/222/222/166; Starboard thread priorities mapped to kernel priorities; all threads on all user cores; 4th core via CapUnlocker when the kernel accepts SCE_KERNEL_CPU_MASK_SYSTEM (auto-probed, logged as YTV_LIFECYCLE_CPU_CORES); YTV_* logs only with ux0:data/youtubevita/verbose.txt. - Touch: front panel → kSbInputDeviceTypeTouchScreen press/move/unpress (verified in Vita3K: tap on Get started works). Script command tap X Y. - Login persistence: storage saves no longer blocked forever by .new/.backup leftovers of a killed app; several records may be open. - Tests: Starboard 183/183, graphics 33/33, Cobalt touch navigation in Vita3K.

v0.20

v0.21: video playback, microphone, startup

v0.22 (in progress): audio fix in SbPlayer, MP4 recording

v0.23: resolutions, zero-copy video, touch gestures

Video

Touch

Tests

v0.24: hardware crash at startup (v0.22/v0.23)

v0.25: hardware report for v0.24 (1 fps, freezes, harsh intro sound, sign-in lost)

The hardware log (logs-psv/v024) gave real per-thread CPU (runClocks) every 2 s: - MainWebModule: ~2000 ms of 2000 (one core saturated). - Rasterizer: up to 1500 ms. RasterzrSubDisp: up to 1085 ms. - NetworkModule: ~250 ms constant. - Idle threads (Watchdog, ServiceWorkerRegistry): ~62 ms each. - Main loop: ~90 ms. - CapUnlocker active (4 cores).

Fixes: 1. Condition variables. VitaSDK pthread-embedded pthread_cond_wait / pthread_cond_timedwait use pte_osSemaphoreCancellablePend, which polls sceKernelWaitSema every 500 us. Every idle thread woke ~2000 times per second. SbMutex and SbConditionVariable are now native SceKernelLwMutex / SceKernelLwCond (port_sync.cpp): - created lazily from the zero static initializer; - signals from a thread that does not hold the mutex retry under a try-lock if the kernel refuses them; - errors logged as YTV_LIFECYCLE_SYNC_ERROR. The scheduled-event queue (main loop wait) and the player worker now use these primitives too. 2. Network waiter. sceNetEpollWait's timeout is in microseconds (confirmed in Vita3K's epoll). The waiter passed 10 meaning milliseconds, so it waited 10 us and spun. Now: - timeouts are in microseconds; - WakeUp sends a byte to a loopback UDP socket kept in the same epoll set, so waits block, with 1 s slices; - without that socket, 4 ms slices. Verified in Vita3K: wake_fd created, navigation and network work. 3. Sign-in / cookies not persisted. Cobalt opens its savegame record with the name "aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=" (base64 of the TV URL, with '='). name_path refused any byte outside [A-Za-z0-9_-], so SbStorageOpenRecord returned null and nothing was ever saved. Names are now sanitized, with an FNV-1a hash suffix when changed; '..', '/', '\' and ':' are still refused. Verified in Vita3K: storage .dat written (YTV_LIFECYCLE_STORAGE_OPEN / WRITE are always logged). 4. UI audio sink. It now pre-buffers about 85 ms before playing, and again after running dry, instead of alternating 512-frame blocks with silence. A Vita3K dump of the intro had 3 gaps (167 ms) in 2.8 s. The intro did not play again in later runs, so the change is not verified. 5. Heartbeat. Now runs for the whole session (5 s steps after the first minute). It adds GL_STATS: frames, swap/raster ms, draws, shader compiles and links with their time. Vita3K shows 4.4 s spent on the first frame (vitaGL shader translation/compile).

Tests: Starboard 193/193 with the new sync primitives. Vita3K: video with sound plays, search UI renders.

v0.26: freeze at 100% CPU, crash at first sign-in, no video on hardware

v0.27: LiveArea assets