I have been googling about electronics gitters and the only thing i know is that is has something to do with sync.
Well when i run Blargg's, the ones that test the apu timing it is always for me "odd jitter not handled properly".
I would like some explanation so i can correct that APU timming error.
THXS
Jitter (APU) what is it?
Moderator: Moderators
Re: Jitter (APU) what is it?
I'm fairly certain the "jitter" refers to clock alignment - inside the 2A03, the CPU's clock is subdivided into two half-speed clocks, one "even" and one "odd", and those two clocks are used to drive the DMA controller as well as most of the audio logic.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
Re: Jitter (APU) what is it?
Blargg's test isn't checking for "jitter" in the audio signal sense.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: Jitter (APU) what is it?
According to the wiki,
The APU frame counter is clocked every other CPU clock cycle. Writing to $4017 will reset the frame counter, but there's a delay of either 3 or 4 CPU cycles before it actually happens. If the write occurs on the same clock cycle the sequencer is clocked, the delay is 3 CPU cycles. If the write occurs in between sequencer clocks, the delay is 4 CPU cycles.
The fact that the delay is sometimes 3 and sometimes 4 CPU cycles is what I think the "jitter" is referring to, but I'm not 100% sure.
The APU frame counter is clocked every other CPU clock cycle. Writing to $4017 will reset the frame counter, but there's a delay of either 3 or 4 CPU cycles before it actually happens. If the write occurs on the same clock cycle the sequencer is clocked, the delay is 3 CPU cycles. If the write occurs in between sequencer clocks, the delay is 4 CPU cycles.
The fact that the delay is sometimes 3 and sometimes 4 CPU cycles is what I think the "jitter" is referring to, but I'm not 100% sure.
Re: Jitter (APU) what is it?
The difference in APU clock versus the CPU clock causes 'jitter' in most CPU/APU interactions. It's very relevant for DMA, but you even see it with the CPU's joypad OUT pins, which only update every APU cycle. The CPU/APU alignment is random at power-on, too, so it's another source of inconsistent behavior.
Re: Jitter (APU) what is it?
It was discovered I think last year by Perkka. It's a huge issue for the compatibility mode of his EPSM, which uses toggles on OUT1 to tell the expansion device when to read the data lines. Getting around this requires synchronization, which can be done with OAM DMA or silent DMC samples, but if you're using DMC, OAM DMA can't guarantee a correct alignment because DMC DMA near the end of OAM DMA takes an odd number of cycles. I've come up with a very gross workaround where the opcode after the write is a 'dummy' instruction that has the same value in the data bits as the value written, so the data is the same on both possible cycles, but I still need to put together a library that makes this work.
You can also detect your alignment by doing a one-cycle strobe with INC, where the strobe will be ignored depending on where it falls relative to the APU cycle.
You can also detect your alignment by doing a one-cycle strobe with INC, where the strobe will be ignored depending on where it falls relative to the APU cycle.
Re: Jitter (APU) what is it?
I have an english missunderstading problem:Drag wrote: ↑Fri May 06, 2022 11:40 am According to the wiki,
The APU frame counter is clocked every other CPU clock cycle. Writing to $4017 will reset the frame counter, but there's a delay of either 3 or 4 CPU cycles before it actually happens. If the write occurs on the same clock cycle the sequencer is clocked, the delay is 3 CPU cycles. If the write occurs in between sequencer clocks, the delay is 4 CPU cycles.
The fact that the delay is sometimes 3 and sometimes 4 CPU cycles is what I think the "jitter" is referring to, but I'm not 100% sure.
What does it mean every OTHER cpu cycle?
ANes
Re: Jitter (APU) what is it?
"Every Other" means half of them. You skip one, you process one, and so on.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: Jitter (APU) what is it?
Yep, if it's "every" clock cycle: clock - clock - clock - clock.
If it's "every other" clock cycle: clock - skip - clock - skip.
If it's "every third" clock cycle: clock - skip - skip - clock - skip - skip.
...and so on, "every fourth", "every fifth", etc.
If it's "every other" clock cycle: clock - skip - clock - skip.
If it's "every third" clock cycle: clock - skip - skip - clock - skip - skip.
...and so on, "every fourth", "every fifth", etc.