When I developped Bad Apple I found out that the STE DMA frequencies may not exactly be the ones that are in every documentation.
This also applies to vertical video frequencies.
Atari ST video frequencies are often described as:
However it seems high-res is actually 71.2Hz and not 71Hz.
The same goes with STE DMA audio:
I read somewhere (maybe here) that the frequencies are actually derived from a main frequency and the values above are rounded.
For Bad Apple I needed to know all exact frequencies because the audio is multiplexed with the video. If audio frames are too small or too large, there is a sync drift that ends up with audio frames being played twice or skipped.
To be precise, the demo runs at 60Hz and plays a 50066 Hz sound in stereo, so the average audio frame should be 1668,87 bytes. I round it to 1668 and my generator adds a pair of bytes from time to time to stick to 1668,87 globally.
The audio DMA is then set to loop mode and the next audio frame addresses are loaded into the DMA register while an audio frame is already playing. This was to avoid using Timer A which may fire too late because of blitter transfers... and honestly it would make some things more complicated.
But... it doesn't work as expected.
When I fire a Timer A to see where the DMA loop point occurs, I can see a big drift in time. Also I noted that the drift is different on real hardware and on emulators.
I had to change the data used for my calculation and found out that the best result I could get was with (2* 50035)/60 = 1667,83 bytes/vbl.
It works, but I wondered why 50035? Or maybe this is the video frequency that's not 60 but something else?
Or maybe I'm completely wrong and my code is crap
Now I'm doing a high-res version and I have the exact same issue, except that the audio drift is really huge. Currently the best shot I could get to make it work on emulators is (2*50005)/71.2 = 1404,63 bytes/vbl. And various emulators behave really differently in monochrome. I couldn't test it on real hardware yet.
To be honest I had the exact same kind of issues back in the 1990's when I worked on an Amiga TFMX conversion.