Skip to content

Commit

Permalink
ALSA: be ready for /dev/snd to not be available
Browse files Browse the repository at this point in the history
If this occurs, the system has no ALSA support in the kernel,
and it is appropriate for the backend to fail.

closes libuv#6
  • Loading branch information
andrewrk committed Sep 3, 2015
1 parent 85c2190 commit 918183a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/alsa.cpp
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 918183a

Please sign in to comment.