RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
tinyalsa.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <time.h>
#include <limits.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <retro_inline.h>
#include <retro_endianness.h>
#include "../audio_driver.h"
#include "../../verbosity.h"
Include dependency graph for tinyalsa.c:

Classes

struct  pcm_mask
 
union  snd_pcm_sync_id
 
struct  snd_pcm_mmap_status
 
struct  snd_pcm_info
 
struct  snd_interval
 
struct  snd_mask
 
struct  snd_pcm_sw_params
 
struct  snd_pcm_hw_params
 
struct  pcm_config
 
struct  snd_pcm_mmap_control
 
struct  snd_pcm_sync_ptr
 
struct  snd_xferi
 
struct  snd_xfern
 
struct  snd_pcm_status
 
struct  pcm
 
struct  tinyalsa
 

Macros

#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)
 

Typedefs

typedef unsigned long snd_pcm_uframes_t
 
typedef signed long snd_pcm_sframes_t
 
typedef int snd_pcm_hw_param_t
 
typedef int __bitwise snd_pcm_access_t
 
typedef int __bitwise snd_pcm_subformat_t
 
typedef int __bitwise snd_pcm_state_t
 
typedef int __bitwise snd_pcm_format_t
 
typedef struct tinyalsa tinyalsa_t
 

Enumerations

enum  pcm_format {
  PCM_FORMAT_S8 = 1, PCM_FORMAT_S16_LE = 0, PCM_FORMAT_S16_BE = 2, PCM_FORMAT_S24_LE,
  PCM_FORMAT_S24_BE, PCM_FORMAT_S24_3LE, PCM_FORMAT_S24_3BE, PCM_FORMAT_S32_LE,
  PCM_FORMAT_S32_BE, PCM_FORMAT_MAX
}
 
enum  { SNDRV_PCM_TSTAMP_NONE = 0, SNDRV_PCM_TSTAMP_ENABLE, SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE }
 
enum  pcm_param {
  PCM_PARAM_ACCESS, PCM_PARAM_FORMAT, PCM_PARAM_SUBFORMAT, PCM_PARAM_SAMPLE_BITS,
  PCM_PARAM_FRAME_BITS, PCM_PARAM_CHANNELS, PCM_PARAM_RATE, PCM_PARAM_PERIOD_TIME,
  PCM_PARAM_PERIOD_SIZE, PCM_PARAM_PERIOD_BYTES, PCM_PARAM_PERIODS, PCM_PARAM_BUFFER_TIME,
  PCM_PARAM_BUFFER_SIZE, PCM_PARAM_BUFFER_BYTES, PCM_PARAM_TICK_TIME
}
 
enum  {
  SNDRV_CHMAP_UNKNOWN = 0, SNDRV_CHMAP_NA, SNDRV_CHMAP_MONO, SNDRV_CHMAP_FL,
  SNDRV_CHMAP_FR, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR, SNDRV_CHMAP_FC,
  SNDRV_CHMAP_LFE, SNDRV_CHMAP_SL, SNDRV_CHMAP_SR, SNDRV_CHMAP_RC,
  SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC, SNDRV_CHMAP_RLC, SNDRV_CHMAP_RRC,
  SNDRV_CHMAP_FLW, SNDRV_CHMAP_FRW, SNDRV_CHMAP_FLH, SNDRV_CHMAP_FCH,
  SNDRV_CHMAP_FRH, SNDRV_CHMAP_TC, SNDRV_CHMAP_TFL, SNDRV_CHMAP_TFR,
  SNDRV_CHMAP_TFC, SNDRV_CHMAP_TRL, SNDRV_CHMAP_TRR, SNDRV_CHMAP_TRC,
  SNDRV_CHMAP_TFLC, SNDRV_CHMAP_TFRC, SNDRV_CHMAP_TSL, SNDRV_CHMAP_TSR,
  SNDRV_CHMAP_LLFE, SNDRV_CHMAP_RLFE, SNDRV_CHMAP_BC, SNDRV_CHMAP_BLC,
  SNDRV_CHMAP_BRC, SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC
}
 
enum  { SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW }
 

Functions

static INLINE int param_is_mask (int p)
 
static INLINE int param_is_interval (int p)
 
static INLINE const struct snd_intervalparam_get_interval (const struct snd_pcm_hw_params *p, int n)
 
static INLINE struct snd_intervalparam_to_interval (struct snd_pcm_hw_params *p, int n)
 
static INLINE struct snd_maskparam_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 pcmpcm_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 voidtinyalsa_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)
 

Variables

static struct pcm bad_pcm
 
audio_driver_t audio_tinyalsa
 

Macro Definition Documentation

◆ BYTES_TO_FRAMES

#define BYTES_TO_FRAMES (   bytes,
  frame_bits 
)    ((bytes) * 8 / frame_bits)

◆ FRAMES_TO_BYTES

#define FRAMES_TO_BYTES (   frames,
  frame_bits 
)    ((frames) * frame_bits / 8)

◆ PARAM_MAX

#define PARAM_MAX   SNDRV_PCM_HW_PARAM_LAST_INTERVAL

◆ PCM_ERROR_MAX

#define PCM_ERROR_MAX   128

◆ PCM_IN

#define PCM_IN   0x10000000

Specifies that the PCM is an input. May not be bitwise AND'd with PCM_OUT. Used in pcm_open.

◆ PCM_MMAP

#define PCM_MMAP   0x00000001

Specifies that the PCM will use mmap read and write methods. Used in pcm_open.

◆ PCM_MONOTONIC

#define PCM_MONOTONIC   0x00000008

Specifies monotonic timestamps. Used in pcm_open.

◆ PCM_NOIRQ

#define PCM_NOIRQ   0x00000002

Specifies no interrupt requests. May only be bitwise AND'd with PCM_MMAP. Used in pcm_open.

◆ PCM_NORESTART

#define PCM_NORESTART   0x00000004

When set, calls to pcm_write for a playback stream will not attempt to restart the stream in the case of an underflow, but will return -EPIPE instead. After the first -EPIPE error, the stream is considered to be stopped, and a second call to pcm_write will attempt to restart the stream. Used in pcm_open.

◆ PCM_OUT

#define PCM_OUT   0x00000000

A flag that specifies that the PCM is an output. May not be bitwise AND'd with PCM_IN. Used in pcm_open.

◆ PCM_STATE_DISCONNECTED

#define PCM_STATE_DISCONNECTED   0x08

Means a PCM has been disconnected.

◆ PCM_STATE_DRAINING

#define PCM_STATE_DRAINING   0x05

For outputs, this means audio samples are played. A PCM is in a draining state when it is coming to a stop.

◆ PCM_STATE_RUNNING

#define PCM_STATE_RUNNING   0x03

For inputs, this means the PCM is recording audio samples. For outputs, this means the PCM is playing audio samples.

◆ PCM_STATE_SUSPENDED

#define PCM_STATE_SUSPENDED   0x07

Means a PCM is suspended.

◆ PCM_STATE_XRUN

#define PCM_STATE_XRUN   0x04

For inputs, this means an overrun occured. For outputs, this means an underrun occured.

◆ SNDRV_CHMAP_DRIVER_SPEC

#define SNDRV_CHMAP_DRIVER_SPEC   (0x02 << 16)

◆ SNDRV_CHMAP_PHASE_INVERSE

#define SNDRV_CHMAP_PHASE_INVERSE   (0x01 << 16)

◆ SNDRV_CHMAP_POSITION_MASK

#define SNDRV_CHMAP_POSITION_MASK   0xffff

◆ SNDRV_MASK_MAX

#define SNDRV_MASK_MAX   256

◆ SNDRV_PCM_ACCESS_LAST

#define SNDRV_PCM_ACCESS_LAST   SNDRV_PCM_ACCESS_RW_NONINTERLEAVED

◆ SNDRV_PCM_ACCESS_MMAP_COMPLEX

#define SNDRV_PCM_ACCESS_MMAP_COMPLEX   (( snd_pcm_access_t) 2) /* complex mmap */

◆ SNDRV_PCM_ACCESS_MMAP_INTERLEAVED

#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED   (( snd_pcm_access_t) 0) /* interleaved mmap */

◆ SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED

#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED   (( snd_pcm_access_t) 1) /* noninterleaved mmap */

◆ SNDRV_PCM_ACCESS_RW_INTERLEAVED

#define SNDRV_PCM_ACCESS_RW_INTERLEAVED   (( snd_pcm_access_t) 3) /* readi/writei */

◆ SNDRV_PCM_ACCESS_RW_NONINTERLEAVED

#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED   (( snd_pcm_access_t) 4) /* readn/writen */

◆ SNDRV_PCM_FORMAT_A_LAW

#define SNDRV_PCM_FORMAT_A_LAW   (( snd_pcm_format_t) 21)

◆ SNDRV_PCM_FORMAT_DSD_U16_BE

#define SNDRV_PCM_FORMAT_DSD_U16_BE   (( snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */

◆ SNDRV_PCM_FORMAT_DSD_U16_LE

#define SNDRV_PCM_FORMAT_DSD_U16_LE   (( snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */

◆ SNDRV_PCM_FORMAT_DSD_U32_BE

#define SNDRV_PCM_FORMAT_DSD_U32_BE   (( snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */

◆ SNDRV_PCM_FORMAT_DSD_U32_LE

#define SNDRV_PCM_FORMAT_DSD_U32_LE   (( snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */

◆ SNDRV_PCM_FORMAT_DSD_U8

#define SNDRV_PCM_FORMAT_DSD_U8   (( snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */

◆ SNDRV_PCM_FORMAT_FLOAT64_BE

#define SNDRV_PCM_FORMAT_FLOAT64_BE   (( snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */

◆ SNDRV_PCM_FORMAT_FLOAT64_LE

#define SNDRV_PCM_FORMAT_FLOAT64_LE   (( snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */

◆ SNDRV_PCM_FORMAT_FLOAT_BE

#define SNDRV_PCM_FORMAT_FLOAT_BE   (( snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */

◆ SNDRV_PCM_FORMAT_FLOAT_LE

#define SNDRV_PCM_FORMAT_FLOAT_LE   (( snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */

◆ SNDRV_PCM_FORMAT_G723_24

#define SNDRV_PCM_FORMAT_G723_24   (( snd_pcm_format_t) 44) /* 8 samples in 3 bytes */

◆ SNDRV_PCM_FORMAT_G723_24_1B

#define SNDRV_PCM_FORMAT_G723_24_1B   (( snd_pcm_format_t) 45) /* 1 sample in 1 byte */

◆ SNDRV_PCM_FORMAT_G723_40

#define SNDRV_PCM_FORMAT_G723_40   (( snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */

◆ SNDRV_PCM_FORMAT_G723_40_1B

#define SNDRV_PCM_FORMAT_G723_40_1B   (( snd_pcm_format_t) 47) /* 1 sample in 1 byte */

◆ SNDRV_PCM_FORMAT_GSM

#define SNDRV_PCM_FORMAT_GSM   (( snd_pcm_format_t) 24)

◆ SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE

#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE   (( snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */

◆ SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE

#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE   (( snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */

◆ SNDRV_PCM_FORMAT_IMA_ADPCM

#define SNDRV_PCM_FORMAT_IMA_ADPCM   (( snd_pcm_format_t) 22)

◆ SNDRV_PCM_FORMAT_LAST

#define SNDRV_PCM_FORMAT_LAST   SNDRV_PCM_FORMAT_DSD_U32_BE

◆ SNDRV_PCM_FORMAT_MPEG

#define SNDRV_PCM_FORMAT_MPEG   (( snd_pcm_format_t) 23)

