Add SPU mips tests (test on HW help needed)#2018
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I think this generally speaking looks good. We may want to avoid the |
Thanks for the feedback. I removed the For the tests themselves, I reached a point where I am happy with what I wrote so far. I am happy to make further changes where I missed the mark. These tests have been tested only on one console. Before I have the confidence to mark the PR as ready, I'd like help to collect the test run results from other consoles as well. |
The SPUVoice ad/sr fields became adsrLo/adsrHi in main; update the SPU tests so they build against current main. Signed-off-by: Nicolas 'Pixel' Noble <nicolas@nobis-crew.org>
Two bugs kept dump mode from working: a duplicate static is_pcdrv_init broke the build, and spu_dump_pcm wrote warmup+period from uninitialized locals instead of the analyzed header, so dumps were a bare 16-byte header with no samples. Use hdr.warmup/hdr.period. Signed-off-by: Nicolas 'Pixel' Noble <nicolas@nobis-crew.org>
The capture window starts within ~1 sample of the bit-11 edge, and which boundary it lands on varies per boot and per console revision. Checked a SCPH-5501 against the 5552 goldens: samples are bit-identical, off by one capture tick. Byte-exact comparison from sample 0 can't survive that, so find the best integer-sample alignment in a small window first. The periodicity check is now shift-invariant. Signed-off-by: Nicolas 'Pixel' Noble <nicolas@nobis-crew.org>
The bit-11 sync and the busy-wait-timed envelope reads are jitter- sensitive; an interrupt mid-measurement mis-syncs a capture or skews an envx read. Disable interrupts for the suite, as the cop0/cpu/timer tests do. Signed-off-by: Nicolas 'Pixel' Noble <nicolas@nobis-crew.org>
|
Pushed a few commits to your branch: merged main (the SPUVoice On the offset: I ran this on a 5501 against your 5552 goldens. The decoded samples are bit-identical, just shifted by one capture tick - the bit-11 sync only pins the start to ~1 sample, and which boundary it lands on differs per boot and per console revision. So a byte-exact compare was never going to be portable; the new one finds the integer-sample alignment first. Two things still flaky on real hardware, more in your court since they're test-design calls:
6-boot sweep on the 5501 after these changes: 23/23, 19/23, 19/23, 14/23, 11/23, 21/23 - the sub-19 ones are the gross sync misses, the 19-21 ones are just the ADSR tolerances. |
| // envx read past its tolerance. Disable interrupts for the suite, as the | ||
| // cop0/cpu/timer tests do. | ||
| CESTER_BEFORE_ALL(spu_tests, | ||
| s_interruptsWereEnabled = enterCriticalSection(); |
I am experimenting a SPU regression suite on a SPCH-5552 to raise the base line to which emulators should adhere to reproduce PS1 sounds accurately.
As of today, tests are non-exhaustive and they occasionally suffer from synchronization issues. These tests aim to purely focus on ADPCM decoding, resampling and the rate ADSR envelopes change the voice volume given a certain set-up. These tests should not depend to accurate CPU cycles, as it would defeat their purpose.
The PR is in draft. I am mostly requesting for feedback. The SPU synchronization is imperfect, and both ADPCM and voice tests might occasionally fail on real hardware. These tests have not been tested on older or newer PS1 revisions, on a PS2 or arcade boards. Tests hang on PCSX Redux due to the SPU Status bit11 flip not being implemented.