|
#define | PCM_OUT 0x00000000 |
|
#define | PCM_IN 0x10000000 |
|
#define | PCM_MMAP 0x00000001 |
|
#define | PCM_NOIRQ 0x00000002 |
|
#define | PCM_NORESTART 0x00000004 |
|
#define | PCM_MONOTONIC 0x00000008 |
|
#define | PCM_STATE_RUNNING 0x03 |
|
#define | PCM_STATE_XRUN 0x04 |
|
#define | PCM_STATE_DRAINING 0x05 |
|
#define | PCM_STATE_SUSPENDED 0x07 |
|
#define | PCM_STATE_DISCONNECTED 0x08 |
|
#define | SNDRV_CHMAP_POSITION_MASK 0xffff |
|
#define | SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16) |
|
#define | SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16) |
|
#define | SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int) |
|
#define | SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info) |
|
#define | SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int) |
|
#define | SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int) |
|
#define | SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params) |
|
#define | SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params) |
|
#define | SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12) |
|
#define | SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params) |
|
#define | SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status) |
|
#define | SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) |
|
#define | SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) |
|
#define | SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) |
|
#define | SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) |
|
#define | SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) |
|
#define | SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) |
|
#define | SNDRV_PCM_IOCTL_START _IO('A', 0x42) |
|
#define | SNDRV_PCM_IOCTL_DROP _IO('A', 0x43) |
|
#define | SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44) |
|
#define | SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int) |
|
#define | SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t) |
|
#define | SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47) |
|
#define | SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48) |
|
#define | SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t) |
|
#define | SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi) |
|
#define | SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi) |
|
#define | SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern) |
|
#define | SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern) |
|
#define | SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int) |
|
#define | SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61) |
|
#define | SNDRV_PCM_ACCESS_MMAP_INTERLEAVED (( snd_pcm_access_t) 0) /* interleaved mmap */ |
|
#define | SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED (( snd_pcm_access_t) 1) /* noninterleaved mmap */ |
|
#define | SNDRV_PCM_ACCESS_MMAP_COMPLEX (( snd_pcm_access_t) 2) /* complex mmap */ |
|
#define | SNDRV_PCM_ACCESS_RW_INTERLEAVED (( snd_pcm_access_t) 3) /* readi/writei */ |
|
#define | SNDRV_PCM_ACCESS_RW_NONINTERLEAVED (( snd_pcm_access_t) 4) /* readn/writen */ |
|
#define | SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED |
|
#define | SNDRV_PCM_SUBFORMAT_STD (( snd_pcm_subformat_t) 0) |
|
#define | SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD |
|
#define | SNDRV_PCM_SUBFORMAT_STD (( snd_pcm_subformat_t) 0) |
|
#define | SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD |
|
#define | SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ |
|
#define | SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ |
|
#define | SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */ |
|
#define | SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */ |
|
#define | SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */ |
|
#define | SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */ |
|
#define | SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */ |
|
#define | SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */ |
|
#define | SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */ |
|
#define | SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */ |
|
#define | SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */ |
|
#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_WAKEUP 0x00800000 /* period wakeup can be disabled */ |
|
#define | SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ |
|
#define | SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
|
#define | SNDRV_PCM_STATE_OPEN (( snd_pcm_state_t) 0) /* stream is open */ |
|
#define | SNDRV_PCM_STATE_SETUP (( snd_pcm_state_t) 1) /* stream has a setup */ |
|
#define | SNDRV_PCM_STATE_PREPARED (( snd_pcm_state_t) 2) /* stream is ready to start */ |
|
#define | SNDRV_PCM_STATE_RUNNING (( snd_pcm_state_t) 3) /* stream is running */ |
|
#define | SNDRV_PCM_STATE_XRUN (( snd_pcm_state_t) 4) /* stream reached an xrun */ |
|
#define | SNDRV_PCM_STATE_DRAINING (( snd_pcm_state_t) 5) /* stream is draining */ |
|
#define | SNDRV_PCM_STATE_PAUSED (( snd_pcm_state_t) 6) /* stream is paused */ |
|
#define | SNDRV_PCM_STATE_SUSPENDED (( snd_pcm_state_t) 7) /* hardware is suspended */ |
|
#define | SNDRV_PCM_STATE_DISCONNECTED (( snd_pcm_state_t) 8) /* hardware is disconnected */ |
|
#define | SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED |
|
#define | SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */ |
|
#define | SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */ |
|
#define | SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */ |
|
#define | SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS |
|
#define | SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT |
|
#define | SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */ |
|
#define | SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */ |
|
#define | SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */ |
|
#define | SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */ |
|
#define | SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between interrupts in us */ |
|
#define | SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between interrupts */ |
|
#define | SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between interrupts */ |
|
#define | SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per buffer */ |
|
#define | SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer in us */ |
|
#define | SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */ |
|
#define | SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */ |
|
#define | SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */ |
|
#define | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS |
|
#define | SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME |
|
#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_WAKEUP (1<<2) /* disable period wakeups */ |
|
#define | SNDRV_PCM_FORMAT_S8 (( snd_pcm_format_t) 0) |
|
#define | SNDRV_PCM_FORMAT_U8 (( snd_pcm_format_t) 1) |
|
#define | SNDRV_PCM_FORMAT_S16_LE (( snd_pcm_format_t) 2) |
|
#define | SNDRV_PCM_FORMAT_S16_BE (( snd_pcm_format_t) 3) |
|
#define | SNDRV_PCM_FORMAT_U16_LE (( snd_pcm_format_t) 4) |
|
#define | SNDRV_PCM_FORMAT_U16_BE (( snd_pcm_format_t) 5) |
|
#define | SNDRV_PCM_FORMAT_S24_LE (( snd_pcm_format_t) 6) /* low three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S24_BE (( snd_pcm_format_t) 7) /* low three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U24_LE (( snd_pcm_format_t) 8) /* low three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U24_BE (( snd_pcm_format_t) 9) /* low three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S32_LE (( snd_pcm_format_t) 10) |
|
#define | SNDRV_PCM_FORMAT_S32_BE (( snd_pcm_format_t) 11) |
|
#define | SNDRV_PCM_FORMAT_U32_LE (( snd_pcm_format_t) 12) |
|
#define | SNDRV_PCM_FORMAT_U32_BE (( snd_pcm_format_t) 13) |
|
#define | SNDRV_PCM_FORMAT_FLOAT_LE (( snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ |
|
#define | SNDRV_PCM_FORMAT_FLOAT_BE (( snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ |
|
#define | SNDRV_PCM_FORMAT_FLOAT64_LE (( snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ |
|
#define | SNDRV_PCM_FORMAT_FLOAT64_BE (( snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ |
|
#define | SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE (( snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */ |
|
#define | SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE (( snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */ |
|
#define | SNDRV_PCM_FORMAT_MU_LAW (( snd_pcm_format_t) 20) |
|
#define | SNDRV_PCM_FORMAT_A_LAW (( snd_pcm_format_t) 21) |
|
#define | SNDRV_PCM_FORMAT_IMA_ADPCM (( snd_pcm_format_t) 22) |
|
#define | SNDRV_PCM_FORMAT_MPEG (( snd_pcm_format_t) 23) |
|
#define | SNDRV_PCM_FORMAT_GSM (( snd_pcm_format_t) 24) |
|
#define | SNDRV_PCM_FORMAT_SPECIAL (( snd_pcm_format_t) 31) |
|
#define | SNDRV_PCM_FORMAT_S24_3LE (( snd_pcm_format_t) 32) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S24_3BE (( snd_pcm_format_t) 33) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U24_3LE (( snd_pcm_format_t) 34) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U24_3BE (( snd_pcm_format_t) 35) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S20_3LE (( snd_pcm_format_t) 36) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S20_3BE (( snd_pcm_format_t) 37) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U20_3LE (( snd_pcm_format_t) 38) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U20_3BE (( snd_pcm_format_t) 39) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S18_3LE (( snd_pcm_format_t) 40) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_S18_3BE (( snd_pcm_format_t) 41) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U18_3LE (( snd_pcm_format_t) 42) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_U18_3BE (( snd_pcm_format_t) 43) /* in three bytes */ |
|
#define | SNDRV_PCM_FORMAT_G723_24 (( snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ |
|
#define | SNDRV_PCM_FORMAT_G723_24_1B (( snd_pcm_format_t) 45) /* 1 sample in 1 byte */ |
|
#define | SNDRV_PCM_FORMAT_G723_40 (( snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ |
|
#define | SNDRV_PCM_FORMAT_G723_40_1B (( snd_pcm_format_t) 47) /* 1 sample in 1 byte */ |
|
#define | SNDRV_PCM_FORMAT_DSD_U8 (( snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */ |
|
#define | SNDRV_PCM_FORMAT_DSD_U16_LE (( snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */ |
|
#define | SNDRV_PCM_FORMAT_DSD_U32_LE (( snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */ |
|
#define | SNDRV_PCM_FORMAT_DSD_U16_BE (( snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */ |
|
#define | SNDRV_PCM_FORMAT_DSD_U32_BE (( snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */ |
|
#define | SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE |
|
#define | SNDRV_MASK_MAX 256 |
|
#define | SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ |
|
#define | SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ |
|
#define | SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ |
|
#define | SNDRV_PCM_MMAP_OFFSET_DATA 0x00000000 |
|
#define | SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000 |
|
#define | SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000 |
|
#define | TINYALSA_CHANNELS_MAX 32U |
|
#define | TINYALSA_CHANNELS_MIN 1U |
|
#define | TINYALSA_FRAMES_MAX (ULONG_MAX / (TINYALSA_CHANNELS_MAX * 4)) |
|
#define | PARAM_MAX SNDRV_PCM_HW_PARAM_LAST_INTERVAL |
|
#define | SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) |
|
#define | PCM_ERROR_MAX 128 |
|
#define | BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits) |
|
#define | FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8) |
|
|
static INLINE int | param_is_mask (int p) |
|
static INLINE int | param_is_interval (int p) |
|
static INLINE const struct snd_interval * | param_get_interval (const struct snd_pcm_hw_params *p, int n) |
|
static INLINE struct snd_interval * | param_to_interval (struct snd_pcm_hw_params *p, int n) |
|
static INLINE struct snd_mask * | param_to_mask (struct snd_pcm_hw_params *p, int n) |
|
static void | param_set_mask (struct snd_pcm_hw_params *p, int n, unsigned int bit) |
|
static void | param_set_min (struct snd_pcm_hw_params *p, int n, unsigned int val) |
|
static void | param_set_int (struct snd_pcm_hw_params *p, int n, unsigned int val) |
|
static unsigned int | param_get_int (struct snd_pcm_hw_params *p, int n) |
|
static void | param_init (struct snd_pcm_hw_params *p) |
|
static unsigned int | pcm_format_to_alsa (enum pcm_format format) |
|
static unsigned int | pcm_get_buffer_size (const struct pcm *pcm) |
|
unsigned int | pcm_format_to_bits (enum pcm_format format) |
|
static unsigned int | pcm_frames_to_bytes (const struct pcm *pcm, unsigned int frames) |
|
static int | pcm_set_config (struct pcm *pcm, const struct pcm_config *config) |
|
static int | pcm_sync_ptr (struct pcm *pcm, int flags) |
|
static int | pcm_hw_mmap_status (struct pcm *pcm) |
|
static void | pcm_hw_munmap_status (struct pcm *pcm) |
|
static INLINE int | pcm_mmap_capture_avail (struct pcm *pcm) |
|
static INLINE int | pcm_mmap_playback_avail (struct pcm *pcm) |
|
static INLINE int | pcm_mmap_avail (struct pcm *pcm) |
|
static int | pcm_is_ready (const struct pcm *pcm) |
|
static int | pcm_prepare (struct pcm *pcm) |
|
static int | pcm_writei (struct pcm *pcm, const void *data, unsigned int frame_count) |
|
static struct pcm_params * | pcm_params_get (unsigned int card, unsigned int device, unsigned int flags) |
|
static void | pcm_params_free (struct pcm_params *pcm_params) |
|
static int | pcm_param_to_alsa (enum pcm_param param) |
|
static unsigned int | param_get_min (const struct snd_pcm_hw_params *p, int n) |
|
static unsigned int | pcm_params_get_min (const struct pcm_params *pcm_params, enum pcm_param param) |
|
static unsigned int | param_get_max (const struct snd_pcm_hw_params *p, int n) |
|
static unsigned int | pcm_params_get_max (const struct pcm_params *pcm_params, enum pcm_param param) |
|
static int | pcm_stop (struct pcm *pcm) |
|
static int | pcm_params_can_pause (const struct pcm_params *pcm_params) |
|
static int | pcm_pause (struct pcm *pcm, int enable) |
|
static int | pcm_close (struct pcm *pcm) |
|
static struct pcm * | pcm_open (unsigned int card, unsigned int device, unsigned int flags, const struct pcm_config *config) |
|
static int | pcm_avail_update (struct pcm *pcm) |
|
static int | pcm_wait (struct pcm *pcm, int timeout) |
|
static void * | tinyalsa_init (const char *devicestr, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate) |
|
static ssize_t | tinyalsa_write (void *data, const void *buf_, size_t size_) |
|
static bool | tinyalsa_stop (void *data) |
|
static bool | tinyalsa_alive (void *data) |
|
static bool | tinyalsa_start (void *data, bool is_shutdown) |
|
static void | tinyalsa_set_nonblock_state (void *data, bool state) |
|
static bool | tinyalsa_use_float (void *data) |
|
static void | tinyalsa_free (void *data) |
|
static size_t | tinyalsa_write_avail (void *data) |
|
static size_t | tinyalsa_buffer_size (void *data) |
|