◆ SNDRV_PCM_FORMAT_MU_LAW

#define SNDRV_PCM_FORMAT_MU_LAW   (( snd_pcm_format_t) 20)

◆ SNDRV_PCM_FORMAT_S16_BE

#define SNDRV_PCM_FORMAT_S16_BE   (( snd_pcm_format_t) 3)

◆ SNDRV_PCM_FORMAT_S16_LE

#define SNDRV_PCM_FORMAT_S16_LE   (( snd_pcm_format_t) 2)

◆ SNDRV_PCM_FORMAT_S18_3BE

#define SNDRV_PCM_FORMAT_S18_3BE   (( snd_pcm_format_t) 41) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S18_3LE

#define SNDRV_PCM_FORMAT_S18_3LE   (( snd_pcm_format_t) 40) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S20_3BE

#define SNDRV_PCM_FORMAT_S20_3BE   (( snd_pcm_format_t) 37) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S20_3LE

#define SNDRV_PCM_FORMAT_S20_3LE   (( snd_pcm_format_t) 36) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S24_3BE

#define SNDRV_PCM_FORMAT_S24_3BE   (( snd_pcm_format_t) 33) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S24_3LE

#define SNDRV_PCM_FORMAT_S24_3LE   (( snd_pcm_format_t) 32) /* in three bytes */

◆ SNDRV_PCM_FORMAT_S24_BE

#define SNDRV_PCM_FORMAT_S24_BE   (( snd_pcm_format_t) 7) /* low three bytes */

◆ SNDRV_PCM_FORMAT_S24_LE

#define SNDRV_PCM_FORMAT_S24_LE   (( snd_pcm_format_t) 6) /* low three bytes */

◆ SNDRV_PCM_FORMAT_S32_BE

#define SNDRV_PCM_FORMAT_S32_BE   (( snd_pcm_format_t) 11)

◆ SNDRV_PCM_FORMAT_S32_LE

#define SNDRV_PCM_FORMAT_S32_LE   (( snd_pcm_format_t) 10)

◆ SNDRV_PCM_FORMAT_S8

#define SNDRV_PCM_FORMAT_S8   (( snd_pcm_format_t) 0)

◆ SNDRV_PCM_FORMAT_SPECIAL

#define SNDRV_PCM_FORMAT_SPECIAL   (( snd_pcm_format_t) 31)

◆ SNDRV_PCM_FORMAT_U16_BE

#define SNDRV_PCM_FORMAT_U16_BE   (( snd_pcm_format_t) 5)

◆ SNDRV_PCM_FORMAT_U16_LE

#define SNDRV_PCM_FORMAT_U16_LE   (( snd_pcm_format_t) 4)

◆ SNDRV_PCM_FORMAT_U18_3BE

#define SNDRV_PCM_FORMAT_U18_3BE   (( snd_pcm_format_t) 43) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U18_3LE

#define SNDRV_PCM_FORMAT_U18_3LE   (( snd_pcm_format_t) 42) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U20_3BE

#define SNDRV_PCM_FORMAT_U20_3BE   (( snd_pcm_format_t) 39) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U20_3LE

#define SNDRV_PCM_FORMAT_U20_3LE   (( snd_pcm_format_t) 38) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U24_3BE

#define SNDRV_PCM_FORMAT_U24_3BE   (( snd_pcm_format_t) 35) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U24_3LE

#define SNDRV_PCM_FORMAT_U24_3LE   (( snd_pcm_format_t) 34) /* in three bytes */

◆ SNDRV_PCM_FORMAT_U24_BE

#define SNDRV_PCM_FORMAT_U24_BE   (( snd_pcm_format_t) 9) /* low three bytes */

◆ SNDRV_PCM_FORMAT_U24_LE

#define SNDRV_PCM_FORMAT_U24_LE   (( snd_pcm_format_t) 8) /* low three bytes */

◆ SNDRV_PCM_FORMAT_U32_BE

#define SNDRV_PCM_FORMAT_U32_BE   (( snd_pcm_format_t) 13)

◆ SNDRV_PCM_FORMAT_U32_LE

#define SNDRV_PCM_FORMAT_U32_LE   (( snd_pcm_format_t) 12)

◆ SNDRV_PCM_FORMAT_U8

#define SNDRV_PCM_FORMAT_U8   (( snd_pcm_format_t) 1)

◆ SNDRV_PCM_HW_PARAM_ACCESS

#define SNDRV_PCM_HW_PARAM_ACCESS   0 /* Access type */

◆ SNDRV_PCM_HW_PARAM_BUFFER_BYTES

#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES   18 /* Size of buffer in bytes */

◆ SNDRV_PCM_HW_PARAM_BUFFER_SIZE

#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE   17 /* Size of buffer in frames */

◆ SNDRV_PCM_HW_PARAM_BUFFER_TIME

#define SNDRV_PCM_HW_PARAM_BUFFER_TIME   16 /* Approx duration of buffer in us */

◆ SNDRV_PCM_HW_PARAM_CHANNELS

#define SNDRV_PCM_HW_PARAM_CHANNELS   10 /* Channels */

◆ SNDRV_PCM_HW_PARAM_FIRST_INTERVAL

#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL   SNDRV_PCM_HW_PARAM_SAMPLE_BITS

◆ SNDRV_PCM_HW_PARAM_FIRST_MASK

#define SNDRV_PCM_HW_PARAM_FIRST_MASK   SNDRV_PCM_HW_PARAM_ACCESS

◆ SNDRV_PCM_HW_PARAM_FORMAT

#define SNDRV_PCM_HW_PARAM_FORMAT   1 /* Format */

◆ SNDRV_PCM_HW_PARAM_FRAME_BITS

#define SNDRV_PCM_HW_PARAM_FRAME_BITS   9 /* Bits per frame */

◆ SNDRV_PCM_HW_PARAM_LAST_INTERVAL

#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL   SNDRV_PCM_HW_PARAM_TICK_TIME

