Exercise network recovery and changing device block sizes

This commit is contained in:
evgeny committed 2026-10-15 13:23:28 +02:00
1 parent 26c91e6295
commit b7b043777b
2 files changed
+48 -1

No files matched your search

+19 -1
View File
@@ -143,9 +143,27 @@ static void phase_after_silence() {
DEBUG_INFO(DEBUG_CATEGORY_CALL, "PASS delay phase: 20 arbitrary initial silence/block combinations converge using cuts only");
}
static void changing_blocks() {
Trial t;
const unsigned blocks[] = {1, 191, 192, 193, 575, 576, 577, 768, 960, 1920, 8192};
uint64_t next = 0, time = 0;
t.available = 48000;
for (unsigned tick = 0; tick < 3000; ++tick) {
unsigned block = blocks[tick % (sizeof(blocks) / sizeof(blocks[0]))];
while (next <= time) { t.available += 960; next += 960; }
// Пауза устройства на каждый новый цикл создаёт избыток, затем резерв заставляет выйти из DSP.
if (!(tick % 50)) t.available += 48000;
unsigned reserve = tick % 50 < 25 ? 960 : (unsigned)(t.available + t.delay.stats().pending + 960);
t.pull(block, reserve);
time += block;
}
CHECK(t.boundaries >= 120);
DEBUG_INFO(DEBUG_CATEGORY_CALL, "PASS delay changing blocks 1..8192 samples, boundaries=%llu", (unsigned long long)t.boundaries);
}
int main() {
debug_config_init(); debug_set_level(DEBUG_LEVEL_INFO);
for (unsigned block : {240, 480, 777, 960}) for (unsigned phase : {0, 239, 479, 719, 959}) steady(block, phase);
switching(); tail_and_reset(); phase_after_silence();
switching(); tail_and_reset(); phase_after_silence(); changing_blocks();
return 0;
}