mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-22 22:25:28 +00:00
ALSA: support mmap complex placement
This commit is contained in:
parent
1e7cd145ad
commit
de5bb99d1f
|
@ -152,8 +152,8 @@ or the server not running, or the platform is wrong, the next backend is tried.
|
|||
0. PulseAudio
|
||||
0. ALSA (Linux)
|
||||
0. CoreAudio (OSX)
|
||||
0. ASIO (Windows)
|
||||
0. WASAPI (Windows)
|
||||
0. ASIO (Windows)
|
||||
0. Dummy
|
||||
|
||||
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
|
||||
- make sure every function which can return an error documents which errors
|
||||
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. -fvisibility=hidden and then explicitly export stuff
|
||||
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.
|
||||
0. add len arguments to APIs that have char *
|
||||
0. custom allocator support
|
||||
0. ALSA: support devices that don't support mmap access
|
||||
|
||||
## Planned Uses for libsoundio
|
||||
|
||||
|
|
13
src/alsa.cpp
13
src/alsa.cpp
|
@ -274,8 +274,11 @@ static int probe_open_device(SoundIoDevice *device, snd_pcm_t *handle, int resam
|
|||
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_NONINTERLEAVED)) < 0)
|
||||
return SoundIoErrorIncompatibleDevice;
|
||||
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_COMPLEX)) < 0) {
|
||||
return SoundIoErrorIncompatibleDevice;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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_NONINTERLEAVED)) < 0) {
|
||||
outstream_destroy_alsa(si, os);
|
||||
return SoundIoErrorIncompatibleDevice;
|
||||
if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) < 0) {
|
||||
outstream_destroy_alsa(si, os);
|
||||
return SoundIoErrorIncompatibleDevice;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue