simoninns / DomesdayDuplicator

High-speed LaserDisc RF sampler
GNU General Public License v3.0
148 stars 21 forks source link

Make the test sequence's length prime #107

Closed atsampson closed 2 years ago

atsampson commented 4 years ago

At present, the DDD test sequence counts from 0 to 1023, so overall it's 2 KiB of data. This divides evenly into the lengths of both the USB transfers and the DDD application's disk buffers, and the result is that all transfers and all buffers (within the same test capture) have exactly the same contents - which means that faults that result in transfers or buffers being dropped, reordered or duplicated can't be detected by test captures.

Could the test sequence be made to count from 0 to 1020 instead (1021 being the biggest prime < 1024)? The code that checks the pattern could easily handle both lengths - start by assuming the pattern is 1024 long, and if you see 0 instead of 1021, switch to assuming it's 1021 long...

simoninns commented 4 years ago

Sounds like a perfectly good idea to me. Generally, it was only meant as a 'light' test to assist with testing the hardware - it was more to allow you to see which data-bit was missing if there was a soldering issue on the board. Making it better/more useful is a good idea though.