Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

The Shared Library
[Application-Specific Components]

Library that provides common tasks to the client and alsad. More...


Files

file  alsad_shared_lib.c
 This is the implementation of the Shared Library.

file  alsad_shared_lib.h
 This is the header for the Shared Library.


Data Structures

struct  alsad_config_keys

Defines

#define ALSAD_PCM_WAIT_TIME   1000
#define ALSAD_RESUME_COUNT   1000
#define ALSAD_KEY_USERNAME   "username"
#define ALSAD_KEY_PRIV_KEY_FILE   "private_key_file"
#define ALSAD_KEY_PUB_KEY_DIR   "public_key_dir"
#define ALSAD_KEY_MAX_STREAM_SINKS   "max_stream_sinks"
#define ALSAD_KEY_PCM_FORMAT   "pcm_format"
#define ALSAD_KEY_CHANNELS   "number_pcm_channels"
#define ALSAD_KEY_OPEN_MODE   "card_open_mode"
#define ALSAD_KEY_CIRC_BUFF_SIZE   "circ_buff_size"
#define ALSAD_KEY_MAX_CIRC_BUFF_SIZE   "max_circ_buff_size"
#define ALSAD_KEY_CARD_BUF_TIME   "card_buffer_time"
#define ALSAD_KEY_CARD_PERIOD_TIME   "card_period_time"
#define ALSAD_KEY_CARD_DEVICE_NAME   "card_device_name"
#define ALSAD_KEY_PORT   "alsad_port"
#define ALSAD_DFLT_USERNAME   "alsad"
#define ALSAD_DFLT_PRIV_KEY_FILE   "~/.ssh/alsad.priv"
#define ALSAD_DFLT_PUB_KEY_DIR   "/etc/alsad/pub/"
#define ALSAD_DFLT_MAX_STREAM_SINKS   "0"
#define ALSAD_DFLT_PCM_FORMAT   "S16_LE"
#define ALSAD_DFLT_CHANNELS   "1"
#define ALSAD_DFLT_OPEN_MODE   "0"
#define ALSAD_DFLT_CIRC_BUFF_SIZE   "1048576"
#define ALSAD_DFLT_MAX_CIRC_BUFF_SIZE   "4194304"
#define ALSAD_DFLT_CARD_BUF_TIME   "500000"
#define ALSAD_DFLT_CARD_PERIOD_TIME   "125000"
#define ALSAD_DFLT_CARD_DEVICE_NAME   "default"
#define ALSAD_DFLT_PORT   "5000"
#define ALSAD_DFLT_HOSTNAME   "localhost"
#define ALSAD_DFLT_RATE   22000
#define ALSAD_DFLT_IDENTIFIER   123456
#define ALSAD_DFLT_DP_IDENTIFIER   0

Typedefs

typedef alsad_config_keys alsad_config_keys_t

Functions

int alsad_config_key_load (char *config_file, alsad_config_keys_t *key_struct)
int alsad_conn_with_host (alsad_connect_addr_t *conn_addr, alsad_net_structs_t *send_structs, char *userid, char *priv_key_file, alsad_control_t *conn_ctrl)
int alsad_handle_client_protocol (int sock, int handle, alsad_control_t *conn_ctrl)
int alsad_configure_snd_card (snd_pcm_t **handle, alsad_stream_props_t *rcvd_stream_props, alsad_hw_params_t *rcvd_hw_params)
int buffer_xrun (snd_pcm_t *handle, long err_val)
void print_pcm_state (snd_pcm_t *handle)
void suspend (snd_pcm_t *handle)
int alsad_hw_playback (snd_pcm_t *handle, alsad_stream_props_t *stream_props, alsad_hw_params_t *configd_hw_params, char *audiobuf)
int alsad_hw_capture (snd_pcm_t *handle, alsad_stream_props_t *stream_props, alsad_hw_params_t *configd_hw_params, char *audiobuf)
ssize_t alsad_file_write (int handle, char *audiobuf, size_t total_to_write)
ssize_t alsad_file_read (int handle, char *audiobuf, size_t total_to_read)
int alsad_strerror (int errnum, char *error_buff, size_t buff_size)
int alsad_client_side_negotiation (int sock, alsad_hw_params_t *hw_params, char **audiobuf)
int alsad_server_side_negotiation (int sock, snd_pcm_t **handle, alsad_hw_params_t *rcvd_hw_params, char **audiobuf)
int allocate_audiobuf (alsad_hw_params_t *configd_hw_params, char **audiobuf)
ssize_t alsad_channel_write (void *channel, void *pipe, char *audiobuf, size_t total_to_write)
ssize_t alsad_channel_read (void *channel, void *pipe, char *audiobuf, size_t total_to_read)

Detailed Description

Library that provides common tasks to the client and alsad.


Define Documentation

#define ALSAD_DFLT_CARD_BUF_TIME   "500000"
 

#define ALSAD_DFLT_CARD_DEVICE_NAME   "default"
 

