mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
alsa-util: No logging when sound card only supports non-interleaved sample format
as suggested by https://bugs.freedesktop.org/show_bug.cgi?id=84804 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
parent
62dc0ad6c3
commit
55a25246ee
1 changed files with 15 additions and 0 deletions
|
|
@ -181,6 +181,19 @@ static int set_buffer_size(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void check_access(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, bool use_mmap) {
|
||||||
|
if ((use_mmap && !snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) ||
|
||||||
|
!snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED))
|
||||||
|
pa_log_error("Weird, PCM claims to support interleaved access, but snd_pcm_hw_params_set_access() failed.");
|
||||||
|
|
||||||
|
if ((use_mmap && !snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED)) ||
|
||||||
|
!snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_NONINTERLEAVED))
|
||||||
|
pa_log_error("PCM seems to support non-interleaved access, but PA doesn't.");
|
||||||
|
else if (use_mmap && !snd_pcm_hw_params_test_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_COMPLEX)) {
|
||||||
|
pa_log_error("PCM seems to support mmapped complex access, but PA doesn't.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the hardware parameters of the given ALSA device. Returns the
|
/* Set the hardware parameters of the given ALSA device. Returns the
|
||||||
* selected fragment settings in *buffer_size and *period_size. Determine
|
* selected fragment settings in *buffer_size and *period_size. Determine
|
||||||
* whether mmap and tsched mode can be enabled. */
|
* whether mmap and tsched mode can be enabled. */
|
||||||
|
|
@ -227,6 +240,7 @@ int pa_alsa_set_hw_params(
|
||||||
|
|
||||||
if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
|
if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
|
||||||
pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret));
|
pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret));
|
||||||
|
check_access(pcm_handle, hwparams, true);
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -235,6 +249,7 @@ int pa_alsa_set_hw_params(
|
||||||
|
|
||||||
} else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
|
} else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
|
||||||
pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret));
|
pa_log_debug("snd_pcm_hw_params_set_access() failed: %s", pa_alsa_strerror(ret));
|
||||||
|
check_access(pcm_handle, hwparams, false);
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue