ALSA: support mmap complex placement

This commit is contained in:
Andrew Kelley 2015-07-20 17:33:21 -07:00
parent 1e7cd145ad
commit de5bb99d1f
2 changed files with 11 additions and 7 deletions

View file

@ -152,8 +152,8 @@ or the server not running, or the platform is wrong, the next backend is tried.
0. PulseAudio 0. PulseAudio
0. ALSA (Linux) 0. ALSA (Linux)
0. CoreAudio (OSX) 0. CoreAudio (OSX)
0. ASIO (Windows)
0. WASAPI (Windows) 0. WASAPI (Windows)
0. ASIO (Windows)
0. Dummy 0. Dummy
If you don't like this order, you can use `soundio_connect_backend` to If you don't like this order, you can use `soundio_connect_backend` to
@ -246,8 +246,6 @@ view `coverage/index.html` in a browser.
0. clean up API and improve documentation 0. clean up API and improve documentation
- make sure every function which can return an error documents which errors - make sure every function which can return an error documents which errors
it can return it can return
- consider doing the public/private struct thing and make `backend_data` a
union instead of a `void *`
0. use a documentation generator and host the docs somewhere 0. use a documentation generator and host the docs somewhere
0. -fvisibility=hidden and then explicitly export stuff 0. -fvisibility=hidden and then explicitly export stuff
0. Integrate into libgroove and test with Groove Basin 0. Integrate into libgroove and test with Groove Basin
@ -259,6 +257,7 @@ view `coverage/index.html` in a browser.
unused to a buffer for you. unused to a buffer for you.
0. add len arguments to APIs that have char * 0. add len arguments to APIs that have char *
0. custom allocator support 0. custom allocator support
0. ALSA: support devices that don't support mmap access
## Planned Uses for libsoundio ## Planned Uses for libsoundio

View file

@ -274,8 +274,11 @@ static int probe_open_device(SoundIoDevice *device, snd_pcm_t *handle, int resam
return SoundIoErrorOpeningDevice; return SoundIoErrorOpeningDevice;
if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) { if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) < 0) if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) < 0) {
return SoundIoErrorIncompatibleDevice; if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) < 0) {
return SoundIoErrorIncompatibleDevice;
}
}
} }
unsigned int channel_count; unsigned int channel_count;
@ -965,8 +968,10 @@ static int outstream_open_alsa(SoundIoPrivate *si, SoundIoOutStreamPrivate *os)
if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) { if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) < 0) { if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) < 0) {
outstream_destroy_alsa(si, os); if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) < 0) {
return SoundIoErrorIncompatibleDevice; outstream_destroy_alsa(si, os);
return SoundIoErrorIncompatibleDevice;
}
} }
} }