Global Namespace
Overview
// typedefs typedef struct _snd_config snd_config_t; typedef struct _snd_config_iterator* snd_config_iterator_t; typedef struct _snd_config_update snd_config_update_t; typedef struct _snd_ctl_card_info snd_ctl_card_info_t; typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t; typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; typedef struct _snd_ctl_elem_value snd_ctl_elem_value_t; typedef struct _snd_ctl_event snd_ctl_event_t; typedef struct _snd_ctl snd_ctl_t; typedef struct _snd_sctl snd_sctl_t; typedef struct _snd_hctl_elem snd_hctl_elem_t; typedef struct _snd_hctl snd_hctl_t; typedef int (*snd_hctl_compare_t)( const snd_hctl_elem_t *e1, const snd_hctl_elem_t *e2 ); typedef int (*snd_hctl_callback_t)( snd_hctl_t *hctl, unsigned int mask, snd_hctl_elem_t *elem ); typedef int (*snd_hctl_elem_callback_t)( snd_hctl_elem_t *elem, unsigned int mask ); typedef unsigned long snd_ctl_ext_key_t; typedef snd_ctl_ext snd_ctl_ext_t; typedef snd_ctl_ext_callback snd_ctl_ext_callback_t; typedef int() snd_ctl_ext_tlv_rw_t( snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int op_flag, unsigned int numid, unsigned int *tlv, unsigned int tlv_size ); typedef void (*snd_lib_error_handler_t)( const char *file, int line, const char *function, int err, const char *fmt, ... ); typedef void (*snd_local_error_handler_t)( const char *file, int line, const char *func, int err, const char *fmt, va_list arg ); typedef struct _snd_async_handler snd_async_handler_t; typedef void (*snd_async_callback_t)(snd_async_handler_t *handler); typedef struct timeval snd_timestamp_t; typedef struct timespec snd_htimestamp_t; typedef struct _snd_hwdep_info snd_hwdep_info_t; typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t; typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t; typedef struct _snd_hwdep snd_hwdep_t; typedef struct _snd_input snd_input_t; typedef struct _snd_mixer snd_mixer_t; typedef struct _snd_mixer_class snd_mixer_class_t; typedef struct _snd_mixer_elem snd_mixer_elem_t; typedef int (*snd_mixer_callback_t)( snd_mixer_t *ctl, unsigned int mask, snd_mixer_elem_t *elem ); typedef int (*snd_mixer_elem_callback_t)( snd_mixer_elem_t *elem, unsigned int mask ); typedef int (*snd_mixer_compare_t)( const snd_mixer_elem_t *e1, const snd_mixer_elem_t *e2 ); typedef int (*snd_mixer_event_t)( snd_mixer_class_t *class_, unsigned int mask, snd_hctl_elem_t *helem, snd_mixer_elem_t *melem ); typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t; typedef struct _snd_output snd_output_t; typedef struct _snd_pcm_info snd_pcm_info_t; typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t; typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t; typedef struct _snd_pcm_status snd_pcm_status_t; typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t; typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t; typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t; typedef unsigned long snd_pcm_uframes_t; typedef long snd_pcm_sframes_t; typedef struct _snd_pcm snd_pcm_t; typedef enum _snd_pcm_type snd_pcm_type_t; typedef struct _snd_pcm_scope snd_pcm_scope_t; typedef struct _snd_pcm_hook snd_pcm_hook_t; typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook); typedef snd_pcm_extplug snd_pcm_extplug_t; typedef snd_pcm_extplug_callback snd_pcm_extplug_callback_t; typedef snd_pcm_ioplug snd_pcm_ioplug_t; typedef snd_pcm_ioplug_callback snd_pcm_ioplug_callback_t; typedef struct _snd_rawmidi_info snd_rawmidi_info_t; typedef struct _snd_rawmidi_params snd_rawmidi_params_t; typedef struct _snd_rawmidi_status snd_rawmidi_status_t; typedef struct _snd_rawmidi snd_rawmidi_t; typedef struct _snd_seq snd_seq_t; typedef struct _snd_seq_system_info snd_seq_system_info_t; typedef struct _snd_seq_client_info snd_seq_client_info_t; typedef struct _snd_seq_client_pool snd_seq_client_pool_t; typedef struct _snd_seq_port_info snd_seq_port_info_t; typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t; typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t; typedef struct _snd_seq_queue_info snd_seq_queue_info_t; typedef struct _snd_seq_queue_status snd_seq_queue_status_t; typedef struct _snd_seq_queue_tempo snd_seq_queue_tempo_t; typedef struct _snd_seq_queue_timer snd_seq_queue_timer_t; typedef struct _snd_seq_remove_events snd_seq_remove_events_t; typedef unsigned char snd_seq_event_type_t; typedef unsigned int snd_seq_tick_time_t; typedef snd_seq_ev_ext snd_seq_ev_ext_t; typedef struct snd_midi_event snd_midi_event_t; typedef struct _snd_timer_id snd_timer_id_t; typedef struct _snd_timer_ginfo snd_timer_ginfo_t; typedef struct _snd_timer_gparams snd_timer_gparams_t; typedef struct _snd_timer_gstatus snd_timer_gstatus_t; typedef struct _snd_timer_info snd_timer_info_t; typedef struct _snd_timer_params snd_timer_params_t; typedef struct _snd_timer_status snd_timer_status_t; typedef struct _snd_timer_query snd_timer_query_t; typedef struct _snd_timer snd_timer_t; typedef struct snd_tplg snd_tplg_t; typedef struct snd_use_case_mgr snd_use_case_mgr_t; // enums enum { SND_SEQ_EVFLG_RESULT, SND_SEQ_EVFLG_NOTE, SND_SEQ_EVFLG_CONTROL, SND_SEQ_EVFLG_QUEUE, SND_SEQ_EVFLG_SYSTEM, SND_SEQ_EVFLG_MESSAGE, SND_SEQ_EVFLG_CONNECTION, SND_SEQ_EVFLG_SAMPLE, SND_SEQ_EVFLG_USERS, SND_SEQ_EVFLG_INSTR, SND_SEQ_EVFLG_QUOTE, SND_SEQ_EVFLG_NONE, SND_SEQ_EVFLG_RAW, SND_SEQ_EVFLG_FIXED, SND_SEQ_EVFLG_VARIABLE, SND_SEQ_EVFLG_VARUSR, }; enum { SND_SEQ_EVFLG_NOTE_ONEARG, SND_SEQ_EVFLG_NOTE_TWOARG, }; enum { CHMAP_CTL_QUERY, CHMAP_CTL_GET, CHMAP_CTL_SET, }; enum { SNDRV_TIMER_IOCTL_START_OLD = _IO('T', 0x20), SNDRV_TIMER_IOCTL_STOP_OLD = _IO('T', 0x21), SNDRV_TIMER_IOCTL_CONTINUE_OLD = _IO('T', 0x22), SNDRV_TIMER_IOCTL_PAUSE_OLD = _IO('T', 0x23), }; enum { SND_SEQ_EVFLG_QUEUE_NOARG, SND_SEQ_EVFLG_QUEUE_TICK, SND_SEQ_EVFLG_QUEUE_TIME, SND_SEQ_EVFLG_QUEUE_VALUE, }; enum { SND_PCM_EXTPLUG_HW_FORMAT, SND_PCM_EXTPLUG_HW_CHANNELS, SND_PCM_EXTPLUG_HW_PARAMS, }; enum { SND_PCM_IOPLUG_HW_ACCESS = 0, SND_PCM_IOPLUG_HW_FORMAT, SND_PCM_IOPLUG_HW_CHANNELS, SND_PCM_IOPLUG_HW_RATE, SND_PCM_IOPLUG_HW_PERIOD_BYTES, SND_PCM_IOPLUG_HW_BUFFER_BYTES, SND_PCM_IOPLUG_HW_PERIODS, SND_PCM_IOPLUG_HW_PARAMS, }; enum _snd_pcm_type; enum snd_config_type_t; enum snd_ctl_elem_iface_t; enum snd_ctl_elem_type_t; enum snd_ctl_event_type_t; enum snd_ctl_ext_access_t; enum snd_ctl_type_t; enum snd_hwdep_iface_t; enum snd_hwdep_type_t; enum snd_input_type_t; enum snd_mixer_elem_type_t; enum snd_mixer_selem_channel_id_t; enum snd_mixer_selem_regopt_abstract; enum snd_output_type_t; enum snd_pcm_access_t; enum snd_pcm_chmap_position; enum snd_pcm_chmap_type; enum snd_pcm_class_t; enum snd_pcm_format_t; enum snd_pcm_hook_type_t; enum snd_pcm_start_t; enum snd_pcm_state_t; enum snd_pcm_stream_t; enum snd_pcm_subclass_t; enum snd_pcm_subformat_t; enum snd_pcm_tstamp_t; enum snd_pcm_tstamp_type_t; enum snd_pcm_xrun_t; enum snd_rawmidi_stream_t; enum snd_rawmidi_type_t; enum snd_seq_client_type_t; enum snd_seq_event_type; enum snd_seq_query_subs_type_t; enum snd_seq_queue_timer_type_t; enum snd_seq_type_t; enum snd_spcm_duplex_type_t; enum snd_spcm_latency_t; enum snd_spcm_xrun_type_t; enum snd_timer_class_t; enum snd_timer_event_t; enum snd_timer_slave_class_t; enum snd_timer_type_t; enum snd_tplg_type; // structs struct ctl_access_elem; struct snd_aes_iec958_t; struct snd_ctl_ext; struct snd_ctl_ext_callback; struct snd_devname; struct snd_mixer_selem_regopt; struct snd_pcm_audio_tstamp_config_t; struct snd_pcm_audio_tstamp_report_t; struct snd_pcm_channel_area_t; struct snd_pcm_chmap_query_t; struct snd_pcm_chmap_t; struct snd_pcm_extplug; struct snd_pcm_extplug_callback; struct snd_pcm_ioplug; struct snd_pcm_ioplug_callback; struct snd_pcm_scope_ops_t; struct snd_seq_addr_t; struct snd_seq_connect_t; struct snd_seq_ev_ctrl_t; struct snd_seq_ev_ext; struct snd_seq_ev_note_t; struct snd_seq_ev_queue_control_t; struct snd_seq_ev_raw32_t; struct snd_seq_ev_raw8_t; struct snd_seq_event_t; struct snd_seq_queue_skew_t; struct snd_seq_real_time_t; struct snd_seq_result_t; struct snd_timer_read_t; struct snd_timer_tread_t; struct snd_tplg_bytes_template; struct snd_tplg_channel_elem; struct snd_tplg_channel_map_template; struct snd_tplg_channel_template; struct snd_tplg_ctl_template; struct snd_tplg_dai_template; struct snd_tplg_enum_template; struct snd_tplg_graph_elem; struct snd_tplg_graph_template; struct snd_tplg_hw_config_template; struct snd_tplg_io_ops_template; struct snd_tplg_link_template; struct snd_tplg_mixer_template; struct snd_tplg_obj_template; struct snd_tplg_obj_template_t; struct snd_tplg_pcm_template; struct snd_tplg_pdata_template; struct snd_tplg_stream_caps_template; struct snd_tplg_stream_template; struct snd_tplg_tlv_dbscale_template; struct snd_tplg_tlv_template; struct snd_tplg_widget_template; // unions union snd_pcm_sync_id_t; union snd_seq_timestamp_t; // global variables snd_config_t* snd_config; snd_lib_error_handler_t snd_lib_error; const unsigned int snd_seq_event_types[]; unsigned int len; void* ptr; static struct sigaction previous_action; static const int snd_async_signo = SIGIO; static snd_config_update_t* snd_config_global_update = NULL; static const char*const build_in_ctls[] = { "hw", "shm", NULL }; static const snd_ctl_ops_t snd_ctl_ext_ops; static const snd_ctl_ops_t snd_ctl_hw_ops = { .close = snd_ctl_hw_close, .nonblock = snd_ctl_hw_nonblock, .async = snd_ctl_hw_async, .subscribe_events = snd_ctl_hw_subscribe_events, .card_info = snd_ctl_hw_card_info, .element_list = snd_ctl_hw_elem_list, .element_info = snd_ctl_hw_elem_info, .element_add = snd_ctl_hw_elem_add, .element_replace = snd_ctl_hw_elem_replace, .element_remove = snd_ctl_hw_elem_remove, .element_read = snd_ctl_hw_elem_read, .element_write = snd_ctl_hw_elem_write, .element_lock = snd_ctl_hw_elem_lock, .element_unlock = snd_ctl_hw_elem_unlock, .element_tlv = snd_ctl_hw_elem_tlv, .hwdep_next_device = snd_ctl_hw_hwdep_next_device, .hwdep_info = snd_ctl_hw_hwdep_info, .pcm_next_device = snd_ctl_hw_pcm_next_device, .pcm_info = snd_ctl_hw_pcm_info, .pcm_prefer_subdevice = snd_ctl_hw_pcm_prefer_subdevice, .rawmidi_next_device = snd_ctl_hw_rawmidi_next_device, .rawmidi_info = snd_ctl_hw_rawmidi_info, .rawmidi_prefer_subdevice = snd_ctl_hw_rawmidi_prefer_subdevice, .set_power_state = snd_ctl_hw_set_power_state, .get_power_state = snd_ctl_hw_get_power_state, .read = snd_ctl_hw_read, }; static const snd_ctl_ops_t snd_ctl_shm_ops = { .close = snd_ctl_shm_close, .nonblock = snd_ctl_shm_nonblock, .async = snd_ctl_shm_async, .subscribe_events = snd_ctl_shm_subscribe_events, .card_info = snd_ctl_shm_card_info, .element_list = snd_ctl_shm_elem_list, .element_info = snd_ctl_shm_elem_info, .element_read = snd_ctl_shm_elem_read, .element_write = snd_ctl_shm_elem_write, .element_lock = snd_ctl_shm_elem_lock, .element_unlock = snd_ctl_shm_elem_unlock, .hwdep_next_device = snd_ctl_shm_hwdep_next_device, .hwdep_info = snd_ctl_shm_hwdep_info, .pcm_next_device = snd_ctl_shm_pcm_next_device, .pcm_info = snd_ctl_shm_pcm_info, .pcm_prefer_subdevice = snd_ctl_shm_pcm_prefer_subdevice, .rawmidi_next_device = snd_ctl_shm_rawmidi_next_device, .rawmidi_info = snd_ctl_shm_rawmidi_info, .rawmidi_prefer_subdevice = snd_ctl_shm_rawmidi_prefer_subdevice, .set_power_state = snd_ctl_shm_set_power_state, .get_power_state = snd_ctl_shm_get_power_state, .read = snd_ctl_shm_read, }; & _snd_module_control_shm; & _snd_module_control_ext; static snd_hctl_t* compare_hctl; static const char* snd_error_codes[] = { "Sound protocol is not compatible" }; static TLS_PFX snd_local_error_handler_t local_error = NULL; snd_lib_error_handler_t snd_err_msg = snd_err_msg_default; static const snd_hwdep_ops_t snd_hwdep_hw_ops = { .close = snd_hwdep_hw_close, .nonblock = snd_hwdep_hw_nonblock, .info = snd_hwdep_hw_info, .ioctl = snd_hwdep_hw_ioctl, .write = snd_hwdep_hw_write, .read = snd_hwdep_hw_read, }; static struct sm_elem_ops simple_none_ops = { .is = is_ops, .get_range = get_range_ops, .get_dB_range = get_dB_range_ops, .set_range = set_range_ops, .ask_vol_dB = ask_vol_dB_ops, .ask_dB_vol = ask_dB_vol_ops, .get_volume = get_volume_ops, .get_dB = get_dB_ops, .set_volume = set_volume_ops, .set_dB = set_dB_ops, .get_switch = get_switch_ops, .set_switch = set_switch_ops, .enum_item_name = enum_item_name_ops, .get_enum_item = get_enum_item_ops, .set_enum_item = set_enum_item_ops }; static const char*const build_in_pcms[] = { "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat", "linear", "meter", "mulaw", "multi", "null", "empty", "plug", "rate", "route", "share", "shm", "dsnoop", "dshare", "asym", "iec958", "softvol", "mmap_emul", NULL }; static const char* chmap_long_names[SND_CHMAP_LAST+1]; static const char IndexAdjust[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; static const short StepSize[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 }; static const snd_pcm_ops_t snd_pcm_adpcm_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_adpcm_hw_refine, .hw_params = snd_pcm_adpcm_hw_params, .hw_free = snd_pcm_adpcm_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_adpcm_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_alaw_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_alaw_hw_refine, .hw_params = snd_pcm_alaw_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_alaw_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_copy_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_copy_hw_refine, .hw_params = snd_pcm_copy_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_copy_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_dmix_ops = { .close = snd_pcm_dmix_close, .info = snd_pcm_direct_info, .hw_refine = snd_pcm_direct_hw_refine, .hw_params = snd_pcm_direct_hw_params, .hw_free = snd_pcm_direct_hw_free, .sw_params = snd_pcm_direct_sw_params, .channel_info = snd_pcm_direct_channel_info, .dump = snd_pcm_dmix_dump, .nonblock = snd_pcm_direct_nonblock, .async = snd_pcm_direct_async, .mmap = snd_pcm_direct_mmap, .munmap = snd_pcm_direct_munmap, .query_chmaps = snd_pcm_direct_query_chmaps, .get_chmap = snd_pcm_direct_get_chmap, .set_chmap = snd_pcm_direct_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_dmix_fast_ops = { .status = snd_pcm_dmix_status, .state = snd_pcm_dmix_state, .hwsync = snd_pcm_dmix_hwsync, .delay = snd_pcm_dmix_delay, .prepare = snd_pcm_direct_prepare, .reset = snd_pcm_dmix_reset, .start = snd_pcm_dmix_start, .drop = snd_pcm_dmix_drop, .drain = snd_pcm_dmix_drain, .pause = snd_pcm_dmix_pause, .rewindable = snd_pcm_dmix_rewindable, .rewind = snd_pcm_dmix_rewind, .forwardable = snd_pcm_dmix_forwardable, .forward = snd_pcm_dmix_forward, .resume = snd_pcm_direct_resume, .link = NULL, .link_slaves = NULL, .unlink = NULL, .writei = snd_pcm_mmap_writei, .writen = snd_pcm_mmap_writen, .readi = snd_pcm_dmix_readi, .readn = snd_pcm_dmix_readn, .avail_update = snd_pcm_dmix_avail_update, .mmap_commit = snd_pcm_dmix_mmap_commit, .htimestamp = snd_pcm_dmix_htimestamp, .poll_descriptors = NULL, .poll_descriptors_count = NULL, .poll_revents = snd_pcm_dmix_poll_revents, }; static const snd_pcm_ops_t = { .close = snd_pcm_dshare_close, .info = snd_pcm_direct_info, .hw_refine = snd_pcm_direct_hw_refine, .hw_params = snd_pcm_direct_hw_params, .hw_free = snd_pcm_direct_hw_free, .sw_params = snd_pcm_direct_sw_params, .channel_info = snd_pcm_direct_channel_info, .dump = snd_pcm_dshare_dump, .nonblock = snd_pcm_direct_nonblock, .async = snd_pcm_direct_async, .mmap = snd_pcm_direct_mmap, .munmap = snd_pcm_direct_munmap, .get_chmap = snd_pcm_direct_get_chmap, .set_chmap = snd_pcm_direct_set_chmap, }; static const snd_pcm_fast_ops_t = { .status = snd_pcm_dshare_status, .state = snd_pcm_dshare_state, .hwsync = snd_pcm_dshare_hwsync, .delay = snd_pcm_dshare_delay, .prepare = snd_pcm_direct_prepare, .reset = snd_pcm_dshare_reset, .start = snd_pcm_dshare_start, .drop = snd_pcm_dshare_drop, .drain = snd_pcm_dshare_drain, .pause = snd_pcm_dshare_pause, .rewindable = snd_pcm_dshare_rewindable, .rewind = snd_pcm_dshare_rewind, .forwardable = snd_pcm_dshare_forwardable, .forward = snd_pcm_dshare_forward, .resume = snd_pcm_direct_resume, .link = NULL, .link_slaves = NULL, .unlink = NULL, .writei = snd_pcm_mmap_writei, .writen = snd_pcm_mmap_writen, .readi = snd_pcm_dshare_readi, .readn = snd_pcm_dshare_readn, .avail_update = snd_pcm_dshare_avail_update, .mmap_commit = snd_pcm_dshare_mmap_commit, .htimestamp = snd_pcm_dshare_htimestamp, .poll_descriptors = NULL, .poll_descriptors_count = NULL, .poll_revents = snd_pcm_direct_poll_revents, }; static const snd_pcm_ops_t snd_pcm_dsnoop_ops = { .close = snd_pcm_dsnoop_close, .info = snd_pcm_direct_info, .hw_refine = snd_pcm_direct_hw_refine, .hw_params = snd_pcm_direct_hw_params, .hw_free = snd_pcm_direct_hw_free, .sw_params = snd_pcm_direct_sw_params, .channel_info = snd_pcm_direct_channel_info, .dump = snd_pcm_dsnoop_dump, .nonblock = snd_pcm_direct_nonblock, .async = snd_pcm_direct_async, .mmap = snd_pcm_direct_mmap, .munmap = snd_pcm_direct_munmap, .query_chmaps = snd_pcm_direct_query_chmaps, .get_chmap = snd_pcm_direct_get_chmap, .set_chmap = snd_pcm_direct_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_dsnoop_fast_ops = { .status = snd_pcm_dsnoop_status, .state = snd_pcm_dsnoop_state, .hwsync = snd_pcm_dsnoop_hwsync, .delay = snd_pcm_dsnoop_delay, .prepare = snd_pcm_direct_prepare, .reset = snd_pcm_dsnoop_reset, .start = snd_pcm_dsnoop_start, .drop = snd_pcm_dsnoop_drop, .drain = snd_pcm_dsnoop_drain, .pause = snd_pcm_dsnoop_pause, .rewindable = snd_pcm_dsnoop_rewindable, .rewind = snd_pcm_dsnoop_rewind, .forwardable = snd_pcm_dsnoop_forwardable, .forward = snd_pcm_dsnoop_forward, .resume = snd_pcm_direct_resume, .link = NULL, .link_slaves = NULL, .unlink = NULL, .writei = snd_pcm_dsnoop_writei, .writen = snd_pcm_dsnoop_writen, .readi = snd_pcm_mmap_readi, .readn = snd_pcm_mmap_readn, .avail_update = snd_pcm_dsnoop_avail_update, .mmap_commit = snd_pcm_dsnoop_mmap_commit, .htimestamp = snd_pcm_dsnoop_htimestamp, .poll_descriptors = NULL, .poll_descriptors_count = NULL, .poll_revents = snd_pcm_direct_poll_revents, }; static const snd_pcm_ops_t snd_pcm_file_ops = { .close = snd_pcm_file_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_generic_hw_refine, .hw_params = snd_pcm_file_hw_params, .hw_free = snd_pcm_file_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_file_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = { .status = snd_pcm_generic_status, .state = snd_pcm_generic_state, .hwsync = snd_pcm_generic_hwsync, .delay = snd_pcm_generic_delay, .prepare = snd_pcm_generic_prepare, .reset = snd_pcm_file_reset, .start = snd_pcm_generic_start, .drop = snd_pcm_file_drop, .drain = snd_pcm_file_drain, .pause = snd_pcm_generic_pause, .rewindable = snd_pcm_file_rewindable, .rewind = snd_pcm_file_rewind, .forwardable = snd_pcm_file_forwardable, .forward = snd_pcm_file_forward, .resume = snd_pcm_generic_resume, .link = snd_pcm_generic_link, .link_slaves = snd_pcm_generic_link_slaves, .unlink = snd_pcm_generic_unlink, .writei = snd_pcm_file_writei, .writen = snd_pcm_file_writen, .readi = snd_pcm_file_readi, .readn = snd_pcm_file_readn, .avail_update = snd_pcm_generic_avail_update, .mmap_commit = snd_pcm_file_mmap_commit, .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count, .poll_descriptors = snd_pcm_generic_poll_descriptors, .poll_revents = snd_pcm_generic_poll_revents, .htimestamp = snd_pcm_generic_real_htimestamp, }; static const snd_pcm_ops_t snd_pcm_hooks_ops = { .close = snd_pcm_hooks_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_generic_hw_refine, .hw_params = snd_pcm_hooks_hw_params, .hw_free = snd_pcm_hooks_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_hooks_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_hooks_fast_ops; static const snd_pcm_ops_t snd_pcm_hw_ops = { .close = snd_pcm_hw_close, .info = snd_pcm_hw_info, .hw_refine = snd_pcm_hw_hw_refine, .hw_params = snd_pcm_hw_hw_params, .hw_free = snd_pcm_hw_hw_free, .sw_params = snd_pcm_hw_sw_params, .channel_info = snd_pcm_hw_channel_info, .dump = snd_pcm_hw_dump, .nonblock = snd_pcm_hw_nonblock, .async = snd_pcm_hw_async, .mmap = snd_pcm_hw_mmap, .munmap = snd_pcm_hw_munmap, .query_chmaps = snd_pcm_hw_query_chmaps, .get_chmap = snd_pcm_hw_get_chmap, .set_chmap = snd_pcm_hw_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_hw_fast_ops = { .status = snd_pcm_hw_status, .state = snd_pcm_hw_state, .hwsync = snd_pcm_hw_hwsync, .delay = snd_pcm_hw_delay, .prepare = snd_pcm_hw_prepare, .reset = snd_pcm_hw_reset, .start = snd_pcm_hw_start, .drop = snd_pcm_hw_drop, .drain = snd_pcm_hw_drain, .pause = snd_pcm_hw_pause, .rewindable = snd_pcm_hw_rewindable, .rewind = snd_pcm_hw_rewind, .forwardable = snd_pcm_hw_forwardable, .forward = snd_pcm_hw_forward, .resume = snd_pcm_hw_resume, .link = snd_pcm_hw_link, .link_slaves = snd_pcm_hw_link_slaves, .unlink = snd_pcm_hw_unlink, .writei = snd_pcm_hw_writei, .writen = snd_pcm_hw_writen, .readi = snd_pcm_hw_readi, .readn = snd_pcm_hw_readn, .avail_update = snd_pcm_hw_avail_update, .mmap_commit = snd_pcm_hw_mmap_commit, .htimestamp = snd_pcm_hw_htimestamp, .poll_descriptors = NULL, .poll_descriptors_count = NULL, .poll_revents = NULL, }; static const snd_pcm_fast_ops_t snd_pcm_hw_fast_ops_timer = { .status = snd_pcm_hw_status, .state = snd_pcm_hw_state, .hwsync = snd_pcm_hw_hwsync, .delay = snd_pcm_hw_delay, .prepare = snd_pcm_hw_prepare, .reset = snd_pcm_hw_reset, .start = snd_pcm_hw_start, .drop = snd_pcm_hw_drop, .drain = snd_pcm_hw_drain, .pause = snd_pcm_hw_pause, .rewindable = snd_pcm_hw_rewindable, .rewind = snd_pcm_hw_rewind, .forwardable = snd_pcm_hw_forwardable, .forward = snd_pcm_hw_forward, .resume = snd_pcm_hw_resume, .link = snd_pcm_hw_link, .link_slaves = snd_pcm_hw_link_slaves, .unlink = snd_pcm_hw_unlink, .writei = snd_pcm_hw_writei, .writen = snd_pcm_hw_writen, .readi = snd_pcm_hw_readi, .readn = snd_pcm_hw_readn, .avail_update = snd_pcm_hw_avail_update, .mmap_commit = snd_pcm_hw_mmap_commit, .htimestamp = snd_pcm_hw_htimestamp, .poll_descriptors = snd_pcm_hw_poll_descriptors, .poll_descriptors_count = snd_pcm_hw_poll_descriptors_count, .poll_revents = snd_pcm_hw_poll_revents, }; static const snd_pcm_ops_t snd_pcm_iec958_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_iec958_hw_refine, .hw_params = snd_pcm_iec958_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_iec958_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_ladspa_ops = { .close = snd_pcm_ladspa_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_ladspa_hw_refine, .hw_params = snd_pcm_ladspa_hw_params, .hw_free = snd_pcm_ladspa_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_ladspa_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_lfloat_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_lfloat_hw_refine, .hw_params = snd_pcm_lfloat_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_lfloat_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_linear_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_linear_hw_refine, .hw_params = snd_pcm_linear_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_linear_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const int linear_formats[4][2][2] = { { { SNDRV_PCM_FORMAT_S8, SNDRV_PCM_FORMAT_S8 }, { SNDRV_PCM_FORMAT_U8, SNDRV_PCM_FORMAT_U8 } }, { { SNDRV_PCM_FORMAT_S16_LE, SNDRV_PCM_FORMAT_S16_BE }, { SNDRV_PCM_FORMAT_U16_LE, SNDRV_PCM_FORMAT_U16_BE } }, { { SNDRV_PCM_FORMAT_S24_LE, SNDRV_PCM_FORMAT_S24_BE }, { SNDRV_PCM_FORMAT_U24_LE, SNDRV_PCM_FORMAT_U24_BE } }, { { SNDRV_PCM_FORMAT_S32_LE, SNDRV_PCM_FORMAT_S32_BE }, { SNDRV_PCM_FORMAT_U32_LE, SNDRV_PCM_FORMAT_U32_BE } } }; static const int linear24_formats[3][2][2] = { { { SNDRV_PCM_FORMAT_S24_3LE, SNDRV_PCM_FORMAT_S24_3BE }, { SNDRV_PCM_FORMAT_U24_3LE, SNDRV_PCM_FORMAT_U24_3BE } }, { { SNDRV_PCM_FORMAT_S20_3LE, SNDRV_PCM_FORMAT_S20_3BE }, { SNDRV_PCM_FORMAT_U20_3LE, SNDRV_PCM_FORMAT_U20_3BE } }, { { SNDRV_PCM_FORMAT_S18_3LE, SNDRV_PCM_FORMAT_S18_3BE }, { SNDRV_PCM_FORMAT_U18_3LE, SNDRV_PCM_FORMAT_U18_3BE } }, }; static const snd_pcm_ops_t snd_pcm_mmap_emul_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_mmap_emul_hw_refine, .hw_params = snd_pcm_mmap_emul_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_mmap_emul_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_mmap_emul_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_mmap_emul_fast_ops; static const snd_pcm_ops_t snd_pcm_mulaw_ops = { .close = snd_pcm_generic_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_mulaw_hw_refine, .hw_params = snd_pcm_mulaw_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_mulaw_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_ops_t snd_pcm_multi_ops = { .close = snd_pcm_multi_close, .info = snd_pcm_multi_info, .hw_refine = snd_pcm_multi_hw_refine, .hw_params = snd_pcm_multi_hw_params, .hw_free = snd_pcm_multi_hw_free, .sw_params = snd_pcm_multi_sw_params, .channel_info = snd_pcm_multi_channel_info, .dump = snd_pcm_multi_dump, .nonblock = snd_pcm_multi_nonblock, .async = snd_pcm_multi_async, .mmap = snd_pcm_multi_mmap, .munmap = snd_pcm_multi_munmap, .query_chmaps = snd_pcm_multi_query_chmaps, .get_chmap = snd_pcm_multi_get_chmap, .set_chmap = snd_pcm_multi_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_multi_fast_ops; static const snd_pcm_ops_t snd_pcm_null_ops = { .close = snd_pcm_null_close, .info = snd_pcm_null_info, .hw_refine = snd_pcm_null_hw_refine, .hw_params = snd_pcm_null_hw_params, .hw_free = snd_pcm_null_hw_free, .sw_params = snd_pcm_null_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_null_dump, .nonblock = snd_pcm_null_nonblock, .async = snd_pcm_null_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_null_query_chmaps, .get_chmap = snd_pcm_null_get_chmap, .set_chmap = NULL, }; static const snd_pcm_fast_ops_t snd_pcm_null_fast_ops = { .status = snd_pcm_null_status, .state = snd_pcm_null_state, .hwsync = snd_pcm_null_hwsync, .delay = snd_pcm_null_delay, .prepare = snd_pcm_null_prepare, .reset = snd_pcm_null_reset, .start = snd_pcm_null_start, .drop = snd_pcm_null_drop, .drain = snd_pcm_null_drain, .pause = snd_pcm_null_pause, .rewindable = snd_pcm_null_rewindable, .rewind = snd_pcm_null_rewind, .forwardable = snd_pcm_null_forwardable, .forward = snd_pcm_null_forward, .resume = snd_pcm_null_resume, .writei = snd_pcm_null_writei, .writen = snd_pcm_null_writen, .readi = snd_pcm_null_readi, .readn = snd_pcm_null_readn, .avail_update = snd_pcm_null_avail_update, .mmap_commit = snd_pcm_null_mmap_commit, .htimestamp = snd_pcm_generic_real_htimestamp, }; static const snd_pcm_format_t linear_preferred_formats[]; static const char linear_format_widths[32] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, }; static const snd_pcm_ops_t snd_pcm_plug_ops = { .close = snd_pcm_plug_close, .info = snd_pcm_plug_info, .hw_refine = snd_pcm_plug_hw_refine, .hw_params = snd_pcm_plug_hw_params, .hw_free = snd_pcm_plug_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_plug_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_pcm_fast_ops_t snd_pcm_rate_fast_ops = { .status = snd_pcm_rate_status, .state = snd_pcm_rate_state, .hwsync = snd_pcm_rate_hwsync, .delay = snd_pcm_rate_delay, .prepare = snd_pcm_rate_prepare, .reset = snd_pcm_rate_reset, .start = snd_pcm_rate_start, .drop = snd_pcm_generic_drop, .drain = snd_pcm_rate_drain, .pause = snd_pcm_generic_pause, .rewindable = snd_pcm_rate_rewindable, .rewind = snd_pcm_rate_rewind, .forwardable = snd_pcm_rate_forwardable, .forward = snd_pcm_rate_forward, .resume = snd_pcm_generic_resume, .writei = snd_pcm_mmap_writei, .writen = snd_pcm_mmap_writen, .readi = snd_pcm_mmap_readi, .readn = snd_pcm_mmap_readn, .avail_update = snd_pcm_rate_avail_update, .mmap_commit = snd_pcm_rate_mmap_commit, .htimestamp = snd_pcm_rate_htimestamp, .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count, .poll_descriptors = snd_pcm_generic_poll_descriptors, .poll_revents = snd_pcm_rate_poll_revents, .may_wait_for_avail_min = snd_pcm_generic_may_wait_for_avail_min, }; static const snd_pcm_ops_t snd_pcm_rate_ops = { .close = snd_pcm_rate_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_rate_hw_refine, .hw_params = snd_pcm_rate_hw_params, .hw_free = snd_pcm_rate_hw_free, .sw_params = snd_pcm_rate_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_rate_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const char*const default_rate_plugins[] = { "speexrate", "linear", NULL }; static const snd_pcm_ops_t snd_pcm_route_ops = { .close = snd_pcm_route_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_route_hw_refine, .hw_params = snd_pcm_route_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_route_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_route_query_chmaps, .get_chmap = snd_pcm_route_get_chmap, .set_chmap = NULL, }; static const snd_pcm_ops_t = { .close = snd_pcm_share_close, .info = snd_pcm_share_info, .hw_refine = snd_pcm_share_hw_refine, .hw_params = snd_pcm_share_hw_params, .hw_free = snd_pcm_share_hw_free, .sw_params = snd_pcm_share_sw_params, .channel_info = snd_pcm_share_channel_info, .dump = snd_pcm_share_dump, .nonblock = snd_pcm_share_nonblock, .async = snd_pcm_share_async, .mmap = snd_pcm_share_mmap, .munmap = snd_pcm_share_munmap, }; static const snd_pcm_fast_ops_t = { .status = snd_pcm_share_status, .state = snd_pcm_share_state, .hwsync = snd_pcm_share_hwsync, .delay = snd_pcm_share_delay, .prepare = snd_pcm_share_prepare, .reset = snd_pcm_share_reset, .start = snd_pcm_share_start, .drop = snd_pcm_share_drop, .drain = snd_pcm_share_drain, .pause = snd_pcm_share_pause, .writei = snd_pcm_mmap_writei, .writen = snd_pcm_mmap_writen, .readi = snd_pcm_mmap_readi, .readn = snd_pcm_mmap_readn, .rewindable = snd_pcm_share_rewindable, .rewind = snd_pcm_share_rewind, .forwardable = snd_pcm_share_forwardable, .forward = snd_pcm_share_forward, .resume = snd_pcm_share_resume, .avail_update = snd_pcm_share_avail_update, .htimestamp = snd_pcm_share_htimestamp, .mmap_commit = snd_pcm_share_mmap_commit, }; static const snd_pcm_ops_t snd_pcm_shm_ops = { .close = snd_pcm_shm_close, .info = snd_pcm_shm_info, .hw_refine = snd_pcm_shm_hw_refine, .hw_params = snd_pcm_shm_hw_params, .hw_free = snd_pcm_shm_hw_free, .sw_params = snd_pcm_shm_sw_params, .channel_info = snd_pcm_shm_channel_info, .dump = snd_pcm_shm_dump, .nonblock = snd_pcm_shm_nonblock, .async = snd_pcm_shm_async, .mmap = snd_pcm_shm_mmap, .munmap = snd_pcm_shm_munmap, }; static const snd_pcm_fast_ops_t snd_pcm_shm_fast_ops = { .status = snd_pcm_shm_status, .state = snd_pcm_shm_state, .hwsync = snd_pcm_shm_hwsync, .delay = snd_pcm_shm_delay, .prepare = snd_pcm_shm_prepare, .reset = snd_pcm_shm_reset, .start = snd_pcm_shm_start, .drop = snd_pcm_shm_drop, .drain = snd_pcm_shm_drain, .pause = snd_pcm_shm_pause, .rewindable = snd_pcm_shm_rewindable, .rewind = snd_pcm_shm_rewind, .forwardable = snd_pcm_shm_forwardable, .forward = snd_pcm_shm_forward, .resume = snd_pcm_shm_resume, .writei = snd_pcm_mmap_writei, .writen = snd_pcm_mmap_writen, .readi = snd_pcm_mmap_readi, .readn = snd_pcm_mmap_readn, .avail_update = snd_pcm_shm_avail_update, .mmap_commit = snd_pcm_shm_mmap_commit, .htimestamp = snd_pcm_shm_htimestamp, }; static const snd_pcm_ops_t snd_pcm_softvol_ops = { .close = snd_pcm_softvol_close, .info = snd_pcm_generic_info, .hw_refine = snd_pcm_softvol_hw_refine, .hw_params = snd_pcm_softvol_hw_params, .hw_free = snd_pcm_generic_hw_free, .sw_params = snd_pcm_generic_sw_params, .channel_info = snd_pcm_generic_channel_info, .dump = snd_pcm_softvol_dump, .nonblock = snd_pcm_generic_nonblock, .async = snd_pcm_generic_async, .mmap = snd_pcm_generic_mmap, .munmap = snd_pcm_generic_munmap, .query_chmaps = snd_pcm_generic_query_chmaps, .get_chmap = snd_pcm_generic_get_chmap, .set_chmap = snd_pcm_generic_set_chmap, }; static const snd_rawmidi_ops_t snd_rawmidi_hw_ops = { .close = snd_rawmidi_hw_close, .nonblock = snd_rawmidi_hw_nonblock, .info = snd_rawmidi_hw_info, .params = snd_rawmidi_hw_params, .status = snd_rawmidi_hw_status, .drop = snd_rawmidi_hw_drop, .drain = snd_rawmidi_hw_drain, .write = snd_rawmidi_hw_write, .read = snd_rawmidi_hw_read, }; static const snd_rawmidi_ops_t snd_rawmidi_virtual_ops = { .close = snd_rawmidi_virtual_close, .nonblock = snd_rawmidi_virtual_nonblock, .info = snd_rawmidi_virtual_info, .params = snd_rawmidi_virtual_params, .status = snd_rawmidi_virtual_status, .drop = snd_rawmidi_virtual_drop, .drain = snd_rawmidi_virtual_drain, .write = snd_rawmidi_virtual_write, .read = snd_rawmidi_virtual_read, }; static const snd_seq_ops_t snd_seq_hw_ops; static const snd_timer_ops_t snd_timer_hw_ops = { .close = snd_timer_hw_close, .nonblock = snd_timer_hw_nonblock, .async = snd_timer_hw_async, .info = snd_timer_hw_info, .params = snd_timer_hw_params, .status = snd_timer_hw_status, .rt_start = snd_timer_hw_start, .rt_stop = snd_timer_hw_stop, .rt_continue = snd_timer_hw_continue, .read = snd_timer_hw_read, }; static const snd_timer_query_ops_t snd_timer_query_hw_ops = { .close = snd_timer_query_hw_close, .next_device = snd_timer_query_hw_next_device, .info = snd_timer_query_hw_info, .params = snd_timer_query_hw_params, .status = snd_timer_query_hw_status }; static const struct map_elem channel_map[]; static const struct ctl_access_elem ctl_access[] = { {"read", SNDRV_CTL_ELEM_ACCESS_READ}, {"write", SNDRV_CTL_ELEM_ACCESS_WRITE}, {"read_write", SNDRV_CTL_ELEM_ACCESS_READWRITE}, {"volatile", SNDRV_CTL_ELEM_ACCESS_VOLATILE}, {"timestamp", SNDRV_CTL_ELEM_ACCESS_TIMESTAMP}, {"tlv_read", SNDRV_CTL_ELEM_ACCESS_TLV_READ}, {"tlv_write", SNDRV_CTL_ELEM_ACCESS_TLV_WRITE}, {"tlv_read_write", SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE}, {"tlv_command", SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND}, {"inactive", SNDRV_CTL_ELEM_ACCESS_INACTIVE}, {"lock", SNDRV_CTL_ELEM_ACCESS_LOCK}, {"owner", SNDRV_CTL_ELEM_ACCESS_OWNER}, {"tlv_callback", SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK}, }; static const struct map_elem widget_map[] = { {"input", SND_SOC_TPLG_DAPM_INPUT}, {"output", SND_SOC_TPLG_DAPM_OUTPUT}, {"mux", SND_SOC_TPLG_DAPM_MUX}, {"mixer", SND_SOC_TPLG_DAPM_MIXER}, {"pga", SND_SOC_TPLG_DAPM_PGA}, {"out_drv", SND_SOC_TPLG_DAPM_OUT_DRV}, {"adc", SND_SOC_TPLG_DAPM_ADC}, {"dac", SND_SOC_TPLG_DAPM_DAC}, {"switch", SND_SOC_TPLG_DAPM_SWITCH}, {"pre", SND_SOC_TPLG_DAPM_PRE}, {"post", SND_SOC_TPLG_DAPM_POST}, {"aif_in", SND_SOC_TPLG_DAPM_AIF_IN}, {"aif_out", SND_SOC_TPLG_DAPM_AIF_OUT}, {"dai_in", SND_SOC_TPLG_DAPM_DAI_IN}, {"dai_out", SND_SOC_TPLG_DAPM_DAI_OUT}, {"dai_link", SND_SOC_TPLG_DAPM_DAI_LINK}, }; static const struct map_elem widget_control_map[] = { {"volsw", SND_SOC_TPLG_DAPM_CTL_VOLSW}, {"enum_double", SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE}, {"enum_virt", SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT}, {"enum_value", SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE}, }; static const struct map_elem control_map[] = { {"volsw", SND_SOC_TPLG_CTL_VOLSW}, {"volsw_sx", SND_SOC_TPLG_CTL_VOLSW_SX}, {"volsw_xr_sx", SND_SOC_TPLG_CTL_VOLSW_XR_SX}, {"enum", SND_SOC_TPLG_CTL_ENUM}, {"bytes", SND_SOC_TPLG_CTL_BYTES}, {"enum_value", SND_SOC_TPLG_CTL_ENUM_VALUE}, {"range", SND_SOC_TPLG_CTL_RANGE}, {"strobe", SND_SOC_TPLG_CTL_STROBE}, }; static const char*const component_dir[] = { "codecs", "dsps", NULL, }; // global functions int snd_config_top(snd_config_t** config); int snd_config_load( snd_config_t* config, snd_input_t* in ); int snd_config_load_override( snd_config_t* config, snd_input_t* in ); int snd_config_save( snd_config_t* config, snd_output_t* out ); int snd_config_update(void); int snd_config_update_r( snd_config_t** top, snd_config_update_t** update, const char* path ); int snd_config_update_free(snd_config_update_t* update); int snd_config_update_free_global(void); int snd_config_update_ref(snd_config_t** top); void snd_config_ref(snd_config_t* top); void snd_config_unref(snd_config_t* top); int snd_config_search( snd_config_t* config, const char* key, snd_config_t** result ); int snd_config_searchv( snd_config_t* config, snd_config_t** result, ... ); int snd_config_search_definition( snd_config_t* config, const char* base, const char* key, snd_config_t** result ); int snd_config_expand( snd_config_t* config, snd_config_t* root, const char* args, snd_config_t* private_data, snd_config_t** result ); int snd_config_evaluate( snd_config_t* config, snd_config_t* root, snd_config_t* private_data, snd_config_t** result ); int snd_config_add( snd_config_t* config, snd_config_t* leaf ); int snd_config_delete(snd_config_t* config); int snd_config_delete_compound_members(const snd_config_t* config); int snd_config_copy( snd_config_t** dst, snd_config_t* src ); int snd_config_make( snd_config_t** config, const char* key, snd_config_type_t type ); int snd_config_make_integer( snd_config_t** config, const char* key ); int snd_config_make_integer64( snd_config_t** config, const char* key ); int snd_config_make_real( snd_config_t** config, const char* key ); int snd_config_make_string( snd_config_t** config, const char* key ); int snd_config_make_pointer( snd_config_t** config, const char* key ); int snd_config_make_compound( snd_config_t** config, const char* key, int join ); int snd_config_imake_integer( snd_config_t** config, const char* key, const long value ); int snd_config_imake_integer64( snd_config_t** config, const char* key, const long long value ); int snd_config_imake_real( snd_config_t** config, const char* key, const double value ); int snd_config_imake_string( snd_config_t** config, const char* key, const char* ascii ); int snd_config_imake_pointer( snd_config_t** config, const char* key, const void* ptr ); snd_config_type_t snd_config_get_type(const snd_config_t* config); int snd_config_set_id( snd_config_t* config, const char* id ); int snd_config_set_integer( snd_config_t* config, long value ); int snd_config_set_integer64( snd_config_t* config, long long value ); int snd_config_set_real( snd_config_t* config, double value ); int snd_config_set_string( snd_config_t* config, const char* value ); int snd_config_set_ascii( snd_config_t* config, const char* ascii ); int snd_config_set_pointer( snd_config_t* config, const void* ptr ); int snd_config_get_id( const snd_config_t* config, const char** value ); int snd_config_get_integer( const snd_config_t* config, long* value ); int snd_config_get_integer64( const snd_config_t* config, long long* value ); int snd_config_get_real( const snd_config_t* config, double* value ); int snd_config_get_ireal( const snd_config_t* config, double* value ); int snd_config_get_string( const snd_config_t* config, const char** value ); int snd_config_get_ascii( const snd_config_t* config, char** value ); int snd_config_get_pointer( const snd_config_t* config, const void** value ); int snd_config_test_id( const snd_config_t* config, const char* id ); snd_config_iterator_t snd_config_iterator_first(const snd_config_t* node); snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator); snd_config_iterator_t snd_config_iterator_end(const snd_config_t* node); snd_config_t* snd_config_iterator_entry(const snd_config_iterator_t iterator); int snd_config_get_bool_ascii(const char* ascii); int snd_config_get_bool(const snd_config_t* conf); int snd_config_get_ctl_iface_ascii(const char* ascii); int snd_config_get_ctl_iface(const snd_config_t* conf); int snd_names_list( const char* iface, snd_devname_t** list ); void snd_names_list_free(snd_devname_t* list); int snd_card_load(int card); int snd_card_next(int* card); int snd_card_get_index(const char* name); int snd_card_get_name( int card, char** name ); int snd_card_get_longname( int card, char** name ); int snd_device_name_hint( int card, const char* iface, void*** hints ); int snd_device_name_free_hint(void** hints); char* snd_device_name_get_hint( const void* hint, const char* id ); int snd_ctl_open( snd_ctl_t** ctl, const char* name, int mode ); int snd_ctl_open_lconf( snd_ctl_t** ctl, const char* name, int mode, snd_config_t* lconf ); int snd_ctl_open_fallback( snd_ctl_t** ctl, snd_config_t* root, const char* name, const char* orig_name, int mode ); int snd_ctl_close(snd_ctl_t* ctl); int snd_ctl_nonblock( snd_ctl_t* ctl, int nonblock ); static __inline__ int snd_ctl_abort(snd_ctl_t* ctl); int snd_async_add_ctl_handler( snd_async_handler_t** handler, snd_ctl_t* ctl, snd_async_callback_t callback, void* private_data ); snd_ctl_t* snd_async_handler_get_ctl(snd_async_handler_t* handler); int snd_ctl_poll_descriptors_count(snd_ctl_t* ctl); int snd_ctl_poll_descriptors( snd_ctl_t* ctl, struct pollfd* pfds, unsigned int space ); int snd_ctl_poll_descriptors_revents( snd_ctl_t* ctl, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_ctl_subscribe_events( snd_ctl_t* ctl, int subscribe ); int snd_ctl_card_info( snd_ctl_t* ctl, snd_ctl_card_info_t* info ); int snd_ctl_elem_list( snd_ctl_t* ctl, snd_ctl_elem_list_t* list ); int snd_ctl_elem_info( snd_ctl_t* ctl, snd_ctl_elem_info_t* info ); int snd_ctl_elem_read( snd_ctl_t* ctl, snd_ctl_elem_value_t* data ); int snd_ctl_elem_write( snd_ctl_t* ctl, snd_ctl_elem_value_t* data ); int snd_ctl_elem_lock( snd_ctl_t* ctl, snd_ctl_elem_id_t* id ); int snd_ctl_elem_unlock( snd_ctl_t* ctl, snd_ctl_elem_id_t* id ); int snd_ctl_elem_tlv_read( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, unsigned int* tlv, unsigned int tlv_size ); int snd_ctl_elem_tlv_write( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, const unsigned int* tlv ); int snd_ctl_elem_tlv_command( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, const unsigned int* tlv ); int snd_ctl_set_power_state( snd_ctl_t* ctl, unsigned int state ); int snd_ctl_get_power_state( snd_ctl_t* ctl, unsigned int* state ); int snd_ctl_read( snd_ctl_t* ctl, snd_ctl_event_t* event ); int snd_ctl_wait( snd_ctl_t* ctl, int timeout ); const char* snd_ctl_name(snd_ctl_t* ctl); snd_ctl_type_t snd_ctl_type(snd_ctl_t* ctl); const char* snd_ctl_elem_type_name(snd_ctl_elem_type_t type); const char* snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface); const char* snd_ctl_event_type_name(snd_ctl_event_type_t type); unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t* obj); unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t* obj); void snd_ctl_event_elem_get_id( const snd_ctl_event_t* obj, snd_ctl_elem_id_t* ptr ); snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t* obj); unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t* obj); unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t* obj); const char* snd_ctl_event_elem_get_name(const snd_ctl_event_t* obj); unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t* obj); int snd_ctl_elem_list_alloc_space( snd_ctl_elem_list_t* obj, unsigned int entries ); void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t* obj); char* snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t* id); int snd_ctl_ascii_elem_id_parse( snd_ctl_elem_id_t* dst, const char* str ); int snd_ctl_ascii_value_parse( snd_ctl_t* handle, snd_ctl_elem_value_t* dst, snd_ctl_elem_info_t* info, const char* value ); size_t snd_ctl_elem_id_sizeof(void); int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t** ptr); void snd_ctl_elem_id_free(snd_ctl_elem_id_t* obj); void snd_ctl_elem_id_clear(snd_ctl_elem_id_t* obj); void snd_ctl_elem_id_copy( snd_ctl_elem_id_t* dst, const snd_ctl_elem_id_t* src ); unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t* obj); snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t* obj); unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t* obj); unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t* obj); const char* snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t* obj); unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t* obj); void snd_ctl_elem_id_set_numid( snd_ctl_elem_id_t* obj, unsigned int val ); void snd_ctl_elem_id_set_interface( snd_ctl_elem_id_t* obj, snd_ctl_elem_iface_t val ); void snd_ctl_elem_id_set_device( snd_ctl_elem_id_t* obj, unsigned int val ); void snd_ctl_elem_id_set_subdevice( snd_ctl_elem_id_t* obj, unsigned int val ); void snd_ctl_elem_id_set_name( snd_ctl_elem_id_t* obj, const char* val ); void snd_ctl_elem_id_set_index( snd_ctl_elem_id_t* obj, unsigned int val ); size_t snd_ctl_card_info_sizeof(void); int snd_ctl_card_info_malloc(snd_ctl_card_info_t** ptr); void snd_ctl_card_info_free(snd_ctl_card_info_t* obj); void snd_ctl_card_info_clear(snd_ctl_card_info_t* obj); void snd_ctl_card_info_copy( snd_ctl_card_info_t* dst, const snd_ctl_card_info_t* src ); int snd_ctl_card_info_get_card(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_id(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_driver(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_name(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_longname(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t* obj); const char* snd_ctl_card_info_get_components(const snd_ctl_card_info_t* obj); size_t snd_ctl_event_sizeof(void); int snd_ctl_event_malloc(snd_ctl_event_t** ptr); void snd_ctl_event_free(snd_ctl_event_t* obj); void snd_ctl_event_clear(snd_ctl_event_t* obj); void snd_ctl_event_copy( snd_ctl_event_t* dst, const snd_ctl_event_t* src ); snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t* obj); size_t snd_ctl_elem_list_sizeof(void); int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t** ptr); void snd_ctl_elem_list_free(snd_ctl_elem_list_t* obj); void snd_ctl_elem_list_clear(snd_ctl_elem_list_t* obj); void snd_ctl_elem_list_copy( snd_ctl_elem_list_t* dst, const snd_ctl_elem_list_t* src ); void snd_ctl_elem_list_set_offset( snd_ctl_elem_list_t* obj, unsigned int val ); unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t* obj); unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t* obj); void snd_ctl_elem_list_get_id( const snd_ctl_elem_list_t* obj, unsigned int idx, snd_ctl_elem_id_t* ptr ); unsigned int snd_ctl_elem_list_get_numid( const snd_ctl_elem_list_t* obj, unsigned int idx ); snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface( const snd_ctl_elem_list_t* obj, unsigned int idx ); unsigned int snd_ctl_elem_list_get_device( const snd_ctl_elem_list_t* obj, unsigned int idx ); unsigned int snd_ctl_elem_list_get_subdevice( const snd_ctl_elem_list_t* obj, unsigned int idx ); const char* snd_ctl_elem_list_get_name( const snd_ctl_elem_list_t* obj, unsigned int idx ); unsigned int snd_ctl_elem_list_get_index( const snd_ctl_elem_list_t* obj, unsigned int idx ); size_t snd_ctl_elem_info_sizeof(void); int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t** ptr); void snd_ctl_elem_info_free(snd_ctl_elem_info_t* obj); void snd_ctl_elem_info_clear(snd_ctl_elem_info_t* obj); void snd_ctl_elem_info_copy( snd_ctl_elem_info_t* dst, const snd_ctl_elem_info_t* src ); snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_tlv_readable(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_tlv_writable(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_is_user(const snd_ctl_elem_info_t* obj); pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t* obj); unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t* obj); long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t* obj); long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t* obj); long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t* obj); long long snd_ctl_elem_info_get_min64(const snd_ctl_elem_info_t* obj); long long snd_ctl_elem_info_get_max64(const snd_ctl_elem_info_t* obj); long long snd_ctl_elem_info_get_step64(const snd_ctl_elem_info_t* obj); unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t* obj); void snd_ctl_elem_info_set_item( snd_ctl_elem_info_t* obj, unsigned int val ); const char* snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t* obj); int snd_ctl_elem_info_get_dimension( const snd_ctl_elem_info_t* obj, unsigned int idx ); int snd_ctl_elem_info_set_dimension( snd_ctl_elem_info_t* info, const int dimension[4] ); void snd_ctl_elem_info_get_id( const snd_ctl_elem_info_t* obj, snd_ctl_elem_id_t* ptr ); unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t* obj); snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t* obj); unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t* obj); unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t* obj); const char* snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t* obj); unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t* obj); void snd_ctl_elem_info_set_id( snd_ctl_elem_info_t* obj, const snd_ctl_elem_id_t* ptr ); void snd_ctl_elem_info_set_numid( snd_ctl_elem_info_t* obj, unsigned int val ); void snd_ctl_elem_info_set_interface( snd_ctl_elem_info_t* obj, snd_ctl_elem_iface_t val ); void snd_ctl_elem_info_set_device( snd_ctl_elem_info_t* obj, unsigned int val ); void snd_ctl_elem_info_set_subdevice( snd_ctl_elem_info_t* obj, unsigned int val ); void snd_ctl_elem_info_set_name( snd_ctl_elem_info_t* obj, const char* val ); void snd_ctl_elem_info_set_index( snd_ctl_elem_info_t* obj, unsigned int val ); int snd_ctl_add_integer_elem_set( snd_ctl_t* ctl, snd_ctl_elem_info_t* info, unsigned int element_count, unsigned int member_count, long min, long max, long step ); int snd_ctl_add_integer64_elem_set( snd_ctl_t* ctl, snd_ctl_elem_info_t* info, unsigned int element_count, unsigned int member_count, long long min, long long max, long long step ); int snd_ctl_add_boolean_elem_set( snd_ctl_t* ctl, snd_ctl_elem_info_t* info, unsigned int element_count, unsigned int member_count ); int snd_ctl_add_enumerated_elem_set( snd_ctl_t* ctl, snd_ctl_elem_info_t* info, unsigned int element_count, unsigned int member_count, unsigned int items, const char*const labels[] ); int snd_ctl_add_bytes_elem_set( snd_ctl_t* ctl, snd_ctl_elem_info_t* info, unsigned int element_count, unsigned int member_count ); int snd_ctl_elem_add_integer( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, unsigned int count, long imin, long imax, long istep ); int snd_ctl_elem_add_integer64( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, unsigned int count, long long imin, long long imax, long long istep ); int snd_ctl_elem_add_boolean( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, unsigned int count ); int snd_ctl_elem_add_enumerated( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, unsigned int count, unsigned int items, const char*const names[] ); int snd_ctl_elem_add_iec958( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id ); int snd_ctl_elem_remove( snd_ctl_t* ctl, snd_ctl_elem_id_t* id ); size_t snd_ctl_elem_value_sizeof(void); int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t** ptr); void snd_ctl_elem_value_free(snd_ctl_elem_value_t* obj); void snd_ctl_elem_value_clear(snd_ctl_elem_value_t* obj); void snd_ctl_elem_value_copy( snd_ctl_elem_value_t* dst, const snd_ctl_elem_value_t* src ); int snd_ctl_elem_value_compare( snd_ctl_elem_value_t* left, const snd_ctl_elem_value_t* right ); void snd_ctl_elem_value_get_id( const snd_ctl_elem_value_t* obj, snd_ctl_elem_id_t* ptr ); unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t* obj); snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t* obj); unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t* obj); unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t* obj); const char* snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t* obj); unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t* obj); void snd_ctl_elem_value_set_id( snd_ctl_elem_value_t* obj, const snd_ctl_elem_id_t* ptr ); void snd_ctl_elem_value_set_numid( snd_ctl_elem_value_t* obj, unsigned int val ); void snd_ctl_elem_value_set_interface( snd_ctl_elem_value_t* obj, snd_ctl_elem_iface_t val ); void snd_ctl_elem_value_set_device( snd_ctl_elem_value_t* obj, unsigned int val ); void snd_ctl_elem_value_set_subdevice( snd_ctl_elem_value_t* obj, unsigned int val ); void snd_ctl_elem_value_set_name( snd_ctl_elem_value_t* obj, const char* val ); void snd_ctl_elem_value_set_index( snd_ctl_elem_value_t* obj, unsigned int val ); int snd_ctl_elem_value_get_boolean( const snd_ctl_elem_value_t* obj, unsigned int idx ); long snd_ctl_elem_value_get_integer( const snd_ctl_elem_value_t* obj, unsigned int idx ); long long snd_ctl_elem_value_get_integer64( const snd_ctl_elem_value_t* obj, unsigned int idx ); unsigned int snd_ctl_elem_value_get_enumerated( const snd_ctl_elem_value_t* obj, unsigned int idx ); unsigned char snd_ctl_elem_value_get_byte( const snd_ctl_elem_value_t* obj, unsigned int idx ); void snd_ctl_elem_value_set_boolean( snd_ctl_elem_value_t* obj, unsigned int idx, long val ); void snd_ctl_elem_value_set_integer( snd_ctl_elem_value_t* obj, unsigned int idx, long val ); void snd_ctl_elem_value_set_integer64( snd_ctl_elem_value_t* obj, unsigned int idx, long long val ); void snd_ctl_elem_value_set_enumerated( snd_ctl_elem_value_t* obj, unsigned int idx, unsigned int val ); void snd_ctl_elem_value_set_byte( snd_ctl_elem_value_t* obj, unsigned int idx, unsigned char val ); void snd_ctl_elem_set_bytes( snd_ctl_elem_value_t* obj, void* data, size_t size ); const void* snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t* obj); void snd_ctl_elem_value_get_iec958( const snd_ctl_elem_value_t* obj, snd_aes_iec958_t* ptr ); void snd_ctl_elem_value_set_iec958( snd_ctl_elem_value_t* obj, const snd_aes_iec958_t* ptr ); int snd_tlv_parse_dB_info( unsigned int* tlv, unsigned int tlv_size, unsigned int** db_tlvp ); int snd_tlv_get_dB_range( unsigned int* tlv, long rangemin, long rangemax, long* min, long* max ); int snd_tlv_convert_to_dB( unsigned int* tlv, long rangemin, long rangemax, long volume, long* db_gain ); int snd_tlv_convert_from_dB( unsigned int* tlv, long rangemin, long rangemax, long db_gain, long* value, int xdir ); int snd_ctl_get_dB_range( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, long* min, long* max ); int snd_ctl_convert_to_dB( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, long volume, long* db_gain ); int snd_ctl_convert_from_dB( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, long db_gain, long* value, int xdir ); int snd_hctl_compare_fast( const snd_hctl_elem_t* c1, const snd_hctl_elem_t* c2 ); int snd_hctl_open( snd_hctl_t** hctl, const char* name, int mode ); int snd_hctl_open_ctl( snd_hctl_t** hctlp, snd_ctl_t* ctl ); int snd_hctl_close(snd_hctl_t* hctl); int snd_hctl_nonblock( snd_hctl_t* hctl, int nonblock ); static __inline__ int snd_hctl_abort(snd_hctl_t* hctl); int snd_hctl_poll_descriptors_count(snd_hctl_t* hctl); int snd_hctl_poll_descriptors( snd_hctl_t* hctl, struct pollfd* pfds, unsigned int space ); int snd_hctl_poll_descriptors_revents( snd_hctl_t* ctl, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); unsigned int snd_hctl_get_count(snd_hctl_t* hctl); int snd_hctl_set_compare( snd_hctl_t* hctl, snd_hctl_compare_t hsort ); snd_hctl_elem_t* snd_hctl_first_elem(snd_hctl_t* hctl); snd_hctl_elem_t* snd_hctl_last_elem(snd_hctl_t* hctl); snd_hctl_elem_t* snd_hctl_find_elem( snd_hctl_t* hctl, const snd_ctl_elem_id_t* id ); void snd_hctl_set_callback( snd_hctl_t* hctl, snd_hctl_callback_t callback ); void snd_hctl_set_callback_private( snd_hctl_t* hctl, void* data ); void* snd_hctl_get_callback_private(snd_hctl_t* hctl); int snd_hctl_load(snd_hctl_t* hctl); int snd_hctl_free(snd_hctl_t* hctl); int snd_hctl_handle_events(snd_hctl_t* hctl); const char* snd_hctl_name(snd_hctl_t* hctl); int snd_hctl_wait( snd_hctl_t* hctl, int timeout ); snd_ctl_t* snd_hctl_ctl(snd_hctl_t* hctl); snd_hctl_elem_t* snd_hctl_elem_next(snd_hctl_elem_t* elem); snd_hctl_elem_t* snd_hctl_elem_prev(snd_hctl_elem_t* elem); int snd_hctl_elem_info( snd_hctl_elem_t* elem, snd_ctl_elem_info_t* info ); int snd_hctl_elem_read( snd_hctl_elem_t* elem, snd_ctl_elem_value_t* value ); int snd_hctl_elem_write( snd_hctl_elem_t* elem, snd_ctl_elem_value_t* value ); int snd_hctl_elem_tlv_read( snd_hctl_elem_t* elem, unsigned int* tlv, unsigned int tlv_size ); int snd_hctl_elem_tlv_write( snd_hctl_elem_t* elem, const unsigned int* tlv ); int snd_hctl_elem_tlv_command( snd_hctl_elem_t* elem, const unsigned int* tlv ); snd_hctl_t* snd_hctl_elem_get_hctl(snd_hctl_elem_t* elem); void snd_hctl_elem_get_id( const snd_hctl_elem_t* obj, snd_ctl_elem_id_t* ptr ); unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t* obj); snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t* obj); unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t* obj); unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t* obj); const char* snd_hctl_elem_get_name(const snd_hctl_elem_t* obj); unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t* obj); void snd_hctl_elem_set_callback( snd_hctl_elem_t* obj, snd_hctl_elem_callback_t val ); void* snd_hctl_elem_get_callback_private(const snd_hctl_elem_t* obj); void snd_hctl_elem_set_callback_private( snd_hctl_elem_t* obj, void* val ); int snd_sctl_build( snd_sctl_t** ctl, snd_ctl_t* handle, snd_config_t* config, snd_config_t* private_data, int mode ); int snd_sctl_free(snd_sctl_t* handle); int snd_sctl_install(snd_sctl_t* handle); int snd_sctl_remove(snd_sctl_t* handle); int snd_ctl_ext_create( snd_ctl_ext_t* ext, const char* name, int mode ); int snd_ctl_ext_delete(snd_ctl_ext_t* ext); const char* snd_strerror(int errnum); int snd_lib_error_set_handler(snd_lib_error_handler_t handler); snd_local_error_handler_t snd_lib_error_set_local(snd_local_error_handler_t func); const char* snd_asoundlib_version(void); void* snd_dlopen( const char* file, int mode ); void* snd_dlsym( void* handle, const char* name, const char* version ); int snd_dlclose(void* handle); int snd_async_add_handler( snd_async_handler_t** handler, int fd, snd_async_callback_t callback, void* private_data ); int snd_async_del_handler(snd_async_handler_t* handler); int snd_async_handler_get_fd(snd_async_handler_t* handler); int snd_async_handler_get_signo(snd_async_handler_t* handler); void* snd_async_handler_get_callback_private(snd_async_handler_t* handler); struct snd_shm_area* snd_shm_area_create( int shmid, void* ptr ); struct snd_shm_area* snd_shm_area_share(struct snd_shm_area* area); int snd_shm_area_destroy(struct snd_shm_area* area); int snd_user_file( const char* file, char** result ); int snd_hwdep_open( snd_hwdep_t** hwdep, const char* name, int mode ); int snd_hwdep_close(snd_hwdep_t* hwdep); int snd_hwdep_poll_descriptors( snd_hwdep_t* hwdep, struct pollfd* pfds, unsigned int space ); int snd_hwdep_poll_descriptors_count(snd_hwdep_t* hwdep); int snd_hwdep_poll_descriptors_revents( snd_hwdep_t* hwdep, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_hwdep_nonblock( snd_hwdep_t* hwdep, int nonblock ); int snd_hwdep_info( snd_hwdep_t* hwdep, snd_hwdep_info_t* info ); int snd_hwdep_dsp_status( snd_hwdep_t* hwdep, snd_hwdep_dsp_status_t* status ); int snd_hwdep_dsp_load( snd_hwdep_t* hwdep, snd_hwdep_dsp_image_t* block ); int snd_hwdep_ioctl( snd_hwdep_t* hwdep, unsigned int request, void* arg ); ssize_t snd_hwdep_write( snd_hwdep_t* hwdep, const void* buffer, size_t size ); ssize_t snd_hwdep_read( snd_hwdep_t* hwdep, void* buffer, size_t size ); size_t snd_hwdep_info_sizeof(void); int snd_hwdep_info_malloc(snd_hwdep_info_t** ptr); void snd_hwdep_info_free(snd_hwdep_info_t* obj); void snd_hwdep_info_copy( snd_hwdep_info_t* dst, const snd_hwdep_info_t* src ); unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t* obj); int snd_hwdep_info_get_card(const snd_hwdep_info_t* obj); const char* snd_hwdep_info_get_id(const snd_hwdep_info_t* obj); const char* snd_hwdep_info_get_name(const snd_hwdep_info_t* obj); snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t* obj); void snd_hwdep_info_set_device( snd_hwdep_info_t* obj, unsigned int val ); size_t snd_hwdep_dsp_status_sizeof(void); int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t** ptr); void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t* obj); void snd_hwdep_dsp_status_copy( snd_hwdep_dsp_status_t* dst, const snd_hwdep_dsp_status_t* src ); unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t* obj); const char* snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t* obj); unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t* obj); unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t* obj); unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t* obj); size_t snd_hwdep_dsp_image_sizeof(void); int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t** ptr); void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t* obj); void snd_hwdep_dsp_image_copy( snd_hwdep_dsp_image_t* dst, const snd_hwdep_dsp_image_t* src ); unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t* obj); const char* snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t* obj); const void* snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t* obj); size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t* obj); void snd_hwdep_dsp_image_set_index( snd_hwdep_dsp_image_t* obj, unsigned int _index ); void snd_hwdep_dsp_image_set_name( snd_hwdep_dsp_image_t* obj, const char* name ); void snd_hwdep_dsp_image_set_image( snd_hwdep_dsp_image_t* obj, void* buffer ); void snd_hwdep_dsp_image_set_length( snd_hwdep_dsp_image_t* obj, size_t length ); int snd_input_stdio_open( snd_input_t** inputp, const char* file, const char* mode ); int snd_input_stdio_attach( snd_input_t** inputp, FILE* fp, int _close ); int snd_input_buffer_open( snd_input_t** inputp, const char* buffer, ssize_t size ); int snd_input_close(snd_input_t* input); int snd_input_scanf( snd_input_t* input, const char* format, ... ); char* snd_input_gets( snd_input_t* input, char* str, size_t size ); int snd_input_getc(snd_input_t* input); int snd_input_ungetc( snd_input_t* input, int c ); int snd_mixer_open( snd_mixer_t** mixer, int mode ); int snd_mixer_close(snd_mixer_t* mixer); snd_mixer_elem_t* snd_mixer_first_elem(snd_mixer_t* mixer); snd_mixer_elem_t* snd_mixer_last_elem(snd_mixer_t* mixer); int snd_mixer_handle_events(snd_mixer_t* mixer); int snd_mixer_attach( snd_mixer_t* mixer, const char* name ); int snd_mixer_attach_hctl( snd_mixer_t* mixer, snd_hctl_t* hctl ); int snd_mixer_detach( snd_mixer_t* mixer, const char* name ); int snd_mixer_detach_hctl( snd_mixer_t* mixer, snd_hctl_t* hctl ); int snd_mixer_get_hctl( snd_mixer_t* mixer, const char* name, snd_hctl_t** hctl ); int snd_mixer_poll_descriptors_count(snd_mixer_t* mixer); int snd_mixer_poll_descriptors( snd_mixer_t* mixer, struct pollfd* pfds, unsigned int space ); int snd_mixer_poll_descriptors_revents( snd_mixer_t* mixer, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_mixer_load(snd_mixer_t* mixer); void snd_mixer_free(snd_mixer_t* mixer); int snd_mixer_wait( snd_mixer_t* mixer, int timeout ); int snd_mixer_set_compare( snd_mixer_t* mixer, snd_mixer_compare_t msort ); void snd_mixer_set_callback( snd_mixer_t* obj, snd_mixer_callback_t val ); void* snd_mixer_get_callback_private(const snd_mixer_t* obj); void snd_mixer_set_callback_private( snd_mixer_t* obj, void* val ); unsigned int snd_mixer_get_count(const snd_mixer_t* obj); int snd_mixer_class_unregister(snd_mixer_class_t* clss); snd_mixer_elem_t* snd_mixer_elem_next(snd_mixer_elem_t* elem); snd_mixer_elem_t* snd_mixer_elem_prev(snd_mixer_elem_t* elem); void snd_mixer_elem_set_callback( snd_mixer_elem_t* obj, snd_mixer_elem_callback_t val ); void* snd_mixer_elem_get_callback_private(const snd_mixer_elem_t* obj); void snd_mixer_elem_set_callback_private( snd_mixer_elem_t* obj, void* val ); snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t* obj); int snd_mixer_class_register( snd_mixer_class_t* class_, snd_mixer_t* mixer ); int snd_mixer_elem_new( snd_mixer_elem_t** elem, snd_mixer_elem_type_t type, int compare_weight, void* private_data, void(*)(snd_mixer_elem_t*elem) private_free ); int snd_mixer_elem_add( snd_mixer_elem_t* elem, snd_mixer_class_t* class_ ); int snd_mixer_elem_remove(snd_mixer_elem_t* elem); void snd_mixer_elem_free(snd_mixer_elem_t* elem); int snd_mixer_elem_info(snd_mixer_elem_t* elem); int snd_mixer_elem_value(snd_mixer_elem_t* elem); int snd_mixer_elem_attach( snd_mixer_elem_t* melem, snd_hctl_elem_t* helem ); int snd_mixer_elem_detach( snd_mixer_elem_t* melem, snd_hctl_elem_t* helem ); int snd_mixer_elem_empty(snd_mixer_elem_t* melem); void* snd_mixer_elem_get_private(const snd_mixer_elem_t* melem); size_t snd_mixer_class_sizeof(void); int snd_mixer_class_malloc(snd_mixer_class_t** ptr); void snd_mixer_class_free(snd_mixer_class_t* obj); void snd_mixer_class_copy( snd_mixer_class_t* dst, const snd_mixer_class_t* src ); snd_mixer_t* snd_mixer_class_get_mixer(const snd_mixer_class_t* class_); snd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t* class_); void* snd_mixer_class_get_private(const snd_mixer_class_t* class_); snd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t* class_); int snd_mixer_class_set_event( snd_mixer_class_t* class_, snd_mixer_event_t event ); int snd_mixer_class_set_private( snd_mixer_class_t* class_, void* private_data ); int snd_mixer_class_set_private_free( snd_mixer_class_t* class_, void(*)(snd_mixer_class_t*) private_free ); int snd_mixer_class_set_compare( snd_mixer_class_t* class_, snd_mixer_compare_t compare ); const char* snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel); int snd_mixer_selem_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp ); void snd_mixer_selem_get_id( snd_mixer_elem_t* element, snd_mixer_selem_id_t* id ); const char* snd_mixer_selem_get_name(snd_mixer_elem_t* elem); unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t* elem); snd_mixer_elem_t* snd_mixer_find_selem( snd_mixer_t* mixer, const snd_mixer_selem_id_t* id ); int snd_mixer_selem_is_active(snd_mixer_elem_t* elem); int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t* elem); int snd_mixer_selem_has_playback_channel( snd_mixer_elem_t* obj, snd_mixer_selem_channel_id_t channel ); int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_channel( snd_mixer_elem_t* obj, snd_mixer_selem_channel_id_t channel ); int snd_mixer_selem_get_capture_group(snd_mixer_elem_t* elem); int snd_mixer_selem_has_common_volume(snd_mixer_elem_t* elem); int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t* elem); int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t* elem); int snd_mixer_selem_has_common_switch(snd_mixer_elem_t* elem); int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t* elem); int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t* elem); int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t* elem); int snd_mixer_selem_ask_playback_vol_dB( snd_mixer_elem_t* elem, long value, long* dBvalue ); int snd_mixer_selem_ask_capture_vol_dB( snd_mixer_elem_t* elem, long value, long* dBvalue ); int snd_mixer_selem_ask_playback_dB_vol( snd_mixer_elem_t* elem, long dBvalue, int dir, long* value ); int snd_mixer_selem_ask_capture_dB_vol( snd_mixer_elem_t* elem, long dBvalue, int dir, long* value ); int snd_mixer_selem_get_playback_volume( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long* value ); int snd_mixer_selem_get_capture_volume( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long* value ); int snd_mixer_selem_get_playback_dB( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long* value ); int snd_mixer_selem_get_capture_dB( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long* value ); int snd_mixer_selem_get_playback_switch( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, int* value ); int snd_mixer_selem_get_capture_switch( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, int* value ); int snd_mixer_selem_set_playback_volume( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long value ); int snd_mixer_selem_set_capture_volume( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long value ); int snd_mixer_selem_set_playback_dB( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long value, int dir ); int snd_mixer_selem_set_capture_dB( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, long value, int dir ); int snd_mixer_selem_set_playback_volume_all( snd_mixer_elem_t* elem, long value ); int snd_mixer_selem_set_capture_volume_all( snd_mixer_elem_t* elem, long value ); int snd_mixer_selem_set_playback_dB_all( snd_mixer_elem_t* elem, long value, int dir ); int snd_mixer_selem_set_capture_dB_all( snd_mixer_elem_t* elem, long value, int dir ); int snd_mixer_selem_set_playback_switch( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, int value ); int snd_mixer_selem_set_capture_switch( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, int value ); int snd_mixer_selem_set_playback_switch_all( snd_mixer_elem_t* elem, int value ); int snd_mixer_selem_set_capture_switch_all( snd_mixer_elem_t* elem, int value ); int snd_mixer_selem_get_playback_volume_range( snd_mixer_elem_t* elem, long* min, long* max ); int snd_mixer_selem_get_playback_dB_range( snd_mixer_elem_t* elem, long* min, long* max ); int snd_mixer_selem_set_playback_volume_range( snd_mixer_elem_t* elem, long min, long max ); int snd_mixer_selem_get_capture_volume_range( snd_mixer_elem_t* elem, long* min, long* max ); int snd_mixer_selem_get_capture_dB_range( snd_mixer_elem_t* elem, long* min, long* max ); int snd_mixer_selem_set_capture_volume_range( snd_mixer_elem_t* elem, long min, long max ); int snd_mixer_selem_is_enumerated(snd_mixer_elem_t* elem); int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t* elem); int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t* elem); int snd_mixer_selem_get_enum_items(snd_mixer_elem_t* elem); int snd_mixer_selem_get_enum_item_name( snd_mixer_elem_t* elem, unsigned int idx, size_t maxlen, char* str ); int snd_mixer_selem_get_enum_item( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, unsigned int* idxp ); int snd_mixer_selem_set_enum_item( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, unsigned int idx ); size_t snd_mixer_selem_id_sizeof(void); int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t** ptr); void snd_mixer_selem_id_free(snd_mixer_selem_id_t* obj); void snd_mixer_selem_id_copy( snd_mixer_selem_id_t* dst, const snd_mixer_selem_id_t* src ); const char* snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t* obj); unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t* obj); void snd_mixer_selem_id_set_name( snd_mixer_selem_id_t* obj, const char* val ); void snd_mixer_selem_id_set_index( snd_mixer_selem_id_t* obj, unsigned int val ); int snd_output_stdio_open( snd_output_t** outputp, const char* file, const char* mode ); int snd_output_stdio_attach( snd_output_t** outputp, FILE* fp, int _close ); int snd_output_buffer_open(snd_output_t** outputp); size_t snd_output_buffer_string( snd_output_t* output, char** buf ); int snd_output_close(snd_output_t* output); int snd_output_printf( snd_output_t* output, const char* format, ... ); int snd_output_vprintf( snd_output_t* output, const char* format, va_list args ); int snd_output_puts( snd_output_t* output, const char* str ); int snd_output_putc( snd_output_t* output, int c ); int snd_output_flush(snd_output_t* output); int snd_pcm_open( snd_pcm_t** pcm, const char* name, snd_pcm_stream_t stream, int mode ); int snd_pcm_open_lconf( snd_pcm_t** pcm, const char* name, snd_pcm_stream_t stream, int mode, snd_config_t* lconf ); int snd_pcm_open_fallback( snd_pcm_t** pcm, snd_config_t* root, const char* name, const char* orig_name, snd_pcm_stream_t stream, int mode ); int snd_pcm_close(snd_pcm_t* pcm); const char* snd_pcm_name(snd_pcm_t* pcm); snd_pcm_type_t snd_pcm_type(snd_pcm_t* pcm); snd_pcm_stream_t snd_pcm_stream(snd_pcm_t* pcm); int snd_pcm_poll_descriptors_count(snd_pcm_t* pcm); int snd_pcm_poll_descriptors( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int space ); int snd_pcm_poll_descriptors_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_pcm_nonblock( snd_pcm_t* pcm, int nonblock ); static __inline__ int snd_pcm_abort(snd_pcm_t* pcm); int snd_async_add_pcm_handler( snd_async_handler_t** handler, snd_pcm_t* pcm, snd_async_callback_t callback, void* private_data ); snd_pcm_t* snd_async_handler_get_pcm(snd_async_handler_t* handler); int snd_pcm_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); int snd_pcm_hw_params_current( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); int snd_pcm_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); int snd_pcm_hw_free(snd_pcm_t* pcm); int snd_pcm_sw_params_current( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); int snd_pcm_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); int snd_pcm_prepare(snd_pcm_t* pcm); int snd_pcm_reset(snd_pcm_t* pcm); int snd_pcm_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); int snd_pcm_start(snd_pcm_t* pcm); int snd_pcm_drop(snd_pcm_t* pcm); int snd_pcm_drain(snd_pcm_t* pcm); int snd_pcm_pause( snd_pcm_t* pcm, int enable ); snd_pcm_state_t snd_pcm_state(snd_pcm_t* pcm); int snd_pcm_hwsync(snd_pcm_t* pcm); int snd_pcm_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); int snd_pcm_resume(snd_pcm_t* pcm); int snd_pcm_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t* pcm); snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t* pcm); int snd_pcm_avail_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* availp, snd_pcm_sframes_t* delayp ); snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t* pcm); snd_pcm_sframes_t snd_pcm_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t* pcm); snd_pcm_sframes_t snd_pcm_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); snd_pcm_sframes_t snd_pcm_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); int snd_pcm_wait( snd_pcm_t* pcm, int timeout ); int snd_pcm_link( snd_pcm_t* pcm1, snd_pcm_t* pcm2 ); int snd_pcm_unlink(snd_pcm_t* pcm); snd_pcm_chmap_query_t** snd_pcm_query_chmaps(snd_pcm_t* pcm); snd_pcm_chmap_query_t** snd_pcm_query_chmaps_from_hw( int card, int dev, int subdev, snd_pcm_stream_t stream ); void snd_pcm_free_chmaps(snd_pcm_chmap_query_t** maps); snd_pcm_chmap_t* snd_pcm_get_chmap(snd_pcm_t* pcm); int snd_pcm_set_chmap( snd_pcm_t* pcm, const snd_pcm_chmap_t* map ); const char* snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val); const char* snd_pcm_chmap_name(enum snd_pcm_chmap_position val); const char* snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val); int snd_pcm_chmap_print( const snd_pcm_chmap_t* map, size_t maxlen, char* buf ); unsigned int snd_pcm_chmap_from_string(const char* str); snd_pcm_chmap_t* snd_pcm_chmap_parse_string(const char* str); int snd_pcm_recover( snd_pcm_t* pcm, int err, int silent ); int snd_pcm_set_params( snd_pcm_t* pcm, snd_pcm_format_t format, snd_pcm_access_t access, unsigned int channels, unsigned int rate, int soft_resample, unsigned int latency ); int snd_pcm_get_params( snd_pcm_t* pcm, snd_pcm_uframes_t* buffer_size, snd_pcm_uframes_t* period_size ); size_t snd_pcm_info_sizeof(void); int snd_pcm_info_malloc(snd_pcm_info_t** ptr); void snd_pcm_info_free(snd_pcm_info_t* obj); void snd_pcm_info_copy( snd_pcm_info_t* dst, const snd_pcm_info_t* src ); unsigned int snd_pcm_info_get_device(const snd_pcm_info_t* obj); unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t* obj); snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t* obj); int snd_pcm_info_get_card(const snd_pcm_info_t* obj); const char* snd_pcm_info_get_id(const snd_pcm_info_t* obj); const char* snd_pcm_info_get_name(const snd_pcm_info_t* obj); const char* snd_pcm_info_get_subdevice_name(const snd_pcm_info_t* obj); snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t* obj); snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t* obj); unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t* obj); unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t* obj); snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t* obj); void snd_pcm_info_set_device( snd_pcm_info_t* obj, unsigned int val ); void snd_pcm_info_set_subdevice( snd_pcm_info_t* obj, unsigned int val ); void snd_pcm_info_set_stream( snd_pcm_info_t* obj, snd_pcm_stream_t val ); int snd_pcm_hw_params_any( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_supports_audio_ts_type( const snd_pcm_hw_params_t* params, int type ); int snd_pcm_hw_params_get_rate_numden( const snd_pcm_hw_params_t* params, unsigned int* rate_num, unsigned int* rate_den ); int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t* params); int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t* params); size_t snd_pcm_hw_params_sizeof(void); int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t** ptr); void snd_pcm_hw_params_free(snd_pcm_hw_params_t* obj); void snd_pcm_hw_params_copy( snd_pcm_hw_params_t* dst, const snd_pcm_hw_params_t* src ); int snd_pcm_hw_params_get_access( const snd_pcm_hw_params_t* params, snd_pcm_access_t* _access ); int snd_pcm_hw_params_test_access( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_access_t _access ); int snd_pcm_hw_params_set_access( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_access_t _access ); int snd_pcm_hw_params_set_access_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_access_t* _access ); int snd_pcm_hw_params_set_access_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_access_t* _access ); int snd_pcm_hw_params_set_access_mask( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_access_mask_t* mask ); int snd_pcm_hw_params_get_access_mask( snd_pcm_hw_params_t* params, snd_pcm_access_mask_t* mask ); int snd_pcm_hw_params_get_format( const snd_pcm_hw_params_t* params, snd_pcm_format_t* val ); int snd_pcm_hw_params_test_format( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_format_t val ); int snd_pcm_hw_params_set_format( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_format_t val ); int snd_pcm_hw_params_set_format_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_format_t* format ); int snd_pcm_hw_params_set_format_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_format_t* format ); int snd_pcm_hw_params_set_format_mask( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_format_mask_t* mask ); void snd_pcm_hw_params_get_format_mask( snd_pcm_hw_params_t* params, snd_pcm_format_mask_t* mask ); int snd_pcm_hw_params_get_subformat( const snd_pcm_hw_params_t* params, snd_pcm_subformat_t* subformat ); int snd_pcm_hw_params_test_subformat( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_subformat_t subformat ); int snd_pcm_hw_params_set_subformat( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_subformat_t subformat ); int snd_pcm_hw_params_set_subformat_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_subformat_t* subformat ); int snd_pcm_hw_params_set_subformat_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_subformat_t* subformat ); int snd_pcm_hw_params_set_subformat_mask( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_subformat_mask_t* mask ); void snd_pcm_hw_params_get_subformat_mask( snd_pcm_hw_params_t* params, snd_pcm_subformat_mask_t* mask ); int snd_pcm_hw_params_get_channels( const snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_get_channels_min( const snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_get_channels_max( const snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_test_channels( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val ); int snd_pcm_hw_params_set_channels( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val ); int snd_pcm_hw_params_set_channels_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_channels_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_channels_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, unsigned int* max ); int snd_pcm_hw_params_set_channels_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_channels_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_channels_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_get_rate( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_rate_min( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_rate_max( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_test_rate( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_rate( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_rate_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_rate_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_rate_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, int* mindir, unsigned int* max, int* maxdir ); int snd_pcm_hw_params_set_rate_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_rate_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_rate_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_rate_resample( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val ); int snd_pcm_hw_params_get_rate_resample( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_export_buffer( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val ); int snd_pcm_hw_params_get_export_buffer( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_set_period_wakeup( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val ); int snd_pcm_hw_params_get_period_wakeup( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_get_period_time( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_period_time_min( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_period_time_max( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_test_period_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_period_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_period_time_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_period_time_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_period_time_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, int* mindir, unsigned int* max, int* maxdir ); int snd_pcm_hw_params_set_period_time_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_period_time_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_period_time_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_period_size( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* frames, int* dir ); int snd_pcm_hw_params_get_period_size_min( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* frames, int* dir ); int snd_pcm_hw_params_get_period_size_max( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* frames, int* dir ); int snd_pcm_hw_params_test_period_size( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t val, int dir ); int snd_pcm_hw_params_set_period_size( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t val, int dir ); int snd_pcm_hw_params_set_period_size_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val, int* dir ); int snd_pcm_hw_params_set_period_size_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val, int* dir ); int snd_pcm_hw_params_set_period_size_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* min, int* mindir, snd_pcm_uframes_t* max, int* maxdir ); int snd_pcm_hw_params_set_period_size_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val, int* dir ); int snd_pcm_hw_params_set_period_size_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val, int* dir ); int snd_pcm_hw_params_set_period_size_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val, int* dir ); int snd_pcm_hw_params_set_period_size_integer( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); int snd_pcm_hw_params_get_periods( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_periods_min( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_periods_max( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_test_periods( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_periods( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_periods_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_periods_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_periods_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, int* mindir, unsigned int* max, int* maxdir ); int snd_pcm_hw_params_set_periods_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_periods_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_periods_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_periods_integer( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); int snd_pcm_hw_params_get_buffer_time( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_buffer_time_min( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_buffer_time_max( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_test_buffer_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_buffer_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_buffer_time_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_buffer_time_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_buffer_time_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, int* mindir, unsigned int* max, int* maxdir ); int snd_pcm_hw_params_set_buffer_time_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_buffer_time_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_buffer_time_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_buffer_size( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_get_buffer_size_min( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_get_buffer_size_max( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_test_buffer_size( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_hw_params_set_buffer_size( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_hw_params_set_buffer_size_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_set_buffer_size_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_set_buffer_size_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* min, snd_pcm_uframes_t* max ); int snd_pcm_hw_params_set_buffer_size_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_set_buffer_size_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_set_buffer_size_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_hw_params_get_min_align( const snd_pcm_hw_params_t* params, snd_pcm_uframes_t* val ); size_t snd_pcm_sw_params_sizeof(void); int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t** ptr); void snd_pcm_sw_params_free(snd_pcm_sw_params_t* obj); void snd_pcm_sw_params_copy( snd_pcm_sw_params_t* dst, const snd_pcm_sw_params_t* src ); int snd_pcm_sw_params_get_boundary( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_tstamp_mode( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_tstamp_t val ); int snd_pcm_sw_params_get_tstamp_mode( const snd_pcm_sw_params_t* params, snd_pcm_tstamp_t* val ); int snd_pcm_sw_params_set_tstamp_type( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_tstamp_type_t val ); int snd_pcm_sw_params_get_tstamp_type( const snd_pcm_sw_params_t* params, snd_pcm_tstamp_type_t* val ); int snd_pcm_sw_params_set_avail_min( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_avail_min( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_period_event( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, int val ); int snd_pcm_sw_params_get_period_event( const snd_pcm_sw_params_t* params, int* val ); int snd_pcm_sw_params_set_start_threshold( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_start_threshold( const snd_pcm_sw_params_t* paramsm, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_stop_threshold( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_stop_threshold( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_silence_threshold( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_silence_threshold( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_silence_size( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_silence_size( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); size_t snd_pcm_access_mask_sizeof(void); int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t** ptr); void snd_pcm_access_mask_free(snd_pcm_access_mask_t* obj); void snd_pcm_access_mask_copy( snd_pcm_access_mask_t* dst, const snd_pcm_access_mask_t* src ); void snd_pcm_access_mask_none(snd_pcm_access_mask_t* mask); void snd_pcm_access_mask_any(snd_pcm_access_mask_t* mask); int snd_pcm_access_mask_test( const snd_pcm_access_mask_t* mask, snd_pcm_access_t val ); int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t* mask); void snd_pcm_access_mask_set( snd_pcm_access_mask_t* mask, snd_pcm_access_t val ); void snd_pcm_access_mask_reset( snd_pcm_access_mask_t* mask, snd_pcm_access_t val ); size_t snd_pcm_format_mask_sizeof(void); int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t** ptr); void snd_pcm_format_mask_free(snd_pcm_format_mask_t* obj); void snd_pcm_format_mask_copy( snd_pcm_format_mask_t* dst, const snd_pcm_format_mask_t* src ); void snd_pcm_format_mask_none(snd_pcm_format_mask_t* mask); void snd_pcm_format_mask_any(snd_pcm_format_mask_t* mask); int snd_pcm_format_mask_test( const snd_pcm_format_mask_t* mask, snd_pcm_format_t val ); int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t* mask); void snd_pcm_format_mask_set( snd_pcm_format_mask_t* mask, snd_pcm_format_t val ); void snd_pcm_format_mask_reset( snd_pcm_format_mask_t* mask, snd_pcm_format_t val ); size_t snd_pcm_subformat_mask_sizeof(void); int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t** ptr); void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t* obj); void snd_pcm_subformat_mask_copy( snd_pcm_subformat_mask_t* dst, const snd_pcm_subformat_mask_t* src ); void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t* mask); void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t* mask); int snd_pcm_subformat_mask_test( const snd_pcm_subformat_mask_t* mask, snd_pcm_subformat_t val ); int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t* mask); void snd_pcm_subformat_mask_set( snd_pcm_subformat_mask_t* mask, snd_pcm_subformat_t val ); void snd_pcm_subformat_mask_reset( snd_pcm_subformat_mask_t* mask, snd_pcm_subformat_t val ); size_t snd_pcm_status_sizeof(void); int snd_pcm_status_malloc(snd_pcm_status_t** ptr); void snd_pcm_status_free(snd_pcm_status_t* obj); void snd_pcm_status_copy( snd_pcm_status_t* dst, const snd_pcm_status_t* src ); snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t* obj); void snd_pcm_status_get_trigger_tstamp( const snd_pcm_status_t* obj, snd_timestamp_t* ptr ); void snd_pcm_status_get_trigger_htstamp( const snd_pcm_status_t* obj, snd_htimestamp_t* ptr ); void snd_pcm_status_get_tstamp( const snd_pcm_status_t* obj, snd_timestamp_t* ptr ); void snd_pcm_status_get_htstamp( const snd_pcm_status_t* obj, snd_htimestamp_t* ptr ); void snd_pcm_status_get_audio_htstamp( const snd_pcm_status_t* obj, snd_htimestamp_t* ptr ); void snd_pcm_status_get_driver_htstamp( const snd_pcm_status_t* obj, snd_htimestamp_t* ptr ); void snd_pcm_status_get_audio_htstamp_report( const snd_pcm_status_t* obj, snd_pcm_audio_tstamp_report_t* audio_tstamp_report ); void snd_pcm_status_set_audio_htstamp_config( snd_pcm_status_t* obj, snd_pcm_audio_tstamp_config_t* audio_tstamp_config ); static void snd_pcm_pack_audio_tstamp_config( unsigned int* data, snd_pcm_audio_tstamp_config_t* config ); static void snd_pcm_unpack_audio_tstamp_report( unsigned int data, unsigned int accuracy, snd_pcm_audio_tstamp_report_t* report ); snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t* obj); snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t* obj); snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t* obj); snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t* obj); const char* snd_pcm_type_name(snd_pcm_type_t type); const char* snd_pcm_stream_name(const snd_pcm_stream_t stream); const char* snd_pcm_access_name(const snd_pcm_access_t _access); const char* snd_pcm_format_name(const snd_pcm_format_t format); const char* snd_pcm_format_description(const snd_pcm_format_t format); const char* snd_pcm_subformat_name(const snd_pcm_subformat_t subformat); const char* snd_pcm_subformat_description(const snd_pcm_subformat_t subformat); snd_pcm_format_t snd_pcm_format_value(const char* name); const char* snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode); const char* snd_pcm_state_name(const snd_pcm_state_t state); int snd_pcm_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dump_hw_setup( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dump_sw_setup( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dump_setup( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_hw_params_dump( snd_pcm_hw_params_t* params, snd_output_t* out ); int snd_pcm_sw_params_dump( snd_pcm_sw_params_t* params, snd_output_t* out ); int snd_pcm_status_dump( snd_pcm_status_t* status, snd_output_t* out ); int snd_pcm_mmap_begin( snd_pcm_t* pcm, const snd_pcm_channel_area_t** areas, snd_pcm_uframes_t* offset, snd_pcm_uframes_t* frames ); snd_pcm_sframes_t snd_pcm_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames ); snd_pcm_sframes_t snd_pcm_mmap_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_mmap_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_mmap_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_mmap_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); int snd_pcm_format_signed(snd_pcm_format_t format); int snd_pcm_format_unsigned(snd_pcm_format_t format); int snd_pcm_format_linear(snd_pcm_format_t format); int snd_pcm_format_float(snd_pcm_format_t format); int snd_pcm_format_little_endian(snd_pcm_format_t format); int snd_pcm_format_big_endian(snd_pcm_format_t format); int snd_pcm_format_cpu_endian(snd_pcm_format_t format); int snd_pcm_format_width(snd_pcm_format_t format); int snd_pcm_format_physical_width(snd_pcm_format_t format); snd_pcm_format_t snd_pcm_build_linear_format( int width, int pwidth, int unsignd, int big_endian ); ssize_t snd_pcm_format_size( snd_pcm_format_t format, size_t samples ); u_int8_t snd_pcm_format_silence(snd_pcm_format_t format); u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format); u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format); u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format); int snd_pcm_format_set_silence( snd_pcm_format_t format, void* buf, unsigned int samples ); snd_pcm_sframes_t snd_pcm_bytes_to_frames( snd_pcm_t* pcm, ssize_t bytes ); ssize_t snd_pcm_frames_to_bytes( snd_pcm_t* pcm, snd_pcm_sframes_t frames ); long snd_pcm_bytes_to_samples( snd_pcm_t* pcm, ssize_t bytes ); ssize_t snd_pcm_samples_to_bytes( snd_pcm_t* pcm, long samples ); int snd_pcm_area_silence( const snd_pcm_channel_area_t* dst_channel, snd_pcm_uframes_t dst_offset, unsigned int samples, snd_pcm_format_t format ); int snd_pcm_areas_silence( const snd_pcm_channel_area_t* dst_channels, snd_pcm_uframes_t dst_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format ); int snd_pcm_area_copy( const snd_pcm_channel_area_t* dst_channel, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_channel, snd_pcm_uframes_t src_offset, unsigned int samples, snd_pcm_format_t format ); int snd_pcm_areas_copy( const snd_pcm_channel_area_t* dst_channels, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_channels, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format ); snd_pcm_t* snd_pcm_hook_get_pcm(snd_pcm_hook_t* hook); void* snd_pcm_hook_get_private(snd_pcm_hook_t* hook); void snd_pcm_hook_set_private( snd_pcm_hook_t* hook, void* private_data ); int snd_pcm_hook_add( snd_pcm_hook_t** hookp, snd_pcm_t* pcm, snd_pcm_hook_type_t type, snd_pcm_hook_func_t func, void* private_data ); int snd_pcm_hook_remove(snd_pcm_hook_t* hook); snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t* pcm); unsigned int snd_pcm_meter_get_channels(snd_pcm_t* pcm); unsigned int snd_pcm_meter_get_rate(snd_pcm_t* pcm); snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t* pcm); snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t* pcm); int snd_pcm_meter_add_scope( snd_pcm_t* pcm, snd_pcm_scope_t* scope ); snd_pcm_scope_t* snd_pcm_meter_search_scope( snd_pcm_t* pcm, const char* name ); int snd_pcm_scope_malloc(snd_pcm_scope_t** ptr); void snd_pcm_scope_set_ops( snd_pcm_scope_t* scope, const snd_pcm_scope_ops_t* val ); void snd_pcm_scope_set_name( snd_pcm_scope_t* scope, const char* val ); const char* snd_pcm_scope_get_name(snd_pcm_scope_t* scope); void* snd_pcm_scope_get_callback_private(snd_pcm_scope_t* scope); void snd_pcm_scope_set_callback_private( snd_pcm_scope_t* scope, void* val ); int snd_pcm_scope_s16_open( snd_pcm_t* pcm, const char* name, snd_pcm_scope_t** scopep ); int16_t* snd_pcm_scope_s16_get_channel_buffer( snd_pcm_scope_t* scope, unsigned int channel ); int snd_spcm_init( snd_pcm_t* pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t _access, snd_spcm_xrun_type_t xrun_type ); int snd_spcm_init_duplex( snd_pcm_t* playback_pcm, snd_pcm_t* capture_pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t _access, snd_spcm_xrun_type_t xrun_type, snd_spcm_duplex_type_t duplex_type ); int snd_spcm_init_get_params( snd_pcm_t* pcm, unsigned int* rate, snd_pcm_uframes_t* buffer_size, snd_pcm_uframes_t* period_size ); const char* snd_pcm_start_mode_name(snd_pcm_start_t mode); const char* snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode); int snd_pcm_sw_params_set_start_mode( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_start_t val ); snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t* params); int snd_pcm_sw_params_set_xrun_mode( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_xrun_t val ); snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t* params); int snd_pcm_sw_params_set_xfer_align( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, snd_pcm_uframes_t val ); int snd_pcm_sw_params_get_xfer_align( const snd_pcm_sw_params_t* params, snd_pcm_uframes_t* val ); int snd_pcm_sw_params_set_sleep_min( snd_pcm_t* pcm, snd_pcm_sw_params_t* params, unsigned int val ); int snd_pcm_sw_params_get_sleep_min( const snd_pcm_sw_params_t* params, unsigned int* val ); int snd_pcm_hw_params_get_tick_time( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_tick_time_min( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_get_tick_time_max( const snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_test_tick_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_tick_time( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int val, int dir ); int snd_pcm_hw_params_set_tick_time_min( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_tick_time_max( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_tick_time_minmax( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* min, int* mindir, unsigned int* max, int* maxdir ); int snd_pcm_hw_params_set_tick_time_near( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_tick_time_first( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_hw_params_set_tick_time_last( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, unsigned int* val, int* dir ); int snd_pcm_parse_control_id( snd_config_t* conf, snd_ctl_elem_id_t* ctl_id, int* cardp, int* cchannelsp, int* hwctlp ); int snd_pcm_extplug_create( snd_pcm_extplug_t* ext, const char* name, snd_config_t* root, snd_config_t* slave_conf, snd_pcm_stream_t stream, int mode ); int snd_pcm_extplug_delete(snd_pcm_extplug_t* ext); void snd_pcm_extplug_params_reset(snd_pcm_extplug_t* ext); int snd_pcm_extplug_set_param_list( snd_pcm_extplug_t* extplug, int type, unsigned int num_list, const unsigned int* list ); int snd_pcm_extplug_set_param_minmax( snd_pcm_extplug_t* extplug, int type, unsigned int min, unsigned int max ); int snd_pcm_extplug_set_slave_param_list( snd_pcm_extplug_t* extplug, int type, unsigned int num_list, const unsigned int* list ); int snd_pcm_extplug_set_slave_param_minmax( snd_pcm_extplug_t* extplug, int type, unsigned int min, unsigned int max ); static __inline__ int snd_pcm_extplug_set_param( snd_pcm_extplug_t* extplug, int type, unsigned int val ); static __inline__ int snd_pcm_extplug_set_slave_param( snd_pcm_extplug_t* extplug, int type, unsigned int val ); int snd_pcm_ioplug_create( snd_pcm_ioplug_t* io, const char* name, snd_pcm_stream_t stream, int mode ); int snd_pcm_ioplug_delete(snd_pcm_ioplug_t* io); int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t* ioplug); const snd_pcm_channel_area_t* snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t* ioplug); void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t* io); int snd_pcm_ioplug_set_param_minmax( snd_pcm_ioplug_t* io, int type, unsigned int min, unsigned int max ); int snd_pcm_ioplug_set_param_list( snd_pcm_ioplug_t* io, int type, unsigned int num_list, const unsigned int* list ); int snd_pcm_ioplug_set_state( snd_pcm_ioplug_t* ioplug, snd_pcm_state_t state ); int snd_rawmidi_open( snd_rawmidi_t** in_rmidi, snd_rawmidi_t** out_rmidi, const char* name, int mode ); int snd_rawmidi_open_lconf( snd_rawmidi_t** in_rmidi, snd_rawmidi_t** out_rmidi, const char* name, int mode, snd_config_t* lconf ); int snd_rawmidi_close(snd_rawmidi_t* rmidi); int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t* rmidi); int snd_rawmidi_poll_descriptors( snd_rawmidi_t* rmidi, struct pollfd* pfds, unsigned int space ); int snd_rawmidi_poll_descriptors_revents( snd_rawmidi_t* rawmidi, struct pollfd* pfds, unsigned int nfds, unsigned short* revent ); int snd_rawmidi_nonblock( snd_rawmidi_t* rmidi, int nonblock ); size_t snd_rawmidi_info_sizeof(void); int snd_rawmidi_info_malloc(snd_rawmidi_info_t** ptr); void snd_rawmidi_info_free(snd_rawmidi_info_t* obj); void snd_rawmidi_info_copy( snd_rawmidi_info_t* dst, const snd_rawmidi_info_t* src ); unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t* obj); unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t* obj); snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t* obj); int snd_rawmidi_info_get_card(const snd_rawmidi_info_t* obj); unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t* obj); const char* snd_rawmidi_info_get_id(const snd_rawmidi_info_t* obj); const char* snd_rawmidi_info_get_name(const snd_rawmidi_info_t* obj); const char* snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t* obj); unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t* obj); unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t* obj); void snd_rawmidi_info_set_device( snd_rawmidi_info_t* obj, unsigned int val ); void snd_rawmidi_info_set_subdevice( snd_rawmidi_info_t* obj, unsigned int val ); void snd_rawmidi_info_set_stream( snd_rawmidi_info_t* obj, snd_rawmidi_stream_t val ); int snd_rawmidi_info( snd_rawmidi_t* rmidi, snd_rawmidi_info_t* info ); size_t snd_rawmidi_params_sizeof(void); int snd_rawmidi_params_malloc(snd_rawmidi_params_t** ptr); void snd_rawmidi_params_free(snd_rawmidi_params_t* obj); void snd_rawmidi_params_copy( snd_rawmidi_params_t* dst, const snd_rawmidi_params_t* src ); int snd_rawmidi_params_set_buffer_size( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params, size_t val ); size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t* params); int snd_rawmidi_params_set_avail_min( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params, size_t val ); size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t* params); int snd_rawmidi_params_set_no_active_sensing( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params, int val ); int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t* params); int snd_rawmidi_params( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params ); int snd_rawmidi_params_current( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params ); size_t snd_rawmidi_status_sizeof(void); int snd_rawmidi_status_malloc(snd_rawmidi_status_t** ptr); void snd_rawmidi_status_free(snd_rawmidi_status_t* obj); void snd_rawmidi_status_copy( snd_rawmidi_status_t* dst, const snd_rawmidi_status_t* src ); void snd_rawmidi_status_get_tstamp( const snd_rawmidi_status_t* obj, snd_htimestamp_t* ptr ); size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t* obj); size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t* obj); int snd_rawmidi_status( snd_rawmidi_t* rmidi, snd_rawmidi_status_t* status ); int snd_rawmidi_drain(snd_rawmidi_t* rmidi); int snd_rawmidi_drop(snd_rawmidi_t* rmidi); ssize_t snd_rawmidi_write( snd_rawmidi_t* rmidi, const void* buffer, size_t size ); ssize_t snd_rawmidi_read( snd_rawmidi_t* rmidi, void* buffer, size_t size ); const char* snd_rawmidi_name(snd_rawmidi_t* rmidi); snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t* rmidi); snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t* rawmidi); int snd_seq_open( snd_seq_t** handle, const char* name, int streams, int mode ); int snd_seq_open_lconf( snd_seq_t** handle, const char* name, int streams, int mode, snd_config_t* lconf ); const char* snd_seq_name(snd_seq_t* seq); snd_seq_type_t snd_seq_type(snd_seq_t* seq); int snd_seq_close(snd_seq_t* handle); int snd_seq_poll_descriptors_count( snd_seq_t* handle, short events ); int snd_seq_poll_descriptors( snd_seq_t* handle, struct pollfd* pfds, unsigned int space, short events ); int snd_seq_poll_descriptors_revents( snd_seq_t* seq, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_seq_nonblock( snd_seq_t* handle, int nonblock ); int snd_seq_client_id(snd_seq_t* handle); size_t snd_seq_get_output_buffer_size(snd_seq_t* handle); size_t snd_seq_get_input_buffer_size(snd_seq_t* handle); int snd_seq_set_output_buffer_size( snd_seq_t* handle, size_t size ); int snd_seq_set_input_buffer_size( snd_seq_t* handle, size_t size ); size_t snd_seq_system_info_sizeof(void); int snd_seq_system_info_malloc(snd_seq_system_info_t** ptr); void snd_seq_system_info_free(snd_seq_system_info_t* ptr); void snd_seq_system_info_copy( snd_seq_system_info_t* dst, const snd_seq_system_info_t* src ); int snd_seq_system_info_get_queues(const snd_seq_system_info_t* info); int snd_seq_system_info_get_clients(const snd_seq_system_info_t* info); int snd_seq_system_info_get_ports(const snd_seq_system_info_t* info); int snd_seq_system_info_get_channels(const snd_seq_system_info_t* info); int snd_seq_system_info_get_cur_clients(const snd_seq_system_info_t* info); int snd_seq_system_info_get_cur_queues(const snd_seq_system_info_t* info); int snd_seq_system_info( snd_seq_t* handle, snd_seq_system_info_t* info ); size_t snd_seq_client_info_sizeof(void); int snd_seq_client_info_malloc(snd_seq_client_info_t** ptr); void snd_seq_client_info_free(snd_seq_client_info_t* ptr); void snd_seq_client_info_copy( snd_seq_client_info_t* dst, const snd_seq_client_info_t* src ); int snd_seq_client_info_get_client(const snd_seq_client_info_t* info); snd_seq_client_type_t snd_seq_client_info_get_type(const snd_seq_client_info_t* info); const char* snd_seq_client_info_get_name(snd_seq_client_info_t* info); int snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t* info); int snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t* info); int snd_seq_client_info_get_card(const snd_seq_client_info_t* info); int snd_seq_client_info_get_pid(const snd_seq_client_info_t* info); const unsigned char* snd_seq_client_info_get_event_filter(const snd_seq_client_info_t* info); int snd_seq_client_info_get_num_ports(const snd_seq_client_info_t* info); int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t* info); void snd_seq_client_info_set_client( snd_seq_client_info_t* info, int client ); void snd_seq_client_info_set_name( snd_seq_client_info_t* info, const char* name ); void snd_seq_client_info_set_broadcast_filter( snd_seq_client_info_t* info, int val ); void snd_seq_client_info_set_error_bounce( snd_seq_client_info_t* info, int val ); void snd_seq_client_info_set_event_filter( snd_seq_client_info_t* info, unsigned char* filter ); void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t* info); void snd_seq_client_info_event_filter_add( snd_seq_client_info_t* info, int event_type ); void snd_seq_client_info_event_filter_del( snd_seq_client_info_t* info, int event_type ); int snd_seq_client_info_event_filter_check( snd_seq_client_info_t* info, int event_type ); int snd_seq_get_client_info( snd_seq_t* handle, snd_seq_client_info_t* info ); int snd_seq_get_any_client_info( snd_seq_t* handle, int client, snd_seq_client_info_t* info ); int snd_seq_set_client_info( snd_seq_t* handle, snd_seq_client_info_t* info ); int snd_seq_query_next_client( snd_seq_t* handle, snd_seq_client_info_t* info ); size_t snd_seq_client_pool_sizeof(void); int snd_seq_client_pool_malloc(snd_seq_client_pool_t** ptr); void snd_seq_client_pool_free(snd_seq_client_pool_t* ptr); void snd_seq_client_pool_copy( snd_seq_client_pool_t* dst, const snd_seq_client_pool_t* src ); int snd_seq_client_pool_get_client(const snd_seq_client_pool_t* info); size_t snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t* info); size_t snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t* info); size_t snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t* info); size_t snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t* info); size_t snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t* info); void snd_seq_client_pool_set_output_pool( snd_seq_client_pool_t* info, size_t size ); void snd_seq_client_pool_set_input_pool( snd_seq_client_pool_t* info, size_t size ); void snd_seq_client_pool_set_output_room( snd_seq_client_pool_t* info, size_t size ); int snd_seq_get_client_pool( snd_seq_t* handle, snd_seq_client_pool_t* info ); int snd_seq_set_client_pool( snd_seq_t* handle, snd_seq_client_pool_t* info ); size_t snd_seq_port_info_sizeof(void); int snd_seq_port_info_malloc(snd_seq_port_info_t** ptr); void snd_seq_port_info_free(snd_seq_port_info_t* ptr); void snd_seq_port_info_copy( snd_seq_port_info_t* dst, const snd_seq_port_info_t* src ); int snd_seq_port_info_get_client(const snd_seq_port_info_t* info); int snd_seq_port_info_get_port(const snd_seq_port_info_t* info); const snd_seq_addr_t* snd_seq_port_info_get_addr(const snd_seq_port_info_t* info); const char* snd_seq_port_info_get_name(const snd_seq_port_info_t* info); unsigned int snd_seq_port_info_get_capability(const snd_seq_port_info_t* info); unsigned int snd_seq_port_info_get_type(const snd_seq_port_info_t* info); int snd_seq_port_info_get_midi_channels(const snd_seq_port_info_t* info); int snd_seq_port_info_get_midi_voices(const snd_seq_port_info_t* info); int snd_seq_port_info_get_synth_voices(const snd_seq_port_info_t* info); int snd_seq_port_info_get_read_use(const snd_seq_port_info_t* info); int snd_seq_port_info_get_write_use(const snd_seq_port_info_t* info); int snd_seq_port_info_get_port_specified(const snd_seq_port_info_t* info); int snd_seq_port_info_get_timestamping(const snd_seq_port_info_t* info); int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t* info); int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t* info); void snd_seq_port_info_set_client( snd_seq_port_info_t* info, int client ); void snd_seq_port_info_set_port( snd_seq_port_info_t* info, int port ); void snd_seq_port_info_set_addr( snd_seq_port_info_t* info, const snd_seq_addr_t* addr ); void snd_seq_port_info_set_name( snd_seq_port_info_t* info, const char* name ); void snd_seq_port_info_set_capability( snd_seq_port_info_t* info, unsigned int capability ); void snd_seq_port_info_set_type( snd_seq_port_info_t* info, unsigned int type ); void snd_seq_port_info_set_midi_channels( snd_seq_port_info_t* info, int channels ); void snd_seq_port_info_set_midi_voices( snd_seq_port_info_t* info, int voices ); void snd_seq_port_info_set_synth_voices( snd_seq_port_info_t* info, int voices ); void snd_seq_port_info_set_port_specified( snd_seq_port_info_t* info, int val ); void snd_seq_port_info_set_timestamping( snd_seq_port_info_t* info, int enable ); void snd_seq_port_info_set_timestamp_real( snd_seq_port_info_t* info, int realtime ); void snd_seq_port_info_set_timestamp_queue( snd_seq_port_info_t* info, int queue ); int snd_seq_create_port( snd_seq_t* handle, snd_seq_port_info_t* info ); int snd_seq_delete_port( snd_seq_t* handle, int port ); int snd_seq_get_port_info( snd_seq_t* handle, int port, snd_seq_port_info_t* info ); int snd_seq_get_any_port_info( snd_seq_t* handle, int client, int port, snd_seq_port_info_t* info ); int snd_seq_set_port_info( snd_seq_t* handle, int port, snd_seq_port_info_t* info ); int snd_seq_query_next_port( snd_seq_t* handle, snd_seq_port_info_t* info ); size_t snd_seq_port_subscribe_sizeof(void); int snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t** ptr); void snd_seq_port_subscribe_free(snd_seq_port_subscribe_t* ptr); void snd_seq_port_subscribe_copy( snd_seq_port_subscribe_t* dst, const snd_seq_port_subscribe_t* src ); const snd_seq_addr_t* snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t* info); const snd_seq_addr_t* snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t* info); int snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t* info); int snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t* info); int snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t* info); int snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t* info); void snd_seq_port_subscribe_set_sender( snd_seq_port_subscribe_t* info, const snd_seq_addr_t* addr ); void snd_seq_port_subscribe_set_dest( snd_seq_port_subscribe_t* info, const snd_seq_addr_t* addr ); void snd_seq_port_subscribe_set_queue( snd_seq_port_subscribe_t* info, int q ); void snd_seq_port_subscribe_set_exclusive( snd_seq_port_subscribe_t* info, int val ); void snd_seq_port_subscribe_set_time_update( snd_seq_port_subscribe_t* info, int val ); void snd_seq_port_subscribe_set_time_real( snd_seq_port_subscribe_t* info, int val ); int snd_seq_get_port_subscription( snd_seq_t* handle, snd_seq_port_subscribe_t* sub ); int snd_seq_subscribe_port( snd_seq_t* handle, snd_seq_port_subscribe_t* sub ); int snd_seq_unsubscribe_port( snd_seq_t* handle, snd_seq_port_subscribe_t* sub ); size_t snd_seq_query_subscribe_sizeof(void); int snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t** ptr); void snd_seq_query_subscribe_free(snd_seq_query_subscribe_t* ptr); void snd_seq_query_subscribe_copy( snd_seq_query_subscribe_t* dst, const snd_seq_query_subscribe_t* src ); int snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t* info); const snd_seq_addr_t* snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t* info); snd_seq_query_subs_type_t snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t* info); const snd_seq_addr_t* snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t* info); int snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t* info); void snd_seq_query_subscribe_set_client( snd_seq_query_subscribe_t* info, int client ); void snd_seq_query_subscribe_set_port( snd_seq_query_subscribe_t* info, int port ); void snd_seq_query_subscribe_set_root( snd_seq_query_subscribe_t* info, const snd_seq_addr_t* addr ); void snd_seq_query_subscribe_set_type( snd_seq_query_subscribe_t* info, snd_seq_query_subs_type_t type ); void snd_seq_query_subscribe_set_index( snd_seq_query_subscribe_t* info, int _index ); int snd_seq_query_port_subscribers( snd_seq_t* seq, snd_seq_query_subscribe_t* subs ); size_t snd_seq_queue_info_sizeof(void); int snd_seq_queue_info_malloc(snd_seq_queue_info_t** ptr); void snd_seq_queue_info_free(snd_seq_queue_info_t* ptr); void snd_seq_queue_info_copy( snd_seq_queue_info_t* dst, const snd_seq_queue_info_t* src ); int snd_seq_queue_info_get_queue(const snd_seq_queue_info_t* info); const char* snd_seq_queue_info_get_name(const snd_seq_queue_info_t* info); int snd_seq_queue_info_get_owner(const snd_seq_queue_info_t* info); int snd_seq_queue_info_get_locked(const snd_seq_queue_info_t* info); unsigned int snd_seq_queue_info_get_flags(const snd_seq_queue_info_t* info); void snd_seq_queue_info_set_name( snd_seq_queue_info_t* info, const char* name ); void snd_seq_queue_info_set_owner( snd_seq_queue_info_t* info, int owner ); void snd_seq_queue_info_set_locked( snd_seq_queue_info_t* info, int locked ); void snd_seq_queue_info_set_flags( snd_seq_queue_info_t* info, unsigned int flags ); int snd_seq_create_queue( snd_seq_t* seq, snd_seq_queue_info_t* info ); int snd_seq_alloc_named_queue( snd_seq_t* seq, const char* name ); int snd_seq_alloc_queue(snd_seq_t* handle); int snd_seq_free_queue( snd_seq_t* handle, int q ); int snd_seq_get_queue_info( snd_seq_t* seq, int q, snd_seq_queue_info_t* info ); int snd_seq_set_queue_info( snd_seq_t* seq, int q, snd_seq_queue_info_t* info ); int snd_seq_query_named_queue( snd_seq_t* seq, const char* name ); int snd_seq_get_queue_usage( snd_seq_t* handle, int q ); int snd_seq_set_queue_usage( snd_seq_t* handle, int q, int used ); size_t snd_seq_queue_status_sizeof(void); int snd_seq_queue_status_malloc(snd_seq_queue_status_t** ptr); void snd_seq_queue_status_free(snd_seq_queue_status_t* ptr); void snd_seq_queue_status_copy( snd_seq_queue_status_t* dst, const snd_seq_queue_status_t* src ); int snd_seq_queue_status_get_queue(const snd_seq_queue_status_t* info); int snd_seq_queue_status_get_events(const snd_seq_queue_status_t* info); snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_status_t* info); const snd_seq_real_time_t* snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t* info); unsigned int snd_seq_queue_status_get_status(const snd_seq_queue_status_t* info); int snd_seq_get_queue_status( snd_seq_t* handle, int q, snd_seq_queue_status_t* status ); size_t snd_seq_queue_tempo_sizeof(void); int snd_seq_queue_tempo_malloc(snd_seq_queue_tempo_t** ptr); void snd_seq_queue_tempo_free(snd_seq_queue_tempo_t* ptr); void snd_seq_queue_tempo_copy( snd_seq_queue_tempo_t* dst, const snd_seq_queue_tempo_t* src ); int snd_seq_queue_tempo_get_queue(const snd_seq_queue_tempo_t* info); unsigned int snd_seq_queue_tempo_get_tempo(const snd_seq_queue_tempo_t* info); int snd_seq_queue_tempo_get_ppq(const snd_seq_queue_tempo_t* info); unsigned int snd_seq_queue_tempo_get_skew(const snd_seq_queue_tempo_t* info); unsigned int snd_seq_queue_tempo_get_skew_base(const snd_seq_queue_tempo_t* info); void snd_seq_queue_tempo_set_tempo( snd_seq_queue_tempo_t* info, unsigned int tempo ); void snd_seq_queue_tempo_set_ppq( snd_seq_queue_tempo_t* info, int ppq ); void snd_seq_queue_tempo_set_skew( snd_seq_queue_tempo_t* info, unsigned int skew ); void snd_seq_queue_tempo_set_skew_base( snd_seq_queue_tempo_t* info, unsigned int base ); int snd_seq_get_queue_tempo( snd_seq_t* handle, int q, snd_seq_queue_tempo_t* tempo ); int snd_seq_set_queue_tempo( snd_seq_t* handle, int q, snd_seq_queue_tempo_t* tempo ); size_t snd_seq_queue_timer_sizeof(void); int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t** ptr); void snd_seq_queue_timer_free(snd_seq_queue_timer_t* ptr); void snd_seq_queue_timer_copy( snd_seq_queue_timer_t* dst, const snd_seq_queue_timer_t* src ); int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t* info); snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t* info); const snd_timer_id_t* snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t* info); unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t* info); void snd_seq_queue_timer_set_type( snd_seq_queue_timer_t* info, snd_seq_queue_timer_type_t type ); void snd_seq_queue_timer_set_id( snd_seq_queue_timer_t* info, const snd_timer_id_t* id ); void snd_seq_queue_timer_set_resolution( snd_seq_queue_timer_t* info, unsigned int resolution ); int snd_seq_get_queue_timer( snd_seq_t* handle, int q, snd_seq_queue_timer_t* timer ); int snd_seq_set_queue_timer( snd_seq_t* handle, int q, snd_seq_queue_timer_t* timer ); int snd_seq_free_event(snd_seq_event_t* ev); ssize_t snd_seq_event_length(snd_seq_event_t* ev); int snd_seq_event_output( snd_seq_t* handle, snd_seq_event_t* ev ); int snd_seq_event_output_buffer( snd_seq_t* handle, snd_seq_event_t* ev ); int snd_seq_event_output_direct( snd_seq_t* handle, snd_seq_event_t* ev ); int snd_seq_event_input( snd_seq_t* handle, snd_seq_event_t** ev ); int snd_seq_event_input_pending( snd_seq_t* seq, int fetch_sequencer ); int snd_seq_drain_output(snd_seq_t* handle); int snd_seq_event_output_pending(snd_seq_t* seq); int snd_seq_extract_output( snd_seq_t* handle, snd_seq_event_t** ev ); int snd_seq_drop_output(snd_seq_t* handle); int snd_seq_drop_output_buffer(snd_seq_t* handle); int snd_seq_drop_input(snd_seq_t* handle); int snd_seq_drop_input_buffer(snd_seq_t* handle); size_t snd_seq_remove_events_sizeof(void); int snd_seq_remove_events_malloc(snd_seq_remove_events_t** ptr); void snd_seq_remove_events_free(snd_seq_remove_events_t* ptr); void snd_seq_remove_events_copy( snd_seq_remove_events_t* dst, const snd_seq_remove_events_t* src ); unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t* info); int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t* info); const snd_seq_timestamp_t* snd_seq_remove_events_get_time(const snd_seq_remove_events_t* info); const snd_seq_addr_t* snd_seq_remove_events_get_dest(const snd_seq_remove_events_t* info); int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t* info); int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t* info); int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t* info); void snd_seq_remove_events_set_condition( snd_seq_remove_events_t* info, unsigned int flags ); void snd_seq_remove_events_set_queue( snd_seq_remove_events_t* info, int queue ); void snd_seq_remove_events_set_time( snd_seq_remove_events_t* info, const snd_seq_timestamp_t* time ); void snd_seq_remove_events_set_dest( snd_seq_remove_events_t* info, const snd_seq_addr_t* addr ); void snd_seq_remove_events_set_channel( snd_seq_remove_events_t* info, int channel ); void snd_seq_remove_events_set_event_type( snd_seq_remove_events_t* info, int type ); void snd_seq_remove_events_set_tag( snd_seq_remove_events_t* info, int tag ); int snd_seq_remove_events( snd_seq_t* handle, snd_seq_remove_events_t* info ); void snd_seq_set_bit( int nr, void* array ); void snd_seq_unset_bit( int nr, void* array ); int snd_seq_change_bit( int nr, void* array ); int snd_seq_get_bit( int nr, void* array ); struct snd_seq_ev_ext __attribute__((packed)); int snd_midi_event_new( size_t bufsize, snd_midi_event_t** rdev ); int snd_midi_event_resize_buffer( snd_midi_event_t* dev, size_t bufsize ); void snd_midi_event_free(snd_midi_event_t* dev); void snd_midi_event_init(snd_midi_event_t* dev); void snd_midi_event_reset_encode(snd_midi_event_t* dev); void snd_midi_event_reset_decode(snd_midi_event_t* dev); void snd_midi_event_no_status( snd_midi_event_t* dev, int on ); long snd_midi_event_encode( snd_midi_event_t* dev, const unsigned char* buf, long count, snd_seq_event_t* ev ); int snd_midi_event_encode_byte( snd_midi_event_t* dev, int c, snd_seq_event_t* ev ); long snd_midi_event_decode( snd_midi_event_t* dev, unsigned char* buf, long count, const snd_seq_event_t* ev ); int snd_seq_control_queue( snd_seq_t* seq, int q, int type, int value, snd_seq_event_t* ev ); int snd_seq_create_simple_port( snd_seq_t* seq, const char* name, unsigned int caps, unsigned int type ); int snd_seq_delete_simple_port( snd_seq_t* seq, int port ); int snd_seq_connect_from( snd_seq_t* seq, int my_port, int src_client, int src_port ); int snd_seq_connect_to( snd_seq_t* seq, int my_port, int dest_client, int dest_port ); int snd_seq_disconnect_from( snd_seq_t* seq, int my_port, int src_client, int src_port ); int snd_seq_disconnect_to( snd_seq_t* seq, int my_port, int dest_client, int dest_port ); int snd_seq_set_client_name( snd_seq_t* seq, const char* name ); int snd_seq_set_client_event_filter( snd_seq_t* seq, int event_type ); int snd_seq_set_client_pool_output( snd_seq_t* seq, size_t size ); int snd_seq_set_client_pool_output_room( snd_seq_t* seq, size_t size ); int snd_seq_set_client_pool_input( snd_seq_t* seq, size_t size ); int snd_seq_sync_output_queue(snd_seq_t* seq); int snd_seq_parse_address( snd_seq_t* seq, snd_seq_addr_t* addr, const char* str ); int snd_seq_reset_pool_output(snd_seq_t* seq); int snd_seq_reset_pool_input(snd_seq_t* seq); int snd_timer_query_open( snd_timer_query_t** handle, const char* name, int mode ); int snd_timer_query_open_lconf( snd_timer_query_t** handle, const char* name, int mode, snd_config_t* lconf ); int snd_timer_query_close(snd_timer_query_t* handle); int snd_timer_query_next_device( snd_timer_query_t* handle, snd_timer_id_t* tid ); int snd_timer_query_info( snd_timer_query_t* handle, snd_timer_ginfo_t* info ); int snd_timer_query_params( snd_timer_query_t* handle, snd_timer_gparams_t* params ); int snd_timer_query_status( snd_timer_query_t* handle, snd_timer_gstatus_t* status ); int snd_timer_open( snd_timer_t** handle, const char* name, int mode ); int snd_timer_open_lconf( snd_timer_t** handle, const char* name, int mode, snd_config_t* lconf ); int snd_timer_close(snd_timer_t* handle); int snd_async_add_timer_handler( snd_async_handler_t** handler, snd_timer_t* timer, snd_async_callback_t callback, void* private_data ); snd_timer_t* snd_async_handler_get_timer(snd_async_handler_t* handler); int snd_timer_poll_descriptors_count(snd_timer_t* handle); int snd_timer_poll_descriptors( snd_timer_t* handle, struct pollfd* pfds, unsigned int space ); int snd_timer_poll_descriptors_revents( snd_timer_t* timer, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); int snd_timer_info( snd_timer_t* handle, snd_timer_info_t* timer ); int snd_timer_params( snd_timer_t* handle, snd_timer_params_t* params ); int snd_timer_status( snd_timer_t* handle, snd_timer_status_t* status ); int snd_timer_start(snd_timer_t* handle); int snd_timer_stop(snd_timer_t* handle); int snd_timer_continue(snd_timer_t* handle); ssize_t snd_timer_read( snd_timer_t* handle, void* buffer, size_t size ); size_t snd_timer_id_sizeof(void); int snd_timer_id_malloc(snd_timer_id_t** ptr); void snd_timer_id_free(snd_timer_id_t* obj); void snd_timer_id_copy( snd_timer_id_t* dst, const snd_timer_id_t* src ); void snd_timer_id_set_class( snd_timer_id_t* id, int dev_class ); int snd_timer_id_get_class(snd_timer_id_t* id); void snd_timer_id_set_sclass( snd_timer_id_t* id, int dev_sclass ); int snd_timer_id_get_sclass(snd_timer_id_t* id); void snd_timer_id_set_card( snd_timer_id_t* id, int card ); int snd_timer_id_get_card(snd_timer_id_t* id); void snd_timer_id_set_device( snd_timer_id_t* id, int device ); int snd_timer_id_get_device(snd_timer_id_t* id); void snd_timer_id_set_subdevice( snd_timer_id_t* id, int subdevice ); int snd_timer_id_get_subdevice(snd_timer_id_t* id); size_t snd_timer_ginfo_sizeof(void); int snd_timer_ginfo_malloc(snd_timer_ginfo_t** ptr); void snd_timer_ginfo_free(snd_timer_ginfo_t* obj); void snd_timer_ginfo_copy( snd_timer_ginfo_t* dst, const snd_timer_ginfo_t* src ); int snd_timer_ginfo_set_tid( snd_timer_ginfo_t* obj, snd_timer_id_t* tid ); snd_timer_id_t* snd_timer_ginfo_get_tid(snd_timer_ginfo_t* obj); unsigned int snd_timer_ginfo_get_flags(snd_timer_ginfo_t* obj); int snd_timer_ginfo_get_card(snd_timer_ginfo_t* obj); char* snd_timer_ginfo_get_id(snd_timer_ginfo_t* obj); char* snd_timer_ginfo_get_name(snd_timer_ginfo_t* obj); unsigned long snd_timer_ginfo_get_resolution(snd_timer_ginfo_t* obj); unsigned long snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t* obj); unsigned long snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t* obj); unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t* obj); size_t snd_timer_info_sizeof(void); int snd_timer_info_malloc(snd_timer_info_t** ptr); void snd_timer_info_free(snd_timer_info_t* obj); void snd_timer_info_copy( snd_timer_info_t* dst, const snd_timer_info_t* src ); int snd_timer_info_is_slave(snd_timer_info_t* info); int snd_timer_info_get_card(snd_timer_info_t* info); const char* snd_timer_info_get_id(snd_timer_info_t* info); const char* snd_timer_info_get_name(snd_timer_info_t* info); long snd_timer_info_get_resolution(snd_timer_info_t* info); size_t snd_timer_params_sizeof(void); int snd_timer_params_malloc(snd_timer_params_t** ptr); void snd_timer_params_free(snd_timer_params_t* obj); void snd_timer_params_copy( snd_timer_params_t* dst, const snd_timer_params_t* src ); int snd_timer_params_set_auto_start( snd_timer_params_t* params, int auto_start ); int snd_timer_params_get_auto_start(snd_timer_params_t* params); int snd_timer_params_set_exclusive( snd_timer_params_t* params, int exclusive ); int snd_timer_params_get_exclusive(snd_timer_params_t* params); int snd_timer_params_set_early_event( snd_timer_params_t* params, int early_event ); int snd_timer_params_get_early_event(snd_timer_params_t* params); void snd_timer_params_set_ticks( snd_timer_params_t* params, long ticks ); long snd_timer_params_get_ticks(snd_timer_params_t* params); void snd_timer_params_set_queue_size( snd_timer_params_t* params, long queue_size ); long snd_timer_params_get_queue_size(snd_timer_params_t* params); void snd_timer_params_set_filter( snd_timer_params_t* params, unsigned int filter ); unsigned int snd_timer_params_get_filter(snd_timer_params_t* params); size_t snd_timer_status_sizeof(void); int snd_timer_status_malloc(snd_timer_status_t** ptr); void snd_timer_status_free(snd_timer_status_t* obj); void snd_timer_status_copy( snd_timer_status_t* dst, const snd_timer_status_t* src ); snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t* status); long snd_timer_status_get_resolution(snd_timer_status_t* status); long snd_timer_status_get_lost(snd_timer_status_t* status); long snd_timer_status_get_overrun(snd_timer_status_t* status); long snd_timer_status_get_queue(snd_timer_status_t* status); long snd_timer_info_get_ticks(snd_timer_info_t* info); snd_tplg_t* snd_tplg_new(void); void snd_tplg_free(snd_tplg_t* tplg); int snd_tplg_build_file( snd_tplg_t* tplg, const char* infile, const char* outfile ); void snd_tplg_verbose( snd_tplg_t* tplg, int verbose ); int snd_tplg_add_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); int snd_tplg_build( snd_tplg_t* tplg, const char* outfile ); int snd_tplg_set_manifest_data( snd_tplg_t* tplg, const void* data, int len ); int snd_tplg_set_version( snd_tplg_t* tplg, unsigned int version ); char* snd_use_case_identifier( const char* fmt, ... ); int snd_use_case_free_list( const char* list[], int items ); int snd_use_case_get_list( snd_use_case_mgr_t* uc_mgr, const char* identifier, const char** list[] ); int snd_use_case_get( snd_use_case_mgr_t* uc_mgr, const char* identifier, const char** value ); int snd_use_case_geti( snd_use_case_mgr_t* uc_mgr, const char* identifier, long* value ); int snd_use_case_set( snd_use_case_mgr_t* uc_mgr, const char* identifier, const char* value ); int snd_use_case_mgr_open( snd_use_case_mgr_t** uc_mgr, const char* card_name ); int snd_use_case_mgr_reload(snd_use_case_mgr_t* uc_mgr); int snd_use_case_mgr_close(snd_use_case_mgr_t* uc_mgr); int snd_use_case_mgr_reset(snd_use_case_mgr_t* uc_mgr); static __inline__ int snd_use_case_card_list(const char** list[]); static __inline__ int snd_use_case_verb_list( snd_use_case_mgr_t* uc_mgr, const char** list[] ); static static LIST_HEAD(snd_async_handlers); static void snd_async_handler( int signo, siginfo_t* siginfo, void* context ); int snd_config_substitute( snd_config_t* dst, snd_config_t* src ); int snd_config_get_type_ascii( const char* ascii, snd_config_type_t* type ); static int snd_config_load1( snd_config_t* config, snd_input_t* in, int override ); int snd_config_remove(snd_config_t* config); int snd_config_imake_safe_string( snd_config_t** config, const char* id, const char* value ); int snd_config_searcha( snd_config_t* root, snd_config_t* config, const char* key, snd_config_t** result ); int snd_config_searchva( snd_config_t* root, snd_config_t* config, snd_config_t** result, ... ); int snd_config_search_alias( snd_config_t* config, const char* base, const char* key, snd_config_t** result ); static int snd_config_hooks( snd_config_t* config, snd_config_t* private_data ); int snd_config_search_hooks( snd_config_t* config, const char* key, snd_config_t** result ); int snd_config_searcha_hooks( snd_config_t* root, snd_config_t* config, const char* key, snd_config_t** result ); int snd_config_searchva_hooks( snd_config_t* root, snd_config_t* config, snd_config_t** result, ... ); int snd_config_search_alias_hooks( snd_config_t* config, const char* base, const char* key, snd_config_t** result ); static int snd_config_hooks_call( snd_config_t* root, snd_config_t* config, snd_config_t* private_data ); static int config_filename_filter(const struct dirent* dirent); static int config_file_open( snd_config_t* root, const char* filename ); int snd_config_hook_load( snd_config_t* root, snd_config_t* config, snd_config_t** dst, snd_config_t* private_data ); int snd_config_hook_load_for_all_cards( snd_config_t* root, snd_config_t* config, snd_config_t** dst, snd_config_t* private_data ); static int snd_config_walk( snd_config_t* src, snd_config_t* root, snd_config_t** dst, snd_config_walk_callback_t callback, snd_config_t* private_data ); static int _snd_config_copy( snd_config_t* src, snd_config_t* root, snd_config_t** dst, snd_config_walk_pass_t pass, snd_config_t* private_data ); static int _snd_config_expand( snd_config_t* src, snd_config_t* root, snd_config_t** dst, snd_config_walk_pass_t pass, snd_config_t* private_data ); static int _snd_config_evaluate( snd_config_t* src, snd_config_t* root, snd_config_t** dst, snd_config_walk_pass_t pass, snd_config_t* private_data ); static int load_defaults( snd_config_t* subs, snd_config_t* defs ); static void skip_blank(const char** ptr); static int parse_char(const char** ptr); static int parse_id(const char** ptr); static int parse_string( const char** ptr, char** val ); static int parse_arg( const char** ptr, unsigned int* varlen, char** val ); static int parse_args( snd_config_t* subs, const char* str, snd_config_t* defs ); size_t page_size(void); size_t page_align(size_t size); size_t page_ptr( size_t object_offset, size_t object_size, size_t* offset, size_t* mmap_offset ); int snd_func_getenv( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_igetenv( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_concat( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); static int snd_func_iops( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data, int op ); int snd_func_iadd( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_imul( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_datadir( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); static int open_ctl( long card, snd_ctl_t** ctl ); int snd_func_private_string( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_private_card_driver( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); static int parse_card( snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_card_inum( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_card_driver( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_card_id( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_card_name( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); int snd_func_refer( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data ); static int snd_card_load2(const char* control); static int snd_card_load1(int card); static bool validate_element_member_dimension(snd_ctl_elem_info_t* info); static int snd_ctl_tlv_do( snd_ctl_t* ctl, int op_flag, const snd_ctl_elem_id_t* id, unsigned int* tlv, unsigned int tlv_size ); int snd_ctl_hwdep_next_device( snd_ctl_t* ctl, int* device ); int snd_ctl_hwdep_info( snd_ctl_t* ctl, snd_hwdep_info_t* info ); int snd_ctl_pcm_next_device( snd_ctl_t* ctl, int* device ); int snd_ctl_pcm_info( snd_ctl_t* ctl, snd_pcm_info_t* info ); int snd_ctl_pcm_prefer_subdevice( snd_ctl_t* ctl, int subdev ); int snd_ctl_rawmidi_next_device( snd_ctl_t* ctl, int* device ); int snd_ctl_rawmidi_info( snd_ctl_t* ctl, snd_rawmidi_info_t* info ); int snd_ctl_rawmidi_prefer_subdevice( snd_ctl_t* ctl, int subdev ); static int snd_ctl_open_conf( snd_ctl_t** ctlp, const char* name, snd_config_t* ctl_root, snd_config_t* ctl_conf, int mode ); static int snd_ctl_open_noupdate( snd_ctl_t** ctlp, snd_config_t* root, const char* name, int mode ); int snd_ctl_elem_info_is_indirect(const snd_ctl_elem_info_t* obj); static int snd_ctl_ext_close(snd_ctl_t* handle); static int snd_ctl_ext_nonblock( snd_ctl_t* handle, int nonblock ); static int snd_ctl_ext_async( snd_ctl_t* ctl, int sig, pid_t pid ); static int snd_ctl_ext_subscribe_events( snd_ctl_t* handle, int subscribe ); static int snd_ctl_ext_card_info( snd_ctl_t* handle, snd_ctl_card_info_t* info ); static int snd_ctl_ext_elem_list( snd_ctl_t* handle, snd_ctl_elem_list_t* list ); static snd_ctl_ext_key_t get_elem( snd_ctl_ext_t* ext, snd_ctl_elem_id_t* id ); static int snd_ctl_ext_elem_info( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_ext_elem_add( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_ext_elem_replace( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_ext_elem_remove( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_ext_elem_read( snd_ctl_t* handle, snd_ctl_elem_value_t* control ); static int snd_ctl_ext_elem_write( snd_ctl_t* handle, snd_ctl_elem_value_t* control ); static int snd_ctl_ext_elem_lock( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_ext_elem_unlock( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_ext_elem_tlv( snd_ctl_t* handle, int op_flag, unsigned int numid, unsigned int* tlv, unsigned int tlv_size ); static int snd_ctl_ext_next_device( snd_ctl_t* handle, int* device ); static int snd_ctl_ext_prefer_subdevice( snd_ctl_t* handle, int subdev ); static int snd_ctl_ext_hwdep_info( snd_ctl_t* handle, snd_hwdep_info_t* info ); static int snd_ctl_ext_pcm_info( snd_ctl_t* handle, snd_pcm_info_t* info ); static int snd_ctl_ext_rawmidi_info( snd_ctl_t* handle, snd_rawmidi_info_t* info ); static int snd_ctl_ext_set_power_state( snd_ctl_t* handle, unsigned int state ); static int snd_ctl_ext_get_power_state( snd_ctl_t* handle, unsigned int* state ); static int snd_ctl_ext_read( snd_ctl_t* handle, snd_ctl_event_t* event ); static int snd_ctl_ext_poll_descriptors_count(snd_ctl_t* handle); static int snd_ctl_ext_poll_descriptors( snd_ctl_t* handle, struct pollfd* pfds, unsigned int space ); static int snd_ctl_ext_poll_revents( snd_ctl_t* handle, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); static int snd_ctl_hw_close(snd_ctl_t* handle); static int snd_ctl_hw_nonblock( snd_ctl_t* handle, int nonblock ); static int snd_ctl_hw_async( snd_ctl_t* ctl, int sig, pid_t pid ); static int snd_ctl_hw_subscribe_events( snd_ctl_t* handle, int subscribe ); static int snd_ctl_hw_card_info( snd_ctl_t* handle, snd_ctl_card_info_t* info ); static int snd_ctl_hw_elem_list( snd_ctl_t* handle, snd_ctl_elem_list_t* list ); static int snd_ctl_hw_elem_info( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_hw_elem_add( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_hw_elem_replace( snd_ctl_t* handle, snd_ctl_elem_info_t* info ); static int snd_ctl_hw_elem_remove( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_hw_elem_read( snd_ctl_t* handle, snd_ctl_elem_value_t* control ); static int snd_ctl_hw_elem_write( snd_ctl_t* handle, snd_ctl_elem_value_t* control ); static int snd_ctl_hw_elem_lock( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_hw_elem_unlock( snd_ctl_t* handle, snd_ctl_elem_id_t* id ); static int snd_ctl_hw_elem_tlv( snd_ctl_t* handle, int op_flag, unsigned int numid, unsigned int* tlv, unsigned int tlv_size ); static int snd_ctl_hw_hwdep_next_device( snd_ctl_t* handle, int* device ); static int snd_ctl_hw_hwdep_info( snd_ctl_t* handle, snd_hwdep_info_t* info ); static int snd_ctl_hw_pcm_next_device( snd_ctl_t* handle, int* device ); static int snd_ctl_hw_pcm_info( snd_ctl_t* handle, snd_pcm_info_t* info ); static int snd_ctl_hw_pcm_prefer_subdevice( snd_ctl_t* handle, int subdev ); static int snd_ctl_hw_rawmidi_next_device( snd_ctl_t* handle, int* device ); static int snd_ctl_hw_rawmidi_info( snd_ctl_t* handle, snd_rawmidi_info_t* info ); static int snd_ctl_hw_rawmidi_prefer_subdevice( snd_ctl_t* handle, int subdev ); static int snd_ctl_hw_set_power_state( snd_ctl_t* handle, unsigned int state ); static int snd_ctl_hw_get_power_state( snd_ctl_t* handle, unsigned int* state ); static int snd_ctl_hw_read( snd_ctl_t* handle, snd_ctl_event_t* event ); int snd_ctl_hw_open( snd_ctl_t** handle, const char* name, int card, int mode ); int _snd_ctl_hw_open( snd_ctl_t** handlep, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_ctl_hw_open, SND_CONTROL_DLSYM_VERSION ); static int snd_ctl_shm_action(snd_ctl_t* ctl); static int snd_ctl_shm_action_fd( snd_ctl_t* ctl, int* fd ); static int snd_ctl_shm_close(snd_ctl_t* ctl); static int snd_ctl_shm_nonblock( snd_ctl_t* handle, int nonblock ); static int snd_ctl_shm_async( snd_ctl_t* ctl, int sig, pid_t pid ); static int snd_ctl_shm_poll_descriptor(snd_ctl_t* ctl); static int snd_ctl_shm_subscribe_events( snd_ctl_t* ctl, int subscribe ); static int snd_ctl_shm_card_info( snd_ctl_t* ctl, snd_ctl_card_info_t* info ); static int snd_ctl_shm_elem_list( snd_ctl_t* ctl, snd_ctl_elem_list_t* list ); static int snd_ctl_shm_elem_info( snd_ctl_t* ctl, snd_ctl_elem_info_t* info ); static int snd_ctl_shm_elem_read( snd_ctl_t* ctl, snd_ctl_elem_value_t* control ); static int snd_ctl_shm_elem_write( snd_ctl_t* ctl, snd_ctl_elem_value_t* control ); static int snd_ctl_shm_elem_lock( snd_ctl_t* ctl, snd_ctl_elem_id_t* id ); static int snd_ctl_shm_elem_unlock( snd_ctl_t* ctl, snd_ctl_elem_id_t* id ); static int snd_ctl_shm_hwdep_next_device( snd_ctl_t* ctl, int* device ); static int snd_ctl_shm_hwdep_info( snd_ctl_t* ctl, snd_hwdep_info_t* info ); static int snd_ctl_shm_pcm_next_device( snd_ctl_t* ctl, int* device ); static int snd_ctl_shm_pcm_info( snd_ctl_t* ctl, snd_pcm_info_t* info ); static int snd_ctl_shm_pcm_prefer_subdevice( snd_ctl_t* ctl, int subdev ); static int snd_ctl_shm_rawmidi_next_device( snd_ctl_t* ctl, int* device ); static int snd_ctl_shm_rawmidi_info( snd_ctl_t* ctl, snd_rawmidi_info_t* info ); static int snd_ctl_shm_rawmidi_prefer_subdevice( snd_ctl_t* ctl, int subdev ); static int snd_ctl_shm_set_power_state( snd_ctl_t* ctl, unsigned int state ); static int snd_ctl_shm_get_power_state( snd_ctl_t* ctl, unsigned int* state ); static int snd_ctl_shm_read( snd_ctl_t* ctl, snd_ctl_event_t* event ); static int make_local_socket(const char* filename); int snd_ctl_shm_open( snd_ctl_t** handlep, const char* name, const char* sockname, const char* sname, int mode ); int _snd_ctl_shm_open( snd_ctl_t** handlep, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_ctl_shm_open, SND_CONTROL_DLSYM_VERSION ); static long get_integer( const char** ptr, long min, long max ); static long long get_integer64( const char** ptr, long long min, long long max ); static int get_ctl_enum_item_index( snd_ctl_t* handle, snd_ctl_elem_info_t* info, const char** ptrp ); static int snd_hctl_compare_default( const snd_hctl_elem_t* c1, const snd_hctl_elem_t* c2 ); int snd_hctl_async( snd_hctl_t* hctl, int sig, pid_t pid ); static int snd_hctl_throw_event( snd_hctl_t* hctl, unsigned int mask, snd_hctl_elem_t* elem ); static int snd_hctl_elem_throw_event( snd_hctl_elem_t* elem, unsigned int mask ); static int snd_hctl_compare_mixer_priority_lookup( const char** name, const char*const* names, int coef ); static int get_compare_weight(const snd_ctl_elem_id_t* id); static int _snd_hctl_find_elem( snd_hctl_t* hctl, const snd_ctl_elem_id_t* id, int* dir ); static int snd_hctl_elem_add( snd_hctl_t* hctl, snd_hctl_elem_t* elem ); static void snd_hctl_elem_remove( snd_hctl_t* hctl, unsigned int idx ); static int hctl_compare( const void* a, const void* b ); static void snd_hctl_sort(snd_hctl_t* hctl); static int snd_hctl_handle_event( snd_hctl_t* hctl, snd_ctl_event_t* event ); static int hint_list_add( struct hint_list* list, const char* name, const char* description ); static void zero_handler( const char* file, int line, const char* function, int err, const char* fmt, va_list arg ); static int get_dev_name1( struct hint_list* list, char** res, int device, int stream ); static char* get_dev_name(struct hint_list* list); static int try_config( snd_config_t* config, struct hint_list* list, const char* base, const char* name ); static int add_card( snd_config_t* config, snd_config_t* rw_config, struct hint_list* list, int card ); static int get_card_name( struct hint_list* list, int card ); static int add_software_devices( snd_config_t* config, snd_config_t* rw_config, struct hint_list* list ); static int free_elems(snd_sctl_t* h); static int snd_config_get_ctl_elem_enumerated( snd_config_t* n, snd_ctl_t* ctl, snd_ctl_elem_info_t* info ); static int snd_config_get_ctl_elem_value( snd_config_t* conf, snd_ctl_t* ctl, snd_ctl_elem_value_t* val, snd_ctl_elem_value_t* mask, snd_ctl_elem_info_t* info ); static int add_elem( snd_sctl_t* h, snd_config_t* _conf, snd_config_t* private_data, int* quit ); static int get_tlv_info( snd_ctl_t* ctl, const snd_ctl_elem_id_t* id, struct tlv_info* rec ); static int snd_dlsym_verify( void* handle, const char* name, const char* version ); snd_local_error_handler_t snd_lib_error_set_local(snd_local_error_handler_t func); static void snd_lib_error_default( const char* file, int line, const char* function, int err, const char* fmt, ... ); static void snd_err_msg_default( const char* file, int line, const char* function, int err, const char* fmt, ... ); static int snd_hwdep_open_conf( snd_hwdep_t** hwdep, const char* name, snd_config_t* hwdep_root, snd_config_t* hwdep_conf, int mode ); static int snd_hwdep_open_noupdate( snd_hwdep_t** hwdep, snd_config_t* root, const char* name, int mode ); int snd_hwdep_open_lconf( snd_hwdep_t** hwdep, const char* name, int mode, snd_config_t* lconf ); const char* snd_hwdep_name(snd_hwdep_t* hwdep); snd_hwdep_type_t snd_hwdep_type(snd_hwdep_t* hwdep); static int snd_hwdep_hw_close(snd_hwdep_t* hwdep); static int snd_hwdep_hw_nonblock( snd_hwdep_t* hwdep, int nonblock ); static int snd_hwdep_hw_info( snd_hwdep_t* hwdep, snd_hwdep_info_t* info ); static int snd_hwdep_hw_ioctl( snd_hwdep_t* hwdep, unsigned int request, void* arg ); static ssize_t snd_hwdep_hw_write( snd_hwdep_t* hwdep, const void* buffer, size_t size ); static ssize_t snd_hwdep_hw_read( snd_hwdep_t* hwdep, void* buffer, size_t size ); int snd_hwdep_hw_open( snd_hwdep_t** handle, const char* name, int card, int device, int mode ); int _snd_hwdep_hw_open( snd_hwdep_t** hwdep, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_hwdep_hw_open, SND_HWDEP_DLSYM_VERSION ); int bag_new(bag_t** bag); void bag_free(bag_t* bag); int bag_empty(bag_t* bag); int bag_add( bag_t* bag, void* ptr ); int bag_del( bag_t* bag, void* ptr ); void bag_del_all(bag_t* bag); static int snd_mixer_compare_default( const snd_mixer_elem_t* c1, const snd_mixer_elem_t* c2 ); static int hctl_elem_event_handler( snd_hctl_elem_t* helem, unsigned int mask ); static int hctl_event_handler( snd_hctl_t* hctl, unsigned int mask, snd_hctl_elem_t* elem ); static int snd_mixer_throw_event( snd_mixer_t* mixer, unsigned int mask, snd_mixer_elem_t* elem ); static int snd_mixer_elem_throw_event( snd_mixer_elem_t* elem, unsigned int mask ); static int _snd_mixer_find_elem( snd_mixer_t* mixer, snd_mixer_elem_t* elem, int* dir ); static int mixer_compare( const void* a, const void* b ); static int snd_mixer_sort(snd_mixer_t* mixer); int snd_mixer_simple_none_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp ); static int snd_mixer_simple_basic_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp ); static int try_open( snd_mixer_class_t* class, const char* lib ); static int try_open_full( snd_mixer_class_t* class, snd_mixer_t* mixer, const char* lib, const char* device ); static int match( snd_mixer_class_t* class, const char* lib, const char* searchl ); static int find_full( snd_mixer_class_t* class, snd_mixer_t* mixer, snd_config_t* top, const char* device ); static int find_module( snd_mixer_class_t* class, snd_config_t* top ); static void private_free(snd_mixer_class_t* class); int snd_mixer_simple_basic_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp ); int snd_mixer_sbasic_info( const snd_mixer_class_t* class, sm_class_basic_t* info ); void* snd_mixer_sbasic_get_private(const snd_mixer_class_t* class); void snd_mixer_sbasic_set_private( const snd_mixer_class_t* class, void* private_data ); void snd_mixer_sbasic_set_private_free( const snd_mixer_class_t* class, void(*)(snd_mixer_class_t*class) private_free ); static const char* get_short_name(const char* lname); static int compare_mixer_priority_lookup( const char** name, const char*const* names, int coef ); static int get_compare_weight( const char* name, unsigned int idx ); static long to_user( selem_none_t* s, int dir, selem_ctl_t* c, long value ); static long from_user( selem_none_t* s, int dir, selem_ctl_t* c, long value ); static int elem_read_volume( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_read_switch( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_read_route( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_read_enum(selem_none_t* s); static int selem_read(snd_mixer_elem_t* elem); static int elem_write_volume( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_write_switch( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_write_switch_constant( selem_none_t* s, selem_ctl_type_t type, int val ); static int elem_write_route( selem_none_t* s, int dir, selem_ctl_type_t type ); static int elem_write_enum(selem_none_t* s); static int selem_write_main(snd_mixer_elem_t* elem); static int selem_write(snd_mixer_elem_t* elem); static void selem_free(snd_mixer_elem_t* elem); static int simple_update(snd_mixer_elem_t* melem); static int base_len( const char* name, selem_ctl_type_t* type ); static int _snd_mixer_selem_set_volume( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, long value ); static int _snd_mixer_selem_set_switch( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, int value ); static int is_ops( snd_mixer_elem_t* elem, int dir, int cmd, int val ); static int get_range_ops( snd_mixer_elem_t* elem, int dir, long* min, long* max ); static int set_range_ops( snd_mixer_elem_t* elem, int dir, long min, long max ); static int get_volume_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, long* value ); static int init_db_range( snd_hctl_elem_t* ctl, struct selem_str* rec ); static int convert_to_dB( snd_hctl_elem_t* ctl, struct selem_str* rec, long volume, long* db_gain ); static selem_ctl_t* get_selem_ctl( selem_none_t* s, int dir ); static int get_dB_range( snd_hctl_elem_t* ctl, struct selem_str* rec, long* min, long* max ); static int get_dB_range_ops( snd_mixer_elem_t* elem, int dir, long* min, long* max ); static int convert_from_dB( snd_hctl_elem_t* ctl, struct selem_str* rec, long db_gain, long* value, int xdir ); static int ask_vol_dB_ops( snd_mixer_elem_t* elem, int dir, long value, long* dBvalue ); static int get_dB_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, long* value ); static int get_switch_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, int* value ); static int set_volume_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, long value ); static int ask_dB_vol_ops( snd_mixer_elem_t* elem, int dir, long dbValue, long* value, int xdir ); static int set_dB_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, long db_gain, int xdir ); static int set_switch_ops( snd_mixer_elem_t* elem, int dir, snd_mixer_selem_channel_id_t channel, int value ); static int enum_item_name_ops( snd_mixer_elem_t* elem, unsigned int item, size_t maxlen, char* buf ); static int get_enum_item_ops( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, unsigned int* itemp ); static int set_enum_item_ops( snd_mixer_elem_t* elem, snd_mixer_selem_channel_id_t channel, unsigned int item ); static int simple_add1( snd_mixer_class_t* class, const char* name, snd_hctl_elem_t* helem, selem_ctl_type_t type, unsigned int value ); static int simple_event_add( snd_mixer_class_t* class, snd_hctl_elem_t* helem ); static int simple_event_remove( snd_hctl_elem_t* helem, snd_mixer_elem_t* melem ); static int simple_event( snd_mixer_class_t* class, unsigned int mask, snd_hctl_elem_t* helem, snd_mixer_elem_t* melem ); int snd_mixer_simple_none_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp ); static int __snd_pcm_poll_descriptors_count(snd_pcm_t* pcm); static int __snd_pcm_poll_descriptors( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int space ); static int __snd_pcm_poll_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); const char* snd_pcm_tstamp_type_name(snd_pcm_tstamp_type_t type); static int snd_pcm_open_conf( snd_pcm_t** pcmp, const char* name, snd_config_t* pcm_root, snd_config_t* pcm_conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_open_noupdate( snd_pcm_t** pcmp, snd_config_t* root, const char* name, snd_pcm_stream_t stream, int mode, int hop ); static void dump_one_param( snd_pcm_hw_params_t* params, unsigned int k, snd_output_t* out ); static int chmap_equal( const snd_pcm_chmap_t* a, const snd_pcm_chmap_t* b ); static int str_to_chmap( const char* str, int len ); static int _copy_to_fixed_query_map( snd_pcm_chmap_query_t** dst, const snd_pcm_chmap_t* src ); struct tplg_elem* lookup_pcm_dai_stream( struct list_head* base, const char* id ); static void copy_stream_caps( const char* id, struct snd_soc_tplg_stream_caps* caps, struct tplg_elem* ref_elem ); static int tplg_build_stream_caps( snd_tplg_t* tplg, const char* id, struct snd_soc_tplg_stream_caps* caps ); static int build_pcm( snd_tplg_t* tplg, struct tplg_elem* elem ); int tplg_build_pcms( snd_tplg_t* tplg, unsigned int type ); static int tplg_build_dai( snd_tplg_t* tplg, struct tplg_elem* elem ); int tplg_build_dais( snd_tplg_t* tplg, unsigned int type ); static int tplg_build_stream_cfg( snd_tplg_t* tplg, struct snd_soc_tplg_stream* stream, int num_streams ); static int build_link( snd_tplg_t* tplg, struct tplg_elem* elem ); int tplg_build_links( snd_tplg_t* tplg, unsigned int type ); static int split_format( struct snd_soc_tplg_stream_caps* caps, char* str ); int tplg_parse_stream_caps( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int tplg_parse_streams( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int tplg_parse_fe_dai( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int parse_flag( snd_config_t* n, unsigned int mask_in, unsigned int* mask, unsigned int* flags ); int tplg_parse_pcm( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_dai( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int parse_hw_config_refs( snd_tplg_t* tplg, snd_config_t* cfg, struct tplg_elem* elem ); int tplg_parse_link( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_cc( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int get_audio_hw_format(const char* val); int tplg_parse_hw_config( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static void tplg_add_stream_object( struct snd_soc_tplg_stream* strm, struct snd_tplg_stream_template* strm_tpl ); static void tplg_add_stream_caps( struct snd_soc_tplg_stream_caps* caps, struct snd_tplg_stream_caps_template* caps_tpl ); int tplg_add_pcm_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); static int set_link_hw_config( struct snd_soc_tplg_hw_config* cfg, struct snd_tplg_hw_config_template* tpl ); int tplg_add_link_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); int tplg_add_dai_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); static char adpcm_encoder( int sl, snd_pcm_adpcm_state_t* state ); static int adpcm_decoder( unsigned char code, snd_pcm_adpcm_state_t* state ); static int snd_pcm_adpcm_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_adpcm_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_adpcm_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_adpcm_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_adpcm_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_adpcm_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_adpcm_hw_free(snd_pcm_t* pcm); static int snd_pcm_adpcm_init(snd_pcm_t* pcm); static snd_pcm_uframes_t snd_pcm_adpcm_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_adpcm_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_adpcm_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_adpcm_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave ); int _snd_pcm_adpcm_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int val_seg(int val); static unsigned char s16_to_alaw(int pcm_val); static int alaw_to_s16(unsigned char a_val); static int snd_pcm_alaw_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_alaw_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_alaw_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_alaw_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_alaw_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_alaw_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_alaw_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_alaw_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_alaw_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_alaw_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave ); int _snd_pcm_alaw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); int _snd_pcm_asym_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_copy_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_copy_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_copy_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_copy_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_copy_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_copy_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_copy_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_copy_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_copy_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_copy_open( snd_pcm_t** pcmp, const char* name, snd_pcm_t* slave, int close_slave ); int _snd_pcm_copy_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int shm_sum_discard(snd_pcm_direct_t* dmix); static int shm_sum_create_or_connect(snd_pcm_direct_t* dmix); static void dmix_server_free(snd_pcm_direct_t* dmix); static void mix_areas( snd_pcm_direct_t* dmix, const snd_pcm_channel_area_t* src_areas, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t src_ofs, snd_pcm_uframes_t dst_ofs, snd_pcm_uframes_t size ); static void remix_areas( snd_pcm_direct_t* dmix, const snd_pcm_channel_area_t* src_areas, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t src_ofs, snd_pcm_uframes_t dst_ofs, snd_pcm_uframes_t size ); static void snd_pcm_dmix_sync_area(snd_pcm_t* pcm); static int snd_pcm_dmix_sync_ptr0( snd_pcm_t* pcm, snd_pcm_uframes_t slave_hw_ptr ); static int snd_pcm_dmix_sync_ptr(snd_pcm_t* pcm); static snd_pcm_state_t snd_pcm_dmix_state(snd_pcm_t* pcm); static int snd_pcm_dmix_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static int snd_pcm_dmix_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int snd_pcm_dmix_hwsync(snd_pcm_t* pcm); static void reset_slave_ptr( snd_pcm_t* pcm, snd_pcm_direct_t* dmix ); static int snd_pcm_dmix_reset(snd_pcm_t* pcm); static int snd_pcm_dmix_start_timer( snd_pcm_t* pcm, snd_pcm_direct_t* dmix ); static int snd_pcm_dmix_start(snd_pcm_t* pcm); static int snd_pcm_dmix_drop(snd_pcm_t* pcm); static int __snd_pcm_dmix_drain(snd_pcm_t* pcm); static int snd_pcm_dmix_drain(snd_pcm_t* pcm); static int snd_pcm_dmix_pause( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t snd_pcm_dmix_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dmix_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_dmix_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dmix_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_dmix_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_dmix_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static int snd_pcm_dmix_close(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dmix_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_dmix_avail_update(snd_pcm_t* pcm); static int snd_pcm_dmix_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static int snd_pcm_dmix_poll_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); static void snd_pcm_dmix_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dmix_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode ); int _snd_pcm_dmix_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static void (snd_pcm_t* pcm); static void ( snd_pcm_direct_t* dshare, const snd_pcm_channel_area_t* src_areas, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t src_ofs, snd_pcm_uframes_t dst_ofs, snd_pcm_uframes_t size ); static void (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_uframes_t slave_hw_ptr ); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_direct_t* dshare); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static int (snd_pcm_t* pcm); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static void ( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dshare_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode ); int _snd_pcm_dshare_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snoop_timestamp(snd_pcm_t* pcm); static void snoop_areas( snd_pcm_direct_t* dsnoop, const snd_pcm_channel_area_t* src_areas, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t src_ofs, snd_pcm_uframes_t dst_ofs, snd_pcm_uframes_t size ); static void snd_pcm_dsnoop_sync_area( snd_pcm_t* pcm, snd_pcm_uframes_t slave_hw_ptr, snd_pcm_uframes_t size ); static int snd_pcm_dsnoop_sync_ptr(snd_pcm_t* pcm); static int snd_pcm_dsnoop_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t snd_pcm_dsnoop_state(snd_pcm_t* pcm); static int snd_pcm_dsnoop_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int snd_pcm_dsnoop_hwsync(snd_pcm_t* pcm); static int snd_pcm_dsnoop_reset(snd_pcm_t* pcm); static int snd_pcm_dsnoop_start(snd_pcm_t* pcm); static int snd_pcm_dsnoop_drop(snd_pcm_t* pcm); static int __snd_pcm_dsnoop_drain(snd_pcm_t* pcm); static int snd_pcm_dsnoop_drain(snd_pcm_t* pcm); static int snd_pcm_dsnoop_pause( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t snd_pcm_dsnoop_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dsnoop_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_dsnoop_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dsnoop_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_dsnoop_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_dsnoop_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static int snd_pcm_dsnoop_close(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_dsnoop_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_dsnoop_avail_update(snd_pcm_t* pcm); static int snd_pcm_dsnoop_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static void snd_pcm_dsnoop_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_dsnoop_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode ); int _snd_pcm_dsnoop_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); int _snd_pcm_empty_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static void snd_pcm_file_write_bytes( snd_pcm_t* pcm, size_t bytes ); static void snd_pcm_file_add_frames( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames ); static int snd_pcm_file_close(snd_pcm_t* pcm); static int snd_pcm_file_reset(snd_pcm_t* pcm); static int snd_pcm_file_drop(snd_pcm_t* pcm); static int snd_pcm_file_drain(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_file_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_file_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_file_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_file_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_file_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_file_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_file_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_file_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_file_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int snd_pcm_file_hw_free(snd_pcm_t* pcm); static int snd_pcm_file_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static void snd_pcm_file_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_file_open( snd_pcm_t** pcmp, const char* name, const char* fname, int fd, const char* ifname, int ifd, int trunc, const char* fmt, int perm, snd_pcm_t* slave, int close_slave, snd_pcm_stream_t stream ); int _snd_pcm_file_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int hook_add_dlobj( snd_pcm_t* pcm, void* dlobj ); static void hook_remove_dlobj(struct snd_pcm_hook_dllist* dl); static int snd_pcm_hooks_close(snd_pcm_t* pcm); static int snd_pcm_hooks_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_hooks_hw_free(snd_pcm_t* pcm); static void snd_pcm_hooks_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_hooks_open( snd_pcm_t** pcmp, const char* name, snd_pcm_t* slave, int close_slave ); static int snd_pcm_hook_add_conf( snd_pcm_t* pcm, snd_config_t* root, snd_config_t* conf ); int _snd_pcm_hooks_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_hook_ctl_elems_hw_params(snd_pcm_hook_t* hook); static int snd_pcm_hook_ctl_elems_hw_free(snd_pcm_hook_t* hook); static int snd_pcm_hook_ctl_elems_close(snd_pcm_hook_t* hook); int _snd_pcm_hook_ctl_elems_install( snd_pcm_t* pcm, snd_config_t* conf ); static int sync_ptr1( snd_pcm_hw_t* hw, unsigned int flags ); static int sync_ptr( snd_pcm_hw_t* hw, unsigned int flags ); static int snd_pcm_hw_clear_timer_queue(snd_pcm_hw_t* hw); static int snd_pcm_hw_poll_descriptors_count(snd_pcm_t* pcm); static int snd_pcm_hw_poll_descriptors( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int space ); static int snd_pcm_hw_poll_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned nfds, unsigned short* revents ); static int snd_pcm_hw_nonblock( snd_pcm_t* pcm, int nonblock ); static int snd_pcm_hw_async( snd_pcm_t* pcm, int sig, pid_t pid ); static int snd_pcm_hw_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); static int hw_refine_call( snd_pcm_hw_t* pcm_hw, snd_pcm_hw_params_t* params ); static int snd_pcm_hw_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int hw_params_call( snd_pcm_hw_t* pcm_hw, snd_pcm_hw_params_t* params ); static int snd_pcm_hw_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static void snd_pcm_hw_close_timer(snd_pcm_hw_t* hw); static int snd_pcm_hw_change_timer( snd_pcm_t* pcm, int enable ); static int snd_pcm_hw_hw_free(snd_pcm_t* pcm); static int snd_pcm_hw_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int snd_pcm_hw_channel_info( snd_pcm_t* pcm, snd_pcm_channel_info_t* info ); static int snd_pcm_hw_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t snd_pcm_hw_state(snd_pcm_t* pcm); static int snd_pcm_hw_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int snd_pcm_hw_hwsync(snd_pcm_t* pcm); static int snd_pcm_hw_prepare(snd_pcm_t* pcm); static int snd_pcm_hw_reset(snd_pcm_t* pcm); static int snd_pcm_hw_start(snd_pcm_t* pcm); static int snd_pcm_hw_drop(snd_pcm_t* pcm); static int snd_pcm_hw_drain(snd_pcm_t* pcm); static int snd_pcm_hw_pause( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t snd_pcm_hw_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_hw_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_hw_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_hw_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int snd_pcm_hw_resume(snd_pcm_t* pcm); static int hw_link( snd_pcm_t* pcm1, snd_pcm_t* pcm2 ); static int snd_pcm_hw_link_slaves( snd_pcm_t* pcm, snd_pcm_t* master ); static int snd_pcm_hw_link( snd_pcm_t* pcm1, snd_pcm_t* pcm2 ); static int snd_pcm_hw_unlink(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_hw_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_hw_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_hw_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_hw_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static int snd_pcm_hw_mmap_status(snd_pcm_t* pcm); static int snd_pcm_hw_mmap_control(snd_pcm_t* pcm); static int snd_pcm_hw_munmap_status(snd_pcm_t* pcm); static int snd_pcm_hw_munmap_control(snd_pcm_t* pcm); static int snd_pcm_hw_mmap(snd_pcm_t* pcm); static int snd_pcm_hw_munmap(snd_pcm_t* pcm); static int snd_pcm_hw_close(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_hw_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_hw_avail_update(snd_pcm_t* pcm); static int snd_pcm_hw_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static void __fill_chmap_ctl_id( snd_ctl_elem_id_t* id, int dev, int subdev, int stream ); static void fill_chmap_ctl_id( snd_pcm_t* pcm, snd_ctl_elem_id_t* id ); static int is_chmap_type(int type); static int chmap_caps( snd_pcm_hw_t* hw, int type ); static void chmap_caps_set_ok( snd_pcm_hw_t* hw, int type ); static void chmap_caps_set_error( snd_pcm_hw_t* hw, int type ); static snd_pcm_chmap_query_t** snd_pcm_hw_query_chmaps(snd_pcm_t* pcm); static snd_pcm_chmap_t* snd_pcm_hw_get_chmap(snd_pcm_t* pcm); static int snd_pcm_hw_set_chmap( snd_pcm_t* pcm, const snd_pcm_chmap_t* map ); static void snd_pcm_hw_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_hw_open_fd( snd_pcm_t** pcmp, const char* name, int fd, int mmap_emulation, int sync_ptr_ioctl ); int snd_pcm_hw_open( snd_pcm_t** pcmp, const char* name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode, int mmap_emulation, int sync_ptr_ioctl ); int _snd_pcm_hw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static void snd_pcm_hw_convert_from_old_params( snd_pcm_hw_params_t* params, struct sndrv_pcm_hw_params_old* oparams ); static void snd_pcm_hw_convert_to_old_params( struct sndrv_pcm_hw_params_old* oparams, snd_pcm_hw_params_t* params, unsigned int* cmask ); static int use_old_hw_params_ioctl( int fd, unsigned int cmd, snd_pcm_hw_params_t* params ); static unsigned int iec958_parity(unsigned int data); static u_int32_t iec958_subframe( snd_pcm_iec958_t* iec, u_int32_t data, int channel ); static int32_t iec958_to_s32( snd_pcm_iec958_t* iec, u_int32_t data ); static int snd_pcm_iec958_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_iec958_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_iec958_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_iec958_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_iec958_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_iec958_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_iec958_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_iec958_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static int snd_pcm_iec958_init(snd_pcm_t* pcm); static void snd_pcm_iec958_dump( snd_pcm_t* pcm, snd_output_t* out ); static snd_pcm_sframes_t snd_pcm_iec958_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_iec958_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); int snd_pcm_iec958_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave, const unsigned char* status_bits, const unsigned char* preamble_vals ); int _snd_pcm_iec958_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static unsigned int snd_pcm_ladspa_count_ports( snd_pcm_ladspa_plugin_t* lplug, LADSPA_PortDescriptor pdesc ); static int snd_pcm_ladspa_find_port( unsigned int* res, snd_pcm_ladspa_plugin_t* lplug, LADSPA_PortDescriptor pdesc, unsigned int port_idx ); static int snd_pcm_ladspa_find_sport( unsigned int* res, snd_pcm_ladspa_plugin_t* lplug, LADSPA_PortDescriptor pdesc, const char* port_name ); static int snd_pcm_ladspa_find_port_idx( unsigned int* res, snd_pcm_ladspa_plugin_t* lplug, LADSPA_PortDescriptor pdesc, unsigned int port ); static void snd_pcm_ladspa_free_io(snd_pcm_ladspa_plugin_io_t* io); static void snd_pcm_ladspa_free_plugins(struct list_head* plugins); static void snd_pcm_ladspa_free(snd_pcm_ladspa_t* ladspa); static int snd_pcm_ladspa_close(snd_pcm_t* pcm); static int snd_pcm_ladspa_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_ladspa_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_ladspa_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_ladspa_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_ladspa_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_ladspa_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static void snd_pcm_ladspa_free_eps(snd_pcm_ladspa_eps_t* eps); static void snd_pcm_ladspa_free_instances( snd_pcm_t* pcm, snd_pcm_ladspa_t* ladspa, int cleanup ); static int snd_pcm_ladspa_add_to_carray( snd_pcm_ladspa_array_t* array, unsigned int idx, unsigned int val ); static int snd_pcm_ladspa_add_to_array( snd_pcm_ladspa_array_t* array, unsigned int idx, unsigned int val ); static int snd_pcm_ladspa_connect_plugin1( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* io, snd_pcm_ladspa_eps_t* eps ); static int snd_pcm_ladspa_connect_plugin( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_instance_t* instance ); static int snd_pcm_ladspa_connect_plugin_duplicate1( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* io, snd_pcm_ladspa_eps_t* eps, unsigned int idx ); static int snd_pcm_ladspa_connect_plugin_duplicate( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* in_io, snd_pcm_ladspa_plugin_io_t* out_io, snd_pcm_ladspa_instance_t* instance, unsigned int idx ); static void snd_pcm_ladspa_get_default_cvalue( const LADSPA_Descriptor* desc, unsigned int port, LADSPA_Data* val ); static int snd_pcm_ladspa_connect_controls( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* io, snd_pcm_ladspa_instance_t* instance ); static int snd_pcm_ladspa_check_connect( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* io, snd_pcm_ladspa_eps_t* eps, unsigned int depth ); static int snd_pcm_ladspa_allocate_instances( snd_pcm_t* pcm, snd_pcm_ladspa_t* ladspa ); static LADSPA_Data* snd_pcm_ladspa_allocate_zero( snd_pcm_ladspa_t* ladspa, unsigned int idx ); static int snd_pcm_ladspa_allocate_memory( snd_pcm_t* pcm, snd_pcm_ladspa_t* ladspa ); static int snd_pcm_ladspa_init(snd_pcm_t* pcm); static int snd_pcm_ladspa_hw_free(snd_pcm_t* pcm); static snd_pcm_uframes_t snd_pcm_ladspa_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_ladspa_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_ladspa_dump_direction( snd_pcm_ladspa_plugin_t* plugin, snd_pcm_ladspa_plugin_io_t* io, snd_output_t* out ); static void snd_pcm_ladspa_dump_array( snd_output_t* out, snd_pcm_ladspa_array_t* array, snd_pcm_ladspa_plugin_t* plugin ); static void snd_pcm_ladspa_plugins_dump( struct list_head* list, snd_output_t* out ); static void snd_pcm_ladspa_dump( snd_pcm_t* pcm, snd_output_t* out ); static int snd_pcm_ladspa_check_file( snd_pcm_ladspa_plugin_t*const plugin, const char* filename, const char* label, const unsigned long ladspa_id ); static int snd_pcm_ladspa_check_dir( snd_pcm_ladspa_plugin_t*const plugin, const char* path, const char* label, const unsigned long ladspa_id ); static int snd_pcm_ladspa_look_for_plugin( snd_pcm_ladspa_plugin_t*const plugin, const char* path, const char* label, const long ladspa_id ); static int snd_pcm_ladspa_add_default_controls( snd_pcm_ladspa_plugin_t* lplug, snd_pcm_ladspa_plugin_io_t* io ); static int snd_pcm_ladspa_parse_controls( snd_pcm_ladspa_plugin_t* lplug, snd_pcm_ladspa_plugin_io_t* io, snd_config_t* controls ); static int snd_pcm_ladspa_parse_bindings( snd_pcm_ladspa_plugin_t* lplug, snd_pcm_ladspa_plugin_io_t* io, snd_config_t* bindings ); static int snd_pcm_ladspa_parse_ioconfig( snd_pcm_ladspa_plugin_t* lplug, snd_pcm_ladspa_plugin_io_t* io, snd_config_t* conf ); static int snd_pcm_ladspa_add_plugin( struct list_head* list, const char* path, snd_config_t* plugin, int reverse ); static int snd_pcm_ladspa_build_plugins( struct list_head* list, const char* path, snd_config_t* plugins, int reverse ); int snd_pcm_ladspa_open( snd_pcm_t** pcmp, const char* name, const char* ladspa_path, unsigned int channels, snd_config_t* ladspa_pplugins, snd_config_t* ladspa_cplugins, snd_pcm_t* slave, int close_slave ); int _snd_pcm_ladspa_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_lfloat_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_lfloat_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_lfloat_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_lfloat_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_lfloat_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_lfloat_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_lfloat_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_lfloat_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_lfloat_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_lfloat_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave ); int _snd_pcm_lfloat_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_linear_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_linear_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_linear_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_linear_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_linear_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_linear_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_linear_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_linear_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_linear_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_linear_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave ); int _snd_pcm_linear_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); void snd_pcm_mmap_appl_backward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); void snd_pcm_mmap_appl_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); void snd_pcm_mmap_hw_backward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); void snd_pcm_mmap_hw_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_mmap_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_mmap_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); int snd_pcm_channel_info_shm( snd_pcm_t* pcm, snd_pcm_channel_info_t* info, int shmid ); int snd_pcm_mmap(snd_pcm_t* pcm); int snd_pcm_munmap(snd_pcm_t* pcm); snd_pcm_sframes_t snd_pcm_write_mmap( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); snd_pcm_sframes_t snd_pcm_read_mmap( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int snd_pcm_mmap_emul_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_mmap_emul_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_mmap_emul_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int snd_pcm_mmap_emul_prepare(snd_pcm_t* pcm); static int snd_pcm_mmap_emul_reset(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_mmap_emul_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_mmap_emul_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t sync_slave_write(snd_pcm_t* pcm); static snd_pcm_sframes_t sync_slave_read(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_mmap_emul_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_mmap_emul_avail_update(snd_pcm_t* pcm); static void snd_pcm_mmap_emul_dump( snd_pcm_t* pcm, snd_output_t* out ); int _snd_pcm_mmap_emul_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int val_seg(int val); static unsigned char s16_to_ulaw(int pcm_val); static int ulaw_to_s16(unsigned char u_val); static int snd_pcm_mulaw_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_mulaw_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_mulaw_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_mulaw_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_mulaw_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_mulaw_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_mulaw_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_mulaw_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_mulaw_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_mulaw_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave ); int _snd_pcm_mulaw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_multi_close(snd_pcm_t* pcm); static int snd_pcm_multi_nonblock( snd_pcm_t* pcm, int nonblock ); static int snd_pcm_multi_async( snd_pcm_t* pcm, int sig, pid_t pid ); static int snd_pcm_multi_poll_descriptors_count(snd_pcm_t* pcm); static int snd_pcm_multi_poll_descriptors( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int space ); static int snd_pcm_multi_poll_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); static int snd_pcm_multi_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); static int snd_pcm_multi_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_multi_hw_refine_sprepare( snd_pcm_t* pcm, unsigned int slave_idx, snd_pcm_hw_params_t* sparams ); static int snd_pcm_multi_hw_refine_schange( snd_pcm_t* pcm, unsigned int slave_idx, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_multi_hw_refine_cchange( snd_pcm_t* pcm, unsigned int slave_idx, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_multi_hw_refine_slave( snd_pcm_t* pcm, unsigned int slave_idx, snd_pcm_hw_params_t* sparams ); static int snd_pcm_multi_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_multi_hw_params_slave( snd_pcm_t* pcm, unsigned int slave_idx, snd_pcm_hw_params_t* sparams ); static void reset_links(snd_pcm_multi_t* multi); static int snd_pcm_multi_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_multi_hw_free(snd_pcm_t* pcm); static int snd_pcm_multi_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int snd_pcm_multi_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t snd_pcm_multi_state(snd_pcm_t* pcm); static int snd_pcm_multi_hwsync(snd_pcm_t* pcm); static int snd_pcm_multi_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static snd_pcm_sframes_t snd_pcm_multi_avail_update(snd_pcm_t* pcm); static int snd_pcm_multi_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static int snd_pcm_multi_prepare(snd_pcm_t* pcm); static int snd_pcm_multi_reset(snd_pcm_t* pcm); static int snd_pcm_multi_start(snd_pcm_t* pcm); static int snd_pcm_multi_drop(snd_pcm_t* pcm); static int snd_pcm_multi_drain(snd_pcm_t* pcm); static int snd_pcm_multi_pause( snd_pcm_t* pcm, int enable ); static int snd_pcm_multi_channel_info( snd_pcm_t* pcm, snd_pcm_channel_info_t* info ); static snd_pcm_sframes_t snd_pcm_multi_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_multi_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_multi_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_multi_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int snd_pcm_multi_resume(snd_pcm_t* pcm); static int snd_pcm_multi_link_slaves( snd_pcm_t* pcm, snd_pcm_t* master ); static int snd_pcm_multi_link( snd_pcm_t* pcm1, snd_pcm_t* pcm2 ); static int snd_pcm_multi_unlink(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_multi_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int snd_pcm_multi_munmap(snd_pcm_t* pcm); static int snd_pcm_multi_mmap(snd_pcm_t* pcm); static int snd_pcm_multi_may_wait_for_avail_min( snd_pcm_t* pcm, snd_pcm_uframes_t avail ); static snd_pcm_chmap_query_t** snd_pcm_multi_query_chmaps(snd_pcm_t* pcm); static snd_pcm_chmap_t* snd_pcm_multi_get_chmap(snd_pcm_t* pcm); static int snd_pcm_multi_set_chmap( snd_pcm_t* pcm, const snd_pcm_chmap_t* map ); static void snd_pcm_multi_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_multi_open( snd_pcm_t** pcmp, const char* name, unsigned int slaves_count, unsigned int master_slave, snd_pcm_t** slaves_pcm, unsigned int* schannels_count, unsigned int channels_count, int* sidxs, unsigned int* schannels, int close_slaves ); int _snd_pcm_multi_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_null_close(snd_pcm_t* pcm); static int snd_pcm_null_nonblock( snd_pcm_t* pcm, int nonblock ); static int snd_pcm_null_async( snd_pcm_t* pcm, int sig, pid_t pid ); static int snd_pcm_null_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); static snd_pcm_sframes_t snd_pcm_null_avail_update(snd_pcm_t* pcm); static int snd_pcm_null_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t snd_pcm_null_state(snd_pcm_t* pcm); static int snd_pcm_null_hwsync(snd_pcm_t* pcm); static int snd_pcm_null_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int snd_pcm_null_reset(snd_pcm_t* pcm); static int snd_pcm_null_prepare(snd_pcm_t* pcm); static int snd_pcm_null_start(snd_pcm_t* pcm); static int snd_pcm_null_drop(snd_pcm_t* pcm); static int snd_pcm_null_drain(snd_pcm_t* pcm); static int snd_pcm_null_pause( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t snd_pcm_null_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_null_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_null_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_null_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int snd_pcm_null_resume(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_null_xfer_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_null_writei( snd_pcm_t* pcm, const void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_null_writen( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_null_readi( snd_pcm_t* pcm, void* buffer, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_null_readn( snd_pcm_t* pcm, void** bufs, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_null_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int snd_pcm_null_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_null_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_null_hw_free(snd_pcm_t* pcm); static int snd_pcm_null_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static snd_pcm_chmap_query_t** snd_pcm_null_query_chmaps(snd_pcm_t* pcm); static snd_pcm_chmap_t* snd_pcm_null_get_chmap(snd_pcm_t* pcm); static void snd_pcm_null_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_null_open( snd_pcm_t** pcmp, const char* name, snd_pcm_stream_t stream, int mode ); int _snd_pcm_null_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_plug_close(snd_pcm_t* pcm); static int snd_pcm_plug_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); static int check_linear_format( const snd_pcm_format_mask_t* format_mask, int wid, int sgn, int ed ); static snd_pcm_format_t snd_pcm_plug_slave_format( snd_pcm_format_t format, const snd_pcm_format_mask_t* format_mask ); static void snd_pcm_plug_clear(snd_pcm_t* pcm); static int snd_pcm_plug_change_format( snd_pcm_t* pcm, snd_pcm_t** new, snd_pcm_plug_params_t* clt, snd_pcm_plug_params_t* slv ); static int snd_pcm_plug_change_access( snd_pcm_t* pcm, snd_pcm_t** new, snd_pcm_plug_params_t* clt, snd_pcm_plug_params_t* slv ); static int snd_pcm_plug_insert_plugins( snd_pcm_t* pcm, snd_pcm_plug_params_t* client, snd_pcm_plug_params_t* slave ); static int snd_pcm_plug_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_plug_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int check_access_change( snd_pcm_hw_params_t* cparams, snd_pcm_hw_params_t* sparams ); static int snd_pcm_plug_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_plug_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_plug_hw_refine_slave( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_plug_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_plug_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_plug_hw_free(snd_pcm_t* pcm); static void snd_pcm_plug_dump( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_plug_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int schannels, int srate, const snd_config_t* rate_converter, enum snd_pcm_plug_route_policy route_policy, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_ssize, unsigned int tt_cused, unsigned int tt_sused, snd_pcm_t* slave, int close_slave ); int _snd_pcm_plug_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_pcm_rate_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_rate_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_rate_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_rate_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_rate_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_rate_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_rate_hw_free(snd_pcm_t* pcm); static void recalc( snd_pcm_t* pcm, snd_pcm_uframes_t* val ); static int snd_pcm_rate_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int snd_pcm_rate_init(snd_pcm_t* pcm); static void convert_to_s16( snd_pcm_rate_t* rate, int16_t* buf, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, unsigned int frames, unsigned int channels ); static void convert_from_s16( snd_pcm_rate_t* rate, const int16_t* buf, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, unsigned int frames, unsigned int channels ); static void do_convert( const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t dst_offset, unsigned int dst_frames, const snd_pcm_channel_area_t* src_areas, snd_pcm_uframes_t src_offset, unsigned int src_frames, unsigned int channels, snd_pcm_rate_t* rate ); static void snd_pcm_rate_write_areas1( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset ); static void snd_pcm_rate_read_areas1( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset ); static void snd_pcm_rate_sync_hwptr0( snd_pcm_t* pcm, snd_pcm_uframes_t slave_hw_ptr ); static void snd_pcm_rate_sync_hwptr(snd_pcm_t* pcm); static int snd_pcm_rate_hwsync(snd_pcm_t* pcm); static snd_pcm_uframes_t snd_pcm_rate_playback_internal_delay(snd_pcm_t* pcm); static int snd_pcm_rate_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int snd_pcm_rate_prepare(snd_pcm_t* pcm); static int snd_pcm_rate_reset(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_rate_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_rate_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_rate_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_rate_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int snd_pcm_rate_commit_area( snd_pcm_t* pcm, snd_pcm_rate_t* rate, snd_pcm_uframes_t appl_offset, snd_pcm_uframes_t size, snd_pcm_uframes_t slave_size ); static int snd_pcm_rate_commit_next_period( snd_pcm_t* pcm, snd_pcm_uframes_t appl_offset ); static int snd_pcm_rate_grab_next_period( snd_pcm_t* pcm, snd_pcm_uframes_t hw_offset ); static int snd_pcm_rate_sync_playback_area( snd_pcm_t* pcm, snd_pcm_uframes_t appl_ptr ); static snd_pcm_sframes_t snd_pcm_rate_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t snd_pcm_rate_avail_update(snd_pcm_t* pcm); static int snd_pcm_rate_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static int snd_pcm_rate_poll_revents( snd_pcm_t* pcm, struct pollfd* pfds, unsigned int nfds, unsigned short* revents ); static int snd_pcm_rate_drain(snd_pcm_t* pcm); static snd_pcm_state_t snd_pcm_rate_state(snd_pcm_t* pcm); static int snd_pcm_rate_start(snd_pcm_t* pcm); static int snd_pcm_rate_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static void snd_pcm_rate_dump( snd_pcm_t* pcm, snd_output_t* out ); static int snd_pcm_rate_close(snd_pcm_t* pcm); const snd_config_t* snd_pcm_rate_get_default_converter(snd_config_t* root); static int is_builtin_plugin(const char* type); static int rate_open_func( snd_pcm_rate_t* rate, const char* type, int verbose ); int snd_pcm_rate_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, unsigned int srate, const snd_config_t* converter, snd_pcm_t* slave, int close_slave ); int _snd_pcm_rate_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static void snd_pcm_route_convert1_zero( const snd_pcm_channel_area_t* dst_area, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_areas, snd_pcm_uframes_t src_offset, unsigned int src_channels, snd_pcm_uframes_t frames, const snd_pcm_route_ttable_dst_t* ttable, const snd_pcm_route_params_t* params ); static void snd_pcm_route_convert( const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_areas, snd_pcm_uframes_t src_offset, unsigned int src_channels, unsigned int dst_channels, snd_pcm_uframes_t frames, snd_pcm_route_params_t* params ); static int snd_pcm_route_close(snd_pcm_t* pcm); static int snd_pcm_route_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_route_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_route_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_route_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_route_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_route_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_route_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_route_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_chmap_t* snd_pcm_route_get_chmap(snd_pcm_t* pcm); static snd_pcm_chmap_query_t** snd_pcm_route_query_chmaps(snd_pcm_t* pcm); static void snd_pcm_route_dump( snd_pcm_t* pcm, snd_output_t* out ); static int strtochannel( const char* id, snd_pcm_chmap_t* chmap, long* channel, int channel_size ); static int determine_chmap( snd_config_t* tt, snd_pcm_chmap_t** tt_chmap ); static int find_matching_chmap( snd_pcm_t* spcm, snd_pcm_chmap_t* tt_chmap, snd_pcm_chmap_t** found_chmap, int* schannels ); static int route_chmap_init(snd_pcm_t* pcm); static int route_load_ttable( snd_pcm_route_params_t* params, snd_pcm_stream_t stream, unsigned int tt_ssize, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_cused, unsigned int tt_sused ); int snd_pcm_route_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int schannels, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_ssize, unsigned int tt_cused, unsigned int tt_sused, snd_pcm_t* slave, int close_slave ); static int _snd_pcm_route_determine_ttable( snd_config_t* tt, unsigned int* tt_csize, unsigned int* tt_ssize, snd_pcm_chmap_t* chmap ); int snd_pcm_route_determine_ttable( snd_config_t* tt, unsigned int* tt_csize, unsigned int* tt_ssize ); static int _snd_pcm_route_load_ttable( snd_config_t* tt, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_csize, unsigned int tt_ssize, unsigned int* tt_cused, unsigned int* tt_sused, int schannels, snd_pcm_chmap_t* chmap ); int snd_pcm_route_load_ttable( snd_config_t* tt, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_csize, unsigned int tt_ssize, unsigned int* tt_cused, unsigned int* tt_sused, int schannels ); int _snd_pcm_route_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static void ( snd_pcm_t* pcm, snd_pcm_state_t state ); static snd_pcm_uframes_t (snd_pcm_share_slave_t* slave); static snd_pcm_uframes_t (snd_pcm_share_slave_t* slave); static snd_pcm_uframes_t (snd_pcm_t* pcm); static snd_pcm_uframes_t (snd_pcm_share_slave_t* slave); static void* (void* data); static void (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, int nonblock ); static int ( snd_pcm_t* pcm, int sig, pid_t pid ); static int ( snd_pcm_t* pcm, snd_pcm_info_t* info ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int ( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int ( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static int ( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, int enable ); static int (snd_pcm_t* pcm); static int ( snd_pcm_t* pcm, snd_pcm_channel_info_t* info ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t (snd_pcm_t* pcm); static snd_pcm_sframes_t ( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static int (snd_pcm_t* pcm); static void ( snd_pcm_t* pcm, snd_output_t* out ); int snd_pcm_share_open( snd_pcm_t** pcmp, const char* name, const char* sname, snd_pcm_format_t sformat, int srate, unsigned int schannels, int speriod_time, int sbuffer_time, unsigned int channels, unsigned int* channels_map, snd_pcm_stream_t stream, int mode ); int _snd_pcm_share_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static long snd_pcm_shm_action_fd0( snd_pcm_t* pcm, int* fd ); static int snd_pcm_shm_new_rbptr( snd_pcm_t* pcm, snd_pcm_shm_t* shm, snd_pcm_rbptr_t* rbptr, volatile snd_pcm_shm_rbptr_t* shm_rbptr ); static long snd_pcm_shm_action(snd_pcm_t* pcm); static long snd_pcm_shm_action_fd( snd_pcm_t* pcm, int* fd ); static int snd_pcm_shm_nonblock( snd_pcm_t* pcm, int nonblock ); static int snd_pcm_shm_async( snd_pcm_t* pcm, int sig, pid_t pid ); static int snd_pcm_shm_info( snd_pcm_t* pcm, snd_pcm_info_t* info ); static int snd_pcm_shm_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_shm_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int snd_pcm_shm_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_shm_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_shm_hw_refine_slave( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_shm_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_shm_hw_params_slave( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_shm_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_shm_hw_free(snd_pcm_t* pcm); static int snd_pcm_shm_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* params ); static int snd_pcm_shm_mmap(snd_pcm_t* pcm); static int snd_pcm_shm_munmap(snd_pcm_t* pcm); static int snd_pcm_shm_channel_info( snd_pcm_t* pcm, snd_pcm_channel_info_t* info ); static int snd_pcm_shm_status( snd_pcm_t* pcm, snd_pcm_status_t* status ); static snd_pcm_state_t snd_pcm_shm_state(snd_pcm_t* pcm); static int snd_pcm_shm_hwsync(snd_pcm_t* pcm); static int snd_pcm_shm_delay( snd_pcm_t* pcm, snd_pcm_sframes_t* delayp ); static snd_pcm_sframes_t snd_pcm_shm_avail_update(snd_pcm_t* pcm); static int snd_pcm_shm_htimestamp( snd_pcm_t* pcm, snd_pcm_uframes_t* avail, snd_htimestamp_t* tstamp ); static int snd_pcm_shm_prepare(snd_pcm_t* pcm); static int snd_pcm_shm_reset(snd_pcm_t* pcm); static int snd_pcm_shm_start(snd_pcm_t* pcm); static int snd_pcm_shm_drop(snd_pcm_t* pcm); static int snd_pcm_shm_drain(snd_pcm_t* pcm); static int snd_pcm_shm_pause( snd_pcm_t* pcm, int enable ); static snd_pcm_sframes_t snd_pcm_shm_rewindable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_shm_rewind( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static snd_pcm_sframes_t snd_pcm_shm_forwardable(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_shm_forward( snd_pcm_t* pcm, snd_pcm_uframes_t frames ); static int snd_pcm_shm_resume(snd_pcm_t* pcm); static snd_pcm_sframes_t snd_pcm_shm_mmap_commit( snd_pcm_t* pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t size ); static int snd_pcm_shm_poll_descriptor(snd_pcm_t* pcm); static int snd_pcm_shm_close(snd_pcm_t* pcm); static void snd_pcm_shm_dump( snd_pcm_t* pcm, snd_output_t* out ); static int make_local_socket(const char* filename); int snd_pcm_shm_open( snd_pcm_t** pcmp, const char* name, const char* sockname, const char* sname, snd_pcm_stream_t stream, int mode ); int _snd_pcm_shm_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int set_buffer_time( snd_spcm_latency_t latency, unsigned int* buffer_time ); static int set_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* hw_params, unsigned int* rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, unsigned int* buffer_time, unsigned int* period_time, snd_pcm_access_t access ); static int set_sw_params( snd_pcm_t* pcm, snd_pcm_sw_params_t* sw_params, snd_spcm_xrun_type_t xrun_type ); static void softvol_convert_stereo_vol( snd_pcm_softvol_t* svol, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_areas, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames ); static void softvol_convert_mono_vol( snd_pcm_softvol_t* svol, const snd_pcm_channel_area_t* dst_areas, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t* src_areas, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames ); static void get_current_volume(snd_pcm_softvol_t* svol); static void softvol_free(snd_pcm_softvol_t* svol); static int snd_pcm_softvol_close(snd_pcm_t* pcm); static int snd_pcm_softvol_hw_refine_cprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_softvol_hw_refine_sprepare( snd_pcm_t* pcm, snd_pcm_hw_params_t* sparams ); static int check_access_mask( snd_pcm_hw_params_t* src, snd_pcm_hw_params_t* dst ); static int snd_pcm_softvol_hw_refine_schange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_softvol_hw_refine_cchange( snd_pcm_t* pcm, snd_pcm_hw_params_t* params, snd_pcm_hw_params_t* sparams ); static int snd_pcm_softvol_hw_refine( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static int snd_pcm_softvol_hw_params( snd_pcm_t* pcm, snd_pcm_hw_params_t* params ); static snd_pcm_uframes_t snd_pcm_softvol_write_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static snd_pcm_uframes_t snd_pcm_softvol_read_areas( snd_pcm_t* pcm, const snd_pcm_channel_area_t* areas, snd_pcm_uframes_t offset, snd_pcm_uframes_t size, const snd_pcm_channel_area_t* slave_areas, snd_pcm_uframes_t slave_offset, snd_pcm_uframes_t* slave_sizep ); static void snd_pcm_softvol_dump( snd_pcm_t* pcm, snd_output_t* out ); static int add_tlv_info( snd_pcm_softvol_t* svol, snd_ctl_elem_info_t* cinfo ); static int add_user_ctl( snd_pcm_softvol_t* svol, snd_ctl_elem_info_t* cinfo, int count ); static int softvol_load_control( snd_pcm_t* pcm, snd_pcm_softvol_t* svol, int ctl_card, snd_ctl_elem_id_t* ctl_id, int cchannels, double min_dB, double max_dB, int resolution ); int snd_pcm_softvol_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int ctl_card, snd_ctl_elem_id_t* ctl_id, int cchannels, double min_dB, double max_dB, int resolution, snd_pcm_t* slave, int close_slave ); int _snd_pcm_softvol_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode ); static int snd_rawmidi_params_default( snd_rawmidi_t* rawmidi, snd_rawmidi_params_t* params ); static int snd_rawmidi_open_conf( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, const char* name, snd_config_t* rawmidi_root, snd_config_t* rawmidi_conf, int mode ); static int snd_rawmidi_open_noupdate( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, snd_config_t* root, const char* name, int mode ); static int snd_rawmidi_hw_close(snd_rawmidi_t* rmidi); static int snd_rawmidi_hw_nonblock( snd_rawmidi_t* rmidi, int nonblock ); static int snd_rawmidi_hw_info( snd_rawmidi_t* rmidi, snd_rawmidi_info_t* info ); static int snd_rawmidi_hw_params( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params ); static int snd_rawmidi_hw_status( snd_rawmidi_t* rmidi, snd_rawmidi_status_t* status ); static int snd_rawmidi_hw_drop(snd_rawmidi_t* rmidi); static int snd_rawmidi_hw_drain(snd_rawmidi_t* rmidi); static ssize_t snd_rawmidi_hw_write( snd_rawmidi_t* rmidi, const void* buffer, size_t size ); static ssize_t snd_rawmidi_hw_read( snd_rawmidi_t* rmidi, void* buffer, size_t size ); int snd_rawmidi_hw_open( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, const char* name, int card, int device, int subdevice, int mode ); int _snd_rawmidi_hw_open( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_rawmidi_hw_open, SND_RAWMIDI_DLSYM_VERSION ); static int snd_rawmidi_virtual_close(snd_rawmidi_t* rmidi); static int snd_rawmidi_virtual_nonblock( snd_rawmidi_t* rmidi, int nonblock ); static int snd_rawmidi_virtual_info( snd_rawmidi_t* rmidi, snd_rawmidi_info_t* info ); static int snd_rawmidi_virtual_input_params( snd_rawmidi_virtual_t* virt, snd_rawmidi_params_t* params ); static int snd_rawmidi_virtual_output_params( snd_rawmidi_virtual_t* virt, snd_rawmidi_params_t* params ); static int snd_rawmidi_virtual_params( snd_rawmidi_t* rmidi, snd_rawmidi_params_t* params ); static int snd_rawmidi_virtual_status( snd_rawmidi_t* rmidi, snd_rawmidi_status_t* status ); static int snd_rawmidi_virtual_drop(snd_rawmidi_t* rmidi); static int snd_rawmidi_virtual_drain(snd_rawmidi_t* rmidi); static ssize_t snd_rawmidi_virtual_write( snd_rawmidi_t* rmidi, const void* buffer, size_t size ); static ssize_t snd_rawmidi_virtual_read( snd_rawmidi_t* rmidi, void* buffer, size_t size ); int snd_rawmidi_virtual_open( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, const char* name, snd_seq_t* seq_handle, int port, int merge, int mode ); int _snd_rawmidi_virtual_open( snd_rawmidi_t** inputp, snd_rawmidi_t** outputp, char* name, snd_config_t* root, snd_config_t* conf, int mode ); static int snd_seq_open_conf( snd_seq_t** seqp, const char* name, snd_config_t* seq_root, snd_config_t* seq_conf, int streams, int mode ); static int snd_seq_open_noupdate( snd_seq_t** seqp, snd_config_t* root, const char* name, int streams, int mode, int hop ); static int alloc_tmpbuf( snd_seq_t* seq, size_t len ); static ssize_t snd_seq_event_read_buffer(snd_seq_t* seq); static int snd_seq_event_retrieve_buffer( snd_seq_t* seq, snd_seq_event_t** retp ); static int snd_seq_event_input_feed( snd_seq_t* seq, int timeout ); static int snd_seq_compare_tick_time( snd_seq_tick_time_t* a, snd_seq_tick_time_t* b ); static int snd_seq_compare_real_time( snd_seq_real_time_t* a, snd_seq_real_time_t* b ); static int remove_match( snd_seq_remove_events_t* info, snd_seq_event_t* ev ); static int snd_seq_hw_close(snd_seq_t* seq); static int snd_seq_hw_nonblock( snd_seq_t* seq, int nonblock ); static int snd_seq_hw_client_id(snd_seq_t* seq); static int snd_seq_hw_system_info( snd_seq_t* seq, snd_seq_system_info_t* info ); static int snd_seq_hw_get_client_info( snd_seq_t* seq, snd_seq_client_info_t* info ); static int snd_seq_hw_set_client_info( snd_seq_t* seq, snd_seq_client_info_t* info ); static int snd_seq_hw_create_port( snd_seq_t* seq, snd_seq_port_info_t* port ); static int snd_seq_hw_delete_port( snd_seq_t* seq, snd_seq_port_info_t* port ); static int snd_seq_hw_get_port_info( snd_seq_t* seq, snd_seq_port_info_t* info ); static int snd_seq_hw_set_port_info( snd_seq_t* seq, snd_seq_port_info_t* info ); static int snd_seq_hw_get_port_subscription( snd_seq_t* seq, snd_seq_port_subscribe_t* sub ); static int snd_seq_hw_subscribe_port( snd_seq_t* seq, snd_seq_port_subscribe_t* sub ); static int snd_seq_hw_unsubscribe_port( snd_seq_t* seq, snd_seq_port_subscribe_t* sub ); static int snd_seq_hw_query_port_subscribers( snd_seq_t* seq, snd_seq_query_subscribe_t* subs ); static int snd_seq_hw_get_queue_status( snd_seq_t* seq, snd_seq_queue_status_t* status ); static int snd_seq_hw_get_queue_tempo( snd_seq_t* seq, snd_seq_queue_tempo_t* tempo ); static int snd_seq_hw_set_queue_tempo( snd_seq_t* seq, snd_seq_queue_tempo_t* tempo ); static int snd_seq_hw_get_queue_timer( snd_seq_t* seq, snd_seq_queue_timer_t* timer ); static int snd_seq_hw_set_queue_timer( snd_seq_t* seq, snd_seq_queue_timer_t* timer ); static int snd_seq_hw_get_queue_client( snd_seq_t* seq, snd_seq_queue_client_t* info ); static int snd_seq_hw_set_queue_client( snd_seq_t* seq, snd_seq_queue_client_t* info ); static int snd_seq_hw_create_queue( snd_seq_t* seq, snd_seq_queue_info_t* info ); static int snd_seq_hw_delete_queue( snd_seq_t* seq, snd_seq_queue_info_t* info ); static int snd_seq_hw_get_queue_info( snd_seq_t* seq, snd_seq_queue_info_t* info ); static int snd_seq_hw_set_queue_info( snd_seq_t* seq, snd_seq_queue_info_t* info ); static int snd_seq_hw_get_named_queue( snd_seq_t* seq, snd_seq_queue_info_t* info ); static ssize_t snd_seq_hw_write( snd_seq_t* seq, void* buf, size_t len ); static ssize_t snd_seq_hw_read( snd_seq_t* seq, void* buf, size_t len ); static int snd_seq_hw_remove_events( snd_seq_t* seq, snd_seq_remove_events_t* rmp ); static int snd_seq_hw_get_client_pool( snd_seq_t* seq, snd_seq_client_pool_t* info ); static int snd_seq_hw_set_client_pool( snd_seq_t* seq, snd_seq_client_pool_t* info ); static int snd_seq_hw_query_next_client( snd_seq_t* seq, snd_seq_client_info_t* info ); static int snd_seq_hw_query_next_port( snd_seq_t* seq, snd_seq_port_info_t* info ); int snd_seq_hw_open( snd_seq_t** handle, const char* name, int streams, int mode ); int _snd_seq_hw_open( snd_seq_t** handlep, char* name, snd_config_t* root, snd_config_t* conf, int streams, int mode ); SND_DLSYM_BUILD_VERSION( _snd_seq_hw_open, SND_SEQ_DLSYM_VERSION ); static void note_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void one_param_ctrl_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void pitchbend_ctrl_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void two_param_ctrl_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void one_param_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void songpos_event( snd_midi_event_t* dev, snd_seq_event_t* ev ); static void note_decode( const snd_seq_event_t* ev, unsigned char* buf ); static void one_param_decode( const snd_seq_event_t* ev, unsigned char* buf ); static void pitchbend_decode( const snd_seq_event_t* ev, unsigned char* buf ); static void two_param_decode( const snd_seq_event_t* ev, unsigned char* buf ); static void songpos_decode( const snd_seq_event_t* ev, unsigned char* buf ); static void reset_encode(snd_midi_event_t* dev); static int extra_decode_ctrl14( snd_midi_event_t* dev, unsigned char* buf, int count, const snd_seq_event_t* ev ); static int extra_decode_xrpn( snd_midi_event_t* dev, unsigned char* buf, int count, const snd_seq_event_t* ev ); static int snd_timer_open_conf( snd_timer_t** timer, const char* name, snd_config_t* timer_root, snd_config_t* timer_conf, int mode ); static int snd_timer_open_noupdate( snd_timer_t** timer, snd_config_t* root, const char* name, int mode ); const char* snd_timer_name(snd_timer_t* timer); snd_timer_type_t snd_timer_type(snd_timer_t* timer); int snd_timer_nonblock( snd_timer_t* timer, int nonblock ); static int snd_timer_hw_close(snd_timer_t* handle); static int snd_timer_hw_nonblock( snd_timer_t* timer, int nonblock ); static int snd_timer_hw_async( snd_timer_t* timer, int sig, pid_t pid ); static int snd_timer_hw_info( snd_timer_t* handle, snd_timer_info_t* info ); static int snd_timer_hw_params( snd_timer_t* handle, snd_timer_params_t* params ); static int snd_timer_hw_status( snd_timer_t* handle, snd_timer_status_t* status ); static int snd_timer_hw_start(snd_timer_t* handle); static int snd_timer_hw_stop(snd_timer_t* handle); static int snd_timer_hw_continue(snd_timer_t* handle); static ssize_t snd_timer_hw_read( snd_timer_t* handle, void* buffer, size_t size ); int snd_timer_hw_open( snd_timer_t** handle, const char* name, int dev_class, int dev_sclass, int card, int device, int subdevice, int mode ); int _snd_timer_hw_open( snd_timer_t** timer, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_timer_hw_open, SND_TIMER_DLSYM_VERSION ); int snd_timer_hw_open( snd_timer_t** handle, const char* name, int dev_class, int dev_sclass, int card, int device, int subdevice, int mode ); int snd_timer_query_hw_open( snd_timer_query_t** handle, const char* name, int mode ); int snd_timer_async( snd_timer_t* timer, int sig, pid_t pid ); static int snd_timer_query_open_conf( snd_timer_query_t** timer, const char* name, snd_config_t* timer_root, snd_config_t* timer_conf, int mode ); static int snd_timer_query_open_noupdate( snd_timer_query_t** timer, snd_config_t* root, const char* name, int mode ); static int snd_timer_query_hw_close(snd_timer_query_t* handle); static int snd_timer_query_hw_next_device( snd_timer_query_t* handle, snd_timer_id_t* tid ); static int snd_timer_query_hw_info( snd_timer_query_t* handle, snd_timer_ginfo_t* info ); static int snd_timer_query_hw_params( snd_timer_query_t* handle, snd_timer_gparams_t* params ); static int snd_timer_query_hw_status( snd_timer_query_t* handle, snd_timer_gstatus_t* status ); int snd_timer_query_hw_open( snd_timer_query_t** handle, const char* name, int mode ); int _snd_timer_query_hw_open( snd_timer_query_t** timer, char* name, snd_config_t* root, snd_config_t* conf, int mode ); SND_DLSYM_BUILD_VERSION( _snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION ); static void verbose( snd_tplg_t* tplg, const char* fmt, ... ); static int write_block_header( snd_tplg_t* tplg, unsigned int type, unsigned int vendor_type, unsigned int version, unsigned int index, size_t payload_size, int count ); static int write_elem_block( snd_tplg_t* tplg, struct list_head* base, int size, int tplg_type, const char* obj_name ); static int calc_block_size(struct list_head* base); static int write_block( snd_tplg_t* tplg, struct list_head* base, int type ); static int write_manifest_data(snd_tplg_t* tplg); int tplg_write_data(snd_tplg_t* tplg); static int lookup_channel(const char* c); int tplg_parse_channel( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int parse_access_values( snd_config_t* cfg, struct snd_soc_tplg_ctl_hdr* hdr ); int parse_access( snd_config_t* cfg, struct snd_soc_tplg_ctl_hdr* hdr ); static int copy_tlv( struct tplg_elem* elem, struct tplg_elem* ref ); static int tplg_build_mixer_control( snd_tplg_t* tplg, struct tplg_elem* elem ); static void copy_enum_texts( struct tplg_elem* enum_elem, struct tplg_elem* ref_elem ); static int tplg_build_enum_control( snd_tplg_t* tplg, struct tplg_elem* elem ); static int tplg_build_bytes_control( snd_tplg_t* tplg, struct tplg_elem* elem ); int tplg_build_controls(snd_tplg_t* tplg); static int tplg_parse_tlv_dbscale( snd_config_t* cfg, struct tplg_elem* elem ); int tplg_parse_tlv( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_control_bytes( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_control_enum( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_control_mixer( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int init_ctl_hdr( struct snd_soc_tplg_ctl_hdr* hdr, struct snd_tplg_ctl_template* t ); int tplg_add_mixer( snd_tplg_t* tplg, struct snd_tplg_mixer_template* mixer, struct tplg_elem** e ); int tplg_add_enum( snd_tplg_t* tplg, struct snd_tplg_enum_template* enum_ctl, struct tplg_elem** e ); int tplg_add_bytes( snd_tplg_t* tplg, struct snd_tplg_bytes_template* bytes_ctl, struct tplg_elem** e ); int tplg_add_mixer_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); int tplg_add_enum_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); int tplg_add_bytes_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); static int lookup_widget(const char* w); static int tplg_parse_dapm_mixers( snd_config_t* cfg, struct tplg_elem* elem ); static int tplg_parse_dapm_enums( snd_config_t* cfg, struct tplg_elem* elem ); static int tplg_parse_dapm_bytes( snd_config_t* cfg, struct tplg_elem* elem ); static int copy_dapm_control( struct tplg_elem* elem, struct tplg_elem* ref ); static int tplg_build_widget( snd_tplg_t* tplg, struct tplg_elem* elem ); int tplg_build_widgets(snd_tplg_t* tplg); int tplg_build_routes(snd_tplg_t* tplg); struct tplg_elem* tplg_elem_new_route(snd_tplg_t* tplg); static int tplg_parse_line( const char* text, struct snd_soc_tplg_dapm_graph_elem* line ); static int tplg_parse_routes( snd_tplg_t* tplg, snd_config_t* cfg ); int tplg_parse_dapm_graph( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_dapm_widget( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_add_route( snd_tplg_t* tplg, struct snd_tplg_graph_elem* t ); int tplg_add_graph_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); int tplg_add_widget_object( snd_tplg_t* tplg, snd_tplg_obj_template_t* t ); struct snd_soc_tplg_private* get_priv_data(struct tplg_elem* elem); static int tplg_parse_data_file( snd_config_t* cfg, struct tplg_elem* elem ); static void dump_priv_data(struct tplg_elem* elem); static int get_hex_num(const char* str); static int get_uuid( const char* str, unsigned char* uuid_le ); static int write_hex( char* buf, char* str, int width ); static int copy_data_hex( char* data, int off, const char* str, int width ); static int tplg_parse_data_hex( snd_config_t* cfg, struct tplg_elem* elem, int width ); static int get_token_value( const char* token_id, struct tplg_vendor_tokens* tokens ); static struct tplg_elem* get_tokens( snd_tplg_t* tplg, struct tplg_elem* elem ); static bool has_tuples(struct tplg_elem* elem); static unsigned int get_tuple_size(int type); static int copy_tuples( struct tplg_elem* elem, struct tplg_vendor_tuples* tuples, struct tplg_vendor_tokens* tokens ); static int build_tuples( snd_tplg_t* tplg, struct tplg_elem* elem ); static int parse_tuple_set( snd_config_t* cfg, struct tplg_tuple_set** s ); static int parse_tuple_sets( snd_config_t* cfg, struct tplg_vendor_tuples* tuples ); int tplg_parse_data_refs( snd_config_t* cfg, struct tplg_elem* elem ); int tplg_parse_tokens( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_tuples( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); void tplg_free_tuples(void* obj); int tplg_parse_manifest_data( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_build_manifest_data(snd_tplg_t* tplg); int tplg_parse_data( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_copy_data( snd_tplg_t* tplg, struct tplg_elem* elem, struct tplg_ref* ref ); int tplg_build_data(snd_tplg_t* tplg); int tplg_ref_add( struct tplg_elem* elem, int type, const char* id ); int tplg_ref_add_elem( struct tplg_elem* elem, struct tplg_elem* elem_ref ); void tplg_ref_free_list(struct list_head* base); struct tplg_elem* tplg_elem_new(void); void tplg_elem_free(struct tplg_elem* elem); void tplg_elem_free_list(struct list_head* base); struct tplg_elem* tplg_elem_lookup( struct list_head* base, const char* id, unsigned int type ); struct tplg_elem* tplg_elem_new_common( snd_tplg_t* tplg, snd_config_t* cfg, const char* name, enum snd_tplg_type type ); static int lookup_ops(const char* c); int tplg_parse_ops( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); int tplg_parse_ext_ops( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int parse_text_values( snd_config_t* cfg, struct tplg_elem* elem ); int tplg_parse_text( snd_tplg_t* tplg, snd_config_t* cfg, void* private ); static int get_value1( char** value, struct list_head* value_list, const char* identifier ); static int get_value3( char** value, const char* identifier, struct list_head* value_list1, struct list_head* value_list2, struct list_head* value_list3 ); static int execute_component_seq( snd_use_case_mgr_t* uc_mgr, struct component_sequence* cmpt_seq, struct list_head* value_list1, struct list_head* value_list2, struct list_head* value_list3, char* cdev ); static int check_identifier( const char* identifier, const char* prefix ); static int list_count(struct list_head* list); static int alloc_str_list( struct list_head* list, int mult, char** result[] ); static int open_ctl( snd_use_case_mgr_t* uc_mgr, snd_ctl_t** ctl, const char* ctl_dev ); static int read_tlv_file( unsigned int** res, const char* filepath ); static int binary_file_parse( snd_ctl_elem_value_t* dst, snd_ctl_elem_info_t* info, const char* filepath ); int __snd_ctl_ascii_elem_id_parse( snd_ctl_elem_id_t* dst, const char* str, const char** ret_ptr ); static int execute_cset( snd_ctl_t* ctl, const char* cset, unsigned int type ); static int execute_sequence( snd_use_case_mgr_t* uc_mgr, struct list_head* seq, struct list_head* value_list1, struct list_head* value_list2, struct list_head* value_list3 ); static int import_master_config(snd_use_case_mgr_t* uc_mgr); static void* find0( struct list_head* list, unsigned long offset, unsigned long soffset, const char* match ); static int get_list0( struct list_head* list, const char** result[], unsigned long offset, unsigned long s1offset ); static int get_list20( struct list_head* list, const char** result[], unsigned long offset, unsigned long s1offset, unsigned long s2offset ); static struct use_case_verb* find_verb( snd_use_case_mgr_t* uc_mgr, const char* verb_name ); static int is_devlist_supported( snd_use_case_mgr_t* uc_mgr, struct dev_list* dev_list ); static int is_modifier_supported( snd_use_case_mgr_t* uc_mgr, struct use_case_modifier* modifier ); static int is_device_supported( snd_use_case_mgr_t* uc_mgr, struct use_case_device* device ); static struct use_case_device* find_device( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, const char* device_name, int check_supported ); static struct use_case_modifier* find_modifier( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, const char* modifier_name, int check_supported ); long device_status( snd_use_case_mgr_t* uc_mgr, const char* device_name ); long modifier_status( snd_use_case_mgr_t* uc_mgr, const char* modifier_name ); static int set_verb( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, int enable ); static int set_modifier( snd_use_case_mgr_t* uc_mgr, struct use_case_modifier* modifier, int enable ); static int set_device( snd_use_case_mgr_t* uc_mgr, struct use_case_device* device, int enable ); static int dismantle_use_case(snd_use_case_mgr_t* uc_mgr); static int get_verb_list( snd_use_case_mgr_t* uc_mgr, const char** list[] ); static int get_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* verbname ); static int get_modifier_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* verbname ); static int get_supcon_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name, enum dev_list_type type ); static int get_supported_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name ); static int get_conflicting_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name ); static int add_values( struct list_head* list, const char* identifier, struct list_head* source ); static int get_value_list( snd_use_case_mgr_t* uc_mgr, const char* identifier, const char** list[], char* verbname ); static int get_enabled_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[] ); static int get_enabled_modifier_list( snd_use_case_mgr_t* uc_mgr, const char** list[] ); static int get_value( snd_use_case_mgr_t* uc_mgr, const char* identifier, char** value, const char* mod_dev_name, const char* verb_name, int exact ); static int handle_transition_verb( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* new_verb ); static int set_verb_user( snd_use_case_mgr_t* uc_mgr, const char* verb_name ); static int set_device_user( snd_use_case_mgr_t* uc_mgr, const char* device_name, int enable ); static int set_modifier_user( snd_use_case_mgr_t* uc_mgr, const char* modifier_name, int enable ); static int switch_device( snd_use_case_mgr_t* uc_mgr, const char* old_device, const char* new_device ); static int switch_modifier( snd_use_case_mgr_t* uc_mgr, const char* old_modifier, const char* new_modifier ); static int parse_sequence( snd_use_case_mgr_t* uc_mgr, struct list_head* base, snd_config_t* cfg ); int parse_string( snd_config_t* n, char** res ); int parse_is_name_safe(const char* name); int parse_get_safe_id( snd_config_t* n, const char** id ); static int parse_transition( snd_use_case_mgr_t* uc_mgr, struct list_head* tlist, snd_config_t* cfg ); static int parse_compound( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, int(*)(snd_use_case_mgr_t*, snd_config_t*, void*, void*) fcn, void* data1, void* data2 ); static int strip_legacy_dev_index(char* name); static int parse_device_list( snd_use_case_mgr_t* uc_mgr, struct dev_list* dev_list, enum dev_list_type type, snd_config_t* cfg ); struct use_case_device* find_component_dev( snd_use_case_mgr_t* uc_mgr, const char* name ); static int parse_component_seq( snd_use_case_mgr_t* uc_mgr, snd_config_t* n, int enable, struct component_sequence* cmpt_seq ); static int parse_value( snd_use_case_mgr_t* uc_mgr, struct list_head* base, snd_config_t* cfg ); static int parse_modifier( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, void* data1, void* data2 ); static int parse_device( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, void* data1, void* data2 ); static int parse_compound_check_legacy( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, int(*)(snd_use_case_mgr_t*, snd_config_t*, void*, void*) fcn, void* data1 ); static int parse_device_name( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, void* data1, void* data2 ); static int parse_modifier_name( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, void* data1, void* data2 ); static int parse_verb( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, snd_config_t* cfg ); static int parse_verb_file( snd_use_case_mgr_t* uc_mgr, const char* use_case_name, const char* comment, const char* file ); static int parse_master_section( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg, void* data1, void* data2 ); static int parse_controls( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg ); static int parse_master_file( snd_use_case_mgr_t* uc_mgr, snd_config_t* cfg ); static int load_master_config( const char* card_name, snd_config_t** cfg ); int uc_mgr_import_master_config(snd_use_case_mgr_t* uc_mgr); static int filename_filter(const struct dirent* dirent); static int is_component_directory(const char* dir); int uc_mgr_scan_master_configs(const char** _list[]); int tplg_parse_compound( snd_tplg_t* tplg, snd_config_t* cfg, int(*)(snd_tplg_t*, snd_config_t*, void*) fcn, void* private ); static int tplg_parse_config( snd_tplg_t* tplg, snd_config_t* cfg ); static int tplg_load_config( const char* file, snd_config_t** cfg ); static int tplg_build_integ(snd_tplg_t* tplg); static bool is_little_endian(void); void uc_mgr_error( const char* fmt, ... ); void uc_mgr_stdout( const char* fmt, ... ); int uc_mgr_config_load( const char* file, snd_config_t** cfg ); void uc_mgr_free_value(struct list_head* base); void uc_mgr_free_dev_list(struct dev_list* dev_list); void uc_mgr_free_sequence_element(struct sequence_element* seq); void uc_mgr_free_sequence(struct list_head* base); void uc_mgr_free_transition_element(struct transition_sequence* tseq); void uc_mgr_free_transition(struct list_head* base); void uc_mgr_free_modifier(struct list_head* base); void uc_mgr_free_device(struct list_head* base); void uc_mgr_free_verb(snd_use_case_mgr_t* uc_mgr); void uc_mgr_free(snd_use_case_mgr_t* uc_mgr); // macros #define ALSA_CONFIG_PATH_DEFAULT #define ALSA_CONFIG_PATH_VAR #define ALSA_CONFIG_UCM_VAR #define ENUM_VAL_SIZE #define F_SETSIG #define GET_VOL_SCALE #define IEC958_AES0_CON_EMPHASIS #define IEC958_AES0_CON_EMPHASIS_5015 #define IEC958_AES0_CON_EMPHASIS_NONE #define IEC958_AES0_CON_MODE #define IEC958_AES0_CON_NOT_COPYRIGHT #define IEC958_AES0_NONAUDIO #define IEC958_AES0_PROFESSIONAL #define IEC958_AES0_PRO_EMPHASIS #define IEC958_AES0_PRO_EMPHASIS_5015 #define IEC958_AES0_PRO_EMPHASIS_CCITT #define IEC958_AES0_PRO_EMPHASIS_NONE #define IEC958_AES0_PRO_EMPHASIS_NOTID #define IEC958_AES0_PRO_FREQ_UNLOCKED #define IEC958_AES0_PRO_FS #define IEC958_AES0_PRO_FS_32000 #define IEC958_AES0_PRO_FS_44100 #define IEC958_AES0_PRO_FS_48000 #define IEC958_AES0_PRO_FS_NOTID #define IEC958_AES1_CON_ADC #define IEC958_AES1_CON_ADC_COPYRIGHT #define IEC958_AES1_CON_ADC_COPYRIGHT_ID #define IEC958_AES1_CON_ADC_COPYRIGHT_MASK #define IEC958_AES1_CON_ADC_COPYRIGHT_OTHER #define IEC958_AES1_CON_ADC_ID #define IEC958_AES1_CON_ADC_MASK #define IEC958_AES1_CON_ADC_OTHER #define IEC958_AES1_CON_BROADCAST1_ID #define IEC958_AES1_CON_BROADCAST1_MASK #define IEC958_AES1_CON_BROADCAST1_OTHER #define IEC958_AES1_CON_BROADCAST2_ID #define IEC958_AES1_CON_BROADCAST2_MASK #define IEC958_AES1_CON_CATEGORY #define IEC958_AES1_CON_DAB_EUROPE #define IEC958_AES1_CON_DAB_JAPAN #define IEC958_AES1_CON_DAB_USA #define IEC958_AES1_CON_DAT #define IEC958_AES1_CON_DCC #define IEC958_AES1_CON_DIGDIGCONV_ID #define IEC958_AES1_CON_DIGDIGCONV_MASK #define IEC958_AES1_CON_DIGDIGCONV_OTHER #define IEC958_AES1_CON_DSP #define IEC958_AES1_CON_DVD #define IEC958_AES1_CON_EXPERIMENTAL #define IEC958_AES1_CON_GENERAL #define IEC958_AES1_CON_IEC62105 #define IEC958_AES1_CON_IEC908_CD #define IEC958_AES1_CON_LASEROPT_ID #define IEC958_AES1_CON_LASEROPT_MASK #define IEC958_AES1_CON_LASTEROPT_OTHER #define IEC958_AES1_CON_MAGNETIC_DISC #define IEC958_AES1_CON_MAGNETIC_ID #define IEC958_AES1_CON_MAGNETIC_MASK #define IEC958_AES1_CON_MAGNETIC_OTHER #define IEC958_AES1_CON_MICROPHONE #define IEC958_AES1_CON_MINI_DISC #define IEC958_AES1_CON_MIXER #define IEC958_AES1_CON_MUSICAL_ID #define IEC958_AES1_CON_MUSICAL_MASK #define IEC958_AES1_CON_MUSICAL_OTHER #define IEC958_AES1_CON_NON_IEC908_CD #define IEC958_AES1_CON_ORIGINAL #define IEC958_AES1_CON_PCM_CODER #define IEC958_AES1_CON_RATE_CONVERTER #define IEC958_AES1_CON_SAMPLER #define IEC958_AES1_CON_SOFTWARE #define IEC958_AES1_CON_SOLIDMEM_DIGITAL_RECORDER_PLAYER #define IEC958_AES1_CON_SOLIDMEM_ID #define IEC958_AES1_CON_SOLIDMEM_MASK #define IEC958_AES1_CON_SOLIDMEM_OTHER #define IEC958_AES1_CON_SYNTHESIZER #define IEC958_AES1_CON_VCR #define IEC958_AES1_PRO_MODE #define IEC958_AES1_PRO_MODE_BYTE3 #define IEC958_AES1_PRO_MODE_NOTID #define IEC958_AES1_PRO_MODE_PRIMARY #define IEC958_AES1_PRO_MODE_SINGLE #define IEC958_AES1_PRO_MODE_STEREOPHONIC #define IEC958_AES1_PRO_MODE_TWO #define IEC958_AES1_PRO_USERBITS #define IEC958_AES1_PRO_USERBITS_192 #define IEC958_AES1_PRO_USERBITS_NOTID #define IEC958_AES1_PRO_USERBITS_UDEF #define IEC958_AES2_CON_CHANNEL #define IEC958_AES2_CON_CHANNEL_UNSPEC #define IEC958_AES2_CON_SOURCE #define IEC958_AES2_CON_SOURCE_UNSPEC #define IEC958_AES2_PRO_SBITS #define IEC958_AES2_PRO_SBITS_20 #define IEC958_AES2_PRO_SBITS_24 #define IEC958_AES2_PRO_SBITS_UDEF #define IEC958_AES2_PRO_WORDLEN #define IEC958_AES2_PRO_WORDLEN_20_16 #define IEC958_AES2_PRO_WORDLEN_22_18 #define IEC958_AES2_PRO_WORDLEN_23_19 #define IEC958_AES2_PRO_WORDLEN_24_20 #define IEC958_AES2_PRO_WORDLEN_NOTID #define IEC958_AES3_CON_CLOCK #define IEC958_AES3_CON_CLOCK_1000PPM #define IEC958_AES3_CON_CLOCK_50PPM #define IEC958_AES3_CON_CLOCK_VARIABLE #define IEC958_AES3_CON_FS #define IEC958_AES3_CON_FS_176400 #define IEC958_AES3_CON_FS_192000 #define IEC958_AES3_CON_FS_22050 #define IEC958_AES3_CON_FS_24000 #define IEC958_AES3_CON_FS_32000 #define IEC958_AES3_CON_FS_44100 #define IEC958_AES3_CON_FS_48000 #define IEC958_AES3_CON_FS_768000 #define IEC958_AES3_CON_FS_88200 #define IEC958_AES3_CON_FS_96000 #define IEC958_AES3_CON_FS_NOTID #define IEC958_AES4_CON_MAX_WORDLEN_24 #define IEC958_AES4_CON_ORIGFS #define IEC958_AES4_CON_ORIGFS_11025 #define IEC958_AES4_CON_ORIGFS_12000 #define IEC958_AES4_CON_ORIGFS_16000 #define IEC958_AES4_CON_ORIGFS_176400 #define IEC958_AES4_CON_ORIGFS_192000 #define IEC958_AES4_CON_ORIGFS_22050 #define IEC958_AES4_CON_ORIGFS_24000 #define IEC958_AES4_CON_ORIGFS_32000 #define IEC958_AES4_CON_ORIGFS_44100 #define IEC958_AES4_CON_ORIGFS_48000 #define IEC958_AES4_CON_ORIGFS_8000 #define IEC958_AES4_CON_ORIGFS_88200 #define IEC958_AES4_CON_ORIGFS_96000 #define IEC958_AES4_CON_ORIGFS_NOTID #define IEC958_AES4_CON_WORDLEN #define IEC958_AES4_CON_WORDLEN_20_16 #define IEC958_AES4_CON_WORDLEN_21_17 #define IEC958_AES4_CON_WORDLEN_22_18 #define IEC958_AES4_CON_WORDLEN_23_19 #define IEC958_AES4_CON_WORDLEN_24_20 #define IEC958_AES4_CON_WORDLEN_NOTID #define IEC958_AES5_CON_CGMSA #define IEC958_AES5_CON_CGMSA_COPYFREELY #define IEC958_AES5_CON_CGMSA_COPYNEVER #define IEC958_AES5_CON_CGMSA_COPYNOMORE #define IEC958_AES5_CON_CGMSA_COPYONCE #define LINE_SIZE #define MAX_CHMAP_CHANNELS #define MAX_SIG_FUNCTION_CODE #define MIDI_CHANNELS #define MIDI_CMD_BENDER #define MIDI_CMD_CHANNEL_PRESSURE #define MIDI_CMD_COMMON_CLOCK #define MIDI_CMD_COMMON_CONTINUE #define MIDI_CMD_COMMON_MTC_QUARTER #define MIDI_CMD_COMMON_RESET #define MIDI_CMD_COMMON_SENSING #define MIDI_CMD_COMMON_SONG_POS #define MIDI_CMD_COMMON_SONG_SELECT #define MIDI_CMD_COMMON_START #define MIDI_CMD_COMMON_STOP #define MIDI_CMD_COMMON_SYSEX #define MIDI_CMD_COMMON_SYSEX_END #define MIDI_CMD_COMMON_TUNE_REQUEST #define MIDI_CMD_CONTROL #define MIDI_CMD_NOTE_OFF #define MIDI_CMD_NOTE_ON #define MIDI_CMD_NOTE_PRESSURE #define MIDI_CMD_PGM_CHANGE #define MIDI_CTL_ALL_NOTES_OFF #define MIDI_CTL_ALL_SOUNDS_OFF #define MIDI_CTL_DATA_DECREMENT #define MIDI_CTL_DATA_INCREMENT #define MIDI_CTL_E1_REVERB_DEPTH #define MIDI_CTL_E2_TREMOLO_DEPTH #define MIDI_CTL_E3_CHORUS_DEPTH #define MIDI_CTL_E4_DETUNE_DEPTH #define MIDI_CTL_E5_PHASER_DEPTH #define MIDI_CTL_GENERAL_PURPOSE5 #define MIDI_CTL_GENERAL_PURPOSE6 #define MIDI_CTL_GENERAL_PURPOSE7 #define MIDI_CTL_GENERAL_PURPOSE8 #define MIDI_CTL_HOLD2 #define MIDI_CTL_LEGATO_FOOTSWITCH #define MIDI_CTL_LOCAL_CONTROL_SWITCH #define MIDI_CTL_LSB_BALANCE #define MIDI_CTL_LSB_BANK #define MIDI_CTL_LSB_BREATH #define MIDI_CTL_LSB_DATA_ENTRY #define MIDI_CTL_LSB_EFFECT1 #define MIDI_CTL_LSB_EFFECT2 #define MIDI_CTL_LSB_EXPRESSION #define MIDI_CTL_LSB_FOOT #define MIDI_CTL_LSB_GENERAL_PURPOSE1 #define MIDI_CTL_LSB_GENERAL_PURPOSE2 #define MIDI_CTL_LSB_GENERAL_PURPOSE3 #define MIDI_CTL_LSB_GENERAL_PURPOSE4 #define MIDI_CTL_LSB_MAIN_VOLUME #define MIDI_CTL_LSB_MODWHEEL #define MIDI_CTL_LSB_PAN #define MIDI_CTL_LSB_PORTAMENTO_TIME #define MIDI_CTL_MONO1 #define MIDI_CTL_MONO2 #define MIDI_CTL_MSB_BALANCE #define MIDI_CTL_MSB_BANK #define MIDI_CTL_MSB_BREATH #define MIDI_CTL_MSB_DATA_ENTRY #define MIDI_CTL_MSB_EFFECT1 #define MIDI_CTL_MSB_EFFECT2 #define MIDI_CTL_MSB_EXPRESSION #define MIDI_CTL_MSB_FOOT #define MIDI_CTL_MSB_GENERAL_PURPOSE1 #define MIDI_CTL_MSB_GENERAL_PURPOSE2 #define MIDI_CTL_MSB_GENERAL_PURPOSE3 #define MIDI_CTL_MSB_GENERAL_PURPOSE4 #define MIDI_CTL_MSB_MAIN_VOLUME #define MIDI_CTL_MSB_MODWHEEL #define MIDI_CTL_MSB_PAN #define MIDI_CTL_MSB_PORTAMENTO_TIME #define MIDI_CTL_NONREG_PARM_NUM_LSB #define MIDI_CTL_NONREG_PARM_NUM_MSB #define MIDI_CTL_OMNI_OFF #define MIDI_CTL_OMNI_ON #define MIDI_CTL_PORTAMENTO #define MIDI_CTL_PORTAMENTO_CONTROL #define MIDI_CTL_REGIST_PARM_NUM_LSB #define MIDI_CTL_REGIST_PARM_NUM_MSB #define MIDI_CTL_RESET_CONTROLLERS #define MIDI_CTL_SC10 #define MIDI_CTL_SC1_SOUND_VARIATION #define MIDI_CTL_SC2_TIMBRE #define MIDI_CTL_SC3_RELEASE_TIME #define MIDI_CTL_SC4_ATTACK_TIME #define MIDI_CTL_SC5_BRIGHTNESS #define MIDI_CTL_SC6 #define MIDI_CTL_SC7 #define MIDI_CTL_SC8 #define MIDI_CTL_SC9 #define MIDI_CTL_SOFT_PEDAL #define MIDI_CTL_SOSTENUTO #define MIDI_CTL_SUSTAIN #define MIDI_CTL_SUSTENUTO #define MIDI_GM_DRUM_CHANNEL #define SNDERR(args...) #define SNDRV_FILE_HWDEP #define SNDRV_FILE_RAWMIDI #define SNDRV_FILE_TIMER #define SNDRV_FILE_TIMER #define SNDRV_HWDEP_VERSION_MAX #define SNDRV_RAWMIDI_VERSION_MAX #define SNDRV_TIMER_IOCTL_STATUS_OLD #define SNDRV_TIMER_VERSION_MAX #define SNDRV_TIMER_VERSION_MAX #define SND_CHMAP_API_VERSION #define SND_CHMAP_DRIVER_SPEC #define SND_CHMAP_PHASE_INVERSE #define SND_CHMAP_POSITION_MASK #define SND_CONFIG_DLSYM_VERSION_EVALUATE #define SND_CONFIG_DLSYM_VERSION_HOOK #define SND_CONTROL_DLSYM_VERSION #define SND_CTL_ASYNC #define SND_CTL_EVENT_MASK_ADD #define SND_CTL_EVENT_MASK_INFO #define SND_CTL_EVENT_MASK_REMOVE #define SND_CTL_EVENT_MASK_TLV #define SND_CTL_EVENT_MASK_VALUE #define SND_CTL_EXT_KEY_NOT_FOUND #define SND_CTL_EXT_VERSION #define SND_CTL_EXT_VERSION_MAJOR #define SND_CTL_EXT_VERSION_MINOR #define SND_CTL_EXT_VERSION_TINY #define SND_CTL_NAME_CAPTURE #define SND_CTL_NAME_IEC958( \ expl, \ direction, \ what \ ) #define SND_CTL_NAME_IEC958_CON_MASK #define SND_CTL_NAME_IEC958_DEFAULT #define SND_CTL_NAME_IEC958_MASK #define SND_CTL_NAME_IEC958_NONE #define SND_CTL_NAME_IEC958_PCM_STREAM #define SND_CTL_NAME_IEC958_PRO_MASK #define SND_CTL_NAME_IEC958_SWITCH #define SND_CTL_NAME_IEC958_VOLUME #define SND_CTL_NAME_NONE #define SND_CTL_NAME_PLAYBACK #define SND_CTL_NONBLOCK #define SND_CTL_PLUGIN_DEFINE_FUNC(plugin) #define SND_CTL_PLUGIN_ENTRY(name) #define SND_CTL_PLUGIN_SYMBOL(name) #define SND_CTL_POWER_D0 #define SND_CTL_POWER_D1 #define SND_CTL_POWER_D2 #define SND_CTL_POWER_D3 #define SND_CTL_POWER_D3cold #define SND_CTL_POWER_D3hot #define SND_CTL_POWER_MASK #define SND_CTL_READONLY #define SND_CTL_TLVT_CHMAP_FIXED #define SND_CTL_TLVT_CHMAP_PAIRED #define SND_CTL_TLVT_CHMAP_VAR #define SND_CTL_TLVT_CONTAINER #define SND_CTL_TLVT_DB_LINEAR #define SND_CTL_TLVT_DB_MINMAX #define SND_CTL_TLVT_DB_MINMAX_MUTE #define SND_CTL_TLVT_DB_RANGE #define SND_CTL_TLVT_DB_SCALE #define SND_CTL_TLV_DB_GAIN_MUTE #define SND_DLSYM_BUILD_VERSION( \ name, \ version \ ) #define SND_DLSYM_VERSION(version) #define SND_ERROR_ALISP_NIL #define SND_ERROR_BEGIN #define SND_ERROR_INCOMPATIBLE_VERSION #define SND_HWDEP_DLSYM_VERSION #define SND_HWDEP_OPEN_DUPLEX #define SND_HWDEP_OPEN_NONBLOCK #define SND_HWDEP_OPEN_READ #define SND_HWDEP_OPEN_WRITE #define SND_LIB_EXTRAVER #define SND_LIB_MAJOR #define SND_LIB_MINOR #define SND_LIB_SUBMINOR #define SND_LIB_VERSION #define SND_LIB_VERSION_STR #define SND_PCM_ABORT #define SND_PCM_ASYNC #define SND_PCM_DLSYM_VERSION #define SND_PCM_EXTPLUG_VERSION #define SND_PCM_EXTPLUG_VERSION_MAJOR #define SND_PCM_EXTPLUG_VERSION_MINOR #define SND_PCM_EXTPLUG_VERSION_TINY #define SND_PCM_IOPLUG_FLAG_LISTED #define SND_PCM_IOPLUG_FLAG_MONOTONIC #define SND_PCM_IOPLUG_VERSION #define SND_PCM_IOPLUG_VERSION_MAJOR #define SND_PCM_IOPLUG_VERSION_MINOR #define SND_PCM_IOPLUG_VERSION_TINY #define SND_PCM_NONBLOCK #define SND_PCM_NO_AUTO_CHANNELS #define SND_PCM_NO_AUTO_FORMAT #define SND_PCM_NO_AUTO_RESAMPLE #define SND_PCM_NO_SOFTVOL #define SND_PCM_PLUGIN_DEFINE_FUNC(plugin) #define SND_PCM_PLUGIN_ENTRY(name) #define SND_PCM_PLUGIN_SYMBOL(name) #define SND_RAWMIDI_APPEND #define SND_RAWMIDI_DLSYM_VERSION #define SND_RAWMIDI_NONBLOCK #define SND_RAWMIDI_SYNC #define SND_SCTL_NOFREE #define SND_SEQ_ADDRESS_BROADCAST #define SND_SEQ_ADDRESS_SUBSCRIBERS #define SND_SEQ_ADDRESS_UNKNOWN #define SND_SEQ_CLIENT_SYSTEM #define SND_SEQ_DLSYM_VERSION #define SND_SEQ_EVENT_LENGTH_FIXED #define SND_SEQ_EVENT_LENGTH_MASK #define SND_SEQ_EVENT_LENGTH_VARIABLE #define SND_SEQ_EVENT_LENGTH_VARUSR #define SND_SEQ_NONBLOCK #define SND_SEQ_OPEN_DUPLEX #define SND_SEQ_OPEN_INPUT #define SND_SEQ_OPEN_OUTPUT #define SND_SEQ_PORT_CAP_DUPLEX #define SND_SEQ_PORT_CAP_NO_EXPORT #define SND_SEQ_PORT_CAP_READ #define SND_SEQ_PORT_CAP_SUBS_READ #define SND_SEQ_PORT_CAP_SUBS_WRITE #define SND_SEQ_PORT_CAP_SYNC_READ #define SND_SEQ_PORT_CAP_SYNC_WRITE #define SND_SEQ_PORT_CAP_WRITE #define SND_SEQ_PORT_SYSTEM_ANNOUNCE #define SND_SEQ_PORT_SYSTEM_TIMER #define SND_SEQ_PORT_TYPE_APPLICATION #define SND_SEQ_PORT_TYPE_DIRECT_SAMPLE #define SND_SEQ_PORT_TYPE_HARDWARE #define SND_SEQ_PORT_TYPE_MIDI_GENERIC #define SND_SEQ_PORT_TYPE_MIDI_GM #define SND_SEQ_PORT_TYPE_MIDI_GM2 #define SND_SEQ_PORT_TYPE_MIDI_GS #define SND_SEQ_PORT_TYPE_MIDI_MT32 #define SND_SEQ_PORT_TYPE_MIDI_XG #define SND_SEQ_PORT_TYPE_PORT #define SND_SEQ_PORT_TYPE_SAMPLE #define SND_SEQ_PORT_TYPE_SOFTWARE #define SND_SEQ_PORT_TYPE_SPECIFIC #define SND_SEQ_PORT_TYPE_SYNTH #define SND_SEQ_PORT_TYPE_SYNTHESIZER #define SND_SEQ_PRIORITY_HIGH #define SND_SEQ_PRIORITY_MASK #define SND_SEQ_PRIORITY_NORMAL #define SND_SEQ_QUEUE_DIRECT #define SND_SEQ_REMOVE_DEST #define SND_SEQ_REMOVE_DEST_CHANNEL #define SND_SEQ_REMOVE_EVENT_TYPE #define SND_SEQ_REMOVE_IGNORE_OFF #define SND_SEQ_REMOVE_INPUT #define SND_SEQ_REMOVE_OUTPUT #define SND_SEQ_REMOVE_TAG_MATCH #define SND_SEQ_REMOVE_TIME_AFTER #define SND_SEQ_REMOVE_TIME_BEFORE #define SND_SEQ_REMOVE_TIME_TICK #define SND_SEQ_TIME_MODE_ABS #define SND_SEQ_TIME_MODE_MASK #define SND_SEQ_TIME_MODE_REL #define SND_SEQ_TIME_STAMP_MASK #define SND_SEQ_TIME_STAMP_REAL #define SND_SEQ_TIME_STAMP_TICK #define SND_TIMER_DLSYM_VERSION #define SND_TIMER_GLOBAL_HPET #define SND_TIMER_GLOBAL_HRTIMER #define SND_TIMER_GLOBAL_RTC #define SND_TIMER_GLOBAL_SYSTEM #define SND_TIMER_OPEN_NONBLOCK #define SND_TIMER_OPEN_TREAD #define SND_TIMER_QUERY_DLSYM_VERSION #define SND_TPLG_MAX_CHAN #define SND_USE_CASE_DEV_BLUETOOTH #define SND_USE_CASE_DEV_EARPIECE #define SND_USE_CASE_DEV_HANDSET #define SND_USE_CASE_DEV_HDMI #define SND_USE_CASE_DEV_HEADPHONES #define SND_USE_CASE_DEV_HEADSET #define SND_USE_CASE_DEV_LINE #define SND_USE_CASE_DEV_NONE #define SND_USE_CASE_DEV_SPDIF #define SND_USE_CASE_DEV_SPEAKER #define SND_USE_CASE_MOD_CAPTURE_MUSIC #define SND_USE_CASE_MOD_CAPTURE_VOICE #define SND_USE_CASE_MOD_ECHO_REF #define SND_USE_CASE_MOD_PLAY_MUSIC #define SND_USE_CASE_MOD_PLAY_TONE #define SND_USE_CASE_MOD_PLAY_VOICE #define SND_USE_CASE_TQ_MUSIC #define SND_USE_CASE_TQ_TONES #define SND_USE_CASE_TQ_VOICE #define SND_USE_CASE_VERB_ANALOG_RADIO #define SND_USE_CASE_VERB_DIGITAL_RADIO #define SND_USE_CASE_VERB_HIFI #define SND_USE_CASE_VERB_HIFI_LOW_POWER #define SND_USE_CASE_VERB_INACTIVE #define SND_USE_CASE_VERB_IP_VOICECALL #define SND_USE_CASE_VERB_VOICE #define SND_USE_CASE_VERB_VOICECALL #define SND_USE_CASE_VERB_VOICE_LOW_POWER #define SORTFUNC #define SYSERR(args...) #define TEXT_SIZE_MAX #define _SND_SEQ_TYPE(x) #define _SND_SEQ_TYPE_OPT(x) #define __SND_DLSYM_VERSION( \ name, \ version \ ) #define __STRING(x) #define __inline__ #define __snd_alloca( \ ptr, \ type \ ) #define atomic_add( \ ptr, \ n \ ) #define atomic_dec(ptr) #define atomic_read(ptr) #define check_range( \ val, \ min, \ max \ ) #define convert_prange1( \ val, \ min, \ max \ ) #define find( \ list, \ type, \ member, \ value, \ match \ ) #define get_list( \ list, \ result, \ type, \ member, \ s1 \ ) #define get_list2( \ list, \ result, \ type, \ member, \ s1, \ s2 \ ) #define snd_config_for_each( \ pos, \ next, \ node \ ) #define snd_ctl_card_info_alloca(ptr) #define snd_ctl_elem_id_alloca(ptr) #define snd_ctl_elem_info_alloca(ptr) #define snd_ctl_elem_list_alloca(ptr) #define snd_ctl_elem_value_alloca(ptr) #define snd_ctl_event_alloca(ptr) #define snd_hwdep_dsp_image_alloca(ptr) #define snd_hwdep_dsp_status_alloca(ptr) #define snd_hwdep_info_alloca(ptr) #define snd_mixer_class_alloca(ptr) #define snd_mixer_selem_id_alloca(ptr) #define snd_mixer_simple_basic_register #define snd_mixer_simple_none_register #define snd_pcm_access_mask_alloca(ptr) #define snd_pcm_format_mask_alloca(ptr) #define snd_pcm_hw_params_alloca(ptr) #define snd_pcm_info_alloca(ptr) #define snd_pcm_status_alloca(ptr) #define snd_pcm_subformat_mask_alloca(ptr) #define snd_pcm_sw_params_alloca(ptr) #define snd_rawmidi_info_alloca(ptr) #define snd_rawmidi_params_alloca(ptr) #define snd_rawmidi_status_alloca(ptr) #define snd_seq_change_queue_tempo( \ seq, \ q, \ tempo, \ ev \ ) #define snd_seq_client_info_alloca(ptr) #define snd_seq_client_pool_alloca(ptr) #define snd_seq_continue_queue( \ seq, \ q, \ ev \ ) #define snd_seq_ev_clear(ev) #define snd_seq_ev_is_abstime(ev) #define snd_seq_ev_is_channel_type(ev) #define snd_seq_ev_is_control_type(ev) #define snd_seq_ev_is_direct(ev) #define snd_seq_ev_is_fixed(ev) #define snd_seq_ev_is_fixed_type(ev) #define snd_seq_ev_is_instr_type(ev) #define snd_seq_ev_is_message_type(ev) #define snd_seq_ev_is_note_type(ev) #define snd_seq_ev_is_prior(ev) #define snd_seq_ev_is_queue_type(ev) #define snd_seq_ev_is_real(ev) #define snd_seq_ev_is_reltime(ev) #define snd_seq_ev_is_reserved(ev) #define snd_seq_ev_is_result_type(ev) #define snd_seq_ev_is_sample_type(ev) #define snd_seq_ev_is_subscribe_type(ev) #define snd_seq_ev_is_tick(ev) #define snd_seq_ev_is_user_type(ev) #define snd_seq_ev_is_variable(ev) #define snd_seq_ev_is_variable_type(ev) #define snd_seq_ev_is_varusr(ev) #define snd_seq_ev_is_varusr_type(ev) #define snd_seq_ev_length_type(ev) #define snd_seq_ev_schedule_real( \ ev, \ q, \ relative, \ rtime \ ) #define snd_seq_ev_schedule_tick( \ ev, \ q, \ relative, \ ttick \ ) #define snd_seq_ev_set_broadcast(ev) #define snd_seq_ev_set_chanpress( \ ev, \ ch, \ val \ ) #define snd_seq_ev_set_controller( \ ev, \ ch, \ cc, \ val \ ) #define snd_seq_ev_set_dest( \ ev, \ c, \ p \ ) #define snd_seq_ev_set_direct(ev) #define snd_seq_ev_set_fixed(ev) #define snd_seq_ev_set_keypress( \ ev, \ ch, \ key, \ vel \ ) #define snd_seq_ev_set_note( \ ev, \ ch, \ key, \ vel, \ dur \ ) #define snd_seq_ev_set_noteoff( \ ev, \ ch, \ key, \ vel \ ) #define snd_seq_ev_set_noteon( \ ev, \ ch, \ key, \ vel \ ) #define snd_seq_ev_set_pgmchange( \ ev, \ ch, \ val \ ) #define snd_seq_ev_set_pitchbend( \ ev, \ ch, \ val \ ) #define snd_seq_ev_set_priority( \ ev, \ high_prior \ ) #define snd_seq_ev_set_queue_continue( \ ev, \ q \ ) #define snd_seq_ev_set_queue_control( \ ev, \ typ, \ q, \ val \ ) #define snd_seq_ev_set_queue_pos_real( \ ev, \ q, \ rtime \ ) #define snd_seq_ev_set_queue_pos_tick( \ ev, \ q, \ ttime \ ) #define snd_seq_ev_set_queue_start( \ ev, \ q \ ) #define snd_seq_ev_set_queue_stop( \ ev, \ q \ ) #define snd_seq_ev_set_queue_tempo( \ ev, \ q, \ val \ ) #define snd_seq_ev_set_source( \ ev, \ p \ ) #define snd_seq_ev_set_subs(ev) #define snd_seq_ev_set_sysex( \ ev, \ datalen, \ dataptr \ ) #define snd_seq_ev_set_tag( \ ev, \ t \ ) #define snd_seq_ev_set_variable( \ ev, \ datalen, \ dataptr \ ) #define snd_seq_ev_set_varusr( \ ev, \ datalen, \ dataptr \ ) #define snd_seq_ev_timemode_type(ev) #define snd_seq_ev_timestamp_type(ev) #define snd_seq_port_info_alloca(ptr) #define snd_seq_port_subscribe_alloca(ptr) #define snd_seq_query_subscribe_alloca(ptr) #define snd_seq_queue_info_alloca(ptr) #define snd_seq_queue_status_alloca(ptr) #define snd_seq_queue_tempo_alloca(ptr) #define snd_seq_queue_timer_alloca(ptr) #define snd_seq_remove_events_alloca(ptr) #define snd_seq_start_queue( \ seq, \ q, \ ev \ ) #define snd_seq_stop_queue( \ seq, \ q, \ ev \ ) #define snd_seq_system_info_alloca(ptr) #define snd_seq_type_check( \ ev, \ x \ ) #define snd_timer_ginfo_alloca(ptr) #define snd_timer_id_alloca(ptr) #define snd_timer_info_alloca(ptr) #define snd_timer_params_alloca(ptr) #define snd_timer_status_alloca(ptr)
Detailed Documentation
Enum Values
SND_PCM_EXTPLUG_HW_FORMAT
format
SND_PCM_EXTPLUG_HW_CHANNELS
channels
SND_PCM_EXTPLUG_HW_PARAMS
max number of hw constraints
SND_PCM_IOPLUG_HW_ACCESS
access type
SND_PCM_IOPLUG_HW_FORMAT
format
SND_PCM_IOPLUG_HW_CHANNELS
channels
SND_PCM_IOPLUG_HW_RATE
rate
SND_PCM_IOPLUG_HW_PERIOD_BYTES
period bytes
SND_PCM_IOPLUG_HW_BUFFER_BYTES
buffer bytes
SND_PCM_IOPLUG_HW_PERIODS
number of periods
SND_PCM_IOPLUG_HW_PARAMS
max number of hw constraints
Typedefs
typedef void (*snd_local_error_handler_t)( const char *file, int line, const char *func, int err, const char *fmt, va_list arg )
Local error handler function type
Global Variables
unsigned int len
length of data
void* ptr
pointer to data (note: can be 64-bit)
static const int snd_async_signo = SIGIO
async signal number
static const char* snd_error_codes[] = { "Sound protocol is not compatible" }
Array of error codes in US ASCII.
snd_lib_error_handler_t snd_err_msg = snd_err_msg_default
The ALSA error message handler
Global Functions
snd_local_error_handler_t snd_lib_error_set_local(snd_local_error_handler_t func)
Install local error handler.
Parameters:
func |
The local error handler function |
Previous |
local error handler function |
int snd_config_substitute( snd_config_t* dst, snd_config_t* src )
Substitutes one configuration node to another.
If both nodes are compounds, the source compound node members are appended to the destination compound node.
If the destination node is a compound and the source node is an ordinary type, the compound members are deleted (including their contents).
Otherwise, the source node’s value replaces the destination node’s value.
In any case, a successful call to this function frees the source node.
Parameters:
dst |
Handle to the destination node. |
src |
Handle to the source node. Must not be the same as dst. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_get_type_ascii( const char* ascii, snd_config_type_t* type )
Converts an ASCII string to a configuration node type.
This function recognizes at least the following node types:
integer<dt>::SND_CONFIG_TYPE_INTEGER |
|
integer64<dt>::SND_CONFIG_TYPE_INTEGER64 |
|
real<dt>::SND_CONFIG_TYPE_REAL |
|
string<dt>::SND_CONFIG_TYPE_STRING |
|
compound<dt>::SND_CONFIG_TYPE_COMPOUND |
-EINVAL |
Unknown note type in type. |
Parameters:
ascii |
A string containing a configuration node type. |
type |
The node type corresponding to ascii. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_remove(snd_config_t* config)
Removes a configuration node from its tree.
This function makes config a top-level node, i.e., if config has a parent, then config is removed from the list of the parent’s children.
This functions does not free the removed node.
Parameters:
config |
Handle to the configuration node to be removed. |
Returns:
Zero if successful, otherwise a negative error code.
See also:
int snd_config_searcha( snd_config_t* root, snd_config_t* config, const char* key, snd_config_t** result )
Searches for a node in a configuration tree, expanding aliases.
This functions searches for a child node of config like snd_config_search. However, any compound node can also be identified by an alias, which is a string node whose value is taken as the id of a compound node below root.
root must be a compound node. root and config may be the same node.
For example, with the following configuration, the call
snd_config_searcha(root, config, "a.b.c.d", &result);
would return the node with id d:
config { a { b bb } } root { bb { c cc } cc ccc ccc { d { x "icks" } } }
-ENOENT |
An id in key or an alias id does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound or string node. |
Parameters:
root |
Handle to the root configuration node containing alias definitions. |
config |
Handle to the root of the configuration (sub)tree to search. |
key |
Search key: one or more node keys, separated with dots. |
result |
When result!= |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_searchva( snd_config_t* root, snd_config_t* config, snd_config_t** result, ... )
Searches for a node in a configuration tree, expanding aliases.
This function searches for a child node of config, allowing aliases, like snd_config_searcha, but the search key is the concatenation of all passed seach key strings, like with snd_config_searchv.
-ENOENT |
An id in a search key does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound or string node. |
Parameters:
root |
Handle to the root configuration node containing alias definitions. |
config |
Handle to the root of the configuration (sub)tree to search. |
result |
When result!= |
… |
One or more concatenated dot separated search keys, terminated with |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_search_alias( snd_config_t* config, const char* base, const char* key, snd_config_t** result )
Searches for a node in a configuration tree, expanding aliases.
This functions searches for a child node of config, allowing aliases, like snd_config_searcha. However, alias definitions are searched below config (there is no separate root parameter), and base specifies a seach key that identifies a compound node that is used to search for an alias definitions that is not found directly below config and that does not contain a period. In other words, when "id"
is not found in config, this function also tries "base.id"
.
-ENOENT |
An id in key or an alias id does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound or string node. |
Parameters:
config |
Handle to the root of the configuration (sub)tree to search. |
base |
Search key base, or |
key |
Search key suffix. |
result |
When result!= |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_search_hooks( snd_config_t* config, const char* key, snd_config_t** result )
Searches for a node in a configuration tree and expands hooks.
This functions searches for a child node of config like snd_config_search, but any compound nodes to be searched that contain hooks are modified by the respective hook functions.
-ENOENT |
An id in key does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound node. |
Additionally, any errors encountered when parsing the hook definitions or returned by the hook functions.
Parameters:
config |
Handle to the root of the configuration (sub)tree to search. |
key |
Search key: one or more node keys, separated with dots. |
result |
The function puts the handle to the node found at the address specified by result. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_searcha_hooks( snd_config_t* root, snd_config_t* config, const char* key, snd_config_t** result )
Searches for a node in a configuration tree, expanding aliases and hooks.
This function searches for a child node of config, allowing aliases, like snd_config_searcha, and expanding hooks, like snd_config_search_hooks.
-ENOENT |
An id in key or an alias id does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound node. |
Additionally, any errors encountered when parsing the hook definitions or returned by the hook functions.
Parameters:
root |
Handle to the root configuration node containing alias definitions. |
config |
Handle to the root of the configuration (sub)tree to search. |
key |
Search key: one or more node keys, separated with dots. |
result |
The function puts the handle to the node found at the address specified by result. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_searchva_hooks( snd_config_t* root, snd_config_t* config, snd_config_t** result, ... )
Searches for a node in a configuration tree, expanding aliases and hooks.
This function searches for a child node of config, allowing aliases and expanding hooks like snd_config_searcha_hooks, but the search key is the concatenation of all passed seach key strings, like with snd_config_searchv.
-ENOENT |
An id in key or an alias id does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound node. |
Additionally, any errors encountered when parsing the hook definitions or returned by the hook functions.
Parameters:
root |
Handle to the root configuration node containing alias definitions. |
config |
Handle to the root of the configuration (sub)tree to search. |
result |
The function puts the handle to the node found at the address specified by result. |
… |
One or more concatenated dot separated search keys, terminated with |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_search_alias_hooks( snd_config_t* config, const char* base, const char* key, snd_config_t** result )
Searches for a node in a configuration tree, using an alias and expanding hooks.
This functions searches for a child node of config, allowing aliases, like snd_config_search_alias, and expanding hooks, like snd_config_search_hooks.
-ENOENT |
An id in key or an alias id does not exist. |
-ENOENT |
config or one of its child nodes to be searched is not a compound node. |
Additionally, any errors encountered when parsing the hook definitions or returned by the hook functions.
Parameters:
config |
Handle to the root of the configuration (sub)tree to search. |
base |
Search key base, or |
key |
Search key suffix. |
result |
The function puts the handle to the node found at the address specified by result. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_hook_load( snd_config_t* root, snd_config_t* config, snd_config_t** dst, snd_config_t* private_data )
Loads and parses the given configurations files.
See Hooks in configuration files for an example.
Parameters:
root |
Handle to the root configuration node. |
config |
Handle to the configuration node for this hook. |
dst |
The function puts the handle to the configuration node loaded from the file(s) at the address specified by dst. |
private_data |
Handle to the private data configuration node. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_config_hook_load_for_all_cards( snd_config_t* root, snd_config_t* config, snd_config_t** dst, snd_config_t* private_data )
Loads and parses the given configurations files for each installed sound card.
This function works like snd_config_hook_load, but the files are loaded once for each sound card. The driver name is available with the private_string
function to customize the file name.
Parameters:
root |
Handle to the root configuration node. |
config |
Handle to the configuration node for this hook. |
dst |
The function puts the handle to the configuration node loaded from the file(s) at the address specified by dst. |
private_data |
Handle to the private data configuration node. |
Returns:
Zero if successful, otherwise a negative error code.
int snd_func_getenv( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns an environment value.
Example:
{ @func getenv vars [ MY_CARD CARD C ] default 0 }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with definitions for |
private_data |
Handle to the |
Returns:
Zero if successful, otherwise a negative error code.
int snd_func_igetenv( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns an integer environment value.
Example:
{ @func igetenv vars [ MY_DEVICE DEVICE D ] default 0 }
Parameters:
dst |
The function puts the handle to the result configuration node (with type integer) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with definitions for |
private_data |
Handle to the |
Returns:
Zero if successful, otherwise a negative error code.
int snd_func_concat( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Merges the given strings.
Example (result is “a1b2c3”):
{ @func concat strings [ "a1" "b2" "c3" ] }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a definition for |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_iadd( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Sum the given integers.
Example (result is 10):
{ @func iadd integers [ 2 3 5 ] }
Parameters:
dst |
The function puts the handle to the result configuration node (with type integer) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a definition for |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_imul( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Multiply the given integers.
Example (result is 12):
{ @func imul integers [ 2 3 2 ] }
Parameters:
dst |
The function puts the handle to the result configuration node (with type integer) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a definition for |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_datadir( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the ALSA data directory.
Example (result is “/usr/share/alsa” using the default paths):
{ @func datadir }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node. |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_private_string( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the string from private_data
.
Example:
{ @func private_string }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node. |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_private_card_driver( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the driver identification from private_data
.
Example:
{ @func private_card_driver }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node. |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_card_inum( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the card number as integer.
Example:
{ @func card_inum card '0' }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_card_driver( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the driver identification for a card.
Example:
{ @func card_driver card 0 }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_card_id( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the identification of a card.
Example:
{ @func card_id card 0 }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_card_name( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Returns the name of a card.
Example:
{ @func card_name card 0 }
Parameters:
dst |
The function puts the handle to the result configuration node (with type string) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with a |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_func_refer( snd_config_t** dst, snd_config_t* root, snd_config_t* src, snd_config_t* private_data )
Copies the specified configuration node.
Note
The root source node can be modified!
Example:
{ @func refer file "/etc/myconf.conf" # optional name "id1.id2.id3" }
Parameters:
dst |
The function puts the handle to the result configuration node (with the same type as the specified node) at the address specified by |
root |
Handle to the root source node. |
src |
Handle to the source node, with definitions for |
private_data |
Handle to the |
Returns:
A non-negative value if successful, otherwise a negative error code.
int snd_ctl_hwdep_next_device( snd_ctl_t* ctl, int* device )
Get next hardware dependent device number.
Parameters:
ctl |
CTL handle |
device |
current device on entry and next device on return |
Returns:
0 on success otherwise a negative error code
int snd_ctl_hwdep_info( snd_ctl_t* ctl, snd_hwdep_info_t* info )
Get info about a hardware dependent device.
Parameters:
ctl |
CTL handle |
info |
Hardware dependent device id/info pointer |
Returns:
0 on success otherwise a negative error code
int snd_ctl_pcm_next_device( snd_ctl_t* ctl, int* device )
Get next PCM device number.
Parameters:
ctl |
CTL handle |
device |
current device on entry and next device on return |
Returns:
0 on success otherwise a negative error code
int snd_ctl_pcm_info( snd_ctl_t* ctl, snd_pcm_info_t* info )
Get info about a PCM device.
Parameters:
ctl |
CTL handle |
info |
PCM device id/info pointer |
Returns:
0 on success otherwise a negative error code
int snd_ctl_pcm_prefer_subdevice( snd_ctl_t* ctl, int subdev )
Set preferred PCM subdevice number of successive PCM open.
Parameters:
ctl |
CTL handle |
subdev |
Preferred PCM subdevice number |
Returns:
0 on success otherwise a negative error code
int snd_ctl_rawmidi_next_device( snd_ctl_t* ctl, int* device )
Get next RawMidi device number.
Parameters:
ctl |
CTL handle |
device |
current device on entry and next device on return |
Returns:
0 on success otherwise a negative error code
int snd_ctl_rawmidi_info( snd_ctl_t* ctl, snd_rawmidi_info_t* info )
Get info about a RawMidi device.
Parameters:
ctl |
CTL handle |
info |
RawMidi device id/info pointer |
Returns:
0 on success otherwise a negative error code
int snd_ctl_rawmidi_prefer_subdevice( snd_ctl_t* ctl, int subdev )
Set preferred RawMidi subdevice number of successive RawMidi open.
Parameters:
ctl |
CTL handle |
subdev |
Preferred RawMidi subdevice number |
Returns:
0 on success otherwise a negative error code
int snd_ctl_elem_info_is_indirect(const snd_ctl_elem_info_t* obj)
(DEPRECATED) Get info about values passing policy from a CTL element value
Parameters:
obj |
CTL element id/info |
Returns:
0 if element value need to be passed by contents, 1 if need to be passed with a pointer
int snd_hctl_async( snd_hctl_t* hctl, int sig, pid_t pid )
set async mode
A signal is raised when a change happens.
Parameters:
hctl |
HCTL handle |
sig |
Signal to raise: < 0 disable, 0 default (SIGIO) |
pid |
Process ID to signal: 0 current |
Returns:
0 on success otherwise a negative error code
static int snd_dlsym_verify( void* handle, const char* name, const char* version )
Verifies a dynamically loaded symbol.
This function checks that the symbol with the version appended to its name does exist in the library.
Parameters:
handle |
Library handle, similar to |
name |
Symbol name. |
version |
Version of the symbol. |
Returns:
Zero is successful, otherwise a negative error code.
snd_local_error_handler_t snd_lib_error_set_local(snd_local_error_handler_t func)
Install local error handler.
Parameters:
func |
The local error handler function |
Previous |
local error handler function |
static void snd_lib_error_default( const char* file, int line, const char* function, int err, const char* fmt, ... )
The default error handler function.
If a local error function has been installed for the current thread by snd_lib_error_set_local, it is called. Otherwise, prints the error message including location to stderr
.
Parameters:
file |
The filename where the error was hit. |
line |
The line number. |
function |
The function name. |
err |
The error code. |
fmt |
The message (including the format characters). |
… |
Optional arguments. |
int snd_hwdep_open_lconf( snd_hwdep_t** hwdep, const char* name, int mode, snd_config_t* lconf )
Opens a new connection to the HwDep interface using local configuration.
Opens a new connection to the HwDep interface specified with an ASCII identifier and mode.
Parameters:
hwdep |
Returned handle (NULL if not wanted) |
name |
ASCII identifier of the HwDep handle |
mode |
Open mode |
lconf |
The local configuration tree |
Returns:
0 on success otherwise a negative error code
const char* snd_hwdep_name(snd_hwdep_t* hwdep)
get identifier of HwDep handle
Returns the ASCII identifier of given HwDep handle. It’s the same identifier specified in snd_hwdep_open().
Parameters:
hwdep |
a Hwdep handle |
Returns:
ascii identifier of HwDep handle
snd_hwdep_type_t snd_hwdep_type(snd_hwdep_t* hwdep)
get type of HwDep handle
Returns the type snd_hwdep_type_t of given HwDep handle.
Parameters:
hwdep |
a HwDep handle |
Returns:
type of HwDep handle
int snd_mixer_simple_none_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp )
Register mixer simple element class - none abstraction.
Parameters:
mixer |
Mixer handle |
options |
Options container |
classp |
Pointer to returned mixer simple element class handle (or NULL) |
Returns:
0 on success otherwise a negative error code
int snd_mixer_simple_basic_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp )
Register mixer simple element class - basic abstraction.
Parameters:
mixer |
Mixer handle |
options |
Options container |
classp |
Pointer to returned mixer simple element class handle (or NULL |
Returns:
0 on success otherwise a negative error code
int snd_mixer_sbasic_info( const snd_mixer_class_t* class, sm_class_basic_t* info )
Basic Mixer Abstraction - Get information about device.
Parameters:
class |
Mixer class |
info |
Info structure |
Returns:
0 on success otherwise a negative error code
void* snd_mixer_sbasic_get_private(const snd_mixer_class_t* class)
Get private data for basic abstraction.
Parameters:
class |
Mixer class |
Returns:
private data
void snd_mixer_sbasic_set_private( const snd_mixer_class_t* class, void* private_data )
Set private data for basic abstraction.
Parameters:
class |
Mixer class |
private_data |
Private data |
void snd_mixer_sbasic_set_private_free( const snd_mixer_class_t* class, void(*)(snd_mixer_class_t*class) private_free )
Set private data free callback for basic abstraction.
Parameters:
class |
Mixer class |
private_free |
free callback for private data |
int snd_mixer_simple_none_register( snd_mixer_t* mixer, struct snd_mixer_selem_regopt* options, snd_mixer_class_t** classp )
Register mixer simple element class - none abstraction.
Parameters:
mixer |
Mixer handle |
options |
Options container |
classp |
Pointer to returned mixer simple element class handle (or NULL) |
Returns:
0 on success otherwise a negative error code
const char* snd_pcm_tstamp_type_name(snd_pcm_tstamp_type_t type)
get name of PCM tstamp type setting
Parameters:
mode |
PCM tstamp type |
Returns:
ascii name of PCM tstamp type setting
int snd_pcm_adpcm_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave )
Creates a new Ima-ADPCM conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_adpcm_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Ima-ADPCM conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_alaw_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave )
Creates a new A-Law conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_alaw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new A-Law conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_asym_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new asym stream PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_copy_open( snd_pcm_t** pcmp, const char* name, snd_pcm_t* slave, int close_slave )
Creates a new copy PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_copy_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new copy PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_dmix_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode )
Creates a new dmix PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
opts |
Direct PCM configurations |
params |
Parameters for slave |
root |
Configuration root |
sconf |
Slave configuration |
stream |
PCM Direction (stream) |
mode |
PCM Mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_dmix_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new dmix PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with dmix PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int snd_pcm_dshare_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode )
Creates a new dshare PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
opts |
Direct PCM configurations |
params |
Parameters for slave |
root |
Configuration root |
sconf |
Slave configuration |
stream |
PCM Direction (stream) |
mode |
PCM Mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_dshare_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new dshare PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with dshare PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int snd_pcm_dsnoop_open( snd_pcm_t** pcmp, const char* name, struct snd_pcm_direct_open_conf* opts, struct slave_params* params, snd_config_t* root, snd_config_t* sconf, snd_pcm_stream_t stream, int mode )
Creates a new dsnoop PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
opts |
Direct PCM configurations |
params |
Parameters for slave |
root |
Configuration root |
sconf |
Slave configuration |
stream |
PCM Direction (stream) |
mode |
PCM Mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_dsnoop_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new dsnoop PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with dsnoop PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int _snd_pcm_empty_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Empty PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with empty PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_file_open( snd_pcm_t** pcmp, const char* name, const char* fname, int fd, const char* ifname, int ifd, int trunc, const char* fmt, int perm, snd_pcm_t* slave, int close_slave, snd_pcm_stream_t stream )
Creates a new File PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
fname |
Output filename (or NULL if file descriptor fd is available) |
fd |
Output file descriptor |
ifname |
Input filename (or NULL if file descriptor ifd is available) |
ifd |
Input file descriptor (if (ifd < 0) && (ifname == NULL), no input redirection will be performed) |
trunc |
Truncate the file if it already exists |
fmt |
File format (“raw” or “wav” are available) |
perm |
File permission |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
stream |
the direction of PCM stream |
zero |
on success otherwise a negative error code |
int _snd_pcm_file_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new File PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with File PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_hooks_open( snd_pcm_t** pcmp, const char* name, snd_pcm_t* slave, int close_slave )
Creates a new hooks PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
slave |
Slave PCM |
close_slave |
If set, slave PCM handle is closed when hooks PCM is closed |
zero |
on success otherwise a negative error code |
int _snd_pcm_hooks_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new hooks PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with hooks PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_hook_ctl_elems_install( snd_pcm_t* pcm, snd_config_t* conf )
Install CTL settings using hardware associated with PCM handle.
Parameters:
pcm |
PCM handle |
conf |
Configuration node with CTL settings |
Returns:
zero on success otherwise a negative error code
int snd_pcm_hw_open_fd( snd_pcm_t** pcmp, const char* name, int fd, int mmap_emulation, int sync_ptr_ioctl )
Creates a new hw PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
fd |
File descriptor |
mmap_emulation |
Obsoleted parameter |
sync_ptr_ioctl |
Boolean flag for sync_ptr ioctl |
zero |
on success otherwise a negative error code |
int snd_pcm_hw_open( snd_pcm_t** pcmp, const char* name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode, int mmap_emulation, int sync_ptr_ioctl )
Creates a new hw PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
card |
Number of card |
device |
Number of device |
subdevice |
Number of subdevice |
stream |
PCM Stream |
mode |
PCM Mode |
mmap_emulation |
Obsoleted parameter |
sync_ptr_ioctl |
Use SYNC_PTR ioctl rather than mmap for control structures |
zero |
on success otherwise a negative error code |
int _snd_pcm_hw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new hw PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with hw PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int snd_pcm_iec958_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave, const unsigned char* status_bits, const unsigned char* preamble_vals )
Creates a new IEC958 subframe conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
status_bits |
The IEC958 status bits |
preamble_vals |
The preamble byte values |
zero |
on success otherwise a negative error code |
int _snd_pcm_iec958_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new IEC958 subframe conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_ladspa_open( snd_pcm_t** pcmp, const char* name, const char* ladspa_path, unsigned int channels, snd_config_t* ladspa_pplugins, snd_config_t* ladspa_cplugins, snd_pcm_t* slave, int close_slave )
Creates a new LADSPA<->ALSA Plugin.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
ladspa_path |
The path for LADSPA plugins |
channels |
Force input channel count to LADSPA plugin chain, 0 = no force (auto) |
ladspa_pplugins |
The playback configuration |
ladspa_cplugins |
The capture configuration |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_ladspa_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new LADSPA<->ALSA PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with LADSPA<->ALSA PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_lfloat_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave )
Creates a new linear conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_lfloat_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new linear<->float conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_linear_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave )
Creates a new linear conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_linear_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new linear conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_mmap_emul_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new mmap_emul PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with hw PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int snd_pcm_mulaw_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, snd_pcm_t* slave, int close_slave )
Creates a new Mu-Law conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_mulaw_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Mu-Law conversion PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with copy PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_multi_open( snd_pcm_t** pcmp, const char* name, unsigned int slaves_count, unsigned int master_slave, snd_pcm_t** slaves_pcm, unsigned int* schannels_count, unsigned int channels_count, int* sidxs, unsigned int* schannels, int close_slaves )
Creates a new Multi PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
slaves_count |
Count of slaves |
master_slave |
Master slave number |
slaves_pcm |
Array with slave PCMs |
schannels_count |
Array with slave channel counts |
channels_count |
Count of channels |
sidxs |
Array with channels indexes to slaves |
schannels |
Array with slave channels |
close_slaves |
When set, the slave PCM handle is closed |
zero |
on success otherwise a negative error code |
int _snd_pcm_multi_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Multi PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Multi PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_null_open( snd_pcm_t** pcmp, const char* name, snd_pcm_stream_t stream, int mode )
Creates a new null PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_null_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Null PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Null PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_plug_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int schannels, int srate, const snd_config_t* rate_converter, enum snd_pcm_plug_route_policy route_policy, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_ssize, unsigned int tt_cused, unsigned int tt_sused, snd_pcm_t* slave, int close_slave )
Creates a new Plug PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave (destination) format |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_plug_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Plug PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Plug PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
const snd_config_t* snd_pcm_rate_get_default_converter(snd_config_t* root)
Get a default converter string.
Parameters:
root |
Root configuration node |
A |
const config item if found, or NULL |
int snd_pcm_rate_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, unsigned int srate, const snd_config_t* converter, snd_pcm_t* slave, int close_slave )
Creates a new rate PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave format |
srate |
Slave rate |
converter |
SRC type string node |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_rate_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new rate PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with rate PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_route_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int schannels, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_ssize, unsigned int tt_cused, unsigned int tt_sused, snd_pcm_t* slave, int close_slave )
Creates a new Route & Volume PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave format |
schannels |
Slave channels |
ttable |
Attenuation table |
tt_ssize |
Attenuation table - slave size |
tt_cused |
Attenuation table - client used count |
tt_sused |
Attenuation table - slave used count |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int snd_pcm_route_determine_ttable( snd_config_t* tt, unsigned int* tt_csize, unsigned int* tt_ssize )
Determine route matrix sizes.
Parameters:
tt |
Configuration root describing route matrix |
tt_csize |
Returned client size in elements |
tt_ssize |
Returned slave size in elements |
zero |
on success otherwise a negative error code |
static int _snd_pcm_route_load_ttable( snd_config_t* tt, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_csize, unsigned int tt_ssize, unsigned int* tt_cused, unsigned int* tt_sused, int schannels, snd_pcm_chmap_t* chmap )
Load route matrix.
Parameters:
tt |
Configuration root describing route matrix |
ttable |
Returned route matrix |
tt_csize |
Client size in elements |
tt_ssize |
Slave size in elements |
tt_cused |
Used client elements |
tt_sused |
Used slave elements |
schannels |
Slave channels |
zero |
on success otherwise a negative error code |
int snd_pcm_route_load_ttable( snd_config_t* tt, snd_pcm_route_ttable_entry_t* ttable, unsigned int tt_csize, unsigned int tt_ssize, unsigned int* tt_cused, unsigned int* tt_sused, int schannels )
Load route matrix.
Parameters:
tt |
Configuration root describing route matrix |
ttable |
Returned route matrix |
tt_csize |
Client size in elements |
tt_ssize |
Slave size in elements |
tt_cused |
Used client elements |
tt_sused |
Used slave elements |
schannels |
Slave channels |
zero |
on success otherwise a negative error code |
int _snd_pcm_route_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Route & Volume PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Route & Volume PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_share_open( snd_pcm_t** pcmp, const char* name, const char* sname, snd_pcm_format_t sformat, int srate, unsigned int schannels, int speriod_time, int sbuffer_time, unsigned int channels, unsigned int* channels_map, snd_pcm_stream_t stream, int mode )
Creates a new Share PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sname |
Slave name |
sformat |
Slave format |
srate |
Slave rate |
schannels |
Slave channels |
speriod_time |
Slave period time |
sbuffer_time |
Slave buffer time |
channels |
Count of channels |
channels_map |
Map of channels |
stream |
Direction |
mode |
PCM mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_share_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Share PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Share PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
int snd_pcm_shm_open( snd_pcm_t** pcmp, const char* name, const char* sockname, const char* sname, snd_pcm_stream_t stream, int mode )
Creates a new shared memory PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sockname |
Unix socket name |
sname |
Server name |
stream |
PCM Stream |
mode |
PCM Mode |
zero |
on success otherwise a negative error code |
int _snd_pcm_shm_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new shm PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with hw PCM description |
stream |
PCM Stream |
mode |
PCM Mode |
int snd_pcm_softvol_open( snd_pcm_t** pcmp, const char* name, snd_pcm_format_t sformat, int ctl_card, snd_ctl_elem_id_t* ctl_id, int cchannels, double min_dB, double max_dB, int resolution, snd_pcm_t* slave, int close_slave )
Creates a new SoftVolume PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
sformat |
Slave format |
ctl_card |
card index of the control |
ctl_id |
The control element |
cchannels |
PCM channels |
min_dB |
minimal dB value |
max_dB |
maximal dB value |
resolution |
resolution of control |
slave |
Slave PCM handle |
close_slave |
When set, the slave PCM handle is closed with copy PCM |
zero |
on success otherwise a negative error code |
int _snd_pcm_softvol_open( snd_pcm_t** pcmp, const char* name, snd_config_t* root, snd_config_t* conf, snd_pcm_stream_t stream, int mode )
Creates a new Soft Volume PCM.
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.
Parameters:
pcmp |
Returns created PCM handle |
name |
Name of PCM |
root |
Root configuration node |
conf |
Configuration node with Soft Volume PCM description |
stream |
Stream type |
mode |
Stream mode |
zero |
on success otherwise a negative error code |
static int snd_rawmidi_params_default( snd_rawmidi_t* rawmidi, snd_rawmidi_params_t* params )
setup the default parameters
Parameters:
rawmidi |
RawMidi handle |
params |
pointer to a snd_rawmidi_params_t structure |
Returns:
0 on success otherwise a negative error code
const char* snd_timer_name(snd_timer_t* timer)
get identifier of timer handle
Returns the ASCII identifier of given timer handle. It’s the same identifier specified in snd_timer_open().
Parameters:
timer |
a timer handle |
Returns:
ascii identifier of timer handle
snd_timer_type_t snd_timer_type(snd_timer_t* timer)
get type of timer handle
Returns the type snd_timer_type_t of given timer handle.
Parameters:
timer |
a timer handle |
Returns:
type of timer handle
int snd_timer_nonblock( snd_timer_t* timer, int nonblock )
set nonblock mode
Parameters:
timer |
timer handle |
nonblock |
0 = block, 1 = nonblock mode |
Returns:
0 on success otherwise a negative error code
static int execute_sequence( snd_use_case_mgr_t* uc_mgr, struct list_head* seq, struct list_head* value_list1, struct list_head* value_list2, struct list_head* value_list3 )
Execute the sequence.
Parameters:
uc_mgr |
Use case manager |
seq |
Sequence |
Returns:
zero on success, otherwise a negative error code
static int import_master_config(snd_use_case_mgr_t* uc_mgr)
Import master config and execute the default sequence.
Parameters:
uc_mgr |
Use case manager |
Returns:
zero on success, otherwise a negative error code
static void* find0( struct list_head* list, unsigned long offset, unsigned long soffset, const char* match )
Universal find - string in a list.
Parameters:
list |
List of structures |
offset |
Offset of list structure |
soffset |
Offset of string structure |
match |
String to match |
Returns:
structure on success, otherwise a NULL (not found)
static int get_list0( struct list_head* list, const char** result[], unsigned long offset, unsigned long s1offset )
Universal string list.
Parameters:
list |
List of structures |
result |
Result list |
offset |
Offset of list structure |
s1offset |
Offset of string structure |
Returns:
count of items on success, otherwise a negative error code
static int get_list20( struct list_head* list, const char** result[], unsigned long offset, unsigned long s1offset, unsigned long s2offset )
Universal string list - pair of strings.
Parameters:
list |
List of structures |
result |
Result list |
offset |
Offset of list structure |
s1offset |
Offset of string structure |
s1offset |
Offset of string structure |
Returns:
count of items on success, otherwise a negative error code
static struct use_case_verb* find_verb( snd_use_case_mgr_t* uc_mgr, const char* verb_name )
Find verb.
Parameters:
uc_mgr |
Use case manager |
verb_name |
verb to find |
Returns:
structure on success, otherwise a NULL (not found)
static struct use_case_device* find_device( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, const char* device_name, int check_supported )
Find device.
Parameters:
verb |
Use case verb |
device_name |
device to find |
Returns:
structure on success, otherwise a NULL (not found)
static struct use_case_modifier* find_modifier( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, const char* modifier_name, int check_supported )
Find modifier.
Parameters:
verb |
Use case verb |
modifier_name |
modifier to find |
Returns:
structure on success, otherwise a NULL (not found)
static int set_verb( snd_use_case_mgr_t* uc_mgr, struct use_case_verb* verb, int enable )
Set verb.
Parameters:
uc_mgr |
Use case manager |
verb |
verb to set |
enable |
nonzero = enable, zero = disable |
Returns:
zero on success, otherwise a negative error code
static int set_modifier( snd_use_case_mgr_t* uc_mgr, struct use_case_modifier* modifier, int enable )
Set modifier.
Parameters:
uc_mgr |
Use case manager |
modifier |
modifier to set |
enable |
nonzero = enable, zero = disable |
Returns:
zero on success, otherwise a negative error code
static int set_device( snd_use_case_mgr_t* uc_mgr, struct use_case_device* device, int enable )
Set device.
Parameters:
uc_mgr |
Use case manager |
device |
device to set |
enable |
nonzero = enable, zero = disable |
Returns:
zero on success, otherwise a negative error code
static int get_verb_list( snd_use_case_mgr_t* uc_mgr, const char** list[] )
Get list of verbs in pair verbname+comment.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* verbname )
Get list of devices in pair devicename+comment.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_modifier_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* verbname )
Get list of modifiers in pair devicename+comment.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_supcon_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name, enum dev_list_type type )
Get list of supported/conflicting devices.
Parameters:
list |
Returned list |
name |
Name of modifier or verb to query |
type |
Type of device list entries to return |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_supported_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name )
Get list of supported devices.
Parameters:
list |
Returned list |
name |
Name of verb or modifier to query |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_conflicting_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[], char* name )
Get list of conflicting devices.
Parameters:
list |
Returned list |
name |
Name of verb or modifier to query |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_value_list( snd_use_case_mgr_t* uc_mgr, const char* identifier, const char** list[], char* verbname )
Get list of values.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_enabled_device_list( snd_use_case_mgr_t* uc_mgr, const char** list[] )
Get list of enabled devices.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_enabled_modifier_list( snd_use_case_mgr_t* uc_mgr, const char** list[] )
Get list of enabled modifiers.
Parameters:
list |
Returned list |
verbname |
For verb (NULL = current) |
Returns:
Number of list entries if success, otherwise a negative error code
static int get_value( snd_use_case_mgr_t* uc_mgr, const char* identifier, char** value, const char* mod_dev_name, const char* verb_name, int exact )
Get value.
Parameters:
uc_mgr |
Use case manager |
identifier |
Value identifier (string) |
value |
Returned value string |
item |
Modifier or Device name (string) |
Returns:
Zero on success (value is filled), otherwise a negative error code
Macros
#define ALSA_CONFIG_PATH_DEFAULT
The name of the default files used by snd_config_update.
#define ALSA_CONFIG_PATH_VAR
The name of the environment variable containing the files list for snd_config_update.
#define ALSA_CONFIG_UCM_VAR
The name of the environment variable containing the UCM directory
#define SND_LIB_EXTRAVER
extra version number, used mainly for betas
#define SND_LIB_MAJOR
major number of library version
#define SND_LIB_MINOR
minor number of library version
#define SND_LIB_SUBMINOR
subminor number of library version
#define SND_LIB_VERSION
library version
#define SND_LIB_VERSION_STR
library version (string)