[alsa-devel] [PATCH] alsa-plugins: Pulse: only underrun if no more data has been written

Raymond Yau superquad.vortex2 at gmail.com
Thu Sep 22 08:12:00 CEST 2011


2011/8/26 Takashi Iwai <tiwai at suse.de>:
> At Thu, 25 Aug 2011 08:17:17 +0200,
>
> It actually is.  gcc gives an error when it's not available.
> The preprocessor is not C, so it's a slightly different rule.
>
> I committed the build fix patch below.
>
>
> thanks,
>
> Takashi
>
> ---
> From: Takashi Iwai <tiwai at suse.de>
> Subject: [PATCH] pulse - Define a dummy PA_CHECK_VERSION() when not available
>
> An old version of PA doesn't define this macro, and gives a build error.
>
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
>  pulse/pcm_pulse.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
> index b0e52ab..e0fbd4c 100644
> --- a/pulse/pcm_pulse.c
> +++ b/pulse/pcm_pulse.c
> @@ -587,7 +587,11 @@ static void stream_request_cb(pa_stream * p, size_t length, void *userdata)
>        update_active(pcm);
>  }
>
> -#if defined(PA_CHECK_VERSION) && PA_CHECK_VERSION(0,99,0)
> +#ifndef PA_CHECK_VERSION
> +#define PA_CHECK_VERSION(x, y, z)      0
> +#endif
> +
> +#if PA_CHECK_VERSION(0,99,0)
>  #define DEFAULT_HANDLE_UNDERRUN                1
>  #define do_underrun_detect(pcm, p) \
>        ((pcm)->written <= pa_stream_get_underflow_index(p))
> --
> 1.7.6.1
>
>

It seem that there is no way to use "handle_underrun=1"  anymore ?

attach a test program which test the playback/capture position

The result seem avail of "pulse" device never reach buffer_size
and the accuracy of the pointer of pulse device depend on the period
time and it is not as accurate as than those of "hw" and "plug:dmix"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alsa_test.c
Type: text/x-csrc
Size: 7039 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20110922/b878c74c/attachment.c 


More information about the Alsa-devel mailing list