#define ALSAD_DFLT_CARD_PERIOD_TIME   "125000"
 

#define ALSAD_DFLT_CHANNELS   "1"
 

#define ALSAD_DFLT_CIRC_BUFF_SIZE   "1048576"
 

#define ALSAD_DFLT_DP_IDENTIFIER   0
 

#define ALSAD_DFLT_HOSTNAME   "localhost"
 

#define ALSAD_DFLT_IDENTIFIER   123456
 

#define ALSAD_DFLT_MAX_CIRC_BUFF_SIZE   "4194304"
 

#define ALSAD_DFLT_MAX_STREAM_SINKS   "0"
 

#define ALSAD_DFLT_OPEN_MODE   "0"
 

#define ALSAD_DFLT_PCM_FORMAT   "S16_LE"
 

#define ALSAD_DFLT_PORT   "5000"
 

#define ALSAD_DFLT_PRIV_KEY_FILE   "~/.ssh/alsad.priv"
 

#define ALSAD_DFLT_PUB_KEY_DIR   "/etc/alsad/pub/"
 

#define ALSAD_DFLT_RATE   22000
 

#define ALSAD_DFLT_USERNAME   "alsad"
 

#define ALSAD_KEY_CARD_BUF_TIME   "card_buffer_time"
 

#define ALSAD_KEY_CARD_DEVICE_NAME   "card_device_name"
 

#define ALSAD_KEY_CARD_PERIOD_TIME   "card_period_time"
 

#define ALSAD_KEY_CHANNELS   "number_pcm_channels"
 

#define ALSAD_KEY_CIRC_BUFF_SIZE   "circ_buff_size"
 

#define ALSAD_KEY_MAX_CIRC_BUFF_SIZE   "max_circ_buff_size"
 

#define ALSAD_KEY_MAX_STREAM_SINKS   "max_stream_sinks"
 

#define ALSAD_KEY_OPEN_MODE   "card_open_mode"
 

#define ALSAD_KEY_PCM_FORMAT   "pcm_format"
 

#define ALSAD_KEY_PORT   "alsad_port"
 

#define ALSAD_KEY_PRIV_KEY_FILE   "private_key_file"
 

#define ALSAD_KEY_PUB_KEY_DIR   "public_key_dir"
 

#define ALSAD_KEY_USERNAME   "username"
 

#define ALSAD_PCM_WAIT_TIME   1000
 

#define ALSAD_RESUME_COUNT   1000
 


Typedef Documentation

typedef struct alsad_config_keys alsad_config_keys_t
 


Function Documentation

int allocate_audiobuf alsad_hw_params_t configd_hw_params,
char **  audiobuf
 

ssize_t alsad_channel_read void *  channel,
void *  pipe,
char *  audiobuf,
size_t  total_to_read
 

ssize_t alsad_channel_write void *  channel,
void *  pipe,
char *  audiobuf,
size_t  total_to_write
 

int alsad_client_side_negotiation int  sock,
alsad_hw_params_t hw_params,
char **  audiobuf
 

int alsad_config_key_load char *  config_file,
alsad_config_keys_t key_struct
 

int alsad_configure_snd_card snd_pcm_t **  handle,
alsad_stream_props_t rcvd_stream_props,
alsad_hw_params_t rcvd_hw_params
 

int alsad_conn_with_host alsad_connect_addr_t conn_addr,
alsad_net_structs_t send_structs,
char *  userid,
char *  priv_key_file,
alsad_control_t conn_ctrl
 

ssize_t alsad_file_read int  handle,
char *  audiobuf,
size_t  total_to_read
 

ssize_t alsad_file_write int  handle,
char *  audiobuf,
size_t  total_to_write
 

int alsad_handle_client_protocol int  sock,
int  handle,
alsad_control_t conn_ctrl
 

Handles executing the alsad protocol after a connection has been established.

More detail here

Parameters:
sock the socket descriptor for the current connection
handle the file handle write/read sound data to/from.
conn_ctrl to establish the type of alsad connection
See also:
alsad_conn_with_host()
Returns:
An integer -1 on failure or 0 on success

int alsad_hw_capture snd_pcm_t *  handle,
alsad_stream_props_t stream_props,
alsad_hw_params_t configd_hw_params,
char *  audio_buf
 

int alsad_hw_playback snd_pcm_t *  handle,
alsad_stream_props_t stream_props,
alsad_hw_params_t configd_hw_params,
char *  audio_buf
 

int alsad_server_side_negotiation int  sock,
snd_pcm_t **  handle,
alsad_hw_params_t rcvd_hw_params,
char **  audiobuf
 

int alsad_strerror int  errnum,
char *  error_buff,
size_t  buff_size
 

int buffer_xrun snd_pcm_t *  handle,
long  err_val
 

void print_pcm_state snd_pcm_t *  handle  ) 
 

void suspend snd_pcm_t *  handle  ) 
 


Generated on Thu Dec 16 23:07:32 2004 for alsad by doxygen 1.3.6