0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00

alsa is weird

This commit is contained in:
2025-01-31 18:18:38 +01:00
parent 0dfeadb7b2
commit 7829a995cd

View File

@@ -587,7 +587,12 @@ int main(int argc, char **argv) {
break;
}
} else {
snd_pcm_writei(output_handle, output, sizeof(output));
snd_pcm_sframes_t frames_written = snd_pcm_writei(output_handle, output, BUFFER_SIZE);
if (frames_written < 0) {
fprintf(stderr, "Error: write to audio interface failed: %s\n", snd_strerror(frames_written));
} else if (frames_written < BUFFER_SIZE) {
fprintf(stderr, "Warning: underrun, only %ld frames written out of %d\n", frames_written, BUFFER_SIZE);
}
}
}
printf("Cleaning up...\n");