◆ SNDRV_PCM_HW_PARAM_LAST_MASK

#define SNDRV_PCM_HW_PARAM_LAST_MASK   SNDRV_PCM_HW_PARAM_SUBFORMAT

◆ SNDRV_PCM_HW_PARAM_PERIOD_BYTES

#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES   14 /* Approx bytes between interrupts */

◆ SNDRV_PCM_HW_PARAM_PERIOD_SIZE

#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE   13 /* Approx frames between interrupts */

◆ SNDRV_PCM_HW_PARAM_PERIOD_TIME

#define SNDRV_PCM_HW_PARAM_PERIOD_TIME   12 /* Approx distance between interrupts in us */

◆ SNDRV_PCM_HW_PARAM_PERIODS

#define SNDRV_PCM_HW_PARAM_PERIODS   15 /* Approx interrupts per buffer */

◆ SNDRV_PCM_HW_PARAM_RATE

#define SNDRV_PCM_HW_PARAM_RATE   11 /* Approx rate */

◆ SNDRV_PCM_HW_PARAM_SAMPLE_BITS

#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS   8 /* Bits per sample */

◆ SNDRV_PCM_HW_PARAM_SUBFORMAT

#define SNDRV_PCM_HW_PARAM_SUBFORMAT   2 /* Subformat */

◆ SNDRV_PCM_HW_PARAM_TICK_TIME

#define SNDRV_PCM_HW_PARAM_TICK_TIME   19 /* Approx tick duration in us */

◆ SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER

#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER   (1<<1) /* export buffer */

◆ SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP [1/2]

#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP   (1<<2) /* disable period wakeups */

◆ SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP [2/2]

#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP   (1<<2)

◆ SNDRV_PCM_HW_PARAMS_NORESAMPLE

#define SNDRV_PCM_HW_PARAMS_NORESAMPLE   (1<<0) /* avoid rate resampling */

◆ SNDRV_PCM_INFO_BATCH

#define SNDRV_PCM_INFO_BATCH   0x00000010 /* double buffering */

◆ SNDRV_PCM_INFO_BLOCK_TRANSFER

#define SNDRV_PCM_INFO_BLOCK_TRANSFER   0x00010000 /* hardware transfer block of samples */

◆ SNDRV_PCM_INFO_COMPLEX

#define SNDRV_PCM_INFO_COMPLEX   0x00000400 /* complex frame organization (mmap only) */

◆ SNDRV_PCM_INFO_DOUBLE

#define SNDRV_PCM_INFO_DOUBLE   0x00000004 /* Double buffering needed for PCM start/stop */

◆ SNDRV_PCM_INFO_FIFO_IN_FRAMES

#define SNDRV_PCM_INFO_FIFO_IN_FRAMES   0x80000000 /* internal kernel flag - FIFO size is in frames */

◆ SNDRV_PCM_INFO_HALF_DUPLEX

#define SNDRV_PCM_INFO_HALF_DUPLEX   0x00100000 /* only half duplex */

◆ SNDRV_PCM_INFO_HAS_WALL_CLOCK

#define SNDRV_PCM_INFO_HAS_WALL_CLOCK   0x01000000 /* has audio wall clock for audio/system time sync */

◆ SNDRV_PCM_INFO_INTERLEAVED

#define SNDRV_PCM_INFO_INTERLEAVED   0x00000100 /* channels are interleaved */

◆ SNDRV_PCM_INFO_JOINT_DUPLEX

#define SNDRV_PCM_INFO_JOINT_DUPLEX   0x00200000 /* playback and capture stream are somewhat correlated */

◆ SNDRV_PCM_INFO_MMAP

#define SNDRV_PCM_INFO_MMAP   0x00000001 /* hardware supports mmap */

◆ SNDRV_PCM_INFO_MMAP_VALID

#define SNDRV_PCM_INFO_MMAP_VALID   0x00000002 /* period data are valid during transfer */

◆ SNDRV_PCM_INFO_NO_PERIOD_WAKEUP

#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP   0x00800000 /* period wakeup can be disabled */

◆ SNDRV_PCM_INFO_NONINTERLEAVED

#define SNDRV_PCM_INFO_NONINTERLEAVED   0x00000200 /* channels are not interleaved */

◆ SNDRV_PCM_INFO_OVERRANGE

#define SNDRV_PCM_INFO_OVERRANGE   0x00020000 /* hardware supports ADC (capture) overrange detection */

◆ SNDRV_PCM_INFO_PAUSE

#define SNDRV_PCM_INFO_PAUSE   0x00080000 /* pause ioctl is supported */

◆ SNDRV_PCM_INFO_RESUME

#define SNDRV_PCM_INFO_RESUME   0x00040000 /* hardware supports stream resume after suspend */

◆ SNDRV_PCM_INFO_SYNC_START

#define SNDRV_PCM_INFO_SYNC_START   0x00400000 /* pcm support some kind of sync go */

◆ SNDRV_PCM_IOCTL_CHANNEL_INFO

#define SNDRV_PCM_IOCTL_CHANNEL_INFO   _IOR('A', 0x32, struct snd_pcm_channel_info)

◆ SNDRV_PCM_IOCTL_DELAY

#define SNDRV_PCM_IOCTL_DELAY   _IOR('A', 0x21, snd_pcm_sframes_t)

◆ SNDRV_PCM_IOCTL_DRAIN

#define SNDRV_PCM_IOCTL_DRAIN   _IO('A', 0x44)

◆ SNDRV_PCM_IOCTL_DROP

#define SNDRV_PCM_IOCTL_DROP   _IO('A', 0x43)

◆ SNDRV_PCM_IOCTL_FORWARD

#define SNDRV_PCM_IOCTL_FORWARD   _IOW('A', 0x49, snd_pcm_uframes_t)

◆ SNDRV_PCM_IOCTL_HW_FREE

#define SNDRV_PCM_IOCTL_HW_FREE   _IO('A', 0x12)

