diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/tinyalsa/mixer.h | 2 | ||||
-rw-r--r-- | include/tinyalsa/pcm.h | 32 |
2 files changed, 30 insertions, 4 deletions
diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index 2acdd54..77d5d01 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -133,7 +133,7 @@ int mixer_ctl_set_array(struct mixer_ctl *ctl, const void *array, size_t count); int mixer_ctl_set_enum_by_string(struct mixer_ctl *ctl, const char *string); -/* Determe range of integer mixer controls */ +/* Determine range of integer mixer controls */ int mixer_ctl_get_range_min(const struct mixer_ctl *ctl); int mixer_ctl_get_range_max(const struct mixer_ctl *ctl); diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 1184d81..cdc31a5 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -202,13 +202,15 @@ struct pcm_config { unsigned int period_count; /** The sample format of a PCM */ enum pcm_format format; - /* Values to use for the ALSA start, stop and silence thresholds. Setting - * any one of these values to 0 will cause the default tinyalsa values to be - * used instead. Tinyalsa defaults are as follows. + /* Values to use for the ALSA start, stop and silence thresholds, and + * silence size. Setting any one of these values to 0 will cause the + * default tinyalsa values to be used instead. + * Tinyalsa defaults are as follows. * * start_threshold : period_count * period_size * stop_threshold : period_count * period_size * silence_threshold : 0 + * silence_size : 0 */ /** The minimum number of frames required to start the PCM */ unsigned int start_threshold; @@ -216,6 +218,9 @@ struct pcm_config { unsigned int stop_threshold; /** The minimum number of frames to silence the PCM */ unsigned int silence_threshold; + /** The number of frames to overwrite the playback buffer when the playback underrun is greater + * than the silence threshold */ + unsigned int silence_size; }; /** Enumeration of a PCM's hardware parameters. @@ -264,6 +269,21 @@ unsigned int pcm_params_get_min(const struct pcm_params *pcm_params, enum pcm_pa unsigned int pcm_params_get_max(const struct pcm_params *pcm_params, enum pcm_param param); +/* Converts the pcm parameters to a human readable string. + * The string parameter is a caller allocated buffer of size bytes, + * which is then filled up to size - 1 and null terminated, + * if size is greater than zero. + * The return value is the number of bytes copied to string + * (not including null termination) if less than size; otherwise, + * the number of bytes required for the buffer. + */ +int pcm_params_to_string(struct pcm_params *params, char *string, unsigned int size); + +/* Returns 1 if the pcm_format is present (format bit set) in + * the pcm_params structure; 0 otherwise, or upon unrecognized format. + */ +int pcm_params_format_test(struct pcm_params *params, enum pcm_format format); + struct pcm; struct pcm *pcm_open(unsigned int card, @@ -321,6 +341,12 @@ int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, unsigned int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames); +int pcm_mmap_avail(struct pcm *pcm); + +int pcm_mmap_get_hw_ptr(struct pcm* pcm, unsigned int *hw_ptr, struct timespec *tstamp); + +int pcm_get_poll_fd(struct pcm *pcm); + int pcm_link(struct pcm *pcm1, struct pcm *pcm2); int pcm_unlink(struct pcm *pcm); |