Skip to content
Snippets Groups Projects
Commit e07b5796 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

When trying to open pulse, play a millisecond of silence

This allows the playback thread to open the device and errors to
be checked.  Otherwise, the first sound won't play.
parent f6c2bc33
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1548 failed
...@@ -416,7 +416,17 @@ DLLCALL xptone_open_locked(void) ...@@ -416,7 +416,17 @@ DLLCALL xptone_open_locked(void)
if(pu_api != NULL) { if(pu_api != NULL) {
handle_type=SOUND_DEVICE_PULSEAUDIO; handle_type=SOUND_DEVICE_PULSEAUDIO;
handle_rc++; handle_rc++;
return(TRUE); pthread_mutex_unlock(&handle_mutex);
xptone(0, 1, WAVE_SHAPE_SQUARE, FALSE);
pthread_mutex_lock(&handle_mutex);
if (pulseaudio_device_open_failed) {
fprintf(stderr, "Pulse broke\n");
handle_type = SOUND_DEVICE_CLOSED;
}
else {
fprintf(stderr, "Using pulse\n");
return(TRUE);
}
} }
} }
#endif #endif
...@@ -632,6 +642,7 @@ DLLCALL xptone_open_locked(void) ...@@ -632,6 +642,7 @@ DLLCALL xptone_open_locked(void)
return(TRUE); return(TRUE);
} }
#endif #endif
return(FALSE); return(FALSE);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment