SND_PCM_TYPE_DMIX,
/** Jack Audio Connection Kit plugin */
SND_PCM_TYPE_JACK,
+ SND_PCM_TYPE_LAST = SND_PCM_TYPE_JACK
};
/** PCM type */
* \{
*/
+const char *snd_pcm_type_name(snd_pcm_state_t state);
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);
ALSA_0.9.0 {
global:
+ snd_pcm_type_name;
snd_timer_query_info;
snd_timer_query_params;
snd_timer_query_status;
}
#ifndef DOC_HIDDEN
+#define PCMTYPE(v) [SND_PCM_TYPE_##v] = #v
#define STATE(v) [SND_PCM_STATE_##v] = #v
#define STREAM(v) [SND_PCM_STREAM_##v] = #v
#define READY(v) [SND_PCM_READY_##v] = #v
#define FORMATD(v, d) [SND_PCM_FORMAT_##v] = d
#define SUBFORMATD(v, d) [SND_PCM_SUBFORMAT_##v] = d
+
static const char *snd_pcm_stream_names[] = {
STREAM(PLAYBACK),
STREAM(CAPTURE),
FORMATD(U18_3BE, "Unsigned 18 bit Big Endian in 3bytes"),
};
+static const char *snd_pcm_type_names[] = {
+ PCMTYPE(HW),
+ PCMTYPE(HOOKS),
+ PCMTYPE(MULTI),
+ PCMTYPE(FILE),
+ PCMTYPE(NULL),
+ PCMTYPE(SHM),
+ PCMTYPE(INET),
+ PCMTYPE(COPY),
+ PCMTYPE(LINEAR),
+ PCMTYPE(ALAW),
+ PCMTYPE(MULAW),
+ PCMTYPE(ADPCM),
+ PCMTYPE(RATE),
+ PCMTYPE(ROUTE),
+ PCMTYPE(PLUG),
+ PCMTYPE(SHARE),
+ PCMTYPE(METER),
+ PCMTYPE(MIX),
+ PCMTYPE(DROUTE),
+ PCMTYPE(LBSERVER),
+ PCMTYPE(LINEAR_FLOAT),
+ PCMTYPE(LADSPA),
+ PCMTYPE(DMIX),
+ PCMTYPE(JACK),
+};
+
static const char *snd_pcm_subformat_names[] = {
SUBFORMAT(STD),
};
}
/**
+ * \brief get name of PCM type
+ * \param type PCM type
+ * \return ascii name of PCM type
+ */
+#ifndef DOXYGEN
+const char *INTERNAL(snd_pcm_type_name)(snd_pcm_type_t type)
+#else
+const char *snd_pcm_type_name(snd_pcm_type_t type)
+#endif
+{
+ if (type > SND_PCM_TYPE_LAST)
+ return NULL;
+ return snd_pcm_type_names[type];
+}
+default_symbol_version(__snd_pcm_type_name, snd_pcm_type_name, ALSA_0.9.0);
+
+/**
* \brief Dump current hardware setup for PCM
* \param pcm PCM handle
* \param out Output handle
snd_pcm_t *slave = plugin->slave;
snd_pcm_uframes_t xfer = 0;
snd_pcm_sframes_t result;
+ int err;
while (size > 0) {
snd_pcm_uframes_t frames = size;
snd_pcm_uframes_t slave_offset;
snd_pcm_uframes_t slave_frames = ULONG_MAX;
- snd_pcm_mmap_begin(slave, &slave_areas, &slave_offset, &slave_frames);
- if (slave_frames == 0)
+ err = snd_pcm_mmap_begin(slave, &slave_areas, &slave_offset, &slave_frames);
+ if (err < 0 || slave_frames == 0)
break;
frames = plugin->write(pcm, areas, offset, frames,
slave_areas, slave_offset, &slave_frames);
}
params->boundary = boundary1;
sparams.boundary = boundary2;
+#if 0
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
rate->pitch = (((u_int64_t)boundary2 * DIV) + boundary1 / 2) / boundary1;
} else {
rate->pitch = (((u_int64_t)boundary1 * DIV) + boundary2 / 2) / boundary2;
}
+#endif
recalc(pcm, &sparams.avail_min);
recalc(pcm, &sparams.xfer_align);
recalc(pcm, &sparams.start_threshold);