fix: reorder passthrough setup before load command in WAV load test

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-11 21:49:35 +00:00
parent 7d842163a2
commit 7deea9266b

View File

@@ -909,20 +909,7 @@ static int test_wav_load(void) {
unlink("loop.wav"); unlink("loop.wav");
return 1; return 1;
} }
/* send control key + note 70 to trigger load */ /* set up passthrough callback before sending load command */
if (send_jack_note_on("looper:control", 64, 127) != 0) {
jack_client_close(client);
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
unlink("loop.wav"); return 1;
}
safe_usleep(200000);
if (send_jack_note_on("looper:control", 70, 127) != 0) {
jack_client_close(client);
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
unlink("loop.wav"); return 1;
}
safe_usleep(1000000); /* give time for load to complete */
/* listen for the loop */
int sr = jack_get_sample_rate(client); int sr = jack_get_sample_rate(client);
continuous_sine = 0; continuous_sine = 0;
beep_remaining = 0; beep_remaining = 0;
@@ -944,7 +931,24 @@ static int test_wav_load(void) {
unlink("loop.wav"); unlink("loop.wav");
return 1; return 1;
} }
safe_usleep(6000000); /* 6 seconds to ensure loop is heard */ /* send control key + note 70 to trigger load */
if (send_jack_note_on("looper:control", 64, 127) != 0) {
jack_deactivate(client);
jack_client_close(client);
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
unlink("loop.wav"); return 1;
}
safe_usleep(200000);
if (send_jack_note_on("looper:control", 70, 127) != 0) {
jack_deactivate(client);
jack_client_close(client);
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
unlink("loop.wav"); return 1;
}
/* wait for the loop to be fully loaded and playing */
safe_usleep(2000000);
/* continue listening for the rest of the time */
safe_usleep(4000000); /* total 6 seconds after activation */
jack_deactivate(client); jack_deactivate(client);
jack_client_close(client); jack_client_close(client);
kill(pid, SIGTERM); waitpid(pid, NULL, 0); kill(pid, SIGTERM); waitpid(pid, NULL, 0);