[alsa-devel] [PATCH] Don't check if period size is equal to buffer size
At least some drivers seem to allow a single period and those which don't would correct us anyway. Moreover, Pulseaudio with tsched sets this frequently. --- aplay/aplay.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c index c7c82a1..4fa36cb 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1044,11 +1044,6 @@ static void set_params(void) } snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); snd_pcm_hw_params_get_buffer_size(params, &buffer_size); - if (chunk_size == buffer_size) { - error(_("Can't use period equal to buffer size (%lu == %lu)"), - chunk_size, buffer_size); - exit(EXIT_FAILURE); - } snd_pcm_sw_params_current(handle, swparams); if (avail_min < 0) n = chunk_size;
On Tue, 15 Sep 2009, Lubomir Rintel wrote:
At least some drivers seem to allow a single period and those which don't would correct us anyway. Moreover, Pulseaudio with tsched sets this frequently.
I'm afraid, but this patch is not enough. At least chunk_size should be less than buffer_size otherwise you'll get underrun immediately.
Jaroslav
aplay/aplay.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c index c7c82a1..4fa36cb 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1044,11 +1044,6 @@ static void set_params(void) } snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
- if (chunk_size == buffer_size) {
error(_("Can't use period equal to buffer size (%lu == %lu)"),
chunk_size, buffer_size);
exit(EXIT_FAILURE);
- } snd_pcm_sw_params_current(handle, swparams); if (avail_min < 0) n = chunk_size;
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Fri, 2 Oct 2009 10:45:31 +0200 (CEST), Jaroslav Kysela wrote:
On Tue, 15 Sep 2009, Lubomir Rintel wrote:
At least some drivers seem to allow a single period and those which don't would correct us anyway. Moreover, Pulseaudio with tsched sets this frequently.
I'm afraid, but this patch is not enough. At least chunk_size should be less than buffer_size otherwise you'll get underrun immediately.
Yep, period=1 makes sense only for the system doing scheduling by itself.
thanks,
Takashi
participants (3)
-
Jaroslav Kysela
-
Lubomir Rintel
-
Takashi Iwai