I'm a bit behind so I just finished the audio marathon lecture and, although my sound system timings appear to be the same as Casey's, I'm getting audio crackles and pops.

The main difference I see in the numbers is that my frame times are more erratic than Casey's (his seem to be dead on). If I just busy wait, the sound is fine and the frame times are steady. The odd thing is, if I busy wait with a positive, negative or random delta on the frame time, as long as the delta is not too big (but still much bigger than the deltas I see from the Sleep code) the sound remains fine.

Here is a comparison of the output from a clean busy wait (tries to hit frame time exactly):

BTL:7680 TC:16360 BTW:8680 - PC:1920 WC:7680 DELTA:5760 (0.030000s)

BTL:16360 TC:18280 BTW:1920 - PC:3840 WC:9600 DELTA:5760 (0.030000s)

BTL:18280 TC:25960 BTW:7680 - PC:11520 WC:17280 DELTA:5760 (0.030000s)

BTL:25960 TC:31720 BTW:5760 - PC:17280 WC:23040 DELTA:5760 (0.030000s)

BTL:31720 TC:37480 BTW:5760 - PC:23040 WC:28800 DELTA:5760 (0.030000s)

BTL:37480 TC:45160 BTW:7680 - PC:30720 WC:36480 DELTA:5760 (0.030000s)

BTL:45160 TC:50920 BTW:5760 - PC:36480 WC:42240 DELTA:5760 (0.030000s)

BTL:50920 TC:58600 BTW:7680 - PC:44160 WC:49920 DELTA:5760 (0.030000s)

BTL:58600 TC:64360 BTW:5760 - PC:49920 WC:55680 DELTA:5760 (0.030000s)

BTL:64360 TC:70120 BTW:5760 - PC:55680 WC:61440 DELTA:5760 (0.030000s)

BTL:70120 TC:77800 BTW:7680 - PC:63360 WC:69120 DELTA:5760 (0.030000s)

BTL:77800 TC:83560 BTW:5760 - PC:69120 WC:74880 DELTA:5760 (0.030000s)

BTL:83560 TC:91240 BTW:7680 - PC:76800 WC:82560 DELTA:5760 (0.030000s)

BTL:91240 TC:97000 BTW:5760 - PC:82560 WC:88320 DELTA:5760 (0.030000s)

BTL:97000 TC:102760 BTW:5760 - PC:88320 WC:94080 DELTA:5760 (0.030000s)

BTL:102760 TC:110440 BTW:7680 - PC:96000 WC:101760 DELTA:5760 (0.030000s)

BTL:110440 TC:116200 BTW:5760 - PC:101760 WC:107520 DELTA:5760 (0.030000s)

BTL:116200 TC:121960 BTW:5760 - PC:107520 WC:113280 DELTA:5760 (0.030000s)

BTL:121960 TC:129640 BTW:7680 - PC:115200 WC:120960 DELTA:5760 (0.030000s)

BTL:129640 TC:135400 BTW:5760 - PC:120960 WC:126720 DELTA:5760 (0.030000s)

BTL:135400 TC:143080 BTW:7680 - PC:128640 WC:134400 DELTA:5760 (0.030000s)

BTL:143080 TC:148840 BTW:5760 - PC:134400 WC:140160 DELTA:5760 (0.030000s)

BTL:148840 TC:156520 BTW:7680 - PC:142080 WC:147840 DELTA:5760 (0.030000s)

BTL:156520 TC:162280 BTW:5760 - PC:147840 WC:153600 DELTA:5760 (0.030000s)

BTL:162280 TC:168040 BTW:5760 - PC:153600 WC:159360 DELTA:5760 (0.030000s)

BTL:168040 TC:175720 BTW:7680 - PC:161280 WC:167040 DELTA:5760 (0.030000s)

BTL:175720 TC:181480 BTW:5760 - PC:167040 WC:172800 DELTA:5760 (0.030000s)

BTL:181480 TC:187240 BTW:5760 - PC:172800 WC:178560 DELTA:5760 (0.030000s)

BTL:187240 TC:2920 BTW:7680 - PC:180480 WC:186240 DELTA:5760 (0.030000s)

BTL:2920 TC:8680 BTW:5760 - PC:186240 WC:0 DELTA:5760 (0.030000s)

And the output from the Sleep code that tries to hit the frame time (and has lots of audio cracks and pops):

BTL:5760 TC:14440 BTW:8680 - PC:0 WC:5760 DELTA:5760 (0.030000s)

BTL:14440 TC:18280 BTW:3840 - PC:3840 WC:9600 DELTA:5760 (0.030000s)

BTL:18280 TC:24040 BTW:5760 - PC:9600 WC:15360 DELTA:5760 (0.030000s)

BTL:24040 TC:31720 BTW:7680 - PC:17280 WC:23040 DELTA:5760 (0.030000s)

BTL:31720 TC:37480 BTW:5760 - PC:23040 WC:28800 DELTA:5760 (0.030000s)

BTL:37480 TC:47080 BTW:9600 - PC:32640 WC:38400 DELTA:5760 (0.030000s)

