Tizen RT Public API  v1.1 D4
tinyalsa.h File Reference

All macros, structures and functions that make up the PCM interface. More...

#include <sys/time.h>
#include <stddef.h>
Include dependency graph for tinyalsa.h:

Go to the source code of this file.

Data Structures

struct  pcm_mask
 A bit mask of 256 bits (32 bytes) that describes some hardware parameters of a PCM. More...
 
struct  pcm_config
 Encapsulates the hardware and software parameters of a PCM. More...
 

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
 

Enumerations

enum  pcm_format {
  PCM_FORMAT_NONE = -1, 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
}
 Audio sample format of a PCM. More...
 
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_SIZE,
  PCM_PARAM_PERIOD_BYTES, PCM_PARAM_PERIODS
}
 Enumeration of a PCM's hardware parameters. More...
 

Functions

struct pcm * pcm_open (unsigned int card, unsigned int device, unsigned int flags, const struct pcm_config *config)
 Opens a PCM for playback or recording. More...
 
struct pcm * pcm_open_by_name (const char *name, unsigned int flags, const struct pcm_config *config)
 Opens a PCM by it's name. More...
 
int pcm_close (struct pcm *pcm)
 Closes a PCM returned by pcm_open. More...
 
int pcm_is_ready (const struct pcm *pcm)
 Checks if a PCM file has been opened without error. More...
 
unsigned int pcm_get_channels (const struct pcm *pcm)
 Gets the channel count of the PCM. More...
 
const struct pcm_configpcm_get_config (const struct pcm *pcm)
 Gets the PCM configuration. More...
 
unsigned int pcm_get_rate (const struct pcm *pcm)
 Gets the sample rate of the PCM. More...
 
enum pcm_format pcm_get_format (const struct pcm *pcm)
 Gets the format of the PCM. More...
 
int pcm_get_file_descriptor (const struct pcm *pcm)
 Gets the file descriptor of the PCM. More...
 
const char * pcm_get_error (const struct pcm *pcm)
 Gets the error message for the last error that occured. More...
 
unsigned int pcm_get_buffer_size (const struct pcm *pcm)
 Gets the buffer size of the PCM. More...
 
unsigned int pcm_frames_to_bytes (const struct pcm *pcm, unsigned int frames)
 Determines how many bytes are occupied by a number of frames of a PCM. More...
 
unsigned int pcm_bytes_to_frames (const struct pcm *pcm, unsigned int bytes)
 Determines how many frames of a PCM can fit into a number of bytes. More...
 
unsigned int pcm_get_subdevice (const struct pcm *pcm)
 Gets the subdevice on which the pcm has been opened. More...
 
int pcm_writei (struct pcm *pcm, const void *data, unsigned int frame_count)
 Writes audio samples to PCM. More...
 
int pcm_readi (struct pcm *pcm, void *data, unsigned int frame_count)
 Reads audio samples from PCM. More...
 
int pcm_prepare (struct pcm *pcm)
 Prepares a PCM, if it has not been prepared already. More...
 
unsigned int pcm_format_to_bits (enum pcm_format format)
 Determines the number of bits occupied by a pcm_format. More...
 

Detailed Description

All macros, structures and functions that make up the PCM interface.

Definition in file tinyalsa.h.