◆ SNDRV_PCM_IOCTL_HW_PARAMS

#define SNDRV_PCM_IOCTL_HW_PARAMS   _IOWR('A', 0x11, struct snd_pcm_hw_params)

◆ SNDRV_PCM_IOCTL_HW_REFINE

#define SNDRV_PCM_IOCTL_HW_REFINE   _IOWR('A', 0x10, struct snd_pcm_hw_params)

◆ SNDRV_PCM_IOCTL_HWSYNC

#define SNDRV_PCM_IOCTL_HWSYNC   _IO('A', 0x22)

◆ SNDRV_PCM_IOCTL_INFO

#define SNDRV_PCM_IOCTL_INFO   _IOR('A', 0x01, struct snd_pcm_info)

◆ SNDRV_PCM_IOCTL_LINK

#define SNDRV_PCM_IOCTL_LINK   _IOW('A', 0x60, int)

◆ SNDRV_PCM_IOCTL_PAUSE

#define SNDRV_PCM_IOCTL_PAUSE   _IOW('A', 0x45, int)

◆ SNDRV_PCM_IOCTL_PREPARE

#define SNDRV_PCM_IOCTL_PREPARE   _IO('A', 0x40)

◆ SNDRV_PCM_IOCTL_PVERSION

#define SNDRV_PCM_IOCTL_PVERSION   _IOR('A', 0x00, int)

◆ SNDRV_PCM_IOCTL_READI_FRAMES

#define SNDRV_PCM_IOCTL_READI_FRAMES   _IOR('A', 0x51, struct snd_xferi)

◆ SNDRV_PCM_IOCTL_READN_FRAMES

#define SNDRV_PCM_IOCTL_READN_FRAMES   _IOR('A', 0x53, struct snd_xfern)

◆ SNDRV_PCM_IOCTL_RESET

#define SNDRV_PCM_IOCTL_RESET   _IO('A', 0x41)

◆ SNDRV_PCM_IOCTL_RESUME

#define SNDRV_PCM_IOCTL_RESUME   _IO('A', 0x47)

◆ SNDRV_PCM_IOCTL_REWIND

#define SNDRV_PCM_IOCTL_REWIND   _IOW('A', 0x46, snd_pcm_uframes_t)

◆ SNDRV_PCM_IOCTL_START

#define SNDRV_PCM_IOCTL_START   _IO('A', 0x42)

◆ SNDRV_PCM_IOCTL_STATUS

#define SNDRV_PCM_IOCTL_STATUS   _IOR('A', 0x20, struct snd_pcm_status)

◆ SNDRV_PCM_IOCTL_SW_PARAMS

#define SNDRV_PCM_IOCTL_SW_PARAMS   _IOWR('A', 0x13, struct snd_pcm_sw_params)

◆ SNDRV_PCM_IOCTL_SYNC_PTR

#define SNDRV_PCM_IOCTL_SYNC_PTR   _IOWR('A', 0x23, struct snd_pcm_sync_ptr)

◆ SNDRV_PCM_IOCTL_TSTAMP

#define SNDRV_PCM_IOCTL_TSTAMP   _IOW('A', 0x02, int)

◆ SNDRV_PCM_IOCTL_TTSTAMP

#define SNDRV_PCM_IOCTL_TTSTAMP   _IOW('A', 0x03, int)

◆ SNDRV_PCM_IOCTL_UNLINK

#define SNDRV_PCM_IOCTL_UNLINK   _IO('A', 0x61)

◆ SNDRV_PCM_IOCTL_WRITEI_FRAMES

#define SNDRV_PCM_IOCTL_WRITEI_FRAMES   _IOW('A', 0x50, struct snd_xferi)

◆ SNDRV_PCM_IOCTL_WRITEN_FRAMES

#define SNDRV_PCM_IOCTL_WRITEN_FRAMES   _IOW('A', 0x52, struct snd_xfern)

◆ SNDRV_PCM_IOCTL_XRUN

#define SNDRV_PCM_IOCTL_XRUN   _IO('A', 0x48)

◆ SNDRV_PCM_MMAP_OFFSET_CONTROL

#define SNDRV_PCM_MMAP_OFFSET_CONTROL   0x81000000

◆ SNDRV_PCM_MMAP_OFFSET_DATA

#define SNDRV_PCM_MMAP_OFFSET_DATA   0x00000000

◆ SNDRV_PCM_MMAP_OFFSET_STATUS

#define SNDRV_PCM_MMAP_OFFSET_STATUS   0x80000000

◆ SNDRV_PCM_STATE_DISCONNECTED

#define SNDRV_PCM_STATE_DISCONNECTED   (( snd_pcm_state_t) 8) /* hardware is disconnected */

◆ SNDRV_PCM_STATE_DRAINING

#define SNDRV_PCM_STATE_DRAINING   (( snd_pcm_state_t) 5) /* stream is draining */

◆ SNDRV_PCM_STATE_LAST

#define SNDRV_PCM_STATE_LAST   SNDRV_PCM_STATE_DISCONNECTED

◆ SNDRV_PCM_STATE_OPEN

#define SNDRV_PCM_STATE_OPEN   (( snd_pcm_state_t) 0) /* stream is open */

◆ SNDRV_PCM_STATE_PAUSED

#define SNDRV_PCM_STATE_PAUSED   (( snd_pcm_state_t) 6) /* stream is paused */

◆ SNDRV_PCM_STATE_PREPARED

#define SNDRV_PCM_STATE_PREPARED   (( snd_pcm_state_t) 2) /* stream is ready to start */

◆ SNDRV_PCM_STATE_RUNNING

#define SNDRV_PCM_STATE_RUNNING   (( snd_pcm_state_t) 3) /* stream is running */

◆ SNDRV_PCM_STATE_SETUP

#define SNDRV_PCM_STATE_SETUP   (( snd_pcm_state_t) 1) /* stream has a setup */

◆ SNDRV_PCM_STATE_SUSPENDED

#define SNDRV_PCM_STATE_SUSPENDED   (( snd_pcm_state_t) 7) /* hardware is suspended */

◆ SNDRV_PCM_STATE_XRUN

#define SNDRV_PCM_STATE_XRUN   (( snd_pcm_state_t) 4) /* stream reached an xrun */

◆ SNDRV_PCM_SUBFORMAT_LAST [1/2]

#define SNDRV_PCM_SUBFORMAT_LAST   SNDRV_PCM_SUBFORMAT_STD

◆ SNDRV_PCM_SUBFORMAT_LAST [2/2]

#define SNDRV_PCM_SUBFORMAT_LAST   SNDRV_PCM_SUBFORMAT_STD

◆ SNDRV_PCM_SUBFORMAT_STD [1/2]

#define SNDRV_PCM_SUBFORMAT_STD   (( snd_pcm_subformat_t) 0)

◆ SNDRV_PCM_SUBFORMAT_STD [2/2]

#define SNDRV_PCM_SUBFORMAT_STD   (( snd_pcm_subformat_t) 0)

◆ SNDRV_PCM_SYNC_PTR_APPL

#define SNDRV_PCM_SYNC_PTR_APPL   (1<<1) /* get appl_ptr from driver (r/w op) */

◆ SNDRV_PCM_SYNC_PTR_AVAIL_MIN

#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN   (1<<2) /* get avail_min from driver */

◆ SNDRV_PCM_SYNC_PTR_HWSYNC

#define SNDRV_PCM_SYNC_PTR_HWSYNC   (1<<0) /* execute hwsync */

◆ TINYALSA_CHANNELS_MAX

#define TINYALSA_CHANNELS_MAX   32U

◆ TINYALSA_CHANNELS_MIN

#define TINYALSA_CHANNELS_MIN   1U

◆ TINYALSA_FRAMES_MAX

#define TINYALSA_FRAMES_MAX   (ULONG_MAX / (TINYALSA_CHANNELS_MAX * 4))

Typedef Documentation

◆ snd_pcm_access_t

typedef int __bitwise snd_pcm_access_t

◆ snd_pcm_format_t

typedef int __bitwise snd_pcm_format_t

◆ snd_pcm_hw_param_t

typedef int snd_pcm_hw_param_t

◆ snd_pcm_sframes_t

typedef signed long snd_pcm_sframes_t

◆ snd_pcm_state_t

typedef int __bitwise snd_pcm_state_t

◆ snd_pcm_subformat_t

typedef int __bitwise snd_pcm_subformat_t

◆ snd_pcm_uframes_t

typedef unsigned long snd_pcm_uframes_t

◆ tinyalsa_t

typedef struct tinyalsa tinyalsa_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SNDRV_PCM_TSTAMP_NONE 
SNDRV_PCM_TSTAMP_ENABLE 
SNDRV_PCM_TSTAMP_LAST 

◆ anonymous enum

anonymous enum
Enumerator
SNDRV_CHMAP_UNKNOWN 
SNDRV_CHMAP_NA 
SNDRV_CHMAP_MONO 
SNDRV_CHMAP_FL 
SNDRV_CHMAP_FR 
SNDRV_CHMAP_RL 
SNDRV_CHMAP_RR 
SNDRV_CHMAP_FC 
SNDRV_CHMAP_LFE 
SNDRV_CHMAP_SL 
SNDRV_CHMAP_SR 
SNDRV_CHMAP_RC 
SNDRV_CHMAP_FLC 
SNDRV_CHMAP_FRC 
SNDRV_CHMAP_RLC 
SNDRV_CHMAP_RRC 
SNDRV_CHMAP_FLW 
SNDRV_CHMAP_FRW 
SNDRV_CHMAP_FLH 
SNDRV_CHMAP_FCH 
SNDRV_CHMAP_FRH 
SNDRV_CHMAP_TC 
SNDRV_CHMAP_TFL 
SNDRV_CHMAP_TFR 
SNDRV_CHMAP_TFC 
SNDRV_CHMAP_TRL 
SNDRV_CHMAP_TRR 
SNDRV_CHMAP_TRC 
SNDRV_CHMAP_TFLC 
SNDRV_CHMAP_TFRC 
SNDRV_CHMAP_TSL 
SNDRV_CHMAP_TSR 
SNDRV_CHMAP_LLFE 
SNDRV_CHMAP_RLFE 
SNDRV_CHMAP_BC 
SNDRV_CHMAP_BLC 
SNDRV_CHMAP_BRC 
SNDRV_CHMAP_LAST 

◆ anonymous enum

anonymous enum
Enumerator
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY 
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC 
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW 
SNDRV_PCM_TSTAMP_TYPE_LAST 

◆ pcm_format

enum pcm_format

Audio sample format of a PCM. The first letter specifiers whether the sample is signed or unsigned. The letter 'S' means signed. The letter 'U' means unsigned. The following number is the amount of bits that the sample occupies in memory. Following the underscore, specifiers whether the sample is big endian or little endian. The letters 'LE' mean little endian. The letters 'BE' mean big endian. This enumeration is used in the pcm_config structure.

Enumerator
PCM_FORMAT_S8 

Signed, 8-bit

PCM_FORMAT_S16_LE 

Signed 16-bit, little endian

PCM_FORMAT_S16_BE 

Signed, 16-bit, big endian

PCM_FORMAT_S24_LE 

Signed, 24-bit (32-bit in memory), little endian

PCM_FORMAT_S24_BE 

Signed, 24-bit (32-bit in memory), big endian

PCM_FORMAT_S24_3LE 

Signed, 24-bit, little endian

PCM_FORMAT_S24_3BE 

Signed, 24-bit, big endian

PCM_FORMAT_S32_LE 

Signed, 32-bit, little endian

PCM_FORMAT_S32_BE 

Signed, 32-bit, big endian

PCM_FORMAT_MAX 

Max of the enumeration list, not an actual format.

◆ pcm_param

