* \author Takashi Iwai <tiwai@suse.de>
* \date 1998-2001
*
- * Definitions of constatns for the ALSA driver
+ * Definitions of constants for the ALSA driver
*
*
* This library is free software; you can redistribute it and/or modify
#endif
/**
- * \defgroup Digital_Audio_Interface Contants For Digital Audio Interface
+ * \defgroup Digital_Audio_Interface Constants For Digital Audio Interface
* AES/IEC958 channel status bits
* \{
*/
#define MIDI_CTL_E5_PHASER_DEPTH 0x5f /**< E5 Phaser Depth */
#define MIDI_CTL_DATA_INCREMENT 0x60 /**< Data Increment */
#define MIDI_CTL_DATA_DECREMENT 0x61 /**< Data Decrement */
-#define MIDI_CTL_NONREG_PARM_NUM_LSB 0x62 /**< Nonregister parameter number */
-#define MIDI_CTL_NONREG_PARM_NUM_MSB 0x63 /**< Nonregister parameter number */
-#define MIDI_CTL_REGIST_PARM_NUM_LSB 0x64 /**< Register parameter number */
-#define MIDI_CTL_REGIST_PARM_NUM_MSB 0x65 /**< Register parameter number */
+#define MIDI_CTL_NONREG_PARM_NUM_LSB 0x62 /**< Non-registered parameter number */
+#define MIDI_CTL_NONREG_PARM_NUM_MSB 0x63 /**< Non-registered parameter number */
+#define MIDI_CTL_REGIST_PARM_NUM_LSB 0x64 /**< Registered parameter number */
+#define MIDI_CTL_REGIST_PARM_NUM_MSB 0x65 /**< Registered parameter number */
#define MIDI_CTL_ALL_SOUNDS_OFF 0x78 /**< All sounds off */
#define MIDI_CTL_RESET_CONTROLLERS 0x79 /**< Reset Controllers */
#define MIDI_CTL_LOCAL_CONTROL_SWITCH 0x7a /**< Local control switch */
/** CTL card info container */
typedef struct _snd_ctl_card_info snd_ctl_card_info_t;
-/** CTL element identificator container */
+/** CTL element identifier container */
typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t;
-/** CTL element identificator list container */
+/** CTL element identifier list container */
typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
/** CTL element info container */
void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
/**
- * \defgroup HControl Highlevel Control Interface
+ * \defgroup HControl High level Control Interface
* \ingroup Control
- * The highlevel control interface.
+ * The high level control interface.
* See \ref hcontrol page for more details.
* \{
*/
/*
* non supported architecture.
*/
-#warning "Atomic operations are not supported on this archictecture."
+#warning "Atomic operations are not supported on this architecture."
typedef struct { volatile int counter; } atomic_t;
* Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org>
*/
-/* Max number of times we must spin on a spinlock calling sched_yield().
+/* Max number of times we must spin on a spin-lock calling sched_yield().
After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */
#ifndef MAX_SPIN_COUNT
#define MAX_SPIN_COUNT 50
#endif
-/* Duration of sleep (in nanoseconds) when we can't acquire a spinlock
+/* Duration of sleep (in nanoseconds) when we can't acquire a spin-lock
after MAX_SPIN_COUNT iterations of sched_yield().
This MUST BE > 2ms.
- (Otherwise the kernel does busy-waiting for realtime threads,
+ (Otherwise the kernel does busy-waiting for real-time threads,
giving other threads no chance to run.) */
#ifndef SPIN_SLEEP_DURATION
/* Simple (legacy) mixer elements API */
-/** Mixer simple element channel identificator */
+/** Mixer simple element channel identifier */
typedef enum _snd_mixer_selem_channel_id {
/** Unknown */
SND_MIXER_SCHN_UNKNOWN = -1,
SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT
} snd_mixer_selem_channel_id_t;
-/** Mixer simple element identificator */
+/** Mixer simple element identifier */
typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t;
const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel);
* \{
*/
-/* Deprecated functions, for compatibity */
+/* Deprecated functions, for compatibility */
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);
/* Family of hash table handling functions. The functions also
have reentrant counterparts ending with _r. The non-reentrant
- functions all work on a signle internal hashing table. */
+ functions all work on a single internal hashing table. */
/* Search for entry matching ITEM.key in internal hash table. If
ACTION is `FIND' return found entry or signal error by returning
/** known client numbers */
#define SND_SEQ_CLIENT_SYSTEM 0 /**< system client */
#define SND_SEQ_CLIENT_DUMMY 62 /**< dummy ports */
-#define SND_SEQ_CLIENT_OSS 63 /**< oss sequencer emulator */
+#define SND_SEQ_CLIENT_OSS 63 /**< OSS sequencer emulator */
/*
*/
/** known port numbers */
#define SND_SEQ_PORT_SYSTEM_TIMER 0 /**< system timer port */
-#define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /**< sysem announce port */
+#define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /**< system announce port */
/** port capabilities (32 bits) */
#define SND_SEQ_PORT_CAP_READ (1<<0) /**< readable from this port */
/**
* \defgroup SeqMisc Sequencer Miscellaneous
- * Sequencer Mescellaneous
+ * Sequencer Miscellaneous
* \ingroup Sequencer
* \{
*/
SND_SEQ_EVENT_STOP,
/** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
SND_SEQ_EVENT_SETPOS_TICK,
- /** Set realtime queue position; event data type = #snd_seq_ev_queue_control_t */
+ /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
SND_SEQ_EVENT_SETPOS_TIME,
/** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
SND_SEQ_EVENT_TEMPO,
* \param ev event instance
* \param q queue id to schedule
* \param relative relative time-stamp if non-zero
- * \param ttick tick time-stap to be delivered
+ * \param ttick tick time-stamp to be delivered
*/
#define snd_seq_ev_schedule_tick(ev, q, relative, ttick) \
((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\
/**
* \brief set the start queue event
* \param ev event record
- * \param q queud id to start
+ * \param q queue id to start
*/
#define snd_seq_ev_set_queue_start(ev, q) \
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_START, q, 0)
/**
* \brief set the stop queue event
* \param ev event record
- * \param q queud id to stop
+ * \param q queue id to stop
*/
#define snd_seq_ev_set_queue_stop(ev, q) \
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_STOP, q, 0)
/**
* \brief set the stop queue event
* \param ev event record
- * \param q queud id to continue
+ * \param q queue id to continue
*/
#define snd_seq_ev_set_queue_continue(ev, q) \
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_CONTINUE, q, 0)
/**
* \brief set the stop queue event
* \param ev event record
- * \param q queud id to change tempo
+ * \param q queue id to change tempo
* \param val the new tempo value
*/
#define snd_seq_ev_set_queue_tempo(ev, q, val) \
/**
* \brief set the real-time position of a queue
* \param ev event record
- * \param q queud id to change tempo
+ * \param q queue id to change tempo
* \param rtime the new real-time pointer
*/
#define snd_seq_ev_set_queue_pos_real(ev, q, rtime) \
/**
* \brief set the tick-time position of a queue
* \param ev event record
- * \param q queud id to change tempo
+ * \param q queue id to change tempo
* \param ttime the new tick-time
*/
#define snd_seq_ev_set_queue_pos_tick(ev, q, ttime) \
(ev)->data.control.value = (val))
/**
- * \brief set pitchbend event
+ * \brief set pitch-bend event
* \param ev event record
* \param ch channel number
* \param val pitch bend; zero centered from -8192 to 8191
/** global timer - RTC */
#define SND_TIMER_GLOBAL_RTC 1
-/** timer open mode flag - nonblocking behaviour */
+/** timer open mode flag - non-blocking behaviour */
#define SND_TIMER_OPEN_NONBLOCK 0x0001
/** timer handle type */
hval += item.key[count];
}
- /* First hash function: simply take the modul but prevent zero. */
+ /* First hash function: simply take the modulo but prevent zero. */
hval %= htab->size;
if (hval == 0)
++hval;
do
{
/* Because SIZE is prime this guarantees to step through all
- available indeces. */
+ available indexes. */
if (idx <= hval2)
idx = htab->size + idx - hval2;
else
The ASCII characters representing whitespace can occur within literal
strings, int which case they are protected from the normal parsing process
-(tey remain as part of the string). For example:
+(they remain as part of the string). For example:
\code
name "John Smith"
\subsection conf_brackets Brackets
-Open and close brackets indicate single array definition. The identificators
+Open and close brackets indicate single array definition. The identifiers
are automatically generated starting with zero.
\code
}
\endcode
-\section confarg_refer Refering argument
+\section confarg_refer Referring argument
-Arguments are refered by dollar-sign ($) and name of argument:
+Arguments are referred by dollar-sign ($) and name of argument:
\code
card $CARD
<P>The ALSA library accepts the runtime modification of configuration.
The several build-in functions are available.</P>
-<P>The function is refered using id @func and function name. All other
+<P>The function is referred using id @func and function name. All other
values in the current compound are used as configuration for the function.
If compound func.<function_name> is defined in the root leafs, then library
and function from this compound configuration is used, otherwise the prefix
<LI>The function load - snd_config_hook_load() - loads and parses the given
configuration files.
<LI>The function load_for_all_cards - snd_config_hook_load_for_all_cards() -
- loads and parses the given configuration files for all installed soundcards.
- The driver name (type of soundcard) is passed in the private configuration
+ loads and parses the given configuration files for all installed sound-cards.
+ The driver name (type of sound-card) is passed in the private configuration
node.
</UL>
}
}
if ((err = snd_config_search(config, "files", &n)) < 0) {
- SNDERR("Unable to find field files in the preload section");
+ SNDERR("Unable to find field files in the pre-load section");
return -EINVAL;
}
if ((err = snd_config_expand(n, root, NULL, private_data, &n)) < 0) {
- SNDERR("Unable to expand filenames in the preload section");
+ SNDERR("Unable to expand filenames in the pre-load section");
return err;
}
if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) {
# ALSA library configuration file
#
-# preload configuration files
+# pre-load the configuration files
@hooks [
{
strings. The result is string.
<LI>The datadir function - snd_func_datadir() - returns the
data directory. The result is string.
- <LI>The refer function - snd_func_refer() - copies the refered
- configuration. The result is same as the refered node.
+ <LI>The refer function - snd_func_refer() - copies the referred
+ configuration. The result is same as the referred node.
<LI>The card_driver function - snd_func_card_driver() - returns
the driver identification. The result is string.
<LI>The card_id function - snd_func_card_id() - returns
#endif
/**
- * \brief Copy the refered configuration node
- * \param dst The destination node (result type is same as refered node)
+ * \brief Copy the referred configuration node
+ * \param dst The destination node (result type is same as referred node)
* \param root The root source node (can be modified!!!)
* \param src The source node
* \param private_data The private_data node
* \return zero if success, otherwise a negative error code
*
* The accepted format is an integer value in ASCII representation
- * or the card identifier (snd_id parameter for soundcard drivers).
+ * or the card identifier (snd_id parameter for sound-card drivers).
*/
int snd_card_get_index(const char *string)
{
}
/**
- * \brief Get a list of element identificators
+ * \brief Get a list of element identifiers
* \param ctl CTL handle
- * \param list CTL element identificators list pointer
+ * \param list CTL element identifiers list pointer
* \return 0 on success otherwise a negative error code
*/
int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list)
}
/**
- * \brief allocate space for CTL element identificators list
- * \param obj CTL element identificators list
+ * \brief allocate space for CTL element identifiers list
+ * \param obj CTL element identifiers list
* \param entries Entries to allocate
* \return 0 on success otherwise a negative error code
*/
}
/**
- * \brief free previously allocated space for CTL element identificators list
- * \param obj CTL element identificators list
+ * \brief free previously allocated space for CTL element identifiers list
+ * \param obj CTL element identifiers list
*/
void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj)
{
}
/**
- * \brief Get CTL element identificator for an element related event
+ * \brief Get CTL element identifier for an element related event
* \param obj CTL event
- * \param ptr Pointer to returned CTL element identificator
+ * \param ptr Pointer to returned CTL element identifier
*/
void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Get element numeric identificator for an element related event
+ * \brief Get element numeric identifier for an element related event
* \param obj CTL event
- * \return element numeric identificator
+ * \return element numeric identifier
*/
unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get interface part of CTL element identificator for an element related event
+ * \brief Get interface part of CTL element identifier for an element related event
* \param obj CTL event
- * \return interface part of element identificator
+ * \return interface part of element identifier
*/
snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get device part of CTL element identificator for an element related event
+ * \brief Get device part of CTL element identifier for an element related event
* \param obj CTL event
- * \return device part of element identificator
+ * \return device part of element identifier
*/
unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get subdevice part of CTL element identificator for an element related event
+ * \brief Get subdevice part of CTL element identifier for an element related event
* \param obj CTL event
- * \return subdevice part of element identificator
+ * \return subdevice part of element identifier
*/
unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get name part of CTL element identificator for an element related event
+ * \brief Get name part of CTL element identifier for an element related event
* \param obj CTL event
- * \return name part of element identificator
+ * \return name part of element identifier
*/
const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get index part of CTL element identificator for an element related event
+ * \brief Get index part of CTL element identifier for an element related event
* \param obj CTL event
- * \return index part of element identificator
+ * \return index part of element identifier
*/
unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj)
{
}
/**
- * \brief Get numeric identificator from a CTL element identificator
- * \param obj CTL element identificator
- * \return CTL element numeric identificator
+ * \brief Get numeric identifier from a CTL element identifier
+ * \param obj CTL element identifier
+ * \return CTL element numeric identifier
*/
unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj)
{
}
/**
- * \brief Get interface part of a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Get interface part of a CTL element identifier
+ * \param obj CTL element identifier
* \return CTL element related interface
*/
snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj)
}
/**
- * \brief Get device part of a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Get device part of a CTL element identifier
+ * \param obj CTL element identifier
* \return CTL element related device
*/
unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj)
}
/**
- * \brief Get subdevice part of a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Get subdevice part of a CTL element identifier
+ * \param obj CTL element identifier
* \return CTL element related subdevice
*/
unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj)
}
/**
- * \brief Get name part of a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Get name part of a CTL element identifier
+ * \param obj CTL element identifier
* \return CTL element name
*/
const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj)
}
/**
- * \brief Get index part of a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Get index part of a CTL element identifier
+ * \param obj CTL element identifier
* \return CTL element index
*/
unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj)
}
/**
- * \brief Set numeric identificator for a CTL element identificator
- * \param obj CTL element identificator
- * \param val CTL element numeric identificator
+ * \brief Set numeric identifier for a CTL element identifier
+ * \param obj CTL element identifier
+ * \param val CTL element numeric identifier
*/
void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val)
{
}
/**
- * \brief Set interface part for a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Set interface part for a CTL element identifier
+ * \param obj CTL element identifier
* \param val CTL element related interface
*/
void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val)
}
/**
- * \brief Set device part for a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Set device part for a CTL element identifier
+ * \param obj CTL element identifier
* \param val CTL element related device
*/
void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val)
}
/**
- * \brief Set subdevice part for a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Set subdevice part for a CTL element identifier
+ * \param obj CTL element identifier
* \param val CTL element related subdevice
*/
void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val)
}
/**
- * \brief Set name part for a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Set name part for a CTL element identifier
+ * \param obj CTL element identifier
* \param val CTL element name
*/
void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val)
}
/**
- * \brief Set index part for a CTL element identificator
- * \param obj CTL element identificator
+ * \brief Set index part for a CTL element identifier
+ * \param obj CTL element identifier
* \param val CTL element index
*/
void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val)
}
/**
- * \brief Get card identificator from a CTL card info
+ * \brief Get card identifier from a CTL card info
* \param obj CTL card info
- * \return card identificator
+ * \return card identifier
*/
const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj)
{
/**
* \brief Get card component list from a CTL card info
* \param obj CTL card info
- * \return card mixer identificator
+ * \return card mixer identifier
*/
const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj)
{
}
/**
- * \brief Set index of first wanted CTL element identificator in a CTL element identificators list
- * \param obj CTL element identificators list
+ * \brief Set index of first wanted CTL element identifier in a CTL element identifiers list
+ * \param obj CTL element identifiers list
* \param val index of CTL element to put at position 0 of list
*/
void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val)
}
/**
- * \brief Get number of used entries in CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get number of used entries in CTL element identifiers list
+ * \param obj CTL element identifier list
* \return number of used entries
*/
unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj)
}
/**
- * \brief Get total count of elements present in CTL device (information present in every filled CTL element identificators list)
- * \param obj CTL element identificator list
+ * \brief Get total count of elements present in CTL device (information present in every filled CTL element identifiers list)
+ * \param obj CTL element identifier list
* \return total number of elements
*/
unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj)
}
/**
- * \brief Get CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
- * \param ptr Pointer to returned CTL element identificator
+ * \param ptr Pointer to returned CTL element identifier
*/
void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Get CTL element numeric identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get CTL element numeric identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
- * \return CTL element numeric identificator
+ * \return CTL element numeric identifier
*/
unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx)
{
}
/**
- * \brief Get interface part of CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get interface part of CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
* \return CTL element related interface
*/
}
/**
- * \brief Get device part of CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get device part of CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
* \return CTL element related device
*/
}
/**
- * \brief Get subdevice part of CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get subdevice part of CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
* \return CTL element related subdevice
*/
}
/**
- * \brief Get name part of CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get name part of CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
* \return CTL element name
*/
}
/**
- * \brief Get index part of CTL element identificator for an entry of a CTL element identificators list
- * \param obj CTL element identificator list
+ * \brief Get index part of CTL element identifier for an entry of a CTL element identifiers list
+ * \param obj CTL element identifier list
* \param idx Index of entry
* \return CTL element index
*/
/**
* \brief Get info about readability from a CTL element id/info
* \param obj CTL element id/info
- * \return 0 if element is not redable, 1 if element is readable
+ * \return 0 if element is not readable, 1 if element is readable
*/
int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj)
{
/**
* \brief Get name for selected item in a #SND_CTL_ELEM_TYPE_ENUMERATED CTL element id/info
* \param obj CTL element id/info
- * \return name of choosen item
+ * \return name of chosen item
*/
const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get CTL element identificator of a CTL element id/info
+ * \brief Get CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param ptr Pointer to returned CTL element identificator
+ * \param ptr Pointer to returned CTL element identifier
*/
void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Get element numeric identificator of a CTL element id/info
+ * \brief Get element numeric identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return element numeric identificator
+ * \return element numeric identifier
*/
unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get interface part of CTL element identificator of a CTL element id/info
+ * \brief Get interface part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return interface part of element identificator
+ * \return interface part of element identifier
*/
snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get device part of CTL element identificator of a CTL element id/info
+ * \brief Get device part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return device part of element identificator
+ * \return device part of element identifier
*/
unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get subdevice part of CTL element identificator of a CTL element id/info
+ * \brief Get subdevice part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return subdevice part of element identificator
+ * \return subdevice part of element identifier
*/
unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get name part of CTL element identificator of a CTL element id/info
+ * \brief Get name part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return name part of element identificator
+ * \return name part of element identifier
*/
const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Get index part of CTL element identificator of a CTL element id/info
+ * \brief Get index part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \return index part of element identificator
+ * \return index part of element identifier
*/
unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj)
{
}
/**
- * \brief Set CTL element identificator of a CTL element id/info
+ * \brief Set CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param ptr CTL element identificator
+ * \param ptr CTL element identifier
*/
void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Set element numeric identificator of a CTL element id/info
+ * \brief Set element numeric identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val element numeric identificator
+ * \param val element numeric identifier
*/
void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val)
{
}
/**
- * \brief Set interface part of CTL element identificator of a CTL element id/info
+ * \brief Set interface part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val interface part of element identificator
+ * \param val interface part of element identifier
*/
void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val)
{
}
/**
- * \brief Set device part of CTL element identificator of a CTL element id/info
+ * \brief Set device part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val device part of element identificator
+ * \param val device part of element identifier
*/
void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val)
{
}
/**
- * \brief Set subdevice part of CTL element identificator of a CTL element id/info
+ * \brief Set subdevice part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val subdevice part of element identificator
+ * \param val subdevice part of element identifier
*/
void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val)
{
}
/**
- * \brief Set name part of CTL element identificator of a CTL element id/info
+ * \brief Set name part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val name part of element identificator
+ * \param val name part of element identifier
*/
void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val)
{
}
/**
- * \brief Set index part of CTL element identificator of a CTL element id/info
+ * \brief Set index part of CTL element identifier of a CTL element id/info
* \param obj CTL element id/info
- * \param val index part of element identificator
+ * \param val index part of element identifier
*/
void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val)
{
}
/**
- * \brief Get CTL element identificator of a CTL element id/value
+ * \brief Get CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param ptr Pointer to returned CTL element identificator
+ * \param ptr Pointer to returned CTL element identifier
*/
void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Get element numeric identificator of a CTL element id/value
+ * \brief Get element numeric identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return element numeric identificator
+ * \return element numeric identifier
*/
unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Get interface part of CTL element identificator of a CTL element id/value
+ * \brief Get interface part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return interface part of element identificator
+ * \return interface part of element identifier
*/
snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Get device part of CTL element identificator of a CTL element id/value
+ * \brief Get device part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return device part of element identificator
+ * \return device part of element identifier
*/
unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Get subdevice part of CTL element identificator of a CTL element id/value
+ * \brief Get subdevice part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return subdevice part of element identificator
+ * \return subdevice part of element identifier
*/
unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Get name part of CTL element identificator of a CTL element id/value
+ * \brief Get name part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return name part of element identificator
+ * \return name part of element identifier
*/
const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Get index part of CTL element identificator of a CTL element id/value
+ * \brief Get index part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return index part of element identificator
+ * \return index part of element identifier
*/
unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj)
{
}
/**
- * \brief Set CTL element identificator of a CTL element id/value
+ * \brief Set CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param ptr CTL element identificator
+ * \param ptr CTL element identifier
*/
void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Set element numeric identificator of a CTL element id/value
+ * \brief Set element numeric identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val element numeric identificator
+ * \param val element numeric identifier
*/
void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val)
{
}
/**
- * \brief Set interface part of CTL element identificator of a CTL element id/value
+ * \brief Set interface part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val interface part of element identificator
+ * \param val interface part of element identifier
*/
void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val)
{
}
/**
- * \brief Set device part of CTL element identificator of a CTL element id/value
+ * \brief Set device part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val device part of element identificator
+ * \param val device part of element identifier
*/
void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val)
{
}
/**
- * \brief Set subdevice part of CTL element identificator of a CTL element id/value
+ * \brief Set subdevice part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val subdevice part of element identificator
+ * \param val subdevice part of element identifier
*/
void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val)
{
}
/**
- * \brief Set name part of CTL element identificator of a CTL element id/value
+ * \brief Set name part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val name part of element identificator
+ * \param val name part of element identifier
*/
void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val)
{
}
/**
- * \brief Set index part of CTL element identificator of a CTL element id/value
+ * \brief Set index part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param val index part of element identificator
+ * \param val index part of element identifier
*/
void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val)
{
* See \ref hcontrol page for more details.
*/
/*
- * Control Interface - highlevel API
+ * Control Interface - high level API
* Copyright (c) 2000 by Jaroslav Kysela <perex@suse.cz>
* Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org>
*
/**
* \brief Search an HCTL element
* \param hctl HCTL handle
- * \param id Element identificator
+ * \param id Element identifier
* \return pointer to found HCTL element or NULL if it does not exists
*/
snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id)
}
/**
- * \brief Get CTL element identificator of a CTL element id/value
+ * \brief Get CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \param ptr Pointer to returned CTL element identificator
+ * \param ptr Pointer to returned CTL element identifier
*/
void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr)
{
}
/**
- * \brief Get element numeric identificator of a CTL element id/value
+ * \brief Get element numeric identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return element numeric identificator
+ * \return element numeric identifier
*/
unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj)
{
}
/**
- * \brief Get interface part of CTL element identificator of a CTL element id/value
+ * \brief Get interface part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return interface part of element identificator
+ * \return interface part of element identifier
*/
snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj)
{
}
/**
- * \brief Get device part of CTL element identificator of a CTL element id/value
+ * \brief Get device part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return device part of element identificator
+ * \return device part of element identifier
*/
unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj)
{
}
/**
- * \brief Get subdevice part of CTL element identificator of a CTL element id/value
+ * \brief Get subdevice part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return subdevice part of element identificator
+ * \return subdevice part of element identifier
*/
unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj)
{
}
/**
- * \brief Get name part of CTL element identificator of a CTL element id/value
+ * \brief Get name part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return name part of element identificator
+ * \return name part of element identifier
*/
const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj)
{
}
/**
- * \brief Get index part of CTL element identificator of a CTL element id/value
+ * \brief Get index part of CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
- * \return index part of element identificator
+ * \return index part of element identifier
*/
unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj)
{
case SND_CTL_ELEM_TYPE_IEC958:
break;
default:
- SNDERR("Unknow control type: %d", type);
+ SNDERR("Unknown control type: %d", type);
return -EINVAL;
}
}
/**
* \brief Find a mixer simple element
* \param mixer Mixer handle
- * \param id Mixer simple element identificator
+ * \param id Mixer simple element identifier
* \return mixer simple element handle or NULL if not found
*/
snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer,
}
/**
- * \brief Get mixer simple element identificator
+ * \brief Get mixer simple element identifier
* \param elem Mixer simple element handle
- * \param id returned mixer simple element identificator
+ * \param id returned mixer simple element identifier
*/
void snd_mixer_selem_get_id(snd_mixer_elem_t *elem,
snd_mixer_selem_id_t *id)
}
/**
- * \brief Get name part of mixer simple element identificator
+ * \brief Get name part of mixer simple element identifier
* \param elem Mixer simple element handle
- * \return name part of simple element identificator
+ * \return name part of simple element identifier
*/
const char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem)
{
}
/**
- * \brief Get index part of mixer simple element identificator
+ * \brief Get index part of mixer simple element identifier
* \param elem Mixer simple element handle
- * \return index part of simple element identificator
+ * \return index part of simple element identifier
*/
unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem)
{
/**
* \brief Return name of mixer simple element channel
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \return channel name
*/
const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel)
/**
* \brief Get info about channels of playback stream of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel Mixer simple element channel identificator
+ * \param channel Mixer simple element channel identifier
* \return 0 if channel is not present, 1 if present
*/
int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel)
/**
* \brief Return value of playback volume control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value pointer to returned value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Return value of playback switch control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value pointer to returned value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Set value of playback volume control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value control value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Set value of playback switch control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value control value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Get info about channels of capture stream of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel Mixer simple element channel identificator
+ * \param channel Mixer simple element channel identifier
* \return 0 if channel is not present, 1 if present
*/
int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel)
/**
* \brief Return value of capture volume control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value pointer to returned value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Return value of capture switch control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value pointer to returned value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Set value of capture volume control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value control value
* \return 0 on success otherwise a negative error code
*/
/**
* \brief Set value of capture switch control of a mixer simple element
* \param elem Mixer simple element handle
- * \param channel mixer simple element channel identificator
+ * \param channel mixer simple element channel identifier
* \param value control value
* \return 0 on success otherwise a negative error code
*/
}
/**
- * \brief Get name part of a mixer simple element identificator
- * \param obj Mixer simple element identificator
+ * \brief Get name part of a mixer simple element identifier
+ * \param obj Mixer simple element identifier
* \return name part
*/
const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj)
}
/**
- * \brief Get index part of a mixer simple element identificator
- * \param obj Mixer simple element identificator
+ * \brief Get index part of a mixer simple element identifier
+ * \param obj Mixer simple element identifier
* \return index part
*/
unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj)
}
/**
- * \brief Set name part of a mixer simple element identificator
- * \param obj Mixer simple element identificator
+ * \brief Set name part of a mixer simple element identifier
+ * \param obj Mixer simple element identifier
* \param val name part
*/
void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val)
}
/**
- * \brief Set index part of a mixer simple element identificator
- * \param obj Mixer simple element identificator
+ * \brief Set index part of a mixer simple element identifier
+ * \param obj Mixer simple element identifier
* \param val index part
*/
void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val)
specific time. One frame might contain one sample (when only one converter is
used - mono) or more samples (for example: stereo has signals from two converters
recorded at same time). Digital audio stream contains collection of frames
-recorded at boundaries of continous time periods.</P>
+recorded at boundaries of continuous time periods.</P>
\section pcm_general_overview General overview
ALSA uses the ring buffer to store outgoing (playback) and incoming (capture,
-record) samples. There are two pointers being mantained to allow
+record) samples. There are two pointers being maintained to allow
a precise communication between application and device pointing to current
processed sample by hardware and last processed sample by application.
The modern audio chips allow to program the transfer time periods.
It means that the stream of samples is divided to small chunks. Device
acknowledges to application when the transfer of a chunk is complete.
-\section pcm_transfer Transfer methods in unix environments
+\section pcm_transfer Transfer methods in UNIX environments
-In the unix environment, data chunk acknowledges are received via standard I/O
+In the UNIX environment, data chunk acknowledges are received via standard I/O
calls or event waiting routines (poll or select function). To accomplish
this list, the asynchronous notification of acknowledges should be listed
here. The ALSA implementation for these methods is described in
The full list of formats present the \link ::snd_pcm_format_t \endlink type.
The 24-bit linear samples uses 32-bit physical space, but the sample is
stored in low three bits. Some hardware does not support processing of full
-range, thus you may get the significative bits for linear samples via
+range, thus you may get the significant bits for linear samples via
\link ::snd_pcm_hw_params_get_sbits \endlink function. The example: ICE1712
chips support 32-bit sample processing, but low byte is ignored (playback)
or zero (capture). The function \link ::snd_pcm_hw_params_get_sbits() \endlink
these functions: \link ::snd_pcm_writen \endlink and \link ::snd_pcm_readn
\endlink.
-\subsection alsa_mmap_rw Direct Read / Write transfer (via mmaped areas)
+\subsection alsa_mmap_rw Direct Read / Write transfer (via mmap'ed areas)
There are two functions for this kind of transfer. Application can get an
access to memory areas via \link ::snd_pcm_mmap_begin \endlink function.
The ALSA PCM device uses two groups of PCM related parameters. The hardware
parameters contains the stream description like format, rate, count of
channels, ring buffer size etc. The software parameters contains the
-software (driver) related parameters. The communicatino behaviour can be
+software (driver) related parameters. The communication behaviour can be
controlled via these parameters, like automatic start, automatic stop,
interrupting (chunk acknowledge) etc. The software parameters can be
modified at any time (when valid hardware parameters are set). It includes
\par Silence threshold
The silence threshold specifies count of samples filled with silence
-ahead of the current application pointer for playback. It is useable
+ahead of the current application pointer for playback. It is usable
for applications when an overrun is possible (like tasks depending on
network I/O etc.). If application wants to manage the ahead samples itself,
the \link ::snd_pcm_rewind() \endlink function allows to forget the last
update \link ::snd_pcm_status_get_tstamp \endlink, delay in samples -
\link ::snd_pcm_status_get_delay \endlink, available count in samples -
\link ::snd_pcm_status_get_avail \endlink, maximum available samples -
-\link ::snd_pcm_status_get_avail_max \endlink, ADC overrange count in
+\link ::snd_pcm_status_get_avail_max \endlink, ADC over-range count in
samples - \link ::snd_pcm_status_get_overrange \endlink. The last two
parameters - avail_max and overrange are reset to zero after the status
call.
\subsection pcm_status_fast Obtaining fast device status
The function \link ::snd_pcm_avail_update \endlink updates the current
-available count of samples for writting (playback) or filled samples for
+available count of samples for writing (playback) or filled samples for
reading (capture).
<p>
The function \link ::snd_pcm_delay \endlink returns the delay in samples.
\par snd_pcm_prepare
The \link ::snd_pcm_prepare \endlink function enters the
-\link ::SND_PCM_STATE_PREPARED \endlink after a successfull finish.
+\link ::SND_PCM_STATE_PREPARED \endlink after a successful finish.
\par snd_pcm_start
The \link ::snd_pcm_start \endlink function enters
-the \link ::SND_PCM_STATE_RUNNING \endlink after a successfull finish.
+the \link ::SND_PCM_STATE_RUNNING \endlink after a successful finish.
\par snd_pcm_drop
The \link ::snd_pcm_drop \endlink function enters the
drivers cannot guarantee the synchronization (sample resolution) on hardware
lacking this feature, the \link ::snd_pcm_info_get_sync \endlink function
returns synchronization ID - \link ::snd_pcm_sync_id_t \endlink, which is equal
-for hardware synchronizated streams. When the \link ::snd_pcm_link \endlink
+for hardware synchronized streams. When the \link ::snd_pcm_link \endlink
function is called, all operations managing the stream state for these two
-streams are joined. The oposite function is \link ::snd_pcm_unlink \endlink.
+streams are joined. The opposite function is \link ::snd_pcm_unlink \endlink.
\section pcm_dev_names PCM naming conventions
\subsection pcm_dev_names_shm Shared memory device
The shm device uses the shm plugin. The two arguments (in order: SOCKET,PCM) specify
-unix socket name (for example /tmp/alsa.socket) for server communication and server's PCM name.
+UNIX socket name (for example /tmp/alsa.socket) for server communication and server's PCM name.
Example:
return pcm->ops->info(pcm->op_arg, info);
}
-/** \brief Install one PCM hardware configuration choosen from a configuration space and #snd_pcm_prepare it
+/** \brief Install one PCM hardware configuration chosen from a configuration space and #snd_pcm_prepare it
* \param pcm PCM handle
* \param params Configuration space definition container
* \return 0 on success otherwise a negative error code
*
- * The configuration is choosen fixing single parameters in this order:
+ * The configuration is chosen fixing single parameters in this order:
* first access, first format, first subformat, min channels, min rate,
* min period time, max buffer size, min tick time
*/
* \brief Stop a PCM preserving pending frames
* \param pcm PCM handle
* \return 0 on success otherwise a negative error code
- * \retval -ESTRPIPE a suspend event occured
+ * \retval -ESTRPIPE a suspend event occurred
*
* For playback wait for all pending frames to be played and then stop
* the PCM.
* \return a positive number of frames actually written otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an underrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an underrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour is selected, then routine waits until
* all requested bytes are played or put to the playback ring buffer.
- * The count of bytes can be less only if a signal or underrun occured.
+ * The count of bytes can be less only if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually written otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an underrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an underrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour is selected, then routine waits until
* all requested bytes are played or put to the playback ring buffer.
- * The count of bytes can be less only if a signal or underrun occured.
+ * The count of bytes can be less only if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually read otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an overrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an overrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour was selected, then routine waits until
* all requested bytes are filled. The count of bytes can be less only
- * if a signal or underrun occured.
+ * if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually read otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an overrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an overrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour was selected, then routine waits until
* all requested bytes are filled. The count of bytes can be less only
- * if a signal or underrun occured.
+ * if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \param pcm PCM handle
* \param timeout maximum time in milliseconds to wait
* \return a positive value on success otherwise a negative error code
- * \retval 0 timeout occured
+ * \retval 0 timeout occurred
* \retval 1 PCM stream is ready for I/O
*/
int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
/**
* \brief Get sample resolution info from a configuration space
* \param params Configuration space
- * \return significative bits in sample otherwise a negative error code if the info is not available
+ * \return signification bits in sample otherwise a negative error code if the info is not available
*/
int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params)
{
}
/**
- * \brief Get hardare fifo size info from a configuration space
+ * \brief Get hard are FIFO size info from a configuration space
* \param params Configuration space
- * \return fifo size in frames otherwise a negative error code if the info is not available
+ * \return FIFO size in frames otherwise a negative error code if the info is not available
*/
int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val target channels count
- * \return choosen channels count
+ * \return chosen channels count
*/
unsigned int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target rate
- * \return approximate choosen rate
+ * \return approximate chosen rate
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
unsigned int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target period duration in us
- * \return approximate choosen period duration in us
+ * \return approximate chosen period duration in us
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
unsigned int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target period size in frames
- * \return approximate choosen period size in frames
+ * \return approximate chosen period size in frames
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
snd_pcm_uframes_t 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)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target periods per buffer
- * \return approximate choosen periods per buffer
+ * \return approximate chosen periods per buffer
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
unsigned int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target buffer duration in us
- * \return approximate choosen buffer duration in us
+ * \return approximate chosen buffer duration in us
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
unsigned int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir)
{
}
/**
- * \brief Restrict a configuration space to contain only its maximum bufferd time
+ * \brief Restrict a configuration space to contain only its maximum buffered time
* \param pcm PCM handle
* \param params Configuration space
* \param dir Sub unit direction
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target buffer size in frames
- * \return approximate choosen buffer size in frames
+ * \return approximate chosen buffer size in frames
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)
{
* \param pcm PCM handle
* \param params Configuration space
* \param val approximate target tick duration in us
- * \return approximate choosen tick duration in us
+ * \return approximate chosen tick duration in us
*
- * target/choosen exact value is <,=,> val following dir (-1,0,1)
+ * target/chosen exact value is <,=,> val following dir (-1,0,1)
*/
unsigned int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir)
{
The algorithm for this coder was taken from:
Proposal for Standardized Audio Interstreamge Formats,
-IMA compatability project proceedings, Vol 2, Issue 2, May 1992.
+IMA compatibility project proceedings, Vol 2, Issue 2, May 1992.
- No, this is *not* a G.721 coder/decoder. The algorithm used by G.721
is very complicated, requiring oodles of floating-point ops per
*
* But in shift step bits are dropped. The net result of this is
* that even if you have fast mul/div hardware you cannot put it to
- * good use since the fixup would be too expensive.
+ * good use since the fix-up would be too expensive.
*/
step = StepSize[state->step_idx];
}
/**
- * \brief Silence a PCM samples buufer
+ * \brief Silence a PCM samples buffer
* \param format Sample format
* \param data Buffer
* \return samples Samples count
* \brief Compose a PCM sample linear format
* \param width Nominal bits per sample
* \param unsignd Sign: 0 signed, 1 unsigned
- * \return big_endian Endianness: 0 little endian, 1 big endian
+ * \return big_endian Endian: 0 little endian, 1 big endian
*/
snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian)
{
* \return a positive number of frames actually written otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an underrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an underrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour is selected, then routine waits until
* all requested bytes are played or put to the playback ring buffer.
- * The count of bytes can be less only if a signal or underrun occured.
+ * The count of bytes can be less only if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually written otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an underrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an underrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour is selected, then routine waits until
* all requested bytes are played or put to the playback ring buffer.
- * The count of bytes can be less only if a signal or underrun occured.
+ * The count of bytes can be less only if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually read otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an overrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an overrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour was selected, then routine waits until
* all requested bytes are filled. The count of bytes can be less only
- * if a signal or underrun occured.
+ * if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
* \return a positive number of frames actually read otherwise a
* negative error code
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
- * \retval -EPIPE an overrun occured
- * \retval -ESTRPIPE a suspend event occured (stream is suspended and waiting for an application recovery)
+ * \retval -EPIPE an overrun occurred
+ * \retval -ESTRPIPE a suspend event occurred (stream is suspended and waiting for an application recovery)
*
* If the blocking behaviour was selected, then routine waits until
* all requested bytes are filled. The count of bytes can be less only
- * if a signal or underrun occured.
+ * if a signal or underrun occurred.
*
* If the non-blocking behaviour is selected, then routine doesn't wait at all.
*/
for (k = 0; k < multi->slaves_count; ++k) {
err = snd_pcm_multi_hw_refine_sprepare(pcm, k, &sparams[k]);
if (err < 0) {
- SNDERR("Slave PCM #%d not useable", k);
+ SNDERR("Slave PCM #%d not usable", k);
return err;
}
}
channels_count = cchannel + 1;
}
if (channels_count == 0) {
- SNDERR("No cannels defined");
+ SNDERR("No channels defined");
return -EINVAL;
}
slaves_id = calloc(slaves_count, sizeof(*slaves_id));
This plugin discards contents of a PCM stream or creates a stream with zero
samples.
-Note: This implementation uses devices /dev/null (playback, must be writeable)
+Note: This implementation uses devices /dev/null (playback, must be writable)
and /dev/full (capture, must be readable).
\code
/* Choose one configuration from configuration space defined by PARAMS
- The configuration choosen is that obtained fixing in this order:
+ The configuration chosen is that obtained fixing in this order:
first access
first format
first subformat
return err;
err = sprepare(pcm, &sparams);
if (err < 0) {
- SNDERR("Slave PCM not useable");
+ SNDERR("Slave PCM not usable");
return err;
}
#ifdef RULES_DEBUG
/* Install one of the configurations present in configuration
space defined by PARAMS.
- The configuration choosen is that obtained fixing in this order:
+ The configuration chosen is that obtained fixing in this order:
first access
first format
first subformat
}
if (snd_pcm_format_mask_empty(&sfmt_mask)) {
- SNDERR("Unable to find an useable slave format for '%s'", pcm->name);
+ SNDERR("Unable to find an usable slave format for '%s'", pcm->name);
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
if (!snd_pcm_format_mask_test(format_mask, format))
continue;
_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
&access_mask);
if (snd_pcm_access_mask_empty(snd_pcm_hw_param_get_mask(sparams, SND_PCM_HW_PARAM_ACCESS))) {
- SNDERR("Unable to find an useable access for '%s'", pcm->name);
+ SNDERR("Unable to find an usable access for '%s'", pcm->name);
return -EINVAL;
}
}
}
if (snd_pcm_format_mask_empty(&fmt_mask)) {
- SNDERR("Unable to find an useable client format");
+ SNDERR("Unable to find an usable client format");
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
if (!snd_pcm_format_mask_test(format_mask, format))
continue;
# copy: only first channels are copied to destination
# duplicate: duplicate first set of channels
# default: copy policy, except for mono capture - sum
- ttable { # Transfer table (bidimensional compound of cchannels * schannels numbers)
+ ttable { # Transfer table (bi-dimensional compound of cchannels * schannels numbers)
CCHANNEL {
SCHANNEL REAL # route value (0.0 - 1.0)
}
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
-These defaults can be freely overwritten in local cofiguration files.
+These defaults can be freely overwritten in local configuration files.
Example:
* Creates a new handle and opens a connection to the kernel
* sequencer interface.
* After a client is created successfully, an event
- * with #SND_SEQ_EVENT_CLIENT_START is broadcasted to announce port.
+ * with #SND_SEQ_EVENT_CLIENT_START is broadcast to announce port.
*/
int snd_seq_open(snd_seq_t **seqp, const char *name,
int streams, int mode)
*
* Closes the sequencer client and releases its resources.
* After a client is closed, an event with
- * #SND_SEQ_EVENT_CLIENT_EXIT is broadcasted to announce port.
+ * #SND_SEQ_EVENT_CLIENT_EXIT is broadcast to announce port.
* The connection between other clients are disconnected.
* Call this just before exiting your program.
*/
* \return the number of poll descriptors.
*
* Get the number of poll descriptors. The polling events to be checked
- * can be specifed by the second argument. When both input and output
+ * can be specified by the second argument. When both input and output
* are checked, pass \c POLLIN|POLLOUT
*/
int snd_seq_poll_descriptors_count(snd_seq_t *seq, short events)
}
/**
- * \brief Set the port-specifiied mode of a port_info container
+ * \brief Set the port-specified mode of a port_info container
* \param info port_info container
* \param val non-zero if specifying the port id at creation
*/
* - #SND_SEQ_PORT_TYPE_SYNTH Synth device
* - #SND_SEQ_PORT_TYPE_DIRECT_SAMPLE Sampling device (supporting download)
* - #SND_SEQ_PORT_TYPE_SAMPLE Sampling device (sample can be downloaded at any time)
- * - #SND_SEQ_PORT_TYPE_APPLICATION Application (suquencer/editor)
+ * - #SND_SEQ_PORT_TYPE_APPLICATION Application (sequencer/editor)
*
- * A port may contain speicific midi channels, midi voices and synth voices.
+ * A port may contain specific midi channels, midi voices and synth voices.
* These values could be zero as default.
*/
int snd_seq_create_port(snd_seq_t *seq, snd_seq_port_info_t * port)
}
/**
- * \brief obatin the information of a port on an arbitrary client
+ * \brief obtain the information of a port on an arbitrary client
* \param seq sequencer handle
* \param client client id to get
* \param port port id to get
}
/**
- * \brief obatin the information of a port on the current client
+ * \brief obtain the information of a port on the current client
* \param seq sequencer handle
* \param port port id to get
* \param info pointer information returns
}
/**
- * \brief Get the number of subscriptiosn of a query_subscribe container
+ * \brief Get the number of subscriptions of a query_subscribe container
* \param info query_subscribe container
* \return number of subscriptions
*/
/**
* \brief Set the conditional bit flags of a queue_info container
* \param info queue_info container
- * \param flags contidional bit flags
+ * \param flags conditional bit flags
*/
void snd_seq_queue_info_set_flags(snd_seq_queue_info_t *info, unsigned int flags)
{
}
/**
- * \brief allocate a queue with the speicified name
+ * \brief allocate a queue with the specified name
* \param seq sequencer handle
* \param name the name of the new queue
* \return the queue id (zero or positive) on success otherwise a negative error code
}
/**
- * \breif delete the specified queue
+ * \brief delete the specified queue
* \param seq sequencer handle
* \param q queue id to delete
* \return 0 on success otherwise a negative error code
/**
* \brief output an event onto the lib buffer without draining buffer
* \param seq sequencer handle
- * \param ev event ot be output
+ * \param ev event to be output
* \return the byte size of remaining events. \c -EAGAIN if the buffer becomes full.
*
* This function doesn't drain buffer unlike snd_seq_event_output().
* The event is created via snd_seq_create_event(), and its pointer is stored on
* ev argument.
*
- * This function firstly recives the event byte-stream data from sequencer
+ * This function firstly receives the event byte-stream data from sequencer
* as much as possible at once. Then it retrieves the first event record
* and store the pointer on ev.
- * By calling this function succeedingly, events are extract from the input buffer.
+ * By calling this function sequentially, events are extracted from the input buffer.
*
* If there is no input from sequencer, function falls into sleep
* in blocking mode until an event is received,
* When events exist, they are transferred to the input buffer,
* and the number of received events are returned.
* If fetch_sequencer argument is zero and
- * no events remain on the input buffer, function simplly returns zero.
+ * no events remain on the input buffer, function simply returns zero.
*/
int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer)
{
/**
* \brief Set the instrument id of an instr_header container
* \param info instr_header container
- * \param id instrumen id pointer
+ * \param id instrument id pointer
*/
void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id)
{
* To send at scheduled time, set the schedule in \a ev.
* If \a ev is NULL, the event is composed locally and sent immediately
* to the specified queue. In any cases, you need to call #snd_seq_drain_event
- * apropriately to feed the event.
+ * appropriately to feed the event.
*/
int snd_seq_control_queue(snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev)
{
* \brief delete the port
* \param seq sequencer handle
* \param port port id
- * \return 0 on success or negavie error code
+ * \return 0 on success or negative error code
*/
int snd_seq_delete_simple_port(snd_seq_t *seq, int port)
{
}
/**
- * \brief sipmle subscription (w/o exclusive & time conversion)
+ * \brief simple subscription (w/o exclusive & time conversion)
* \param myport the port id as sender
* \param dest_client destination client id
* \param dest_port destination port id
*
* Author: Jaroslav Kysela <perex@suse.cz>
*
- * Author of bandpass filtersweep effect:
+ * Author of bandpass filter sweep effect:
* Maarten de Boer <mdeboer@iua.upf.es>
*
* This small demo program can be used for measuring latency between
#define FILTERSWEEP_LFO_FREQ 0.2
#define FILTER_BANDWIDTH 50
-/* filter sweep variables */
+/* filter the sweep variables */
float lfo,dlfo,fs,fc,BW,C,D,a0,a1,a2,b1,b2,*x[3],*y[3];
void applyeffect(char* buffer,int r)
-b,--block block mode
-t,--time maximal tick time in us
-p,--poll use poll (wait for event - reduces CPU usage)
--e,--effect apply an effect (bandpass filtersweep)
+-e,--effect apply an effect (bandpass filter sweep)
");
printf("Recognized sample formats are:");
for (k = 0; k < SND_PCM_FORMAT_LAST; ++(unsigned long) k) {
}
printf("\n\n");
printf("\
-Tip #1 (useable latency with large periods, non-blocking mode, good CPU usage,
+Tip #1 (usable latency with large periods, non-blocking mode, good CPU usage,
superb xrun prevention):
latency -m 8192 -M 8192 -t 1 -p
Tip #2 (superb latency, non-blocking mode, but heavy CPU usage):
return 0;
}
- /* initialize filter sweep variables */
+ /* initialize the filter sweep variables */
if (effect) {
fs = (float) rate;
BW = FILTER_BANDWIDTH;
.fi
.SH DESCRIPTION
-The \fCmfread\fR function reads and inteprets a standard MIDI file.
+The \fCmfread\fR function reads and interprets a standard MIDI file.
To use it you need to understand the general form of a
MIDI file and the type of information it contains, but you don't
need to know much, if anything, about the detailed format of the file
0x05 Lyric
0x06 Marker
0x07 Cue Point
-0x08-0x0F Reserverd but Undefined
+0x08-0x0F Reserved but Undefined
.fi
.in -1i
\fCMf_text\fR is called for each of these; the arguments are
the type number, the message length, and a pointer to the message buffer.
-Misceallaneous \fImeta\fR messages are handled by \fCMf_metamisc\fR,
+Miscellaneous \fImeta\fR messages are handled by \fCMf_metamisc\fR,
sequencer-specific messages are handled by \fCMf_seqspecific\fR, and
arbitrary "escape" messages (started with 0xF7) are handled by
\fCMf_arbitrary\fR.
routines to write the actual MIDI data. The routine
\fCMf_writetrack\fR will be passed a single parameter which is the
number of the track to be written. The pointer \fCMf_putc\fR should be
-set to point to a routine that accepts a charcter as input, writes that
+set to point to a routine that accepts a character as input, writes that
character to a file, and returns the value that was written. In the
case of a format 1 file, a routine has to be written to write a tempo
map, and assigned to the function pointer \fCMf_writetempotrack\fR.
bits 14 through 0 represent the number of delta-time "ticks"
which make up a quarter note. If bit 15 of division is a one,
delta-times in a file correspond to subdivisions of a second
-similiar to SMPTE and MIDI time code. In this format bits
+similar to SMPTE and MIDI time code. In this format bits
14 through 8 contain one of four values - 24, -25, -29, or -30,
corresponding to the four standard SMPTE and MIDI time code
frame per second formats, where -29 represents 30 drop frame.
.SH WRITING EXAMPLE
The following is a simple program to demonstrate writing MIDI files.
The track would consist of a series of quarter notes from lowest to
-highest in pitch at constant velocity, each separted by a quarter-note
+highest in pitch at constant velocity, each separated by a quarter-note
rest.
.sp
.in +1i
* The file format implemented here is called
* Standard MIDI Files, and is part of the Musical
* instrument Digital Interface specification.
- * The spec is avaiable from:
+ * The spec is available from:
*
* International MIDI Association
* 5316 West 57th Street
* (1) can now set the global variable Mf_interactive to 1 to prevent the
* reading functions from looking for file and track headers
* (2) can now write system exclusive data with
- * mf_write_midi_event(delta_time, system_exlusive, 0, data, size)
+ * mf_write_midi_event(delta_time, system_exclusive, 0, data, size)
* (3) changed definition of 'sequencer_specific' in midifile.h to 0x7f
* (4) changed mf_write_tempo to take additional delta_time as first argument
* (since delta need not be zero)
* because Mf_currtime does not really measure time at all, since
* its units change value at every tempo change. Mf_realtime is
* the midi-time elapsed in units of 1/16 of a centisecond (but it
- * does not handle smpte times)
+ * does not handle SMPTE times)
* (9) maintains a history of tempo settings to update Mf_currtempo,
* to handle tempo tracks.
* (10) if there is an Mf_error function, the error routine no longer
static int laststatus = 0;
/*
- * mfwrite() - The only fuction you'll need to call to write out
+ * mfwrite() - The only function you'll need to call to write out
* a midi file.
*
* format 0 - Single multi-channel track
* bits 14 through 0 represent the number of delta-time
* "ticks" which make up a quarter note. If bit 15 of
* division is a one, delta-times in a file correspond to
- * subdivisions of a second similiar to SMPTE and MIDI
+ * subdivisions of a second similar to SMPTE and MIDI
* time code. In this format bits 14 through 8 contain
* one of four values - 24, -25, -29, or -30,
* corresponding to the four standard SMPTE and MIDI
/* 7 bit controllers */
#define damper_pedal 0x40
#define portamento 0x41
-#define sostenuto 0x42
+#define sustenuto 0x42
#define soft_pedal 0x43
#define general_4 0x44
#define hold_2 0x45
/*
- * This small demo generates simple sinus wave on output of speakers.
+ * This small demo sends a simple sinusoidal wave to your speakers.
*/
#include <stdio.h>
int channels = 1; /* count of channels */
int buffer_time = 500000; /* ring buffer length in us */
int period_time = 100000; /* period time in us */
-double freq = 440; /* sinus wave frequency in Hz */
+double freq = 440; /* sinusoidal wave frequency in Hz */
snd_pcm_sframes_t buffer_size;
snd_pcm_sframes_t period_size;
printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
return -EINVAL;
}
- /* set buffer time */
+ /* set the buffer time */
err = snd_pcm_hw_params_set_buffer_time_near(handle, params, buffer_time, &dir);
if (err < 0) {
printf("Unable to set buffer time %i for playback: %s\n", buffer_time, snd_strerror(err));
return err;
}
buffer_size = snd_pcm_hw_params_get_buffer_size(params);
- /* set period time */
+ /* set the period time */
err = snd_pcm_hw_params_set_period_time_near(handle, params, period_time, &dir);
if (err < 0) {
printf("Unable to set period time %i for playback: %s\n", period_time, snd_strerror(err));
{
int err;
- /* get current swparams */
+ /* get the current swparams */
err = snd_pcm_sw_params_current(handle, swparams);
if (err < 0) {
printf("Unable to determine current swparams for playback: %s\n", snd_strerror(err));
return err;
}
- /* start transfer when the buffer is full */
+ /* start the transfer when the buffer is full */
err = snd_pcm_sw_params_set_start_threshold(handle, swparams, buffer_size);
if (err < 0) {
printf("Unable to set start threshold mode for playback: %s\n", snd_strerror(err));
return err;
}
- /* allow transfer when at least period_size samples can be processed */
+ /* allow the transfer when at least period_size samples can be processed */
err = snd_pcm_sw_params_set_avail_min(handle, swparams, period_size);
if (err < 0) {
printf("Unable to set avail min for playback: %s\n", snd_strerror(err));
return err;
}
- /* align all transfers to 1 samples */
+ /* align all transfers to 1 sample */
err = snd_pcm_sw_params_set_xfer_align(handle, swparams, 1);
if (err < 0) {
printf("Unable to set transfer align for playback: %s\n", snd_strerror(err));
return err;
}
- /* write the parameters to device */
+ /* write the parameters to the playback device */
err = snd_pcm_sw_params(handle, swparams);
if (err < 0) {
printf("Unable to set sw params for playback: %s\n", snd_strerror(err));
static int xrun_recovery(snd_pcm_t *handle, int err)
{
- if (err == -EPIPE) { /* underrun */
+ if (err == -EPIPE) { /* under-run */
err = snd_pcm_prepare(handle);
if (err < 0)
printf("Can't recovery from underrun, prepare failed: %s\n", snd_strerror(err));
return 0;
} else if (err == -ESTRPIPE) {
while ((err = snd_pcm_resume(handle)) == -EAGAIN)
- sleep(1); /* wait until suspend flag is released */
+ sleep(1); /* wait until the suspend flag is released */
if (err < 0) {
err = snd_pcm_prepare(handle);
if (err < 0)
cptr -= err;
if (cptr == 0)
break;
- /* it is possible, that initial buffer cannot store */
- /* all data from last period, so wait awhile */
+ /* it is possible, that the initial buffer cannot store */
+ /* all data from the last period, so wait awhile */
err = wait_for_poll(handle, ufds, count);
if (err < 0) {
if (snd_pcm_state(handle) == SND_PCM_STATE_XRUN ||
-f,--frequency sine wave frequency in Hz
-b,--buffer ring buffer size in samples
-p,--period period size in us
--m,--method tranfer method
+-m,--method transfer method
");
printf("Recognized sample formats are:");
printf(" %s", s);
}
printf("\n");
- printf("Recognized tranfer methods are:");
+ printf("Recognized transfer methods are:");
for (k = 0; transfer_methods[k].name; k++)
printf(" %s", transfer_methods[k].name);
printf("\n");
#include "../include/asoundlib.h"
-/* send real-time time stamps instead of midi ticks to the ALSA sequencer */
+/* send the real-time time stamps (instead of midi ticks) to the ALSA sequencer */
static int use_realtime = 0;
-/* control event buffering by blocking mode */
+/* control the event buffering by using a blocking mode */
static int use_blocking_mode = 1;
/* default destination queue, client and port numbers */
/* event pool size */
#define WRITE_POOL_SIZE 200
#define WRITE_POOL_SPACE 10
-#define READ_POOL_SIZE 10 /* we need read pool only for echoing */
+#define READ_POOL_SIZE 10 /* we need to read the pool only for echoing */
static FILE *F;
static snd_seq_t *seq_handle = NULL;
}
}
-/* read byte */
+/* read the byte */
static int mygetc(void)
{
return getc(F);
}
-/* print out text */
+/* print out the text */
static void mytext(int type ATTRIBUTE_UNUSED, int leng, char *msg)
{
char *p;
alsa_stop_timer();
exit(1);
}
- /* set ppq */
+ /* set the ppq */
snd_seq_queue_tempo_alloca(&tempo);
- /* ppq must be set before starting timer */
+ /* ppq must be set before starting the timer */
if (snd_seq_get_queue_tempo(seq_handle, dest_queue, tempo) < 0) {
perror("get_queue_tempo");
exit(1);
}
}
-/* fill time */
+/* fill the event time */
static void set_event_time(snd_seq_event_t *ev, unsigned int currtime)
{
if (use_realtime) {
}
}
-/* fill normal event header */
+/* fill the normal event header */
static void set_event_header(snd_seq_event_t *ev)
{
snd_seq_ev_clear(ev);
set_event_time(ev, Mf_currtime);
}
-/* start timer */
+/* start the timer */
static void alsa_start_timer(void)
{
snd_seq_start_queue(seq_handle, dest_queue, NULL);
}
-/* stop timer */
+/* stop the timer */
static void alsa_stop_timer(void)
{
snd_seq_event_t ev;
snd_seq_stop_queue(seq_handle, dest_queue, &ev);
}
-/* change tempo */
+/* change the tempo */
static void do_tempo(int us)
{
snd_seq_event_t ev;
printf("Tempo %d us/beat, %.2f bpm\n", us, bpm);
}
- /* store new tempo and timestamp of tempo change */
+ /* store the new tempo and timestamp of the tempo change */
local_secs = tick2time_dbl(Mf_currtime);
local_ticks = Mf_currtime;
local_tempo = us;
static void do_pitchbend(int chan, int lsb, int msb)
-{ /* !@#$% lsb & msb are in wrong order in docs */
+{ /* !@#$% lsb & msb are in the wrong order in docs */
snd_seq_event_t ev;
if (verbose >= VERB_EVENT)
snd_seq_event_t *input_event;
if (use_blocking_mode) {
- /* read event - blocked until any event is read */
+ /* read the event - blocked until any event is read */
left = snd_seq_event_input(seq_handle, &input_event);
} else {
- /* read event - using select syscall */
+ /* read the event - using select syscall */
while ((left = snd_seq_event_input(seq_handle, &input_event)) >= 0 &&
input_event == NULL) {
int npfds = snd_seq_poll_descriptors_count(seq_handle, POLLIN);
return input_event;
}
-/* synchronize to the end of event */
+/* synchronize to the end of the event */
static void alsa_sync(void)
{
- /* send echo event to self client. */
+ /* send the echo event to the self client. */
if (verbose >= VERB_MUCH)
printf("alsa_sync syncing...\n");
- /* dump buffer */
+ /* dump the buffer */
snd_seq_drain_output(seq_handle);
snd_seq_sync_output_queue(seq_handle);
if (verbose >= VERB_MUCH)
}
-/* wait for start of the queue */
+/* wait for the start of the queue */
static void wait_start(void)
{
snd_seq_event_t *input_event;
- /* wait the start event from the system timer */
+ /* wait for the start event from the system timer */
for (;;) {
input_event = wait_for_event();
if (input_event) {
}
-/* print usage */
+/* print the usage */
static void usage(void)
{
fprintf(stderr, "usage: playmidi1 [options] [file]\n");
fprintf(stderr, " -a client:port : set destination address (default=%d:%d)\n",
DEST_CLIENT_NUMBER, DEST_PORT_NUMBER);
fprintf(stderr, " -q queue: use the specified queue\n");
- fprintf(stderr, " -s queue: slave mode (allow external clock synchronisation)\n");
+ fprintf(stderr, " -s queue: slave mode (allow external clock synchronization)\n");
fprintf(stderr, " -r : play on real-time mode\n");
fprintf(stderr, " -b : play on non-blocking mode\n");
}
printf("ALSA MIDI Player, feeding events to song queue\n");
}
- /* open sequencer device */
- /* Here we open the device read/write for slave mode. */
+ /* open the sequencer device */
+ /* Here we open the device in read/write for slave mode. */
tmp = snd_seq_open(&seq_handle, "hw", slave ? SND_SEQ_OPEN_DUPLEX : SND_SEQ_OPEN_OUTPUT, 0);
if (tmp < 0) {
perror("open /dev/snd/seq");
exit(1);
}
- /* set name */
- /* set event filter to recieve only echo event */
- /* if running in slave mode also listen for START event */
+ /* set the name */
+ /* set the event filter to receive only the echo event */
+ /* if running in slave mode, also listen for a START event */
if (slave)
snd_seq_set_client_event_filter(seq_handle, SND_SEQ_EVENT_START);
snd_seq_set_client_name(seq_handle, "MIDI file player");
- /* create port */
+ /* create the port */
my_port = snd_seq_create_simple_port(seq_handle, "Port 0",
SND_SEQ_PORT_CAP_WRITE |
SND_SEQ_PORT_CAP_READ,
SND_SEQ_PORT_TYPE_MIDI_GENERIC);
if (my_port < 0) {
- perror("creat port");
+ perror("create port");
exit(1);
}
dest_client = dest_addr.client;
dest_port = dest_addr.port;
- /* setup queue */
+ /* set the queue */
if (dest_queue >= 0) {
shared_queue = 1;
if (snd_seq_set_queue_usage(seq_handle, dest_queue, 1) < 0) {
}
}
- /* setup subscriber */
+ /* set the subscriber */
tmp = snd_seq_connect_to(seq_handle, my_port, dest_client, dest_port);
if (tmp < 0) {
perror("subscribe");
exit(1);
}
- /* subscribe for timer START event */
+ /* subscribe for the timer START event */
if (slave) {
tmp = snd_seq_connect_from(seq_handle, my_port,
SND_SEQ_CLIENT_SYSTEM,
}
}
- /* change pool size */
+ /* change the pool size */
if (snd_seq_set_client_pool_output(seq_handle, WRITE_POOL_SIZE) < 0 ||
snd_seq_set_client_pool_input(seq_handle, READ_POOL_SIZE) < 0 ||
snd_seq_set_client_pool_output_room(seq_handle, WRITE_POOL_SPACE) < 0) {
fprintf(stderr, " example:\n");
fprintf(stderr, " rawmidi -i hw:0,0 -o /dev/midi1\n");
fprintf(stderr, " tests input for card 0, device 0, using snd_rawmidi API\n");
- fprintf(stderr, " and /dev/midi1 using file desciptors\n");
+ fprintf(stderr, " and /dev/midi1 using file descriptors\n");
}
int stop=0;
printf("%sEvent = %s", space, event_names[ev->type]);
else
printf("%sEvent = Reserved %d\n", space, ev->type);
- /* decode actual event data... */
+ /* decode the actual event data... */
switch (ev->type) {
case SND_SEQ_EVENT_NOTE:
printf("; ch=%d, note=%d, velocity=%d, off_velocity=%d, duration=%d\n",
}
bzero(&qtimer, sizeof(qtimer));
qtimer.type = SND_SEQ_TIMER_MASTER;
- /* note: last bit from subdevices specifies playback */
+ /* note: last bit from the subdevices specifies playback */
/* or capture direction for the timer specification */
qtimer.number = SND_TIMER_PCM(pcard, pdevice, pinfo.subdevice << 1);
if ((err = snd_seq_set_queue_timer(handle, queue, &qtimer)) < 0) {