Improved automatic start/stop

This commit is contained in:
Abramo Bagnara 2001-04-19 21:18:23 +00:00
parent 667f008cd4
commit 301a62f90a
8 changed files with 229 additions and 91 deletions

View file

@ -53,4 +53,49 @@ typedef enum _snd_set_mode {
size_t page_align(size_t size);
size_t page_size(void);
#define HAVE_GNU_LD
#define HAVE_ELF
#define HAVE_ASM_PREVIOUS_DIRECTIVE
/* Stolen from libc-symbols.h in GNU glibc */
/* When a reference to SYMBOL is encountered, the linker will emit a
warning message MSG. */
#ifdef HAVE_GNU_LD
# ifdef HAVE_ELF
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
# define __make_section_unallocated(section_string) \
asm (".section " section_string "\n\t.previous");
# elif defined HAVE_ASM_POPSECTION_DIRECTIVE
# define __make_section_unallocated(section_string) \
asm (".pushsection " section_string "\n\t.popsection");
# else
# define __make_section_unallocated(section_string)
# endif
/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
section attributes on what looks like a comment to the assembler. */
# ifdef HAVE_SECTION_QUOTES
# define link_warning(symbol, msg) \
__make_section_unallocated (".gnu.warning." #symbol) \
static const char __evoke_link_warning_##symbol[] \
__attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
# else
# define link_warning(symbol, msg) \
__make_section_unallocated (".gnu.warning." #symbol) \
static const char __evoke_link_warning_##symbol[] \
__attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
# endif
# else
# define link_warning(symbol, msg) \
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
# endif
#else
/* We will never be heard; they will all die horribly. */
# define link_warning(symbol, msg)
#endif
#endif

View file

@ -172,19 +172,19 @@ typedef enum _snd_pcm_state {
/** PCM start mode */
typedef enum _snd_pcm_start {
/** Automatic start on data read/write */
SND_PCM_START_DATA = SNDRV_PCM_START_DATA,
SND_PCM_START_DATA,
/** Explicit start */
SND_PCM_START_EXPLICIT = SNDRV_PCM_START_EXPLICIT,
SND_PCM_START_LAST = SNDRV_PCM_START_LAST,
SND_PCM_START_EXPLICIT,
SND_PCM_START_LAST,
} snd_pcm_start_t;
/** PCM xrun mode */
typedef enum _snd_pcm_xrun {
/** Xrun detection disabled */
SND_PCM_XRUN_NONE = SNDRV_PCM_XRUN_NONE,
SND_PCM_XRUN_NONE,
/** Stop on xrun detection */
SND_PCM_XRUN_STOP = SNDRV_PCM_XRUN_STOP,
SND_PCM_XRUN_LAST = SNDRV_PCM_XRUN_LAST,
SND_PCM_XRUN_STOP,
SND_PCM_XRUN_LAST,
} snd_pcm_xrun_t;
/** PCM timestamp mode */
@ -695,6 +695,12 @@ snd_pcm_uframes_t snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *par
int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
snd_pcm_uframes_t snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params);
int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
snd_pcm_uframes_t snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *params);
int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
snd_pcm_uframes_t snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params);
int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
snd_pcm_uframes_t snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params);