enum pcm_param

Enumeration of a PCM's hardware parameters. Each of these parameters is either a mask or an interval.

Enumerator
PCM_PARAM_ACCESS 

A mask that represents the type of read or write method available (e.g. interleaved, mmap).

PCM_PARAM_FORMAT 

A mask that represents the pcm_format available (e.g. PCM_FORMAT_S32_LE)

PCM_PARAM_SUBFORMAT 

A mask that represents the subformat available

PCM_PARAM_SAMPLE_BITS 

An interval representing the range of sample bits available (e.g. 8 to 32)

PCM_PARAM_FRAME_BITS 

An interval representing the range of frame bits available (e.g. 8 to 64)

PCM_PARAM_CHANNELS 

An interval representing the range of channels available (e.g. 1 to 2)

PCM_PARAM_RATE 

An interval representing the range of rates available (e.g. 44100 to 192000)

PCM_PARAM_PERIOD_TIME 
PCM_PARAM_PERIOD_SIZE 

The number of frames in a period

PCM_PARAM_PERIOD_BYTES 

The number of bytes in a period

PCM_PARAM_PERIODS 

The number of periods for a PCM

PCM_PARAM_BUFFER_TIME 
PCM_PARAM_BUFFER_SIZE 
PCM_PARAM_BUFFER_BYTES 
PCM_PARAM_TICK_TIME 

Function Documentation

◆ param_get_int()

