-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect timing of queued register writes in ymf262 #1
Comments
Hi! Thanks for spotting some misalignments! I think that's because my implementation pre-calculates as much as possible within Up to now this should be the only known difference between AYMO and Nuked OPL3. |
I checked the failing tests and the register writes occur at the same tick in nuked opl and the simd versions (with my solution). Just for testing I moved the the code block Because of this code block, your implementation sometimes generates different output than the original nuked opl. Wouldn't it be better to change your implementation to match the original nuked opl ? Regardless of this, here is an example file where the tests fail (with I haven't checked why, maybe I should open a new issue ? |
Hopefully I fixed tremolo (as per Nuked OPL3) with commit 17913f2. I tested the score file you provided, comparing the output of the two implementations. |
You forgot to add |
Ah! I'm rather tired today 😅 Patched with commit 4374fe5, tested on RPi5 |
Ok, commit f99285b corrected a few wrong slot delays related to As per the open point about queue delays, I'd have to change a few scheduling policies to make them match Nuked's. |
I see three problems/differences with your queue implementation:
In my understanding with these changes your implementation matches nuked (no test I did shows a difference) except the third problem.
I found another example where tests fail: |
When you queue some register writes (
aymo_ymf262_enqueue_write
) before reading the output (aymo_ymf262_generate_i16x2
), there is a difference in timings between nuked opl and simd versions.In nuked opl the register writes occur at the end of 3rd, 5th, 7th, 9th, ... tick.
In simd versions the register writes occur at the end of 1st, 4th, 7th, 10th, ... tick.
This results in different output with simd versions vs nuked opl.
Possible fix is to change the line
chip->rq_delay = AYMO_(REG_QUEUE_LATENCY);
in functionaymo_(rq_update)
tochip->rq_delay = AYMO_(REG_QUEUE_LATENCY) - 1;
and add the linechip->rq_delay = AYMO_(REG_QUEUE_LATENCY);
to the end of functionaymo_(ctor)
.A minor unrelated issue is that in file
aymo_ym7128_common.h
you're declaring variableaymo_ym7128_kernel_minèhase
instead ofaymo_ym7128_kernel_minphase
.The text was updated successfully, but these errors were encountered: