Repository navigation
v0.0.25
repsp v0.0.25
음악이 게임 시계보다 늦게 들리던 원인 네 가지.
| issue | 내용 | 커밋 |
|---|---|---|
| #52 | blocking 출력(sceAudioOutput*Blocking)이 채널 대기열이 한 블록 이하일 때 돌아가서, 1024 샘플 음악 채널에 늘 1.7블록(40.7 ms)이 쌓였다. 이제 min(128 프레임, sample_count) 이하에서 돌아간다. drain은 그대로 빌 때까지 기다린다. 측정(한 게임): 음악 대기열 1793 → 769 프레임, 곡 중간 끊김 0. |
이 릴리스의 squash merge 커밋 |
| #53 | fact 청크의 인코더 지연을 건너뛰지 않아, 모든 트랙이 그만큼 늦게 시작했다(한 게임에서 35~43 ms). 곡 끝의 지연 샘플이 잘렸고, 루프는 프레임 경계에서 다시 시작했다. 이제 위치는 지연을 포함한 원시 샘플이다. 출력은 지연에서 시작해 endSample + delay에서 끝난다. 루프는 loopEnd + 1에서 loopStart로 같은 블록 안에서 이어진다. 블록 크기(samples_per_frame)는 이월 버퍼로 유지한다. Reset 계열과 GetSoundSample의 루프 지점은 들리는 샘플 기준이다(실기 미확인). ATRAC_TRACE Open 줄의 인자 밀림도 고쳤다. |
이 릴리스의 squash merge 커밋 |
| #54 | UI 스레드가 flush 내내 g_gl.mutex를 잡는다. 그동안 그 잠금을 기다리는 게스트 스레드(GE 그리기, 표시 확인)가 게스트 CPU를 쥐고 있어서, 타이머가 끝난 높은 우선순위 스레드가 돌지 못했다. 한 게임에서는 음악 시작 직전에 117 ms를 기다렸다. 이제 LockGl()이 잡힌 잠금을 ScopedHostWait 안에서 기다린 뒤 다시 시도한다. gl_probe가 넘겨줌을 검사한다. |
이 릴리스의 squash merge 커밋 |
| #55 | repsp::hle::atrac::SetStartOffsetMs(int32_t)(기본 0): 새로 여는 트랙을 양수만큼 앞당기거나(끝을 넘지 않음), 음수만큼 앞에 무음을 넣는다. 블록 크기는 유지되고, 루프와 Reset에는 적용되지 않는다. 앱이 호스트 출력 지연을 게임 시계에 맞춰 보정하는 데 쓴다. |
이 릴리스의 squash merge 커밋 |
사용자가 창 모드에서 확인했다(앱 쪽 선점 수정과 음악 오프셋을 함께 써서).
검증: Win64(Visual Studio·Ninja) Debug/Release, Linux x64 Debug/Release 빌드와 CTest. audio_probe는 Release와 Debug에서 각각 100회 연속 통과했다.
repsp v0.0.25
Four causes of music heard later than the game clock.
- Issue #52, blocking output:
- A blocking output (
sceAudioOutput*Blocking) returned once the channel queue held at most one block, so a 1024-sample music channel always held 1.7 blocks (40.7 ms). - It now returns at
min(128 frames, sample_count). A drain still waits for empty. - Measured on one title: music queue 1793 → 769 frames, no mid-song underruns.
- A blocking output (
- Issue #53, ATRAC encoder delay:
- The
factchunk's encoder delay was never skipped, so every track started that late (35-43 ms in one title). A track's last delay samples were cut, and loops restarted at a frame boundary. - Positions are now raw samples that include the delay. Output starts at the delay and ends at
endSample + delay. Loops go fromloopEnd + 1toloopStartwithin the same block. - The block size (
samples_per_frame) is kept with a carry buffer. - The reset functions and
GetSoundSample's loop points use audible samples (unconfirmed on hardware). - The
ATRAC_TRACEopen line no longer has its arguments shifted.
- The
- Issue #54, GL lock:
- The UI thread holds
g_gl.mutexfor a whole flush. A guest thread waiting for it (GE draws, the present check) held the guest CPU meanwhile, so a higher-priority thread whose timer expired could not run. One title waited 117 ms right before its music started. LockGl()now waits for a held lock inside aScopedHostWaitand retries.gl_probechecks the handover.
- The UI thread holds
- Issue #55, start offset:
repsp::hle::atrac::SetStartOffsetMs(int32_t)(default 0) starts newly opened tracks that much later in their content (positive, capped at the end) or after that much leading silence (negative).- The block size is kept, and loops and resets are not affected.
- Apps use it to compensate host output latency against a game clock.
Confirmed by the user in windowed mode, together with the app's preemption fix and music offset.
Verified: build and CTest pass on Win64 (Visual Studio and Ninja) Debug/Release and Linux x64 Debug/Release. audio_probe passed 100 consecutive runs each in Release and Debug.