diff --git a/src/plugins/alsa09/ao_alsa09.c b/src/plugins/alsa09/ao_alsa09.c index fa88b4ba5af16616fd666d2013fe22205c8315c3..5cd548d6006d113ffee206a3aeb2b619bc167e1b 100644 --- a/src/plugins/alsa09/ao_alsa09.c +++ b/src/plugins/alsa09/ao_alsa09.c @@ -71,7 +71,10 @@ int ao_plugin_test() snd_pcm_t *handle; int err; - err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0); + /* Use nonblock flag when testing to avoid getting stuck if the device + is in use. */ + err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, + SND_PCM_NONBLOCK); if (err != 0) return 0; /* Cannot use this plugin with default parameters */