mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-23 06:55:39 +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. 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
|
||||||
|
|
||||||
|
|
|
@ -274,9 +274,12 @@ 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) {
|
||||||
|
if ((err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) < 0) {
|
||||||
return SoundIoErrorIncompatibleDevice;
|
return SoundIoErrorIncompatibleDevice;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int channel_count;
|
unsigned int channel_count;
|
||||||
if ((err = snd_pcm_hw_params_set_channels_last(handle, hwparams, &channel_count)) < 0)
|
if ((err = snd_pcm_hw_params_set_channels_last(handle, hwparams, &channel_count)) < 0)
|
||||||
|
@ -965,10 +968,12 @@ 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) {
|
||||||
|
if ((err = snd_pcm_hw_params_set_access(osa->handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) < 0) {
|
||||||
outstream_destroy_alsa(si, os);
|
outstream_destroy_alsa(si, os);
|
||||||
return SoundIoErrorIncompatibleDevice;
|
return SoundIoErrorIncompatibleDevice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((err = snd_pcm_hw_params_set_channels(osa->handle, hwparams, outstream->layout.channel_count)) < 0) {
|
if ((err = snd_pcm_hw_params_set_channels(osa->handle, hwparams, outstream->layout.channel_count)) < 0) {
|
||||||
outstream_destroy_alsa(si, os);
|
outstream_destroy_alsa(si, os);
|
||||||
|
|
Loading…
Reference in a new issue