ALSA: be ready for /dev/snd to not be available

If this occurs, the system has no ALSA support in the kernel,
and it is appropriate for the backend to fail.

closes #6
This commit is contained in:
Andrew Kelley 2015-09-03 15:40:36 -07:00
parent 85c2190675
commit 918183adc6

View file

@ -1814,13 +1814,14 @@ int soundio_alsa_init(SoundIoPrivate *si) {
assert(err != EFAULT);
assert(err != EINVAL);
assert(err != ENAMETOOLONG);
assert(err != ENOENT);
destroy_alsa(si);
if (err == ENOSPC) {
return SoundIoErrorSystemResources;
} else {
assert(err == ENOMEM);
} else if (err == ENOMEM) {
return SoundIoErrorNoMem;
} else {
// Kernel must not have ALSA support.
return SoundIoErrorInitAudioBackend;
}
}