Repository navigation
PSX3DS v0.2.6 — Real-3DS Audio Fix & Steady 60.0 FPS Lock
PSX3DS v0.2.6 — Real-Hardware Audio Fix (SysCore Priority 0x2F, Core 0 NDSP Backstop, 4x735 Full-Buffer FIFO Feeder) & Steady 60.0 FPS Frame Pacer
v0.2.6 resolves the two issues reported on real New 3DS hardware running World Soccer Jikkyou Winning Eleven 3 - Final Ver. (Japan) (SLPM_861.62 + SCPH5500.BIN) on v0.2.5: missing audio output ("另外没有声音") and 30–80 FPS framerate fluctuation ("帧数不稳定, 在30-80之间跳动. 希望能锁定最高60帧稳定运行").
English Release Notes
1. Fix Real-3DS Missing Audio (src/platform/3ds/threads_3ds.c, src/platform/3ds/audio_ndsp.c, src/platform/3ds/main_3ds.c, src/periph/spu.c)
- SysCore (
Core 1) SPU Worker Priority Ladder (0x2F):- Root Cause: In
v0.2.4/v0.2.5,spu_core1_workerwas spawned on Core 1 atmain_prio + 1(0x31), numerically lower priority than Horizon OS's0x30APT_SetAppCpuTimeLimitSysCore quota thread (or fell back to Core 0 at0x30wheremain()never yields), starving the audio worker 100% of the time while still displayingCore1 SPU: ASYNCon the HUD. - Fix:
spu_core1_workernow launches on Core 1 atmain_prio - 1(0x2F) with a Core 1 retry ladder (0x2F -> 0x30 -> 0x31) and a sleeping-worker-safe Core 0 fallback (0x2F). Because the worker sleeps500 usper step and parks10 msonAPTHOOK_ONSUSPEND,0x2Fnever blocks HOME Menu transitions.spu_core1_activenow checksactual_core == 1and logsspu_core=%d.
- Root Cause: In
- Dual-Core Trylock-Guarded NDSP Feeder & Core 0 Frame-End Backstop:
ctr_audio_step_core1(sys)is now guarded by an atomic trylock (g_step_lock) and pumped at the end of every emulated frame on Core 0 in addition to Core 1's500 usworker. When Core 1 keeps up, Core 0 returns in< 1 us; if SysCore ever throttles Core 1, Core 0 seamlessly renders queuedSpuCmdbatches and feeds NDSP wavebufs.
- 4x735 Full-Buffer FIFO NDSP Ring, 2-Buffer (
33.3 ms) Re-Prime & Bounded Drift Resampler:- Root Cause: Previously, waking every
500 uspopped partial48..64-frame SPU batches into735-frame NDSP wavebufs and padded the remaining93.5%–100%with flat DC (g_last_l/g_last_r), locking NDSP into50 msof flat silence and inflatingspu_underrunsat2 kHz. - Fix: Expanded NDSP ring to
4 x 735stereo frames (66.7 ms), submitted via a strict FIFO cursor (g_wbuf_next) only when a full735-frame buffer of real audio is ready. After cold start or a full NDSP drain, playback pre-primes2 x 735frames (33.33 ms, one full 30 HzVSync(2)Even+Odd pair) so heavy~22 ms3D frames never underrun NDSP, counting exactly one atomicspu_underrunstransition per genuine stream drain (0underruns inwe3_f2000/we3_f3100). Above high water, a gentle<= 1.1%linear resampler bounds latency under the60.00 Hzlock.
- Root Cause: Previously, waking every
- Savestate Async SPU Regression Test (
tests/unit/test_periph_spu.c):- Added
test_spu_async_savestate_and_ringverifying that loading a sync (async_mode = false) savestate into an async (cfg.spu_async = true) 3DS system preservesasync_mode == trueand renders contiguous non-zero stereo audio across queuedSpuCmdbatches without drops.
- Added
2. Steady 60.0 FPS Wall-Clock Pacer & 32-Frame Rolling HUD Telemetry (src/gpu_hw/gpu_citro3d.c, src/platform/3ds/main_3ds.c, src/platform/3ds/ui_bottom.c)
- Eliminate Extra VBlank Stalls on Empty
VSync(2)Odd Frames:hw_presentnow callsbegin_frame(st, 0)instead ofC3D_FRAME_SYNCDRAWwhen!st->in_frame, preventing empty Odd frames of 30 HzVSync(2)games (~22 msEven +~6 msOdd =~28 ms < 33.33 ms) from stalling an extra hardware VBlank.
- Drift-Free
60.00 HzNTSC /50.00 HzPAL Deadline Pacer:- Added
CtrFramePacer(16667 / 16667 / 16666 us= exact50,000 usper 3 NTSC frames;20,000 usPAL) with a 2-frame (33,334 us) catch-up window so 30 HzVSync(2)Even+Odd pairs lock cleanly to60.0 FPSwhile capping menus at60.0 FPS(instead of running uncapped at80+ FPS), without fast-forwarding after CD seeks or state loads.
- Added
- 32-Frame Rolling HUD Average & Odd Redraw Cadence (
15frames =4.0 Hz):- Replaced single-frame unpaced
1000000.0 / us_frameHUD readouts and the even-parity16-frame redraw divisor (which aliased onto either heavy Even frames ~35 FPS or light Odd frames ~80 FPS) with a 32-frame rolling average of paced frame/CPU/GPU times, clamped cleanly at60.0 FPS(16.67 ms) with an odd15-frame idle redraw cadence.
- Replaced single-frame unpaced
中文更新说明 (v0.2.6)
- 彻底修复 New 3DS 实机无声音问题:
- 修复 Core 1 (
SysCore) SPU 音频线程饥饿:v0.2.4/v0.2.5将 SPU 异步线程优先级设为0x31(低于 Horizon OS 在 Core 1 上运行的0x30系统配额线程,或静默回退至主循环从不让出 CPU 的 Core 0),导致音频线程完全饥饿。现改为0x2F(main_prio - 1)并配备优先级回退梯队与每帧末尾 Core 0 原子无锁(trylock)兜底泵送,确保任何情况下音频持续输出,且不影响 HOME 键挂起/退出。 - 修复 NDSP 半满缓冲静音拼接与 FIFO 乱序:NDSP 环形缓冲扩容至
4 x 735立体声采样帧(66.7 ms),严格按 FIFO 顺序仅在攒满735帧真实音频采样时提交(不再将未满缓冲区的93%+填平为直流静音);启动或缓冲耗尽后自动预充2 x 735帧(33.3 ms,覆盖完整 30 Hz 奇偶帧周期),并通过<= 1.1%线性自适应重采样消除60.00 Hz锁帧下的长期音频延迟累积。
- 修复 Core 1 (
- 修复 30–80 帧跳动,稳定锁定最高 60.0 FPS:
- 消除 30 Hz 游戏空奇帧额外垂直同步停顿:移除
hw_present在无绘制奇帧上的C3D_FRAME_SYNCDRAW,使《实况足球 3》比赛画面(偶帧~22 ms+ 奇帧~6 ms=28 ms < 33.33 ms)不再多等一次硬件 VBlank。 - 零漂移
60.00 Hz(NTSC)/50.00 Hz(PAL)硬件时钟限帧器:带 2 帧(33.33 ms)追赶窗口,菜单与比赛最高稳定锁死60.0 FPS(不再冲上 80+ FPS,也不会在光盘寻道后快进)。 - HUD 32 帧滑动平均与奇分频(每 15 帧)刷新:消除旧版每 16 帧(偶数分频)采样奇偶帧导致的帧数显示跳变,稳定显示真实平滑帧率(最高钳位
60.0 FPS)。
- 消除 30 Hz 游戏空奇帧额外垂直同步停顿:移除