Skip to content

Fix transmit failures when using virtual devices #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,14 +1204,28 @@ int audio_flush (int a)

snd_pcm_recover (adev[a].audio_out_handle, k, 1);
}
else if (k == -ESTRPIPE) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Driver suspended, recovering\n");
snd_pcm_recover(adev[a].audio_out_handle, k, 1);
}
else if (k == -EBADFD) {
k = snd_pcm_prepare (adev[a].audio_out_handle);
if(k < 0) {
dw_printf ("Error preparing after bad state: %s\n", snd_strerror(k));
}
}
else if (k < 0) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Audio write error: %s\n", snd_strerror(k));

/* Some other error condition. */
/* Try again. What do we have to lose? */

snd_pcm_recover (adev[a].audio_out_handle, k, 1);
k = snd_pcm_prepare (adev[a].audio_out_handle);
if(k < 0) {
dw_printf ("Error preparing after error: %s\n", snd_strerror(k));
}
}
else if (k != adev[a].outbuf_len / adev[a].bytes_per_frame) {
text_color_set(DW_COLOR_ERROR);
Expand Down