BTL:47080 TC:50920 BTW:3840 - PC:36480 WC:42240 DELTA:5760 (0.030000s)

BTL:50920 TC:58600 BTW:7680 - PC:44160 WC:49920 DELTA:5760 (0.030000s)

BTL:58600 TC:66280 BTW:7680 - PC:51840 WC:57600 DELTA:5760 (0.030000s)

BTL:66280 TC:70120 BTW:3840 - PC:55680 WC:61440 DELTA:5760 (0.030000s)

BTL:70120 TC:75880 BTW:5760 - PC:61440 WC:67200 DELTA:5760 (0.030000s)

BTL:75880 TC:83560 BTW:7680 - PC:69120 WC:74880 DELTA:5760 (0.030000s)

BTL:83560 TC:91240 BTW:7680 - PC:76800 WC:82560 DELTA:5760 (0.030000s)

BTL:91240 TC:97000 BTW:5760 - PC:82560 WC:88320 DELTA:5760 (0.030000s)

BTL:97000 TC:102760 BTW:5760 - PC:88320 WC:94080 DELTA:5760 (0.030000s)

BTL:102760 TC:110440 BTW:7680 - PC:96000 WC:101760 DELTA:5760 (0.030000s)

BTL:110440 TC:116200 BTW:5760 - PC:101760 WC:107520 DELTA:5760 (0.030000s)

BTL:116200 TC:121960 BTW:5760 - PC:107520 WC:113280 DELTA:5760 (0.030000s)

BTL:121960 TC:129640 BTW:7680 - PC:115200 WC:120960 DELTA:5760 (0.030000s)

BTL:129640 TC:135400 BTW:5760 - PC:120960 WC:126720 DELTA:5760 (0.030000s)

BTL:135400 TC:143080 BTW:7680 - PC:128640 WC:134400 DELTA:5760 (0.030000s)

BTL:143080 TC:148840 BTW:5760 - PC:134400 WC:140160 DELTA:5760 (0.030000s)

BTL:148840 TC:158440 BTW:9600 - PC:144000 WC:149760 DELTA:5760 (0.030000s)

BTL:158440 TC:162280 BTW:3840 - PC:147840 WC:153600 DELTA:5760 (0.030000s)

BTL:162280 TC:171880 BTW:9600 - PC:157440 WC:163200 DELTA:5760 (0.030000s)

BTL:171880 TC:175720 BTW:3840 - PC:161280 WC:167040 DELTA:5760 (0.030000s)

BTL:175720 TC:181480 BTW:5760 - PC:167040 WC:172800 DELTA:5760 (0.030000s)

BTL:181480 TC:189160 BTW:7680 - PC:174720 WC:180480 DELTA:5760 (0.030000s)

BTL:189160 TC:2920 BTW:5760 - PC:180480 WC:186240 DELTA:5760 (0.030000s)

BTL:2920 TC:10600 BTW:7680 - PC:188160 WC:1920 DELTA:5760 (0.030000s)

BTL:10600 TC:16360 BTW:5760 - PC:1920 WC:7680 DELTA:5760 (0.030000s)

BTL:16360 TC:24040 BTW:7680 - PC:9600 WC:15360 DELTA:5760 (0.030000s)

BTL:24040 TC:31720 BTW:7680 - PC:17280 WC:23040 DELTA:5760 (0.030000s)

BTL:31720 TC:37480 BTW:5760 - PC:23040 WC:28800 DELTA:5760 (0.030000s)

BTL:37480 TC:43240 BTW:5760 - PC:28800 WC:34560 DELTA:5760 (0.030000s)

BTL:43240 TC:49000 BTW:5760 - PC:34560 WC:40320 DELTA:5760 (0.030000s)

BTL:49000 TC:56680 BTW:7680 - PC:42240 WC:48000 DELTA:5760 (0.030000s)

BTL:56680 TC:62440 BTW:5760 - PC:48000 WC:53760 DELTA:5760 (0.030000s)

BTL:62440 TC:70120 BTW:7680 - PC:55680 WC:61440 DELTA:5760 (0.030000s)

BTL:70120 TC:75880 BTW:5760 - PC:61440 WC:67200 DELTA:5760 (0.030000s)

BTL:75880 TC:81640 BTW:5760 - PC:67200 WC:72960 DELTA:5760 (0.030000s)

BTL:81640 TC:87400 BTW:5760 - PC:72960 WC:78720 DELTA:5760 (0.030000s)

BTL:87400 TC:98920 BTW:11520 - PC:84480 WC:90240 DELTA:5760 (0.030000s)

BTL:98920 TC:100840 BTW:1920 - PC:86400 WC:92160 DELTA:5760 (0.030000s)

BTL:100840 TC:108520 BTW:7680 - PC:94080 WC:99840 DELTA:5760 (0.030000s)

BTL:108520 TC:116200 BTW:7680 - PC:101760 WC:107520 DELTA:5760 (0.030000s)

I can patch things right now by jacking up the SafetyBytes to a whole frame. Maybe we can do that for now in the "trunk" so that people like me don't need to do this every drop?