static unsigned int param_get_int ( struct snd_pcm_hw_params p,
int  n 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_get_interval()

static INLINE const struct snd_interval* param_get_interval ( const struct snd_pcm_hw_params p,
int  n 
)
static
Here is the caller graph for this function:

◆ param_get_max()

static unsigned int param_get_max ( const struct snd_pcm_hw_params p,
int  n 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_get_min()

static unsigned int param_get_min ( const struct snd_pcm_hw_params p,
int  n 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_init()

static void param_init ( struct snd_pcm_hw_params p)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_is_interval()

static INLINE int param_is_interval ( int  p)
static
Here is the caller graph for this function:

◆ param_is_mask()

static INLINE int param_is_mask ( int  p)
static
Here is the caller graph for this function:

◆ param_set_int()

static void param_set_int ( struct snd_pcm_hw_params p,
int  n,
unsigned int  val 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_set_mask()

static void param_set_mask ( struct snd_pcm_hw_params p,
int  n,
unsigned int  bit 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_set_min()

static void param_set_min ( struct snd_pcm_hw_params p,
int  n,
unsigned int  val 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_to_interval()

static INLINE struct snd_interval* param_to_interval ( struct snd_pcm_hw_params p,
int  n 
)
static
Here is the caller graph for this function:

◆ param_to_mask()

static INLINE struct snd_mask* param_to_mask ( struct snd_pcm_hw_params p,
int  n 
)
static
Here is the caller graph for this function:

◆ pcm_avail_update()

static int pcm_avail_update ( struct pcm pcm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_close()

static int pcm_close ( struct pcm pcm)
static

Closes a PCM returned by pcm_open.

Parameters
pcmA PCM returned by pcm_open. May not be NULL.
Returns
Always returns zero.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_format_to_alsa()

static unsigned int pcm_format_to_alsa ( enum pcm_format  format)
static
Here is the caller graph for this function:

◆ pcm_format_to_bits()

unsigned int pcm_format_to_bits ( enum pcm_format  format)

Determines the number of bits occupied by a pcm_format.

Parameters
formatA PCM format.
Returns
The number of bits associated with format
Here is the caller graph for this function:

◆ pcm_frames_to_bytes()

static unsigned int pcm_frames_to_bytes ( const struct pcm pcm,
unsigned int  frames 
)
static

Determines how many bytes are occupied by a number of frames of a PCM.

Parameters
pcmA PCM handle.
framesThe number of frames of a PCM.
Returns
The bytes occupied by frames.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_get_buffer_size()

static unsigned int pcm_get_buffer_size ( const struct pcm pcm)
static

Gets the buffer size of the PCM.

Parameters
pcmA PCM handle.
Returns
The buffer size of the PCM.
Here is the caller graph for this function:

◆ pcm_hw_mmap_status()

static int pcm_hw_mmap_status ( struct pcm pcm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_hw_munmap_status()

static void pcm_hw_munmap_status ( struct pcm pcm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_is_ready()

static int pcm_is_ready ( const struct pcm pcm)
static

Checks if a PCM file has been opened without error.

Parameters
pcmA PCM handle. May be NULL.
Returns
If a PCM's file descriptor is not valid or the pointer is NULL, it returns zero. Otherwise, the function returns one.
Here is the caller graph for this function:

◆ pcm_mmap_avail()

static INLINE int pcm_mmap_avail ( struct pcm pcm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_mmap_capture_avail()

static INLINE int pcm_mmap_capture_avail ( struct pcm pcm)
static
Here is the caller graph for this function:

◆ pcm_mmap_playback_avail()

static INLINE int pcm_mmap_playback_avail ( struct pcm pcm)
static
Here is the caller graph for this function:

◆ pcm_open()

static struct pcm* pcm_open ( unsigned int  card,
unsigned int  device,
unsigned int  flags,
const struct pcm_config config 
)
static

Opens a PCM.

Parameters
cardThe card that the pcm belongs to. The default card is zero.
deviceThe device that the pcm belongs to. The default device is zero.
flagsSpecify characteristics and functionality about the pcm. May be a bitwise AND of the following:
configThe hardware and software parameters to open the PCM with.
Returns
A PCM structure. If an error occurs allocating memory for the PCM, NULL is returned. Otherwise, client code should check that the PCM opened properly by calling pcm_is_ready. If pcm_is_ready, check pcm_get_error for more information.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_param_to_alsa()

static int pcm_param_to_alsa ( enum pcm_param  param)
static
Here is the caller graph for this function:

◆ pcm_params_can_pause()

static int pcm_params_can_pause ( const struct pcm_params *  pcm_params)
static
Here is the caller graph for this function:

◆ pcm_params_free()

static void pcm_params_free ( struct pcm_params *  pcm_params)
static

Frees the hardware parameters returned by pcm_params_get.

Parameters
pcm_paramsHardware parameters of a PCM. May be NULL.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_params_get()

static struct pcm_params* pcm_params_get ( unsigned int  card,
unsigned int  device,
unsigned int  flags 
)
static

Gets the hardware parameters of a PCM, without created a PCM handle.

Parameters
cardThe card of the PCM. The default card is zero.
deviceThe device of the PCM. The default device is zero.
flagsSpecifies whether the PCM is an input or output. May be one of the following:
Returns
On success, the hardware parameters of the PCM; on failure, NULL.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_params_get_max()

static unsigned int pcm_params_get_max ( const struct pcm_params *  pcm_params,
enum pcm_param  param 
)
static

Get the maximum of a specified PCM parameter.

Parameters
pcm_paramsA PCM parameters structure.
paramThe specified parameter to get the maximum of.
Returns
On success, the parameter maximum. On failure, zero.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_params_get_min()

static unsigned int pcm_params_get_min ( const struct pcm_params *  pcm_params,
enum pcm_param  param 
)
static

Get the minimum of a specified PCM parameter.

Parameters
pcm_paramsA PCM parameters structure.
paramThe specified parameter to get the minimum of.
Returns
On success, the parameter minimum. On failure, zero.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_pause()

static int pcm_pause ( struct pcm pcm,
int  enable 
)
static
Here is the caller graph for this function:

◆ pcm_prepare()

static int pcm_prepare ( struct pcm pcm)
static

Prepares a PCM, if it has not been prepared already.

Parameters
pcmA PCM handle.
Returns
On success, zero; on failure, a negative number.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_set_config()

static int pcm_set_config ( struct pcm pcm,
const struct pcm_config config 
)
static

Sets the PCM configuration.

Parameters
pcmA PCM handle.
configThe configuration to use for the PCM. This parameter may be NULL, in which case the default configuration is used.
Returns
Zero on success, a negative errno value on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_stop()

static int pcm_stop ( struct pcm pcm)
static

Stops a PCM.

Parameters
pcmA PCM handle.
Returns
On success, zero; on failure, a negative number.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_sync_ptr()

static int pcm_sync_ptr ( struct pcm pcm,
int  flags 
)
static
Here is the caller graph for this function:

◆ pcm_wait()

static int pcm_wait ( struct pcm pcm,
int  timeout 
)
static

Waits for frames to be available for read or write operations.

Parameters
pcmA PCM handle.
timeoutThe maximum amount of time to wait for, in terms of milliseconds.
Returns
If frames became available, one is returned. If a timeout occured, zero is returned. If an error occured, a negative number is returned.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcm_writei()

static int pcm_writei ( struct pcm pcm,
const void data,
unsigned int  frame_count 
)
static

Writes audio samples to PCM. If the PCM has not been started, it is started in this function. This function is only valid for PCMs opened with the PCM_OUT flag. This function is not valid for PCMs opened with the PCM_MMAP flag.

Parameters
pcmA PCM handle.
dataThe audio sample array
frame_countThe number of frames occupied by the sample array. This value should not be greater than TINYALSA_FRAMES_MAX or INT_MAX.
Returns
On success, this function returns the number of frames written; otherwise, a negative number.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tinyalsa_alive()

static bool tinyalsa_alive ( void data)
static

◆ tinyalsa_buffer_size()

static size_t tinyalsa_buffer_size ( void data)
static

◆ tinyalsa_free()

static void tinyalsa_free ( void data)
static
Here is the call graph for this function:

◆ tinyalsa_init()

static void* tinyalsa_init ( const char *  devicestr,
unsigned  rate,
unsigned  latency,
unsigned  block_frames,
unsigned *  new_rate 
)
static
Here is the call graph for this function:

◆ tinyalsa_set_nonblock_state()

static void tinyalsa_set_nonblock_state ( void data,
bool  state 
)
static

◆ tinyalsa_start()

static bool tinyalsa_start ( void data,
bool  is_shutdown 
)
static
Here is the call graph for this function:

◆ tinyalsa_stop()

static bool tinyalsa_stop ( void data)
static
Here is the call graph for this function:

◆ tinyalsa_use_float()

static bool tinyalsa_use_float ( void data)
static

◆ tinyalsa_write()

static ssize_t tinyalsa_write ( void data,
const void buf_,
size_t  size_ 
)
static
Here is the call graph for this function:

◆ tinyalsa_write_avail()

static size_t tinyalsa_write_avail ( void data)
static
Here is the call graph for this function:

Variable Documentation

◆ audio_tinyalsa

audio_driver_t audio_tinyalsa
Initial value:
= {
"tinyalsa",
NULL,
NULL,
}
static ssize_t tinyalsa_write(void *data, const void *buf_, size_t size_)
Definition: tinyalsa.c:2283
static bool tinyalsa_alive(void *data)
Definition: tinyalsa.c:2345
static size_t tinyalsa_write_avail(void *data)
Definition: tinyalsa.c:2403
static void tinyalsa_set_nonblock_state(void *data, bool state)
Definition: tinyalsa.c:2376
static void * tinyalsa_init(const char *devicestr, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
Definition: tinyalsa.c:2165
static size_t tinyalsa_buffer_size(void *data)
Definition: tinyalsa.c:2414
static bool tinyalsa_stop(void *data)
Definition: tinyalsa.c:2328
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static bool tinyalsa_use_float(void *data)
Definition: tinyalsa.c:2382
static bool tinyalsa_start(void *data, bool is_shutdown)
Definition: tinyalsa.c:2356
static void tinyalsa_free(void *data)
Definition: tinyalsa.c:2389

◆ bad_pcm

struct pcm bad_pcm
static
Initial value:
= {
-1
}