Repository navigation
PSX3DS v0.2.7 — Real-3DS NDSP Hardware Audio Fix & Winning Eleven 4 Anti-Modchip Fix
PSX3DS v0.2.7 — Real-3DS NDSP Hardware Audio Fix (ndspChnWaveBufClear Stop-Race Re-Arm, Core 0 Exclusive WaveBuf Owner & svcFlushProcessDataCache, Async SPU Readback Coherency) & Winning Eleven 4 Anti-Modchip Fix
v0.2.7 resolves the remaining real New 3DS hardware missing-audio issue reported on v0.2.6 ("1. 还是没声音", while "帧数没问题" confirmed the 60.0 FPS pacer works cleanly on real hardware) and fixes the anti-modchip lockout in World Soccer Jikkyou Winning Eleven 4 (Japan) (SLPM_862.91), verified across The King of Fighters '97, Winning Eleven 3 Final Ver., Winning Eleven 4, and Winning Eleven 2002.
English Release Notes
1. Real-3DS Hardware Audio Fix (src/platform/3ds/audio_ndsp.c, src/platform/3ds/threads_3ds.c, src/platform/3ds/main_3ds.c, src/periph/spu.c)
libctrundspiReadChnState/ndspiUpdateChnStop-Race Fix (ndspChnWaveBufClearRe-Arm & Zero Menu Dummy Buffers):- Root Cause: ELF disassembly of
libctru'sndspiReadChnState(0x001ccf88..0x001cd07c) revealed that when the final wavebuf in NDSP finishes (wavebuf_seq == 0,flags == 0x0100),libctrusetschn->wavebuf_queued_count = 0while leavingchn->playing = 1. Queuing dummy silence buffers in the ROM menu (or draining during BIOS boot) and later callingndspChnWaveBufAddwithoutndspChnWaveBufClearcausedndspiUpdateChn(dirty_playing == 0) to mark wavebufsNDSP_WBUF_PLAYINGwithout restarting the stopped DSP hardware channel or incrementingchn->sync_count, deadlockingg_wbufsinPLAYINGon a stopped DSP channel forever. - Fix:
ctr_audio_initno longer queues silence buffers in the ROM menu;ctr_audio_bind_systemresets the channel cleanly on every game boot; and whenever NDSP drains (active_wbufs == 0) or triggers the150 ms/35 ms-stopped stall watchdog,ndspChnWaveBufClear(CTR_NDSP_CH)is called before pre-priming2 x 735frames (33.3 ms) to bumpchn->sync_countand cleanly restart the DSP channel. When down to the final active wavebuf (active_wbufs <= 1), partial frames smoothly decay toward0instead of letting the DSP channel stop mid-stream.
- Root Cause: ELF disassembly of
- Core 1 Render / Core 0 NDSP Ownership Split & Kernel11
svcFlushProcessDataCache:- Root Cause:
DSP_FlushDataCacheinvokessvcSendSyncRequest(dspHandle)without a lock, racingndspThreadMain(priority0x18on Core 0) on every 5 ms DSP interrupt, and calling it on Core 1 could not clean Core 0's private 16 KiB ARM11 L1 D-cache. - Fix: Core 1 (
spu_core1_worker) now exclusively callsctr_audio_render_core1(sys)(rendering queuedSpuCmdbatches intosys->spu.out_ringwithout touchingg_linear_pcmorndsp*). Core 0 exclusively owns wavebuf refill and submission (ctr_audio_step_core1/ctr_audio_pump_core0, pumped every frame and every<= 4 msslice insidepacer_wait), flushing wavebuf PCM directly from Core 0's L1/L2 cache to FCRAM via Kernel11svcFlushProcessDataCache(CUR_PROCESS_HANDLE, ...)+GSPGPU_FlushDataCache.
- Root Cause:
- Core 0 / Core 1 Async SPU Register Readback Coherency (
src/periph/spu.c):- Made all
spu->endxupdates/reads atomic across Core 0 and Core 1, updated Core-0-readable voice shadow state (start_addr,repeat_addr,adsr_vol, andKONclearingendx+ zeroingadsr_vol) immediately on MMIO write beforecmd_ringdrain, and prevented Core 1cmd_ringreplay (spu_apply_queued_reg16) from overwriting newer Core 0spu->regs[]mirrors. Covered bytest_spu_async_readback_coherency.
- Made all
- Live Audio Diagnostics on
2:HUD&4:LOG(src/platform/3ds/ui_bottom.c):2:HUDnow displays live wavebuf submission/in-flight counts and PCM peak amplitude (SPU:C1 NDSP:OK WB:<sub/act> Pk:<peak>), and4:LOGhighlights[audio_ndsp]activation lines in green (COL_OK).
2. Winning Eleven 4 (SLPM_862.91) Anti-Modchip Lockout Fix (src/periph/cdrom.c)
- Root Cause: At boot (
LBA ~52875..53125), Winning Eleven 4 starts muted CD-DA playback, resets SCEx counters (0x19 0x04), and queriesGetSCExCounters(0x19 0x05). Returning{ stat, 0x01, 0x01 }outside the Lead-In (LBA < 150) mimicked an old non-stealth modchip continuously injecting SCEx strings and triggered"強制終了しました。本体が改造されているおそれがあります。". - Fix:
CDL_TEST 0x05now returns{ stat, 0x01, 0x01 }only when idle in the Lead-In (cur_lba < 150and not playing/reading), and{ stat, 0x00, 0x00 }wheneverplaying,reading, orcur_lba >= 150. Covered bytest_cdrom_scex_counters.
中文更新说明 (v0.2.7)
- 彻底修复 New 3DS 实机无声音问题(
libctruNDSP 停止态死锁与跨核缓存一致性):- 修复
libctruNDSP 通道耗尽后无法重启的固件交互 Bug:反汇编psx3ds.elf中libctru的ndspiReadChnState/ndspiUpdateChn发现,当最后一个音频缓冲区播放完毕时,libctru将队列计数清零但保留chn->playing = 1;此前在 ROM 菜单预先入队的静音缓冲在 67 ms 内耗尽后,后续ndspChnWaveBufAdd未先调用ndspChnWaveBufClear重置同步计数与播放标志,导致新缓冲永久卡在已停止的 DSP 硬件通道上静音死锁。现移除菜单空转静音缓冲,每次启动游戏及缓冲重充前均通过ndspChnWaveBufClear重新武装通道,并加入150 ms/35 ms停滞看门狗与尾帧平滑衰减保护。 - Core 1 渲染 / Core 0 提交职责分离与
svcFlushProcessDataCache直刷:Core 1 线程仅负责异步渲染 SPU 采样至out_ring;所有 NDSP 缓冲区填充、Kernel11svcFlushProcessDataCache(零dspHandleIPC 竞争、直刷 Core 0 私有 16 KiB L1 D-Cache 至 FCRAM)及ndspChnWaveBufAdd均由 Core 0 独占执行(含pacer_wait帧限速休眠期间每<= 4 ms切片自动泵送)。 - 异步 SPU 寄存器回读一致性与 HUD 实时音频监控:原子化
ENDX状态并在 Core 0 写入KON/repeat_addr/adsr_vol时即时同步可读镜像;下屏2:HUD新增SPU:C1 NDSP:OK WB:<已提交/活跃> Pk:<峰值>实时音频指标,4:LOG高亮显示[audio_ndsp] audio active日志。
- 修复
- 修复《实况足球 4》(Winning Eleven 4,
SLPM_862.91) 反改机检测锁死:- 修正
CD-ROM Test 0x19 0x05(GetSCExCounters):仅在光头静止于导入区(LBA < 150)时返回0x01, 0x01;在数据/音轨区(LBA >= 150)或播放 CD-DA / 读取数据时返回真机一致的0x00, 0x00,顺利通过反改机校验进入 JOC 授权画面、片头动画与标题界面。
- 修正
- 多游戏实测通过:《拳皇 '97》(
SLPM_860.84)、《实况足球 3 最终版》(SLPM_861.62)、《实况足球 4》(SLPM_862.91)、《实况足球 2002》(SLPM_870.56) 均验证正常启动、音频输出饱满且帧率稳定锁定60.0 FPS。