[alsa-devel] [PATCH 2/2] add API to allow disabling period interrupt

Takashi Iwai tiwai at suse.de
Tue Nov 2 08:28:55 CET 2010


At Mon,  1 Nov 2010 17:13:34 -0500,
Pierre-Louis Bossart wrote:
> 
> cleaned-up version of the patch posted on May 17, 2010 by
> Clemens Ladisch <clemens at ladisch.de>
> (No filtering in pcm_multi and pcm_direct info fields)
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at intel.com>
> ---
>  configure.in           |    2 +-
>  include/pcm.h          |    3 ++
>  include/sound/asound.h |    5 +++-
>  src/Versions.in        |    7 +++++
>  src/pcm/pcm.c          |   61 ++++++++++++++++++++++++++++++++++++++++++++++++
>  src/pcm/pcm_local.h    |    3 ++
>  6 files changed, 79 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.in b/configure.in
> index c353759..0a67de7 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -12,7 +12,7 @@ dnl add API = c+1:0:a+1
>  dnl remove API = c+1:0:0
>  dnl *************************************************
>  AC_CANONICAL_HOST
> -AM_INIT_AUTOMAKE(alsa-lib, 1.0.23)
> +AM_INIT_AUTOMAKE(alsa-lib, 1.0.24)
>  eval LIBTOOL_VERSION_INFO="2:0:0"
>  dnl *************************************************
>  AM_CONDITIONAL(INSTALL_M4, test -n "${ACLOCAL}")
> diff --git a/include/pcm.h b/include/pcm.h
> index f3618c3..cd506ab 100644
> --- a/include/pcm.h
> +++ b/include/pcm.h
> @@ -531,6 +531,7 @@ int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
>  int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
>  int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
>  int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
> +int snd_pcm_hw_params_can_disable_period_irq(const snd_pcm_hw_params_t *params);
>  int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
>  				      unsigned int *rate_num,
>  				      unsigned int *rate_den);
> @@ -626,6 +627,8 @@ int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
>  int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
>  int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
>  int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
> +int snd_pcm_hw_params_set_period_irq(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
> +int snd_pcm_hw_params_get_period_irq(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
>  
>  int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
>  int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
> diff --git a/include/sound/asound.h b/include/sound/asound.h
> index fa88938..fbcfef9 100644
> --- a/include/sound/asound.h
> +++ b/include/sound/asound.h
> @@ -278,6 +278,8 @@ enum sndrv_pcm_subformat {
>  #define SNDRV_PCM_INFO_HALF_DUPLEX	0x00100000	/* only half duplex */
>  #define SNDRV_PCM_INFO_JOINT_DUPLEX	0x00200000	/* playback and capture stream are somewhat correlated */
>  #define SNDRV_PCM_INFO_SYNC_START	0x00400000	/* pcm support some kind of sync go */
> +#define SNDRV_PCM_INFO_NO_PERIOD_IRQ    0x00800000      /* period interrupt can be disabled */
> +#define SNDRV_PCM_INFO_FIFO_IN_FRAMES	0x80000000	/* internal kernel flag - FIFO size is in frames */
>  
>  enum sndrv_pcm_state {
>  	SNDRV_PCM_STATE_OPEN = 0,	/* stream is open */
> @@ -346,7 +348,8 @@ enum sndrv_pcm_hw_param {
>  
>  #define SNDRV_PCM_HW_PARAMS_NORESAMPLE	(1<<0)  /* avoid rate resampling */
>  #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER	(1<<1)  /* export buffer */
> -
> +#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_IRQ      (1<<2)  /* disable period
> +                                                          interrupts */
>  struct sndrv_interval {
>  	unsigned int min, max;
>  	unsigned int openmin:1,
> diff --git a/src/Versions.in b/src/Versions.in
> index 8d2dd11..112b9ec 100644
> --- a/src/Versions.in
> +++ b/src/Versions.in
> @@ -129,3 +129,10 @@ ALSA_0.9.7 {
>      @SYMBOL_PREFIX at alsa_lisp_*;
>  } ALSA_0.9.5;
>  
> +ALSA_1.0.24 {
> +  global:
> +    @SYMBOL_PREFIX at snd_pcm_hw_params_can_disable_period_irq;
> +    @SYMBOL_PREFIX at snd_pcm_hw_params_set_period_irq;
> +    @SYMBOL_PREFIX at snd_pcm_hw_params_get_period_irq;
> +
> +} ALSA_0.9.7;
> \ No newline at end of file

In general we don't put this any more.  All snd_* are exported unless
blacklisted.  So, avoid changing the version number in your patch.


thanks,

Takashi


More information about the Alsa-devel mailing list