summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libasound.c173
-rw-r--r--src/mixer.c264
-rw-r--r--src/pcm.c910
-rw-r--r--src/stubs.h1227
-rw-r--r--src/symversioning-hell.h236
-rw-r--r--src/util/defs.h29
-rw-r--r--src/util/dsp.c924
-rw-r--r--src/util/dsp.h163
-rw-r--r--src/util/sysex.h120
-rw-r--r--src/util/util.h29
10 files changed, 4075 insertions, 0 deletions
diff --git a/src/libasound.c b/src/libasound.c
new file mode 100644
index 0000000..b43ae95
--- /dev/null
+++ b/src/libasound.c
@@ -0,0 +1,173 @@
+#include <alsa/asoundlib.h>
+#include <alsa/pcm.h>
+#include <alsa/pcm_plugin.h>
+#include <alsa/pcm_extplug.h>
+#include <alsa/pcm_ioplug.h>
+#include <alsa/control_external.h>
+#include <alsa/mixer_abst.h>
+#include <alsa/use-case.h>
+#include <alsa/topology.h>
+
+#include "util/util.h"
+#include "stubs.h"
+#include "symversioning-hell.h"
+
+struct _snd_config { char noop; } s_snd_config;
+struct _snd_config *snd_config = &s_snd_config;
+
+const char*
+snd_asoundlib_version(void)
+{
+ return "1.1.7";
+}
+
+const char*
+snd_strerror(int errnum)
+{
+ // Do not bother implementing this, just WARN/ERR directly in this lib
+ // Letting applications show useful error messages never works out
+ return "^";
+}
+
+snd_lib_error_handler_t snd_lib_error;
+
+int snd_lib_error_set_handler(snd_lib_error_handler_t handler)
+{
+ snd_lib_error = handler;
+ return 0;
+}
+
+int
+snd_card_load(int card)
+{
+ return 0;
+}
+
+int
+snd_card_next(int *card)
+{
+ if (card) {
+ *card = (*card == -1 ? 0 : -1);
+ return 0;
+ }
+
+ return -1;
+}
+
+int
+snd_card_get_index(const char *name)
+{
+ if (!strcmp(name, "default"))
+ return 0;
+
+ return -1;
+}
+
+int
+snd_card_get_name(int card, char **name)
+{
+ if (name) *name = "default";
+ return 0;
+}
+
+int snd_card_get_longname(int card, char **name)
+{
+ if (name) *name = "default";
+ return 0;
+}
+
+struct device_name_hint { char *name, *ioid; };
+
+int
+snd_device_name_hint(int card, const char *iface, void ***hints)
+{
+ static struct device_name_hint defaults[] = { { .name = "default", .ioid = "Output" }, { .name = "capture", .ioid = "Input" } };
+ static struct device_name_hint *array[] = { &defaults[0], &defaults[1], NULL };
+ *hints = (void**)array;
+ return 0;
+}
+
+char*
+snd_device_name_get_hint(const void *hint, const char *id)
+{
+ const struct device_name_hint *shint = hint;
+
+ if (!strcmp(id, "NAME"))
+ return c_strdup(shint->name);
+ else if (!strcmp(id, "IOID"))
+ return c_strdup(shint->ioid);
+
+ return NULL;
+}
+
+int
+snd_device_name_free_hint(void **hints)
+{
+ return 0;
+}
+
+struct _snd_ctl {
+ char noop;
+};
+
+int
+snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode)
+{
+ if (!(*ctl = calloc(1, sizeof(**ctl)))) {
+ WARNX1("calloc");
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+snd_ctl_close(snd_ctl_t *ctl)
+{
+ free(ctl);
+ return 0;
+}
+
+struct _snd_ctl_card_info {
+ const char *name;
+};
+
+size_t
+snd_ctl_card_info_sizeof(void)
+{
+ return sizeof(snd_ctl_card_info_t);
+}
+
+int
+snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr)
+{
+ if (!(*ptr = calloc(1, sizeof(**ptr))))
+ return -1;
+
+ return 0;
+}
+
+void
+snd_ctl_card_info_free(snd_ctl_card_info_t *obj)
+{
+ free(obj);
+}
+
+int
+snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info)
+{
+ info->name = "sndio";
+ return 0;
+}
+
+const char*
+snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj)
+{
+ return obj->name;
+}
+
+const char*
+snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj)
+{
+ return obj->name;
+}
diff --git a/src/mixer.c b/src/mixer.c
new file mode 100644
index 0000000..317f12c
--- /dev/null
+++ b/src/mixer.c
@@ -0,0 +1,264 @@
+#include <alsa/asoundlib.h>
+#include <sndio.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include "util/sysex.h"
+#include "util/util.h"
+
+struct _snd_mixer_elem {
+ snd_mixer_elem_t *next;
+ char name[SYSEX_NAMELEN];
+ unsigned int index, vol;
+};
+
+struct _snd_mixer {
+ struct mio_hdl *hdl;
+ snd_mixer_elem_t *controls;
+};
+
+#define MIXER_MAX_CHANNELS 16
+
+static bool
+onsysex(unsigned char *buf, unsigned len, snd_mixer_elem_t controls[MIXER_MAX_CHANNELS + 1])
+{
+ if (len < SYSEX_SIZE(empty))
+ return false;
+
+ union {
+ struct sysex x;
+ unsigned char buf[sizeof(struct sysex)];
+ } u;
+
+ memcpy(u.buf, buf, len);
+
+ if (u.x.type == SYSEX_TYPE_RT && u.x.id0 == SYSEX_CONTROL && u.x.id1 == SYSEX_MASTER) {
+ if (len == SYSEX_SIZE(master)) {
+ controls[0].vol = u.x.u.master.coarse;
+ snprintf(controls[0].name, sizeof(controls[0].name), "master");
+ }
+ return false;
+ }
+
+ if (u.x.type != SYSEX_TYPE_EDU || u.x.id0 != SYSEX_AUCAT)
+ return false;
+
+ switch (u.x.id1) {
+ case SYSEX_AUCAT_MIXINFO: {
+ unsigned cn = u.x.u.mixinfo.chan;
+ if (cn >= MIXER_MAX_CHANNELS || !memchr(u.x.u.mixinfo.name, '\0', SYSEX_NAMELEN))
+ return false;
+
+ snprintf(controls[cn + 1].name, sizeof(controls[cn + 1].name), "%s", u.x.u.mixinfo.name);
+ break;
+ }
+
+ case SYSEX_AUCAT_DUMPEND:
+ return true;
+ }
+
+ return false;
+}
+
+static void
+oncommon(unsigned char *buf, unsigned len, snd_mixer_elem_t controls[MIXER_MAX_CHANNELS + 1])
+{
+#define MIDI_CMDMASK 0xf0
+#define MIDI_CTL 0xb0
+#define MIDI_CTLVOL 7
+ if ((buf[0] & MIDI_CMDMASK) != MIDI_CTL || buf[1] != MIDI_CTLVOL)
+ return;
+
+#define MIDI_CHANMASK 0x0f
+ unsigned cn = (buf[0] & MIDI_CHANMASK);
+ if (cn >= MIXER_MAX_CHANNELS)
+ return;
+
+ controls[cn + 1].vol = buf[2];
+}
+
+static void
+get_controls(snd_mixer_t *mixer)
+{
+ const unsigned char dumpreq[] = {
+ SYSEX_START,
+ SYSEX_TYPE_EDU,
+ 0,
+ SYSEX_AUCAT,
+ SYSEX_AUCAT_DUMPREQ,
+ SYSEX_END,
+ };
+
+ static snd_mixer_elem_t controls[MIXER_MAX_CHANNELS + 1];
+ memset(controls, 0, sizeof(controls));
+
+ unsigned char buf[0x100];
+ mio_write(mixer->hdl, dumpreq, sizeof(dumpreq));
+ for (int ready = 0; !ready;) {
+ size_t size;
+ if (!(size = mio_read(mixer->hdl, buf, sizeof(buf)))) {
+ WARNX1("mio_read failed");
+ return;
+ }
+
+ static unsigned voice_len[] = { 3, 3, 3, 3, 2, 2, 3 };
+ static unsigned common_len[] = { 0, 2, 3, 2, 0, 0, 1, 1 };
+
+ unsigned char mmsg[0x100];
+ unsigned int mst = 0, midx = 0, mlen = 0;
+ for (unsigned char *p = buf; size > 0; --size, ++p) {
+ if (*p >= 0xf8) {
+ /* clock events */
+ } else if (*p >= 0xf0) {
+ if (mst == SYSEX_START && *p == SYSEX_END && midx < sizeof(mmsg)) {
+ mmsg[midx++] = *p;
+ ready = onsysex(mmsg, midx, controls);
+ continue;
+ }
+
+ mmsg[0] = *p;
+ mlen = common_len[*p & 7];
+ mst = *p;
+ midx = 1;
+ } else if (*p >= 0x80) {
+ mmsg[0] = *p;
+ mlen = voice_len[(*p >> 4) & 7];
+ mst = *p;
+ midx = 1;
+ } else if (mst) {
+ if (midx == sizeof(mmsg))
+ continue;
+
+ if (midx == 0)
+ mmsg[midx++] = mst;
+
+ mmsg[midx++] = *p;
+
+ if (midx == mlen) {
+ oncommon(mmsg, midx, controls);
+ midx = 0;
+ }
+ }
+ }
+ }
+
+ snd_mixer_elem_t **tail = &mixer->controls;
+ for (size_t i = 0; i < ARRAY_SIZE(controls); ++i) {
+ if (!controls[i].name[0])
+ continue;
+
+ *tail = &controls[i];
+ tail = &(*tail)->next;
+ }
+}
+
+int
+snd_mixer_open(snd_mixer_t **mixer, int mode)
+{
+ if (!(*mixer = calloc(1, sizeof(**mixer)))) {
+ WARNX1("calloc");
+ return -1;
+ }
+
+ if (!((*mixer)->hdl = mio_open("snd/0", MIO_OUT | MIO_IN, 0))) {
+ WARNX1("mio_open failed");
+ goto fail;
+ }
+
+ get_controls(*mixer);
+ return 0;
+
+fail:
+ free(*mixer);
+ return -1;
+}
+
+int
+snd_mixer_close(snd_mixer_t *mixer)
+{
+ mio_close(mixer->hdl);
+ free(mixer);
+ return 0;
+}
+
+struct _snd_mixer_selem_id {
+ char noop;
+};
+
+int
+snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr)
+{
+ if (!(*ptr = calloc(1, sizeof(**ptr))))
+ return -1;
+
+ return 0;
+}
+
+void
+snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj)
+{
+ free(obj);
+}
+
+snd_mixer_elem_t*
+snd_mixer_first_elem(snd_mixer_t *mixer)
+{
+ return mixer->controls;
+}
+
+snd_mixer_elem_t*
+snd_mixer_elem_next(snd_mixer_elem_t *elem)
+{
+ return elem->next;
+}
+
+const char*
+snd_mixer_selem_get_name(snd_mixer_elem_t *elem)
+{
+ return elem->name;
+}
+
+int
+snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
+{
+ if (value) *value = ((float)elem->vol / (float)0x7f) * 100;
+ return 0;
+}
+
+int
+snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value)
+{
+ if (value) *value = (long)elem->vol - 0x7f;
+ return 0;
+}
+
+int
+snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem, long *min, long *max)
+{
+ if (max) *max = 0;
+ if (min) *min = -127;
+ return 0;
+}
+
+int
+snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem)
+{
+ return true;
+}
+
+int
+snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem)
+{
+ return true;
+}
+
+int
+snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem)
+{
+ return true;
+}
+
+int
+snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem)
+{
+ return true;
+}
diff --git a/src/pcm.c b/src/pcm.c
new file mode 100644
index 0000000..ad77c06
--- /dev/null
+++ b/src/pcm.c
@@ -0,0 +1,910 @@
+#include <alsa/asoundlib.h>
+#include <sndio.h>
+#include <poll.h>
+#include <stdbool.h>
+#include <assert.h>
+#include "util/dsp.h"
+#include "util/util.h"
+
+struct _snd_pcm_hw_params {
+ struct sio_cap cap;
+ struct sio_par par;
+ snd_pcm_format_t alsa_format;
+ snd_pcm_access_t access;
+ bool needs_conversion; // for unsupported formats
+};
+
+struct _snd_pcm_sw_params { char noop; };
+
+struct _snd_pcm {
+ struct _snd_pcm_hw_params hw, hw_requested;
+ struct _snd_pcm_sw_params sw;
+ struct sio_hdl *hdl;
+ const char *name;
+ snd_pcm_uframes_t position, written, avail;
+ snd_pcm_stream_t stream;
+ int mode;
+ bool started;
+};
+
+static int
+sndio_stream(snd_pcm_stream_t stream)
+{
+ switch (stream) {
+ case SND_PCM_STREAM_PLAYBACK: return SIO_PLAY;
+ case SND_PCM_STREAM_CAPTURE: return SIO_REC;
+ }
+ ERRX(EXIT_FAILURE, "unknown stream: %u", stream);
+}
+
+static int
+sndio_mode(int mode)
+{
+ switch (mode) {
+ case SND_PCM_NONBLOCK: WARNX1("SND_PCM_NONBLOCK"); return true;
+ // ASYNC: SIGIO will be emitted whenever a period has been completely processed by the soundcard.
+ case SND_PCM_ASYNC: ERRX1(EXIT_FAILURE, "SND_PCM_ASYNC is not supported");
+ }
+ return false;
+}
+
+static void
+onmove(void *arg, int delta)
+{
+ snd_pcm_t *pcm = arg;
+ pcm->position += delta;
+ pcm->avail += delta;
+}
+
+static struct sio_hdl*
+device_open(snd_pcm_t *pcm, const char *name, snd_pcm_stream_t stream, int mode)
+{
+ const char *sndio_name = (!name || !strcmp(name, "default") ? SIO_DEVANY : name);
+
+ struct sio_hdl *hdl;
+ if (!(hdl = sio_open(sndio_name, sndio_stream(stream), sndio_mode(mode))) &&
+ !(hdl = sio_open(SIO_DEVANY, sndio_stream(stream), sndio_mode(mode)))) {
+ WARNX1("sio_open failed");
+ return NULL;
+ }
+
+ sio_onmove(hdl, onmove, pcm);
+ pcm->mode = mode;
+ return hdl;
+}
+
+int
+snd_pcm_open(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode)
+{
+ if (!(*pcm = calloc(1, sizeof(**pcm)))) {
+ WARN1("calloc");
+ return -1;
+ }
+
+ if (!((*pcm)->hdl = device_open(*pcm, name, stream, mode)))
+ goto fail;
+
+ sio_initpar(&(*pcm)->hw_requested.par);
+ (*pcm)->name = (name ? name : "default");
+ return (sio_getcap((*pcm)->hdl, &(*pcm)->hw.cap) && sio_getpar((*pcm)->hdl, &(*pcm)->hw.par) ? 0 : -1);
+
+fail:
+ free(*pcm);
+ return -1;
+}
+
+int
+snd_pcm_close(snd_pcm_t *pcm)
+{
+ sio_close(pcm->hdl);
+ free(pcm);
+ return 0;
+}
+
+const char*
+snd_pcm_name(snd_pcm_t *pcm)
+{
+ return pcm->name;
+}
+
+int
+snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
+{
+ if ((pcm->mode == SND_PCM_NONBLOCK && nonblock) || (!pcm->mode && !nonblock))
+ return 0;
+
+ WARNX("snd_pcm_nonblock(%d)", nonblock);
+ snd_pcm_drain(pcm);
+ sio_close(pcm->hdl);
+
+ if (!(pcm->hdl = device_open(pcm, pcm->name, pcm->stream, (nonblock ? SND_PCM_NONBLOCK : false))))
+ return -1;
+
+ return snd_pcm_hw_params(pcm, &pcm->hw_requested);
+}
+
+int
+snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
+{
+ return sio_nfds(pcm->hdl);
+}
+
+int
+snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
+{
+ if (space > (unsigned int)sio_nfds(pcm->hdl))
+ return -1;
+
+ return sio_pollfd(pcm->hdl, pfds, (pcm->stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN));
+}
+
+int
+snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
+{
+ if (!revents || nfds > (unsigned int)sio_nfds(pcm->hdl))
+ return -1;
+
+ *revents = sio_revents(pcm->hdl, pfds);
+ return 0;
+}
+
+snd_pcm_state_t
+snd_pcm_state(snd_pcm_t *pcm)
+{
+ if (pcm->started)
+ return SND_PCM_STATE_RUNNING;
+
+ return SND_PCM_STATE_OPEN;
+}
+
+int
+snd_pcm_wait(snd_pcm_t *pcm, int timeout)
+{
+ return 1; // we are always ready for io
+}
+
+static size_t
+io_do(snd_pcm_t *pcm, void *buffer, const size_t frames, size_t (*io)(struct sio_hdl*, void*, size_t))
+{
+ if (pcm->hw.needs_conversion) {
+ struct aparams params = {
+ .bps = pcm->hw.par.bps,
+ .bits = pcm->hw.par.bits,
+ .le = pcm->hw.par.le,
+ .sig = pcm->hw.par.sig,
+ .msb = pcm->hw.par.msb
+ };
+
+ struct conv dec, enc;
+ dec_init(&dec, &params, pcm->hw.par.pchan);
+ enc_init(&enc, &params, pcm->hw.par.pchan);
+
+ size_t total_frames = frames, io_bytes = 0;
+ unsigned char decoded[4096], encoded[sizeof(decoded)];
+ const size_t max_frames = snd_pcm_bytes_to_frames(pcm, sizeof(decoded));
+ for (unsigned char *p = buffer; total_frames > 0;) {
+ const int todo_frames = (total_frames > max_frames ? max_frames : total_frames);
+ total_frames -= todo_frames;
+
+ // sadly can't function pointer here as some formats may need different parameters for decoder
+ if (pcm->hw.alsa_format == SND_PCM_FORMAT_FLOAT_LE || pcm->hw.alsa_format == SND_PCM_FORMAT_FLOAT_BE) {
+ dec_do_float(&dec, p, decoded, todo_frames);
+ } else {
+ dec_do(&dec, p, decoded, todo_frames);
+ }
+
+ enc_do(&enc, decoded, encoded, todo_frames);
+
+ const size_t todo_bytes = snd_pcm_frames_to_bytes(pcm, todo_frames);
+ io_bytes += io(pcm->hdl, encoded, todo_bytes);
+ p += todo_bytes;
+ }
+
+ return io_bytes;
+ }
+
+ return io(pcm->hdl, buffer, snd_pcm_frames_to_bytes(pcm, frames));
+}
+
+snd_pcm_sframes_t
+snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes)
+{
+ const int bpf = (pcm->hw.par.bps * pcm->hw.par.pchan);
+ return bytes / bpf;
+}
+
+ssize_t
+snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
+{
+ const int bpf = (pcm->hw.par.bps * pcm->hw.par.pchan);
+ return frames * bpf;
+}
+
+snd_pcm_sframes_t
+snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
+{
+ const snd_pcm_sframes_t ret = snd_pcm_bytes_to_frames(pcm, io_do(pcm, (void*)buffer, size, (size_t(*)(struct sio_hdl*, void*, size_t))sio_write));
+ pcm->written += ret;
+ pcm->avail -= ret;
+ return ret;
+}
+
+snd_pcm_sframes_t
+snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
+{
+ const snd_pcm_sframes_t ret = snd_pcm_bytes_to_frames(pcm, io_do(pcm, buffer, size, sio_read));
+ pcm->written += ret;
+ pcm->avail -= ret;
+ return ret;
+}
+
+snd_pcm_sframes_t
+snd_pcm_avail_update(snd_pcm_t *pcm)
+{
+ struct pollfd pfd[16];
+ int nfds = sio_nfds(pcm->hdl);
+ assert((unsigned int)nfds < ARRAY_SIZE(pfd));
+
+ nfds = sio_pollfd(pcm->hdl, pfd, (pcm->stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN));
+
+ // XXX: timeout should be period time/buffer time(?)
+ errno = 0;
+ while ((nfds = poll(pfd, nfds, -1)) < 0) {
+ if (errno == EINVAL) {
+ WARNX1("poll EINVAL");
+ goto nodata;
+ }
+ }
+
+ const int revents = sio_revents(pcm->hdl, pfd);
+ if (!(revents & POLLOUT) && !(revents & POLLIN))
+ goto nodata;
+
+ return pcm->avail;
+
+nodata:
+ // NOTE: returning 1, as some programs don't check the return value :/ (namely qwebengine)
+ // thus they SIGFPE by dividing by 0 or -1
+ return 1;
+}
+
+snd_pcm_sframes_t
+snd_pcm_avail(snd_pcm_t *pcm)
+{
+ return pcm->avail;
+}
+
+int
+snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
+{
+ if (delayp) *delayp = pcm->written - pcm->position;
+ return 0;
+}
+
+int
+snd_pcm_prepare(snd_pcm_t *pcm)
+{
+ if (!pcm->started && sio_start(pcm->hdl)) {
+ pcm->started = true;
+ pcm->written = pcm->position = 0;
+ pcm->avail = pcm->hw.par.bufsz;
+ }
+
+ return (pcm->started ? 0 : -1);
+}
+
+int
+snd_pcm_start(snd_pcm_t *pcm)
+{
+ return snd_pcm_prepare(pcm);
+}
+
+int
+snd_pcm_drain(snd_pcm_t *pcm)
+{
+ if (pcm->started && sio_stop(pcm->hdl)) {
+ pcm->started = false;
+ pcm->written = pcm->position = 0;
+ }
+
+ return (!pcm->started ? 0 : -1);
+}
+
+int
+snd_pcm_drop(snd_pcm_t *pcm)
+{
+ // FIXME: not correct, we need to do emulation
+ return snd_pcm_drain(pcm);
+}
+
+int
+snd_pcm_resume(snd_pcm_t *pcm)
+{
+ // FIXME: not correct, we need to do emulation
+ return snd_pcm_drain(pcm);
+}
+
+int
+snd_pcm_pause(snd_pcm_t *pcm, int enable)
+{
+ // FIXME: not correct, we need to do emulation
+ return (enable ? snd_pcm_drain(pcm) : snd_pcm_start(pcm));
+}
+
+int
+snd_pcm_reset(snd_pcm_t *pcm)
+{
+ return (!snd_pcm_drain(pcm) && !snd_pcm_prepare(pcm) ? 0 : -1);
+}
+
+size_t
+snd_pcm_hw_params_sizeof(void)
+{
+ return sizeof(snd_pcm_hw_params_t);
+}
+
+void
+snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src)
+{
+ *dst = *src;
+}
+
+static void
+copy_important_params(struct sio_par *dst, const struct sio_par *src)
+{
+ assert(dst && src);
+ dst->rate = src->rate;
+ dst->pchan = src->pchan;
+ dst->rchan = src->rchan;
+ dst->appbufsz = src->appbufsz;
+ dst->round = src->round;
+}
+
+int
+snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
+{
+ params->cap = pcm->hw.cap;
+ sio_initpar(&params->par);
+ copy_important_params(&params->par, &pcm->hw.par);
+ WARNX("rate: %u, round: %u, appbufsz: %u pchan: %u", params->par.rate, params->par.round, params->par.appbufsz, params->par.pchan);
+ return 0;
+}
+
+int
+snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
+{
+ if (memcmp(params, &pcm->hw, sizeof(*params))) {
+ snd_pcm_drain(pcm);
+
+ pcm->hw_requested = *params;
+ if (!sio_setpar(pcm->hdl, &params->par)) {
+ WARNX1("sio_setpar failed");
+ return -1;
+ }
+
+ pcm->hw = *params;
+ if (!sio_getpar(pcm->hdl, &pcm->hw.par)) {
+ WARNX1("sio_getpar failed");
+ return -1;
+ }
+ }
+
+ WARNX("rate: %u, round: %u, appbufsz: %u, bufsz: %u, pchan: %u", pcm->hw.par.rate, pcm->hw.par.round, pcm->hw.par.appbufsz, pcm->hw.par.bufsz, pcm->hw.par.pchan);
+ return snd_pcm_prepare(pcm);
+}
+
+int
+snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
+{
+ *params = pcm->hw;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access)
+{
+ if (_access != SND_PCM_ACCESS_RW_INTERLEAVED)
+ goto fail;
+
+ params->access = _access;
+ return 0;
+
+fail:
+ WARNX("access mode `0x%x` not supported yet", _access);
+ return -1;
+}
+
+int
+snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access)
+{
+ if (_access) *_access = params->access;
+ return 0;
+}
+
+const char*
+snd_pcm_format_name(const snd_pcm_format_t format)
+{
+#define NAME(x) case x: return #x
+ switch (format) {
+ NAME(SND_PCM_FORMAT_U8);
+ NAME(SND_PCM_FORMAT_S8);
+ NAME(SND_PCM_FORMAT_S16_LE);
+ NAME(SND_PCM_FORMAT_S16_BE);
+ NAME(SND_PCM_FORMAT_U16_LE);
+ NAME(SND_PCM_FORMAT_U16_BE);
+ NAME(SND_PCM_FORMAT_S24_LE);
+ NAME(SND_PCM_FORMAT_S24_BE);
+ NAME(SND_PCM_FORMAT_U24_LE);
+ NAME(SND_PCM_FORMAT_U24_BE);
+ NAME(SND_PCM_FORMAT_S32_LE);
+ NAME(SND_PCM_FORMAT_S32_BE);
+ NAME(SND_PCM_FORMAT_U32_LE);
+ NAME(SND_PCM_FORMAT_U32_BE);
+ NAME(SND_PCM_FORMAT_FLOAT_LE);
+ NAME(SND_PCM_FORMAT_FLOAT_BE);
+ default:
+ WARNX("unsupported format: 0x%x", format);
+ return "unsupported";
+ }
+#undef NAME
+}
+
+static bool
+pcm_format(const snd_pcm_format_t format, struct sio_par *par, bool *out_needs_conversion)
+{
+ switch (format) {
+ case SND_PCM_FORMAT_U8:
+ par->bits = 8;
+ par->sig = 0;
+ break;
+ case SND_PCM_FORMAT_S8:
+ par->bits = 8;
+ par->sig = 1;
+ break;
+ case SND_PCM_FORMAT_S16_LE:
+ par->bits = 16;
+ par->sig = 1;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_S16_BE:
+ par->bits = 16;
+ par->sig = 1;
+ par->le = 0;
+ break;
+ case SND_PCM_FORMAT_U16_LE:
+ par->bits = 16;
+ par->sig = 0;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_U16_BE:
+ par->bits = 16;
+ par->sig = 0;
+ par->le = 0;
+ break;
+ case SND_PCM_FORMAT_S24_LE:
+ par->bits = 24;
+ par->sig = 1;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_S24_BE:
+ par->bits = 24;
+ par->sig = 1;
+ par->le = 0;
+ break;
+ case SND_PCM_FORMAT_U24_LE:
+ par->bits = 24;
+ par->sig = 0;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_U24_BE:
+ par->bits = 24;
+ par->sig = 0;
+ par->le = 0;
+ break;
+ case SND_PCM_FORMAT_FLOAT_LE:
+ *out_needs_conversion = true;
+ /* fallthrough */
+ case SND_PCM_FORMAT_S32_LE:
+ par->bits = 32;
+ par->sig = 1;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_FLOAT_BE:
+ *out_needs_conversion = true;
+ /* fallthrough */
+ case SND_PCM_FORMAT_S32_BE:
+ par->bits = 32;
+ par->sig = 1;
+ par->le = 0;
+ break;
+ case SND_PCM_FORMAT_U32_LE:
+ par->bits = 32;
+ par->sig = 0;
+ par->le = 1;
+ break;
+ case SND_PCM_FORMAT_U32_BE:
+ par->bits = 32;
+ par->sig = 0;
+ par->le = 0;
+ break;
+ default:
+ WARNX("unsupported format: 0x%x", format);
+ return false;
+ }
+ return true;
+}
+
+struct _snd_pcm_format_mask {
+ snd_pcm_format_t *fmts;
+ uint8_t nmemb;
+};
+
+size_t
+snd_pcm_format_mask_sizeof(void)
+{
+ return sizeof(snd_pcm_format_mask_t);
+}
+
+int
+snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr)
+{
+ // OpenAL-soft uses this :(
+ *ptr = calloc(1, sizeof(**ptr));
+ return (*ptr ? 0 : -1);
+}
+
+void
+snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj)
+{
+ free(obj);
+}
+
+void
+snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask)
+{
+ static snd_pcm_format_t def_fmts[] = {
+ SND_PCM_FORMAT_U8,
+ SND_PCM_FORMAT_S8,
+ SND_PCM_FORMAT_S16_LE,
+ SND_PCM_FORMAT_S16_BE,
+ SND_PCM_FORMAT_U16_LE,
+ SND_PCM_FORMAT_U16_BE,
+ SND_PCM_FORMAT_S24_LE,
+ SND_PCM_FORMAT_S24_BE,
+ SND_PCM_FORMAT_U24_LE,
+ SND_PCM_FORMAT_U24_BE,
+ SND_PCM_FORMAT_S32_LE,
+ SND_PCM_FORMAT_S32_BE,
+ SND_PCM_FORMAT_U32_LE,
+ SND_PCM_FORMAT_U32_BE,
+ SND_PCM_FORMAT_FLOAT_LE,
+ SND_PCM_FORMAT_FLOAT_BE
+ };
+ static snd_pcm_format_mask_t def_mask = { .fmts = def_fmts, .nmemb = ARRAY_SIZE(def_fmts) };
+ if (mask) *mask = def_mask;
+}
+
+int
+snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
+{
+ for (uint8_t i = 0; i < mask->nmemb; ++i) {
+ if (mask->fmts[i] != val)
+ continue;
+
+ return true;
+ }
+ return false;
+}
+
+int
+snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
+{
+ snd_pcm_format_mask_t mask;
+ snd_pcm_hw_params_get_format_mask(params, &mask);
+ return (snd_pcm_format_mask_test(&mask, val) ? 0 : -1);
+}
+
+int
+snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
+{
+ // FIXME: prob should check hw caps
+ if (!pcm_format(val, &params->par, &params->needs_conversion))
+ return -1;
+
+ WARNX1(snd_pcm_format_name(val));
+ params->alsa_format = val;
+ params->par.bps = SIO_BPS(params->par.bits);
+ return 0;
+}
+
+static int
+update(snd_pcm_t *pcm, struct sio_par *par, void *curv, void *newv, const size_t size)
+{
+ if (!newv)
+ return 0;
+
+ struct sio_par old = *par;
+ memcpy(curv, newv, size);
+ const bool was_started = pcm->started;
+
+ if (was_started)
+ snd_pcm_drain(pcm);
+
+ if (!sio_setpar(pcm->hdl, par)) {
+ WARNX1("sio_setpar failed");
+ *par = old;
+ return 0;
+ }
+
+ struct sio_par hpar;
+ if (sio_getpar(pcm->hdl, &hpar)) {
+ copy_important_params(par, &hpar);
+ } else {
+ WARNX1("sio_getpar failed");
+ }
+
+ memcpy(newv, curv, size);
+
+ if (was_started)
+ snd_pcm_prepare(pcm);
+
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ // FIXME: need to store stream info in params
+ if (val) *val = params->par.pchan;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ if (val) {
+ if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
+ assert(sizeof(params->par.pchan) == sizeof(*val));
+ return update(pcm, &params->par, &params->par.pchan, val, sizeof(*val));
+ } else {
+ assert(sizeof(params->par.rchan) == sizeof(*val));
+ return update(pcm, &params->par, &params->par.rchan, val, sizeof(*val));
+ }
+ }
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
+{
+ return snd_pcm_hw_params_set_channels_near(pcm, params, &val);
+}
+
+int
+snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ // FIXME: need to store stream info in params
+ unsigned int min = (unsigned int)~0;
+ for (int i = 0; i < SIO_NCHAN; ++i) {
+ if (!(params->cap.confs[0].pchan & (1 << i)))
+ continue;
+ min = (params->cap.pchan[i] < min ? params->cap.pchan[i] : min);
+ }
+ if (val) *val = min;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ // FIXME: need to store stream info in params
+ unsigned int max = 0;
+ for (int i = 0; i < SIO_NCHAN; ++i) {
+ if (!(params->cap.confs[0].pchan & (1 << i)))
+ continue;
+ max = (params->cap.pchan[i] > max ? params->cap.pchan[i] : max);
+ }
+ if (val) *val = max;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) *val = params->par.rate;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ if (dir) *dir = 0;
+ assert(sizeof(params->par.rate) == sizeof(*val));
+ return update(pcm, &params->par, &params->par.rate, val, sizeof(*val));
+}
+
+int
+snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
+{
+ return snd_pcm_hw_params_set_rate_near(pcm, params, &val, &dir);
+}
+
+int
+snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ unsigned int min = (unsigned int)~0;
+ for (int i = 0; i < SIO_NRATE; ++i) {
+ if (!(params->cap.confs[0].rate & (1 << i)))
+ continue;
+ min = (params->cap.rate[i] < min ? params->cap.rate[i] : min);
+ }
+ if (dir) *dir = 0;
+ if (val) *val = min;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ unsigned int max = 0;
+ for (int i = 0; i < SIO_NRATE; ++i) {
+ if (!(params->cap.confs[0].rate & (1 << i)))
+ continue;
+ max = (params->cap.rate[i] > max ? params->cap.rate[i] : max);
+ }
+ if (dir) *dir = 0;
+ if (val) *val = max;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
+{
+ if (val) *val = params->par.appbufsz;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
+{
+ if (val) {
+ unsigned int newv = *val;
+ assert(sizeof(params->par.appbufsz) == sizeof(newv));
+ const int ret = update(pcm, &params->par, &params->par.appbufsz, &newv, sizeof(newv));
+ *val = newv;
+ return ret;
+ }
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
+{
+ if (val) *val = params->par.appbufsz;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
+{
+ if (val) *val = params->par.appbufsz;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) *val = params->par.round;
+ return 0;
+}
+
+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)
+{
+ if (dir) *dir = 0;
+ assert(sizeof(params->par.round) == sizeof(*val));
+ return update(pcm, &params->par, &params->par.round, val, sizeof(*val));
+}
+
+int
+snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) *val = params->par.round;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) *val = params->par.round;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) *val = params->par.appbufsz / params->par.round;
+ return 0;
+}
+
+int
+snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
+{
+ if (dir) *dir = 0;
+ if (val) {
+ unsigned int round = params->par.appbufsz / *val;
+ assert(sizeof(params->par.round) == sizeof(round));
+ return update(pcm, &params->par, &params->par.round, &round, sizeof(*val));
+ }
+ return 0;
+}
+
+size_t
+snd_pcm_sw_params_sizeof(void)
+{
+ return sizeof(snd_pcm_sw_params_t);
+}
+
+int
+snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr)
+{
+ // OpenAL-soft uses this :(
+ *ptr = calloc(1, sizeof(**ptr));
+ return (*ptr ? 0 : -1);
+}
+
+void
+snd_pcm_sw_params_free(snd_pcm_sw_params_t *ptr)
+{
+ free(ptr);
+}
+
+int
+snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
+{
+ *params = pcm->sw;
+ return 0;
+}
+
+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)
+{
+ snd_pcm_hw_params_t params;
+ return (!snd_pcm_hw_params_any(pcm, &params) && !snd_pcm_hw_params_set_format(pcm, &params, format) &&
+ !snd_pcm_hw_params_set_access(pcm, &params, access) && !snd_pcm_hw_params_set_channels(pcm, &params, channels) &&
+ !snd_pcm_hw_params_set_rate(pcm, &params, rate, 0) && !snd_pcm_hw_params(pcm, &params) ? 0 : -1);
+}
+
+int
+snd_pcm_get_params(snd_pcm_t *pcm, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t *period_size)
+{
+ if (buffer_size) *buffer_size = pcm->hw.par.appbufsz;
+ if (period_size) *period_size = pcm->hw.par.round;
+ return 0;
+}
+
+snd_pcm_chmap_t*
+snd_pcm_get_chmap(snd_pcm_t *pcm)
+{
+ const unsigned int nc = (pcm->stream == SND_PCM_STREAM_PLAYBACK ? pcm->hw.par.pchan : pcm->hw.par.rchan);
+
+ snd_pcm_chmap_t *map;
+ if (!(map = calloc(1, sizeof(*map) + nc)))
+ return NULL;
+
+ map->channels = nc;
+
+ if (nc == 1) {
+ map->pos[0] = SND_CHMAP_MONO;
+ } else if (nc == 2) {
+ map->pos[0] = SND_CHMAP_FL;
+ map->pos[1] = SND_CHMAP_FR;
+ }
+
+ return map;
+}
diff --git a/src/stubs.h b/src/stubs.h
new file mode 100644
index 0000000..f52e19e
--- /dev/null
+++ b/src/stubs.h
@@ -0,0 +1,1227 @@
+const char *snd_config_topdir(void) { WARNX1("stub"); return NULL; }
+int snd_config_top(snd_config_t **config) { WARNX1("stub"); return -1; }
+int snd_config_load(snd_config_t *config, snd_input_t *in) { WARNX1("stub"); return -1; }
+int snd_config_load_override(snd_config_t *config, snd_input_t *in) { WARNX1("stub"); return -1; }
+int snd_config_save(snd_config_t *config, snd_output_t *out) { WARNX1("stub"); return -1; }
+int snd_config_update(void) { WARNX1("stub"); return -1; }
+int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path) { WARNX1("stub"); return -1; }
+int snd_config_update_free(snd_config_update_t *update) { WARNX1("stub"); return -1; }
+int snd_config_update_free_global(void) { WARNX1("stub"); return -1; }
+int snd_config_update_ref(snd_config_t **top) { WARNX1("stub"); return -1; }
+void snd_config_ref(snd_config_t *top) { WARNX1("stub"); }
+void snd_config_unref(snd_config_t *top) { WARNX1("stub"); }
+int snd_config_search(snd_config_t *config, const char *key, snd_config_t **result) { WARNX1("stub"); return -1; }
+int snd_config_searchv(snd_config_t *config, snd_config_t **result, ...) { WARNX1("stub"); return -1; }
+int snd_config_search_definition(snd_config_t *config, const char *base, const char *key, snd_config_t **result) { WARNX1("stub"); return -1; }
+int snd_config_expand(snd_config_t *config, snd_config_t *root, const char *args, snd_config_t *private_data, snd_config_t **result) { WARNX1("stub"); return -1; }
+int snd_config_evaluate(snd_config_t *config, snd_config_t *root, snd_config_t *private_data, snd_config_t **result) { WARNX1("stub"); return -1; }
+int snd_config_add(snd_config_t *config, snd_config_t *leaf) { WARNX1("stub"); return -1; }
+int snd_config_delete(snd_config_t *config) { WARNX1("stub"); return -1; }
+int snd_config_delete_compound_members(const snd_config_t *config) { WARNX1("stub"); return -1; }
+int snd_config_copy(snd_config_t **dst, snd_config_t *src) { WARNX1("stub"); return -1; }
+int snd_config_make(snd_config_t **config, const char *key, snd_config_type_t type) { WARNX1("stub"); return -1; }
+int snd_config_make_integer(snd_config_t **config, const char *key) { WARNX1("stub"); return -1; }
+int snd_config_make_real(snd_config_t **config, const char *key) { WARNX1("stub"); return -1; }
+int snd_config_make_string(snd_config_t **config, const char *key) { WARNX1("stub"); return -1; }
+int snd_config_make_pointer(snd_config_t **config, const char *key) { WARNX1("stub"); return -1; }
+int snd_config_make_compound(snd_config_t **config, const char *key, int join) { WARNX1("stub"); return -1; }
+int snd_config_imake_integer(snd_config_t **config, const char *key, const long value) { WARNX1("stub"); return -1; }
+int snd_config_imake_real(snd_config_t **config, const char *key, const double value) { WARNX1("stub"); return -1; }
+int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii) { WARNX1("stub"); return -1; }
+int snd_config_imake_safe_string(snd_config_t **config, const char *key, const char *ascii) { WARNX1("stub"); return -1; }
+int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr) { WARNX1("stub"); return -1; }
+snd_config_type_t snd_config_get_type(const snd_config_t *config) { WARNX1("stub"); return -1; }
+int snd_config_set_id(snd_config_t *config, const char *id) { WARNX1("stub"); return -1; }
+int snd_config_set_integer(snd_config_t *config, long value) { WARNX1("stub"); return -1; }
+int snd_config_set_real(snd_config_t *config, double value) { WARNX1("stub"); return -1; }
+int snd_config_set_string(snd_config_t *config, const char *value) { WARNX1("stub"); return -1; }
+int snd_config_set_ascii(snd_config_t *config, const char *ascii) { WARNX1("stub"); return -1; }
+int snd_config_set_pointer(snd_config_t *config, const void *ptr) { WARNX1("stub"); return -1; }
+int snd_config_get_id(const snd_config_t *config, const char **value) { WARNX1("stub"); return -1; }
+int snd_config_get_integer(const snd_config_t *config, long *value) { WARNX1("stub"); return -1; }
+int snd_config_get_real(const snd_config_t *config, double *value) { WARNX1("stub"); return -1; }
+int snd_config_get_ireal(const snd_config_t *config, double *value) { WARNX1("stub"); return -1; }
+int snd_config_get_string(const snd_config_t *config, const char **value) { WARNX1("stub"); return -1; }
+int snd_config_get_ascii(const snd_config_t *config, char **value) { WARNX1("stub"); return -1; }
+int snd_config_get_pointer(const snd_config_t *config, const void **value) { WARNX1("stub"); return -1; }
+int snd_config_test_id(const snd_config_t *config, const char *id) { WARNX1("stub"); return -1; }
+snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node) { WARNX1("stub"); return NULL; }
+snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator) { WARNX1("stub"); return NULL; }
+snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node) { WARNX1("stub"); return NULL; }
+snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator) { WARNX1("stub"); return NULL; }
+int snd_config_get_bool_ascii(const char *ascii) { WARNX1("stub"); return -1; }
+int snd_config_get_bool(const snd_config_t *conf) { WARNX1("stub"); return -1; }
+int snd_config_get_ctl_iface_ascii(const char *ascii) { WARNX1("stub"); return -1; }
+int snd_config_get_ctl_iface(const snd_config_t *conf) { WARNX1("stub"); return -1; }
+int snd_names_list(const char *iface, snd_devname_t **list) { WARNX1("stub"); return 0; }
+void snd_names_list_free(snd_devname_t *list) { WARNX1("stub"); }
+int snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+int snd_ctl_open_fallback(snd_ctl_t **ctl, snd_config_t *root, const char *name, const char *orig_name, int mode) { WARNX1("stub"); return 0; }
+int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock) { WARNX1("stub"); return 0; }
+int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl, snd_async_callback_t callback, void *private_data) { WARNX1("stub"); return 0; }
+snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler) { WARNX1("stub"); return NULL; }
+int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl) { WARNX1("stub"); return 0; }
+int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t *list) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *data) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *data) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int *tlv, unsigned int tlv_size) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, const unsigned int *tlv) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, const unsigned int *tlv) { WARNX1("stub"); return 0; }
+int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device) { WARNX1("stub"); return 0; }
+int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info) { WARNX1("stub"); return 0; }
+int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device) { WARNX1("stub"); return 0; }
+int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info) { WARNX1("stub"); return 0; }
+int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev) { WARNX1("stub"); return 0; }
+int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device) { WARNX1("stub"); return 0; }
+int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info) { WARNX1("stub"); return 0; }
+int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev) { WARNX1("stub"); return 0; }
+int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state) { WARNX1("stub"); return 0; }
+int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state) { WARNX1("stub"); return 0; }
+int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event) { WARNX1("stub"); return 0; }
+int snd_ctl_wait(snd_ctl_t *ctl, int timeout) { WARNX1("stub"); return 0; }
+const char *snd_ctl_name(snd_ctl_t *ctl) { WARNX1("stub"); return NULL; }
+snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl) { WARNX1("stub"); return 0; }
+const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type) { WARNX1("stub"); return NULL; }
+const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface) { WARNX1("stub"); return NULL; }
+const char *snd_ctl_event_type_name(snd_ctl_event_type_t type) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj) { WARNX1("stub"); }
+char *snd_ctl_ascii_elem_id_get(snd_ctl_elem_id_t *id) { WARNX1("stub"); return NULL; }
+int snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+size_t snd_ctl_elem_id_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr) { WARNX1("stub"); return -1; }
+void snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src) { WARNX1("stub"); }
+unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return 0; }
+snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val) { WARNX1("stub"); }
+void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val) { WARNX1("stub"); }
+void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) { WARNX1("stub"); }
+void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src) { WARNX1("stub"); }
+int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj) { WARNX1("stub"); return NULL; }
+size_t snd_ctl_event_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_ctl_event_malloc(snd_ctl_event_t **ptr) { WARNX1("stub"); return -1; }
+void snd_ctl_event_free(snd_ctl_event_t *obj) { WARNX1("stub"); }
+void snd_ctl_event_clear(snd_ctl_event_t *obj) { WARNX1("stub"); }
+void snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src) { WARNX1("stub"); }
+snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj) { WARNX1("stub"); return 0; }
+size_t snd_ctl_elem_list_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr) { WARNX1("stub"); return -1; }
+void snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src) { WARNX1("stub"); }
+void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val) { WARNX1("stub"); }
+unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+size_t snd_ctl_elem_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src) { WARNX1("stub"); }
+snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_tlv_readable(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_tlv_writable(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_is_user(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val) { WARNX1("stub"); }
+const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return NULL; }
+int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info, const int dimension[4]) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val) { WARNX1("stub"); }
+void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val) { WARNX1("stub"); }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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[]) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_add_boolean(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, unsigned int count) { WARNX1("stub"); return 0; }
+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[]) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_remove(snd_ctl_t *ctl, snd_ctl_elem_id_t *id) { WARNX1("stub"); return 0; }
+size_t snd_ctl_elem_value_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr) { WARNX1("stub"); return -1; }
+void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj) { WARNX1("stub"); }
+void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src) { WARNX1("stub"); }
+int snd_ctl_elem_value_compare(snd_ctl_elem_value_t *left, const snd_ctl_elem_value_t *right) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return 0; }
+snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val) { WARNX1("stub"); }
+int snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+long snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+unsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+unsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx) { WARNX1("stub"); return 0; }
+void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val) { WARNX1("stub"); }
+void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val) { WARNX1("stub"); }
+void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size) { WARNX1("stub"); }
+const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj) { WARNX1("stub"); return NULL; }
+int snd_tlv_parse_dB_info(unsigned int *tlv, unsigned int tlv_size, unsigned int **db_tlvp) { WARNX1("stub"); return 0; }
+int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax, long *min, long *max) { WARNX1("stub"); return 0; }
+int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, long volume, long *db_gain) { WARNX1("stub"); return 0; }
+int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax, long db_gain, long *value, int xdir) { WARNX1("stub"); return 0; }
+int snd_ctl_get_dB_range(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, long *min, long *max) { WARNX1("stub"); return 0; }
+int snd_ctl_convert_to_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, long volume, long *db_gain) { WARNX1("stub"); return 0; }
+int snd_ctl_convert_from_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, long db_gain, long *value, int xdir) { WARNX1("stub"); return 0; }
+int snd_hctl_compare_fast(const snd_hctl_elem_t *c1, const snd_hctl_elem_t *c2) { WARNX1("stub"); return 0; }
+int snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_hctl_open_ctl(snd_hctl_t **hctlp, snd_ctl_t *ctl) { WARNX1("stub"); return 0; }
+int snd_hctl_close(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock) { WARNX1("stub"); return 0; }
+int snd_hctl_poll_descriptors_count(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_hctl_poll_descriptors_revents(snd_hctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+unsigned int snd_hctl_get_count(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort) { WARNX1("stub"); return 0; }
+snd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl) { WARNX1("stub"); return NULL; }
+snd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl) { WARNX1("stub"); return NULL; }
+snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id) { WARNX1("stub"); return NULL; }
+void snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback) { WARNX1("stub"); }
+void snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data) { WARNX1("stub"); }
+void *snd_hctl_get_callback_private(snd_hctl_t *hctl) { WARNX1("stub"); return NULL; }
+int snd_hctl_load(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_hctl_free(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_hctl_handle_events(snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+const char *snd_hctl_name(snd_hctl_t *hctl) { WARNX1("stub"); return NULL; }
+int snd_hctl_wait(snd_hctl_t *hctl, int timeout) { WARNX1("stub"); return 0; }
+snd_ctl_t *snd_hctl_ctl(snd_hctl_t *hctl) { WARNX1("stub"); return NULL; }
+snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem) { WARNX1("stub"); return NULL; }
+snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem) { WARNX1("stub"); return NULL; }
+int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info) { WARNX1("stub"); return 0; }
+int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value) { WARNX1("stub"); return 0; }
+int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value) { WARNX1("stub"); return 0; }
+int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size) { WARNX1("stub"); return 0; }
+int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv) { WARNX1("stub"); return 0; }
+int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv) { WARNX1("stub"); return 0; }
+snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem) { WARNX1("stub"); return NULL; }
+void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr) { WARNX1("stub"); }
+unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj) { WARNX1("stub"); return 0; }
+snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj) { WARNX1("stub"); return 0; }
+void snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val) { WARNX1("stub"); }
+void * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj) { WARNX1("stub"); return NULL; }
+void snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val) { WARNX1("stub"); }
+int snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config, snd_config_t *private_data, int mode) { WARNX1("stub"); return 0; }
+int snd_sctl_free(snd_sctl_t *handle) { WARNX1("stub"); return 0; }
+int snd_sctl_install(snd_sctl_t *handle) { WARNX1("stub"); return 0; }
+int snd_sctl_remove(snd_sctl_t *handle) { WARNX1("stub"); return 0; }
+int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_ctl_ext_delete(snd_ctl_ext_t *ext) { WARNX1("stub"); return 0; }
+snd_local_error_handler_t snd_lib_error_set_local(snd_local_error_handler_t func) { WARNX1("stub"); return 0; }
+void *snd_dlopen(const char *file, int mode, char *errbuf, size_t errbuflen) { WARNX1("stub"); return NULL; }
+void *snd_dlsym(void *handle, const char *name, const char *version) { WARNX1("stub"); return NULL; }
+int snd_dlclose(void *handle) { WARNX1("stub"); return 0; }
+int snd_async_add_handler(snd_async_handler_t **handler, int fd, snd_async_callback_t callback, void *private_data) { WARNX1("stub"); return 0; }
+int snd_async_del_handler(snd_async_handler_t *handler) { WARNX1("stub"); return 0; }
+int snd_async_handler_get_fd(snd_async_handler_t *handler) { WARNX1("stub"); return 0; }
+int snd_async_handler_get_signo(snd_async_handler_t *handler) { WARNX1("stub"); return 0; }
+void *snd_async_handler_get_callback_private(snd_async_handler_t *handler) { WARNX1("stub"); return NULL; }
+struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr) { WARNX1("stub"); return NULL; }
+struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area) { WARNX1("stub"); return NULL; }
+int snd_shm_area_destroy(struct snd_shm_area *area) { WARNX1("stub"); return 0; }
+int snd_user_file(const char *file, char **result) { WARNX1("stub"); return 0; }
+int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_hwdep_close(snd_hwdep_t *hwdep) { WARNX1("stub"); return 0; }
+int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep) { WARNX1("stub"); return 0; }
+int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock) { WARNX1("stub"); return 0; }
+int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info) { WARNX1("stub"); return 0; }
+int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status) { WARNX1("stub"); return 0; }
+int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block) { WARNX1("stub"); return 0; }
+int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg) { WARNX1("stub"); return 0; }
+ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size) { WARNX1("stub"); return 0; }
+ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size) { WARNX1("stub"); return 0; }
+size_t snd_hwdep_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_hwdep_info_free(snd_hwdep_info_t *obj) { WARNX1("stub"); }
+void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src) { WARNX1("stub"); }
+unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj) { WARNX1("stub"); return NULL; }
+snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj) { WARNX1("stub"); return 0; }
+void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val) { WARNX1("stub"); }
+size_t snd_hwdep_dsp_status_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr) { WARNX1("stub"); return -1; }
+void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); }
+void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src) { WARNX1("stub"); }
+unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj) { WARNX1("stub"); return 0; }
+size_t snd_hwdep_dsp_image_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr) { WARNX1("stub"); return -1; }
+void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj) { WARNX1("stub"); }
+void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src) { WARNX1("stub"); }
+unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj) { WARNX1("stub"); return NULL; }
+const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj) { WARNX1("stub"); return NULL; }
+size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj) { WARNX1("stub"); return 0; }
+void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index) { WARNX1("stub"); }
+void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name) { WARNX1("stub"); }
+void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer) { WARNX1("stub"); }
+void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length) { WARNX1("stub"); }
+int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode) { WARNX1("stub"); return 0; }
+int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close) { WARNX1("stub"); return 0; }
+int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size) { WARNX1("stub"); return 0; }
+int snd_input_close(snd_input_t *input) { WARNX1("stub"); return 0; }
+char *snd_input_gets(snd_input_t *input, char *str, size_t size) { WARNX1("stub"); return NULL; }
+int snd_input_getc(snd_input_t *input) { WARNX1("stub"); return 0; }
+int snd_input_ungetc(snd_input_t *input, int c) { WARNX1("stub"); return 0; }
+snd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer) { WARNX1("stub"); return NULL; }
+int snd_mixer_handle_events(snd_mixer_t *mixer) { WARNX1("stub"); return 0; }
+int snd_mixer_attach(snd_mixer_t *mixer, const char *name) { WARNX1("stub"); return 0; }
+int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_mixer_detach(snd_mixer_t *mixer, const char *name) { WARNX1("stub"); return 0; }
+int snd_mixer_detach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl) { WARNX1("stub"); return 0; }
+int snd_mixer_get_hctl(snd_mixer_t *mixer, const char *name, snd_hctl_t **hctl) { WARNX1("stub"); return 0; }
+int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer) { WARNX1("stub"); return 0; }
+int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+int snd_mixer_load(snd_mixer_t *mixer) { WARNX1("stub"); return 0; }
+void snd_mixer_free(snd_mixer_t *mixer) { WARNX1("stub"); }
+int snd_mixer_wait(snd_mixer_t *mixer, int timeout) { WARNX1("stub"); return 0; }
+int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort) { WARNX1("stub"); return 0; }
+void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val) { WARNX1("stub"); }
+void * snd_mixer_get_callback_private(const snd_mixer_t *obj) { WARNX1("stub"); return NULL; }
+void snd_mixer_set_callback_private(snd_mixer_t *obj, void * val) { WARNX1("stub"); }
+unsigned int snd_mixer_get_count(const snd_mixer_t *obj) { WARNX1("stub"); return 0; }
+int snd_mixer_class_unregister(snd_mixer_class_t *clss) { WARNX1("stub"); return 0; }
+snd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem) { WARNX1("stub"); return NULL; }
+void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val) { WARNX1("stub"); }
+void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj) { WARNX1("stub"); return NULL; }
+void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val) { WARNX1("stub"); }
+snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj) { WARNX1("stub"); return 0; }
+int snd_mixer_class_register(snd_mixer_class_t *class_, snd_mixer_t *mixer) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_new(snd_mixer_elem_t **elem, snd_mixer_elem_type_t type, int compare_weight, void *private_data, void (*private_free)(snd_mixer_elem_t *elem)) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_add(snd_mixer_elem_t *elem, snd_mixer_class_t *class_) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_remove(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+void snd_mixer_elem_free(snd_mixer_elem_t *elem) { WARNX1("stub"); }
+int snd_mixer_elem_info(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_value(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_attach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_detach(snd_mixer_elem_t *melem, snd_hctl_elem_t *helem) { WARNX1("stub"); return 0; }
+int snd_mixer_elem_empty(snd_mixer_elem_t *melem) { WARNX1("stub"); return 0; }
+void *snd_mixer_elem_get_private(const snd_mixer_elem_t *melem) { WARNX1("stub"); return NULL; }
+size_t snd_mixer_class_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_mixer_class_malloc(snd_mixer_class_t **ptr) { WARNX1("stub"); return -1; }
+void snd_mixer_class_free(snd_mixer_class_t *obj) { WARNX1("stub"); }
+void snd_mixer_class_copy(snd_mixer_class_t *dst, const snd_mixer_class_t *src) { WARNX1("stub"); }
+snd_mixer_t *snd_mixer_class_get_mixer(const snd_mixer_class_t *class_) { WARNX1("stub"); return NULL; }
+snd_mixer_event_t snd_mixer_class_get_event(const snd_mixer_class_t *class_) { WARNX1("stub"); return 0; }
+void *snd_mixer_class_get_private(const snd_mixer_class_t *class_) { WARNX1("stub"); return NULL; }
+snd_mixer_compare_t snd_mixer_class_get_compare(const snd_mixer_class_t *class_) { WARNX1("stub"); return 0; }
+int snd_mixer_class_set_event(snd_mixer_class_t *class_, snd_mixer_event_t event) { WARNX1("stub"); return 0; }
+int snd_mixer_class_set_private(snd_mixer_class_t *class_, void *private_data) { WARNX1("stub"); return 0; }
+int snd_mixer_class_set_private_free(snd_mixer_class_t *class_, void (*private_free)(snd_mixer_class_t *)) { WARNX1("stub"); return 0; }
+int snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t compare) { WARNX1("stub"); return 0; }
+const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel) { WARNX1("stub"); return NULL; }
+int snd_mixer_selem_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp) { WARNX1("stub"); return 0; }
+void snd_mixer_selem_get_id(snd_mixer_elem_t *element, snd_mixer_selem_id_t *id) { WARNX1("stub"); }
+unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer, const snd_mixer_selem_id_t *id) { WARNX1("stub"); return NULL; }
+int snd_mixer_selem_is_active(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_ask_playback_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_ask_capture_vol_dB(snd_mixer_elem_t *elem, long value, long *dBvalue) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_ask_playback_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_ask_capture_dB_vol(snd_mixer_elem_t *elem, long dBvalue, int dir, long *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_dB_all(snd_mixer_elem_t *elem, long value, int dir) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_dB_all(snd_mixer_elem_t *elem, long value, int dir) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem, long *min, long *max) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem, long min, long max) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem, long *min, long *max) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem, long *min, long *max) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem, long min, long max) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_is_enum_playback(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_is_enum_capture(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp) { WARNX1("stub"); return 0; }
+int snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx) { WARNX1("stub"); return 0; }
+size_t snd_mixer_selem_id_sizeof(void) { WARNX1("stub"); return 0; }
+void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src) { WARNX1("stub"); }
+const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj) { WARNX1("stub"); return 0; }
+void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val) { WARNX1("stub"); }
+void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val) { WARNX1("stub"); }
+int snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2) { WARNX1("stub"); return 0; }
+int snd_mixer_sbasic_info(const snd_mixer_class_t *class, sm_class_basic_t *info) { WARNX1("stub"); return 0; }
+void *snd_mixer_sbasic_get_private(const snd_mixer_class_t *class) { WARNX1("stub"); return NULL; }
+void snd_mixer_sbasic_set_private(const snd_mixer_class_t *class, void *private_data) { WARNX1("stub"); }
+void snd_mixer_sbasic_set_private_free(const snd_mixer_class_t *class, void (*private_free)(snd_mixer_class_t *class)) { WARNX1("stub"); }
+int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode) { WARNX1("stub"); return 0; }
+int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close) { WARNX1("stub"); return 0; }
+int snd_output_buffer_open(snd_output_t **outputp) { WARNX1("stub"); return 0; }
+size_t snd_output_buffer_string(snd_output_t *output, char **buf) { WARNX1("stub"); return 0; }
+int snd_output_close(snd_output_t *output) { WARNX1("stub"); return 0; }
+int snd_output_vprintf(snd_output_t *output, const char *format, va_list args) { WARNX1("stub"); return 0; }
+int snd_output_puts(snd_output_t *output, const char *str) { WARNX1("stub"); return 0; }
+int snd_output_putc(snd_output_t *output, int c) { WARNX1("stub"); return 0; }
+int snd_output_flush(snd_output_t *output) { WARNX1("stub"); return 0; }
+int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, snd_async_callback_t callback, void *private_data) { WARNX1("stub"); return 0; }
+snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler) { WARNX1("stub"); return NULL; }
+int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_free(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status) { WARNX1("stub"); return 0; }
+int snd_pcm_hwsync(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp) { WARNX1("stub"); return 0; }
+int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) { WARNX1("stub"); return 0; }
+int snd_pcm_unlink(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm) { WARNX1("stub"); return NULL; }
+snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, snd_pcm_stream_t stream) { WARNX1("stub"); return NULL; }
+void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps) { WARNX1("stub"); }
+int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map) { WARNX1("stub"); return 0; }
+const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val) { WARNX1("stub"); return NULL; }
+int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_chmap_from_string(const char *str) { WARNX1("stub"); return 0; }
+snd_pcm_chmap_t *snd_pcm_chmap_parse_string(const char *str) { WARNX1("stub"); return NULL; }
+int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent) { WARNX1("stub"); return 0; }
+size_t snd_pcm_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_pcm_info_malloc(snd_pcm_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_info_free(snd_pcm_info_t *obj) { WARNX1("stub"); }
+void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src) { WARNX1("stub"); }
+unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_pcm_info_get_card(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj) { WARNX1("stub"); return NULL; }
+snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj) { WARNX1("stub"); return (snd_pcm_sync_id_t){0}; }
+void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val) { WARNX1("stub"); }
+int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params) /* deprecated, use audio_ts_type */ { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_supports_audio_ts_type(const snd_pcm_hw_params_t *params, int type) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params, unsigned int *rate_num, unsigned int *rate_den) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm, snd_pcm_hw_params_t *fail, snd_pcm_hw_params_t *success, unsigned int depth, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask) { WARNX1("stub"); return 0; }
+void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask) { WARNX1("stub"); }
+int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src) { WARNX1("stub"); }
+int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+size_t snd_pcm_access_mask_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj) { WARNX1("stub"); }
+void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src) { WARNX1("stub"); }
+void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask) { WARNX1("stub"); }
+void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask) { WARNX1("stub"); }
+int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask) { WARNX1("stub"); return 0; }
+void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val) { WARNX1("stub"); }
+void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val) { WARNX1("stub"); }
+int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj) { WARNX1("stub"); }
+void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src) { WARNX1("stub"); }
+void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask) { WARNX1("stub"); }
+void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask) { WARNX1("stub"); }
+int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask) { WARNX1("stub"); return 0; }
+void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val) { WARNX1("stub"); }
+void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val) { WARNX1("stub"); }
+size_t snd_pcm_subformat_mask_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj) { WARNX1("stub"); }
+void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src) { WARNX1("stub"); }
+void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask) { WARNX1("stub"); }
+void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask) { WARNX1("stub"); }
+int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask) { WARNX1("stub"); return 0; }
+void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val) { WARNX1("stub"); }
+void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val) { WARNX1("stub"); }
+size_t snd_pcm_status_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_pcm_status_malloc(snd_pcm_status_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_status_free(snd_pcm_status_t *obj) { WARNX1("stub"); }
+void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src) { WARNX1("stub"); }
+snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj) { WARNX1("stub"); return 0; }
+void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_driver_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr) { WARNX1("stub"); }
+void snd_pcm_status_get_audio_htstamp_report(const snd_pcm_status_t *obj, snd_pcm_audio_tstamp_report_t *audio_tstamp_report) { WARNX1("stub"); }
+void snd_pcm_status_set_audio_htstamp_config(snd_pcm_status_t *obj, snd_pcm_audio_tstamp_config_t *audio_tstamp_config) { WARNX1("stub"); }
+snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_pcm_type_name(snd_pcm_type_t type) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_stream_name(const snd_pcm_stream_t stream) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_access_name(const snd_pcm_access_t _access) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_format_description(const snd_pcm_format_t format) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat) { WARNX1("stub"); return NULL; }
+snd_pcm_format_t snd_pcm_format_value(const char* name) { WARNX1("stub"); return 0; }
+const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_state_name(const snd_pcm_state_t state) { WARNX1("stub"); return NULL; }
+int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out) { WARNX1("stub"); return 0; }
+int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size) { WARNX1("stub"); return 0; }
+int snd_pcm_format_signed(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_unsigned(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_linear(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_float(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_little_endian(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_big_endian(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_cpu_endian(snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+int snd_pcm_format_width(snd_pcm_format_t format) /* in bits */ { WARNX1("stub"); return 0; }
+int snd_pcm_format_physical_width(snd_pcm_format_t format) /* in bits */ { WARNX1("stub"); return 0; }
+snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian) { WARNX1("stub"); return 0; }
+ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples) { WARNX1("stub"); return 0; }
+int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples) { WARNX1("stub"); return 0; }
+long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes) { WARNX1("stub"); return 0; }
+ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, const snd_pcm_uframes_t dst_size, const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, const snd_pcm_uframes_t src_size, const unsigned int channels, snd_pcm_uframes_t frames, const snd_pcm_format_t format) { WARNX1("stub"); return 0; }
+snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook) { WARNX1("stub"); return NULL; }
+void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook) { WARNX1("stub"); return NULL; }
+void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data) { WARNX1("stub"); }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hook_remove(snd_pcm_hook_t *hook) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm) { WARNX1("stub"); return 0; }
+int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope) { WARNX1("stub"); return 0; }
+snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name) { WARNX1("stub"); return NULL; }
+int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr) { WARNX1("stub"); return -1; }
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, const snd_pcm_scope_ops_t *val) { WARNX1("stub"); }
+void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val) { WARNX1("stub"); }
+const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope) { WARNX1("stub"); return NULL; }
+void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope) { WARNX1("stub"); return NULL; }
+void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val) { WARNX1("stub"); }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) { WARNX1("stub"); return NULL; }
+const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) { WARNX1("stub"); return NULL; }
+int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val) { WARNX1("stub"); return 0; }
+snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val) { WARNX1("stub"); return 0; }
+snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) { WARNX1("stub"); return 0; }
+int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { WARNX1("stub"); return 0; }
+int snd_pcm_parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *cardp, int *cchannelsp, int *hwctlp) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext) { WARNX1("stub"); return 0; }
+void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext) { WARNX1("stub"); }
+int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list) { WARNX1("stub"); return 0; }
+int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max) { WARNX1("stub"); return 0; }
+int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list) { WARNX1("stub"); return 0; }
+int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max) { WARNX1("stub"); return 0; }
+int snd_pcm_ioplug_create(snd_pcm_ioplug_t *io, const char *name, snd_pcm_stream_t stream, int mode) { WARNX1("stub"); return 0; }
+int snd_pcm_ioplug_delete(snd_pcm_ioplug_t *io) { WARNX1("stub"); return 0; }
+int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug) { WARNX1("stub"); return 0; }
+const snd_pcm_channel_area_t *snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t *ioplug) { WARNX1("stub"); return NULL; }
+void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *io) { WARNX1("stub"); }
+int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *io, int type, unsigned int min, unsigned int max) { WARNX1("stub"); return 0; }
+int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *io, int type, unsigned int num_list, const unsigned int *list) { WARNX1("stub"); return 0; }
+int snd_pcm_ioplug_set_state(snd_pcm_ioplug_t *ioplug, snd_pcm_state_t state) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_ioplug_avail(const snd_pcm_ioplug_t * const ioplug, const snd_pcm_uframes_t hw_ptr, const snd_pcm_uframes_t appl_ptr) { WARNX1("stub"); return 0; }
+snd_pcm_uframes_t snd_pcm_ioplug_hw_avail(const snd_pcm_ioplug_t * const ioplug, const snd_pcm_uframes_t hw_ptr, const snd_pcm_uframes_t appl_ptr) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, snd_pcm_stream_t stream, int mode) { WARNX1("stub"); return 0; }
+int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_route_determine_ttable(snd_config_t *tt, unsigned int *tt_csize, unsigned int *tt_ssize) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int close_slave) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+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) { WARNX1("stub"); return 0; }
+int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, snd_config_t *playback_conf, snd_config_t *capture_conf, snd_pcm_stream_t stream, int mode) { WARNX1("stub"); return 0; }
+int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode) { WARNX1("stub"); return 0; }
+int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+int snd_rawmidi_close(snd_rawmidi_t *rmidi) { WARNX1("stub"); return 0; }
+int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi) { WARNX1("stub"); return 0; }
+int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent) { WARNX1("stub"); return 0; }
+int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_rawmidi_info_free(snd_rawmidi_info_t *obj) { WARNX1("stub"); }
+void snd_rawmidi_info_copy(snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src) { WARNX1("stub"); }
+unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return NULL; }
+const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj) { WARNX1("stub"); return 0; }
+void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val) { WARNX1("stub"); }
+void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val) { WARNX1("stub"); }
+int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_params_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr) { WARNX1("stub"); return -1; }
+void snd_rawmidi_params_free(snd_rawmidi_params_t *obj) { WARNX1("stub"); }
+void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src) { WARNX1("stub"); }
+int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t *params) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params_set_avail_min(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params) { WARNX1("stub"); return 0; }
+int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_status_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr) { WARNX1("stub"); return -1; }
+void snd_rawmidi_status_free(snd_rawmidi_status_t *obj) { WARNX1("stub"); }
+void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src) { WARNX1("stub"); }
+void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr) { WARNX1("stub"); }
+size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj) { WARNX1("stub"); return 0; }
+size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj) { WARNX1("stub"); return 0; }
+int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status) { WARNX1("stub"); return 0; }
+int snd_rawmidi_drain(snd_rawmidi_t *rmidi) { WARNX1("stub"); return 0; }
+int snd_rawmidi_drop(snd_rawmidi_t *rmidi) { WARNX1("stub"); return 0; }
+ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size) { WARNX1("stub"); return 0; }
+ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size) { WARNX1("stub"); return 0; }
+const char *snd_rawmidi_name(snd_rawmidi_t *rmidi) { WARNX1("stub"); return NULL; }
+snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi) { WARNX1("stub"); return 0; }
+snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi) { WARNX1("stub"); return 0; }
+int snd_seq_open(snd_seq_t **handle, const char *name, int streams, int mode) { WARNX1("stub"); return 0; }
+int snd_seq_open_lconf(snd_seq_t **handle, const char *name, int streams, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+const char *snd_seq_name(snd_seq_t *seq) { WARNX1("stub"); return NULL; }
+snd_seq_type_t snd_seq_type(snd_seq_t *seq) { WARNX1("stub"); return 0; }
+int snd_seq_close(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_poll_descriptors_count(snd_seq_t *handle, short events) { WARNX1("stub"); return 0; }
+int snd_seq_poll_descriptors(snd_seq_t *handle, struct pollfd *pfds, unsigned int space, short events) { WARNX1("stub"); return 0; }
+int snd_seq_poll_descriptors_revents(snd_seq_t *seq, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+int snd_seq_nonblock(snd_seq_t *handle, int nonblock) { WARNX1("stub"); return 0; }
+int snd_seq_client_id(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+size_t snd_seq_get_output_buffer_size(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+size_t snd_seq_get_input_buffer_size(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_set_output_buffer_size(snd_seq_t *handle, size_t size) { WARNX1("stub"); return 0; }
+int snd_seq_set_input_buffer_size(snd_seq_t *handle, size_t size) { WARNX1("stub"); return 0; }
+size_t snd_seq_system_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_malloc(snd_seq_system_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_system_info_free(snd_seq_system_info_t *ptr) { WARNX1("stub"); }
+void snd_seq_system_info_copy(snd_seq_system_info_t *dst, const snd_seq_system_info_t *src) { WARNX1("stub"); }
+int snd_seq_system_info_get_queues(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_get_clients(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_get_ports(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_get_channels(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_get_cur_clients(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info_get_cur_queues(const snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_system_info(snd_seq_t *handle, snd_seq_system_info_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_client_info_malloc(snd_seq_client_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_client_info_free(snd_seq_client_info_t *ptr) { WARNX1("stub"); }
+void snd_seq_client_info_copy(snd_seq_client_info_t *dst, const snd_seq_client_info_t *src) { WARNX1("stub"); }
+int snd_seq_client_info_get_client(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+snd_seq_client_type_t snd_seq_client_info_get_type(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+const char *snd_seq_client_info_get_name(snd_seq_client_info_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_client_info_get_card(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_client_info_get_pid(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+const unsigned char *snd_seq_client_info_get_event_filter(const snd_seq_client_info_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_client_info_get_num_ports(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_client_info_set_client(snd_seq_client_info_t *info, int client) { WARNX1("stub"); }
+void snd_seq_client_info_set_name(snd_seq_client_info_t *info, const char *name) { WARNX1("stub"); }
+void snd_seq_client_info_set_broadcast_filter(snd_seq_client_info_t *info, int val) { WARNX1("stub"); }
+void snd_seq_client_info_set_error_bounce(snd_seq_client_info_t *info, int val) { WARNX1("stub"); }
+void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter) { WARNX1("stub"); }
+void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t *info) { WARNX1("stub"); }
+void snd_seq_client_info_event_filter_add(snd_seq_client_info_t *info, int event_type) { WARNX1("stub"); }
+void snd_seq_client_info_event_filter_del(snd_seq_client_info_t *info, int event_type) { WARNX1("stub"); }
+int snd_seq_client_info_event_filter_check(snd_seq_client_info_t *info, int event_type) { WARNX1("stub"); return 0; }
+int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_info(snd_seq_t *handle, snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_next_client(snd_seq_t *handle, snd_seq_client_info_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_client_pool_malloc(snd_seq_client_pool_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_client_pool_free(snd_seq_client_pool_t *ptr) { WARNX1("stub"); }
+void snd_seq_client_pool_copy(snd_seq_client_pool_t *dst, const snd_seq_client_pool_t *src) { WARNX1("stub"); }
+int snd_seq_client_pool_get_client(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_client_pool_set_output_pool(snd_seq_client_pool_t *info, size_t size) { WARNX1("stub"); }
+void snd_seq_client_pool_set_input_pool(snd_seq_client_pool_t *info, size_t size) { WARNX1("stub"); }
+void snd_seq_client_pool_set_output_room(snd_seq_client_pool_t *info, size_t size) { WARNX1("stub"); }
+int snd_seq_get_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_port_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_malloc(snd_seq_port_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_port_info_free(snd_seq_port_info_t *ptr) { WARNX1("stub"); }
+void snd_seq_port_info_copy(snd_seq_port_info_t *dst, const snd_seq_port_info_t *src) { WARNX1("stub"); }
+int snd_seq_port_info_get_client(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_port(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info) { WARNX1("stub"); return NULL; }
+const char *snd_seq_port_info_get_name(const snd_seq_port_info_t *info) { WARNX1("stub"); return NULL; }
+unsigned int snd_seq_port_info_get_capability(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+unsigned int snd_seq_port_info_get_type(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_midi_channels(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_midi_voices(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_synth_voices(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_read_use(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_write_use(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_port_specified(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_timestamping(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_port_info_set_client(snd_seq_port_info_t *info, int client) { WARNX1("stub"); }
+void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port) { WARNX1("stub"); }
+void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr) { WARNX1("stub"); }
+void snd_seq_port_info_set_name(snd_seq_port_info_t *info, const char *name) { WARNX1("stub"); }
+void snd_seq_port_info_set_capability(snd_seq_port_info_t *info, unsigned int capability) { WARNX1("stub"); }
+void snd_seq_port_info_set_type(snd_seq_port_info_t *info, unsigned int type) { WARNX1("stub"); }
+void snd_seq_port_info_set_midi_channels(snd_seq_port_info_t *info, int channels) { WARNX1("stub"); }
+void snd_seq_port_info_set_midi_voices(snd_seq_port_info_t *info, int voices) { WARNX1("stub"); }
+void snd_seq_port_info_set_synth_voices(snd_seq_port_info_t *info, int voices) { WARNX1("stub"); }
+void snd_seq_port_info_set_port_specified(snd_seq_port_info_t *info, int val) { WARNX1("stub"); }
+void snd_seq_port_info_set_timestamping(snd_seq_port_info_t *info, int enable) { WARNX1("stub"); }
+void snd_seq_port_info_set_timestamp_real(snd_seq_port_info_t *info, int realtime) { WARNX1("stub"); }
+void snd_seq_port_info_set_timestamp_queue(snd_seq_port_info_t *info, int queue) { WARNX1("stub"); }
+int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_delete_port(snd_seq_t *handle, int port) { WARNX1("stub"); return 0; }
+int snd_seq_get_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_get_any_port_info(snd_seq_t *handle, int client, int port, snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_set_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_next_port(snd_seq_t *handle, snd_seq_port_info_t *info) { WARNX1("stub"); return 0; }
+size_t snd_seq_port_subscribe_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_port_subscribe_free(snd_seq_port_subscribe_t *ptr) { WARNX1("stub"); }
+void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_port_subscribe_t *src) { WARNX1("stub"); }
+const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return NULL; }
+const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_port_subscribe_set_sender(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr) { WARNX1("stub"); }
+void snd_seq_port_subscribe_set_dest(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr) { WARNX1("stub"); }
+void snd_seq_port_subscribe_set_queue(snd_seq_port_subscribe_t *info, int q) { WARNX1("stub"); }
+void snd_seq_port_subscribe_set_exclusive(snd_seq_port_subscribe_t *info, int val) { WARNX1("stub"); }
+void snd_seq_port_subscribe_set_time_update(snd_seq_port_subscribe_t *info, int val) { WARNX1("stub"); }
+void snd_seq_port_subscribe_set_time_real(snd_seq_port_subscribe_t *info, int val) { WARNX1("stub"); }
+int snd_seq_get_port_subscription(snd_seq_t *handle, snd_seq_port_subscribe_t *sub) { WARNX1("stub"); return 0; }
+int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub) { WARNX1("stub"); return 0; }
+int snd_seq_unsubscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub) { WARNX1("stub"); return 0; }
+size_t snd_seq_query_subscribe_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_query_subscribe_free(snd_seq_query_subscribe_t *ptr) { WARNX1("stub"); }
+void snd_seq_query_subscribe_copy(snd_seq_query_subscribe_t *dst, const snd_seq_query_subscribe_t *src) { WARNX1("stub"); }
+int snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return NULL; }
+snd_seq_query_subs_type_t snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_query_subscribe_set_client(snd_seq_query_subscribe_t *info, int client) { WARNX1("stub"); }
+void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port) { WARNX1("stub"); }
+void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr) { WARNX1("stub"); }
+void snd_seq_query_subscribe_set_type(snd_seq_query_subscribe_t *info, snd_seq_query_subs_type_t type) { WARNX1("stub"); }
+void snd_seq_query_subscribe_set_index(snd_seq_query_subscribe_t *info, int _index) { WARNX1("stub"); }
+int snd_seq_query_port_subscribers(snd_seq_t *seq, snd_seq_query_subscribe_t * subs) { WARNX1("stub"); return 0; }
+size_t snd_seq_queue_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_queue_info_malloc(snd_seq_queue_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_queue_info_free(snd_seq_queue_info_t *ptr) { WARNX1("stub"); }
+void snd_seq_queue_info_copy(snd_seq_queue_info_t *dst, const snd_seq_queue_info_t *src) { WARNX1("stub"); }
+int snd_seq_queue_info_get_queue(const snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+const char *snd_seq_queue_info_get_name(const snd_seq_queue_info_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_queue_info_get_owner(const snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_queue_info_get_locked(const snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+unsigned int snd_seq_queue_info_get_flags(const snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_queue_info_set_name(snd_seq_queue_info_t *info, const char *name) { WARNX1("stub"); }
+void snd_seq_queue_info_set_owner(snd_seq_queue_info_t *info, int owner) { WARNX1("stub"); }
+void snd_seq_queue_info_set_locked(snd_seq_queue_info_t *info, int locked) { WARNX1("stub"); }
+void snd_seq_queue_info_set_flags(snd_seq_queue_info_t *info, unsigned int flags) { WARNX1("stub"); }
+int snd_seq_create_queue(snd_seq_t *seq, snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_alloc_named_queue(snd_seq_t *seq, const char *name) { WARNX1("stub"); return 0; }
+int snd_seq_alloc_queue(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_free_queue(snd_seq_t *handle, int q) { WARNX1("stub"); return 0; }
+int snd_seq_get_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_set_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_query_named_queue(snd_seq_t *seq, const char *name) { WARNX1("stub"); return 0; }
+int snd_seq_get_queue_usage(snd_seq_t *handle, int q) { WARNX1("stub"); return 0; }
+int snd_seq_set_queue_usage(snd_seq_t *handle, int q, int used) { WARNX1("stub"); return 0; }
+size_t snd_seq_queue_status_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_queue_status_malloc(snd_seq_queue_status_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_queue_status_free(snd_seq_queue_status_t *ptr) { WARNX1("stub"); }
+void snd_seq_queue_status_copy(snd_seq_queue_status_t *dst, const snd_seq_queue_status_t *src) { WARNX1("stub"); }
+int snd_seq_queue_status_get_queue(const snd_seq_queue_status_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_queue_status_get_events(const snd_seq_queue_status_t *info) { WARNX1("stub"); return 0; }
+snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_status_t *info) { WARNX1("stub"); return 0; }
+const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info) { WARNX1("stub"); return NULL; }
+unsigned int snd_seq_queue_status_get_status(const snd_seq_queue_status_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_get_queue_status(snd_seq_t *handle, int q, snd_seq_queue_status_t *status) { WARNX1("stub"); return 0; }
+size_t snd_seq_queue_tempo_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_queue_tempo_malloc(snd_seq_queue_tempo_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_queue_tempo_free(snd_seq_queue_tempo_t *ptr) { WARNX1("stub"); }
+void snd_seq_queue_tempo_copy(snd_seq_queue_tempo_t *dst, const snd_seq_queue_tempo_t *src) { WARNX1("stub"); }
+int snd_seq_queue_tempo_get_queue(const snd_seq_queue_tempo_t *info) { WARNX1("stub"); return 0; }
+unsigned int snd_seq_queue_tempo_get_tempo(const snd_seq_queue_tempo_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_queue_tempo_get_ppq(const snd_seq_queue_tempo_t *info) { WARNX1("stub"); return 0; }
+unsigned int snd_seq_queue_tempo_get_skew(const snd_seq_queue_tempo_t *info) { WARNX1("stub"); return 0; }
+unsigned int snd_seq_queue_tempo_get_skew_base(const snd_seq_queue_tempo_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_queue_tempo_set_tempo(snd_seq_queue_tempo_t *info, unsigned int tempo) { WARNX1("stub"); }
+void snd_seq_queue_tempo_set_ppq(snd_seq_queue_tempo_t *info, int ppq) { WARNX1("stub"); }
+void snd_seq_queue_tempo_set_skew(snd_seq_queue_tempo_t *info, unsigned int skew) { WARNX1("stub"); }
+void snd_seq_queue_tempo_set_skew_base(snd_seq_queue_tempo_t *info, unsigned int base) { WARNX1("stub"); }
+int snd_seq_get_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo) { WARNX1("stub"); return 0; }
+int snd_seq_set_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo) { WARNX1("stub"); return 0; }
+size_t snd_seq_queue_timer_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_queue_timer_free(snd_seq_queue_timer_t *ptr) { WARNX1("stub"); }
+void snd_seq_queue_timer_copy(snd_seq_queue_timer_t *dst, const snd_seq_queue_timer_t *src) { WARNX1("stub"); }
+int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t *info) { WARNX1("stub"); return 0; }
+snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t *info) { WARNX1("stub"); return 0; }
+const snd_timer_id_t *snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t *info) { WARNX1("stub"); return NULL; }
+unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_queue_timer_set_type(snd_seq_queue_timer_t *info, snd_seq_queue_timer_type_t type) { WARNX1("stub"); }
+void snd_seq_queue_timer_set_id(snd_seq_queue_timer_t *info, const snd_timer_id_t *id) { WARNX1("stub"); }
+void snd_seq_queue_timer_set_resolution(snd_seq_queue_timer_t *info, unsigned int resolution) { WARNX1("stub"); }
+int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer) { WARNX1("stub"); return 0; }
+int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer) { WARNX1("stub"); return 0; }
+int snd_seq_free_event(snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+ssize_t snd_seq_event_length(snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_event_output_buffer(snd_seq_t *handle, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_event_output_direct(snd_seq_t *handle, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev) { WARNX1("stub"); return 0; }
+int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer) { WARNX1("stub"); return 0; }
+int snd_seq_drain_output(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_event_output_pending(snd_seq_t *seq) { WARNX1("stub"); return 0; }
+int snd_seq_extract_output(snd_seq_t *handle, snd_seq_event_t **ev) { WARNX1("stub"); return 0; }
+int snd_seq_drop_output(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_drop_output_buffer(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_drop_input(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+int snd_seq_drop_input_buffer(snd_seq_t *handle) { WARNX1("stub"); return 0; }
+size_t snd_seq_remove_events_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr) { WARNX1("stub"); return -1; }
+void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr) { WARNX1("stub"); }
+void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src) { WARNX1("stub"); }
+unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info) { WARNX1("stub"); return NULL; }
+const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info) { WARNX1("stub"); return NULL; }
+int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_remove_events_set_condition(snd_seq_remove_events_t *info, unsigned int flags) { WARNX1("stub"); }
+void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue) { WARNX1("stub"); }
+void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time) { WARNX1("stub"); }
+void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr) { WARNX1("stub"); }
+void snd_seq_remove_events_set_channel(snd_seq_remove_events_t *info, int channel) { WARNX1("stub"); }
+void snd_seq_remove_events_set_event_type(snd_seq_remove_events_t *info, int type) { WARNX1("stub"); }
+void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag) { WARNX1("stub"); }
+int snd_seq_remove_events(snd_seq_t *handle, snd_seq_remove_events_t *info) { WARNX1("stub"); return 0; }
+void snd_seq_set_bit(int nr, void *array) { WARNX1("stub"); }
+void snd_seq_unset_bit(int nr, void *array) { WARNX1("stub"); }
+int snd_seq_change_bit(int nr, void *array) { WARNX1("stub"); return 0; }
+int snd_seq_get_bit(int nr, void *array) { WARNX1("stub"); return 0; }
+int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev) { WARNX1("stub"); return 0; }
+int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize) { WARNX1("stub"); return 0; }
+void snd_midi_event_free(snd_midi_event_t *dev) { WARNX1("stub"); }
+void snd_midi_event_init(snd_midi_event_t *dev) { WARNX1("stub"); }
+void snd_midi_event_reset_encode(snd_midi_event_t *dev) { WARNX1("stub"); }
+void snd_midi_event_reset_decode(snd_midi_event_t *dev) { WARNX1("stub"); }
+void snd_midi_event_no_status(snd_midi_event_t *dev, int on) { WARNX1("stub"); }
+long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_control_queue(snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev) { WARNX1("stub"); return 0; }
+int snd_seq_create_simple_port(snd_seq_t *seq, const char *name, unsigned int caps, unsigned int type) { WARNX1("stub"); return 0; }
+int snd_seq_delete_simple_port(snd_seq_t *seq, int port) { WARNX1("stub"); return 0; }
+int snd_seq_connect_from(snd_seq_t *seq, int my_port, int src_client, int src_port) { WARNX1("stub"); return 0; }
+int snd_seq_connect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port) { WARNX1("stub"); return 0; }
+int snd_seq_disconnect_from(snd_seq_t *seq, int my_port, int src_client, int src_port) { WARNX1("stub"); return 0; }
+int snd_seq_disconnect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_name(snd_seq_t *seq, const char *name) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_event_filter(snd_seq_t *seq, int event_type) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_pool_output(snd_seq_t *seq, size_t size) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_pool_output_room(snd_seq_t *seq, size_t size) { WARNX1("stub"); return 0; }
+int snd_seq_set_client_pool_input(snd_seq_t *seq, size_t size) { WARNX1("stub"); return 0; }
+int snd_seq_sync_output_queue(snd_seq_t *seq) { WARNX1("stub"); return 0; }
+int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *str) { WARNX1("stub"); return 0; }
+int snd_seq_reset_pool_output(snd_seq_t *seq) { WARNX1("stub"); return 0; }
+int snd_seq_reset_pool_input(snd_seq_t *seq) { WARNX1("stub"); return 0; }
+int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+int snd_timer_query_close(snd_timer_query_t *handle) { WARNX1("stub"); return 0; }
+int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid) { WARNX1("stub"); return 0; }
+int snd_timer_query_info(snd_timer_query_t *handle, snd_timer_ginfo_t *info) { WARNX1("stub"); return 0; }
+int snd_timer_query_params(snd_timer_query_t *handle, snd_timer_gparams_t *params) { WARNX1("stub"); return 0; }
+int snd_timer_query_status(snd_timer_query_t *handle, snd_timer_gstatus_t *status) { WARNX1("stub"); return 0; }
+int snd_timer_open(snd_timer_t **handle, const char *name, int mode) { WARNX1("stub"); return 0; }
+int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf) { WARNX1("stub"); return 0; }
+int snd_timer_close(snd_timer_t *handle) { WARNX1("stub"); return 0; }
+int snd_async_add_timer_handler(snd_async_handler_t **handler, snd_timer_t *timer, snd_async_callback_t callback, void *private_data) { WARNX1("stub"); return 0; }
+snd_timer_t *snd_async_handler_get_timer(snd_async_handler_t *handler) { WARNX1("stub"); return NULL; }
+int snd_timer_poll_descriptors_count(snd_timer_t *handle) { WARNX1("stub"); return 0; }
+int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space) { WARNX1("stub"); return 0; }
+int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents) { WARNX1("stub"); return 0; }
+int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer) { WARNX1("stub"); return 0; }
+int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params) { WARNX1("stub"); return 0; }
+int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status) { WARNX1("stub"); return 0; }
+int snd_timer_start(snd_timer_t *handle) { WARNX1("stub"); return 0; }
+int snd_timer_stop(snd_timer_t *handle) { WARNX1("stub"); return 0; }
+int snd_timer_continue(snd_timer_t *handle) { WARNX1("stub"); return 0; }
+ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size) { WARNX1("stub"); return 0; }
+size_t snd_timer_id_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_timer_id_malloc(snd_timer_id_t **ptr) { WARNX1("stub"); return -1; }
+void snd_timer_id_free(snd_timer_id_t *obj) { WARNX1("stub"); }
+void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src) { WARNX1("stub"); }
+void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class) { WARNX1("stub"); }
+int snd_timer_id_get_class(snd_timer_id_t *id) { WARNX1("stub"); return 0; }
+void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass) { WARNX1("stub"); }
+int snd_timer_id_get_sclass(snd_timer_id_t *id) { WARNX1("stub"); return 0; }
+void snd_timer_id_set_card(snd_timer_id_t *id, int card) { WARNX1("stub"); }
+int snd_timer_id_get_card(snd_timer_id_t *id) { WARNX1("stub"); return 0; }
+void snd_timer_id_set_device(snd_timer_id_t *id, int device) { WARNX1("stub"); }
+int snd_timer_id_get_device(snd_timer_id_t *id) { WARNX1("stub"); return 0; }
+void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice) { WARNX1("stub"); }
+int snd_timer_id_get_subdevice(snd_timer_id_t *id) { WARNX1("stub"); return 0; }
+size_t snd_timer_ginfo_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_timer_ginfo_malloc(snd_timer_ginfo_t **ptr) { WARNX1("stub"); return -1; }
+void snd_timer_ginfo_free(snd_timer_ginfo_t *obj) { WARNX1("stub"); }
+void snd_timer_ginfo_copy(snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src) { WARNX1("stub"); }
+int snd_timer_ginfo_set_tid(snd_timer_ginfo_t *obj, snd_timer_id_t *tid) { WARNX1("stub"); return 0; }
+snd_timer_id_t *snd_timer_ginfo_get_tid(snd_timer_ginfo_t *obj) { WARNX1("stub"); return NULL; }
+unsigned int snd_timer_ginfo_get_flags(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+int snd_timer_ginfo_get_card(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj) { WARNX1("stub"); return NULL; }
+char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj) { WARNX1("stub"); return NULL; }
+unsigned long snd_timer_ginfo_get_resolution(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+unsigned long snd_timer_ginfo_get_resolution_min(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+unsigned long snd_timer_ginfo_get_resolution_max(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+unsigned int snd_timer_ginfo_get_clients(snd_timer_ginfo_t *obj) { WARNX1("stub"); return 0; }
+size_t snd_timer_info_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_timer_info_malloc(snd_timer_info_t **ptr) { WARNX1("stub"); return -1; }
+void snd_timer_info_free(snd_timer_info_t *obj) { WARNX1("stub"); }
+void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src) { WARNX1("stub"); }
+int snd_timer_info_is_slave(snd_timer_info_t * info) { WARNX1("stub"); return 0; }
+int snd_timer_info_get_card(snd_timer_info_t * info) { WARNX1("stub"); return 0; }
+const char *snd_timer_info_get_id(snd_timer_info_t * info) { WARNX1("stub"); return NULL; }
+const char *snd_timer_info_get_name(snd_timer_info_t * info) { WARNX1("stub"); return NULL; }
+long snd_timer_info_get_resolution(snd_timer_info_t * info) { WARNX1("stub"); return 0; }
+size_t snd_timer_params_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_timer_params_malloc(snd_timer_params_t **ptr) { WARNX1("stub"); return -1; }
+void snd_timer_params_free(snd_timer_params_t *obj) { WARNX1("stub"); }
+void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src) { WARNX1("stub"); }
+int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start) { WARNX1("stub"); return 0; }
+int snd_timer_params_get_auto_start(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive) { WARNX1("stub"); return 0; }
+int snd_timer_params_get_exclusive(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event) { WARNX1("stub"); return 0; }
+int snd_timer_params_get_early_event(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks) { WARNX1("stub"); }
+long snd_timer_params_get_ticks(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size) { WARNX1("stub"); }
+long snd_timer_params_get_queue_size(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter) { WARNX1("stub"); }
+unsigned int snd_timer_params_get_filter(snd_timer_params_t * params) { WARNX1("stub"); return 0; }
+size_t snd_timer_status_sizeof(void) { WARNX1("stub"); return 0; }
+int snd_timer_status_malloc(snd_timer_status_t **ptr) { WARNX1("stub"); return -1; }
+void snd_timer_status_free(snd_timer_status_t *obj) { WARNX1("stub"); }
+void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src) { WARNX1("stub"); }
+snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status) { WARNX1("stub"); return (snd_htimestamp_t){0}; }
+long snd_timer_status_get_resolution(snd_timer_status_t * status) { WARNX1("stub"); return 0; }
+long snd_timer_status_get_lost(snd_timer_status_t * status) { WARNX1("stub"); return 0; }
+long snd_timer_status_get_overrun(snd_timer_status_t * status) { WARNX1("stub"); return 0; }
+long snd_timer_status_get_queue(snd_timer_status_t * status) { WARNX1("stub"); return 0; }
+long snd_timer_info_get_ticks(snd_timer_info_t * info) { WARNX1("stub"); return 0; }
+snd_tplg_t *snd_tplg_new(void) { WARNX1("stub"); return NULL; }
+void snd_tplg_free(snd_tplg_t *tplg) { WARNX1("stub"); }
+int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile, const char *outfile) { WARNX1("stub"); return 0; }
+void snd_tplg_verbose(snd_tplg_t *tplg, int verbose) { WARNX1("stub"); }
+int snd_tplg_add_object(snd_tplg_t *tplg, snd_tplg_obj_template_t *t) { WARNX1("stub"); return 0; }
+int snd_tplg_build(snd_tplg_t *tplg, const char *outfile) { WARNX1("stub"); return 0; }
+int snd_tplg_set_manifest_data(snd_tplg_t *tplg, const void *data, int len) { WARNX1("stub"); return 0; }
+int snd_tplg_set_version(snd_tplg_t *tplg, unsigned int version) { WARNX1("stub"); return 0; }
+char *snd_use_case_identifier(const char *fmt, ...) { WARNX1("stub"); return NULL; }
+int snd_use_case_free_list(const char *list[], int items) { WARNX1("stub"); return 0; }
+int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, const char *identifier, const char **list[]) { WARNX1("stub"); return 0; }
+int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, const char *identifier, const char **value) { WARNX1("stub"); return 0; }
+int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr, const char *identifier, long *value) { WARNX1("stub"); return 0; }
+int snd_use_case_set(snd_use_case_mgr_t *uc_mgr, const char *identifier, const char *value) { WARNX1("stub"); return 0; }
+int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr, const char *card_name) { WARNX1("stub"); return 0; }
+int snd_use_case_mgr_reload(snd_use_case_mgr_t *uc_mgr) { WARNX1("stub"); return 0; }
+int snd_use_case_mgr_close(snd_use_case_mgr_t *uc_mgr) { WARNX1("stub"); return 0; }
+int snd_use_case_mgr_reset(snd_use_case_mgr_t *uc_mgr) { WARNX1("stub"); return 0; }
diff --git a/src/symversioning-hell.h b/src/symversioning-hell.h
new file mode 100644
index 0000000..f3e9b35
--- /dev/null
+++ b/src/symversioning-hell.h
@@ -0,0 +1,236 @@
+// symversioning... jesus fucking christ... stop doing this people...
+// below is madness copied from upstream libasound's src/pcm/pcm.c
+
+#define __SYMBOL_PREFIX ""
+#define ASM_NAME(name) __SYMBOL_PREFIX name
+#define INTERNAL(Name) Name
+
+#define symbol_version(real, name, version) \
+ __asm__(".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version)
+#define default_symbol_version(real, name, version) \
+ __asm__(".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version)
+
+#define OBSOLETE1(name, what, new) \
+ default_symbol_version(__##name, name, new); \
+ symbol_version(__old_##name, name, what);
+
+#define __P_OLD_GET(pfx, name, val_type, ret_type) \
+ret_type pfx##name(const snd_pcm_hw_params_t *params) \
+{ \
+ val_type val; \
+ if (INTERNAL(name)(params, &val) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __P_OLD_GET1(pfx, name, val_type, ret_type) \
+ret_type pfx##name(const snd_pcm_hw_params_t *params, int *dir) \
+{ \
+ val_type val; \
+ if (INTERNAL(name)(params, &val, dir) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __OLD_GET(name, val_type, ret_type) __P_OLD_GET(__old_, name, val_type, ret_type)
+#define __OLD_GET1(name, val_type, ret_type) __P_OLD_GET1(__old_, name, val_type, ret_type)
+
+__OLD_GET(snd_pcm_hw_params_get_access, snd_pcm_access_t, int)
+__OLD_GET(snd_pcm_hw_params_get_format, snd_pcm_format_t, int)
+__OLD_GET(snd_pcm_hw_params_get_subformat, snd_pcm_subformat_t, int)
+__OLD_GET(snd_pcm_hw_params_get_channels, unsigned int, int)
+__OLD_GET1(snd_pcm_hw_params_get_rate, unsigned int, int)
+__OLD_GET1(snd_pcm_hw_params_get_period_time, unsigned int, int)
+__OLD_GET1(snd_pcm_hw_params_get_period_size, snd_pcm_uframes_t, snd_pcm_sframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_periods, unsigned int, int)
+__OLD_GET1(snd_pcm_hw_params_get_buffer_time, unsigned int, int)
+__OLD_GET(snd_pcm_hw_params_get_buffer_size, snd_pcm_uframes_t, snd_pcm_sframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_tick_time, unsigned int, int)
+
+__OLD_GET(snd_pcm_hw_params_get_channels_min, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_rate_min, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_period_time_min, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_period_size_min, snd_pcm_uframes_t, snd_pcm_uframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_periods_min, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_buffer_time_min, unsigned int, unsigned int)
+__OLD_GET(snd_pcm_hw_params_get_buffer_size_min, snd_pcm_uframes_t, snd_pcm_uframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_tick_time_min, unsigned int, unsigned int)
+
+__OLD_GET(snd_pcm_hw_params_get_channels_max, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_rate_max, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_period_time_max, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_period_size_max, snd_pcm_uframes_t, snd_pcm_uframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_periods_max, unsigned int, unsigned int)
+__OLD_GET1(snd_pcm_hw_params_get_buffer_time_max, unsigned int, unsigned int)
+__OLD_GET(snd_pcm_hw_params_get_buffer_size_max, snd_pcm_uframes_t, snd_pcm_uframes_t)
+__OLD_GET1(snd_pcm_hw_params_get_tick_time_max, unsigned int, unsigned int)
+
+#define __P_OLD_NEAR(pfx, name, ret_type) \
+ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val) \
+{ \
+ if (INTERNAL(name)(pcm, params, &val) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __P_OLD_NEAR1(pfx, name, ret_type) \
+ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val, int *dir) \
+{ \
+ if (INTERNAL(name)(pcm, params, &val, dir) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __OLD_NEAR(name, ret_type) __P_OLD_NEAR(__old_, name, ret_type)
+#define __OLD_NEAR1(name, ret_type) __P_OLD_NEAR1(__old_, name, ret_type)
+
+__OLD_NEAR(snd_pcm_hw_params_set_channels_near, unsigned int)
+__OLD_NEAR1(snd_pcm_hw_params_set_rate_near, unsigned int)
+__OLD_NEAR1(snd_pcm_hw_params_set_period_time_near, unsigned int)
+__OLD_NEAR1(snd_pcm_hw_params_set_period_size_near, snd_pcm_uframes_t)
+__OLD_NEAR1(snd_pcm_hw_params_set_periods_near, unsigned int)
+__OLD_NEAR1(snd_pcm_hw_params_set_buffer_time_near, unsigned int)
+__OLD_NEAR(snd_pcm_hw_params_set_buffer_size_near, snd_pcm_uframes_t)
+__OLD_NEAR1(snd_pcm_hw_params_set_tick_time_near, unsigned int)
+
+#define __P_OLD_SET_FL(pfx, name, ret_type) \
+ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) \
+{ \
+ ret_type val; \
+ if (INTERNAL(name)(pcm, params, &val) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __P_OLD_SET_FL1(pfx, name, ret_type) \
+ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir) \
+{ \
+ ret_type val; \
+ if (INTERNAL(name)(pcm, params, &val, dir) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __OLD_SET_FL(name, ret_type) __P_OLD_SET_FL(__old_, name, ret_type)
+#define __OLD_SET_FL1(name, ret_type) __P_OLD_SET_FL1(__old_, name, ret_type)
+
+__OLD_SET_FL(snd_pcm_hw_params_set_access_first, snd_pcm_access_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_format_first, snd_pcm_format_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_subformat_first, snd_pcm_subformat_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_channels_first, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_rate_first, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_period_time_first, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_period_size_first, snd_pcm_uframes_t)
+__OLD_SET_FL1(snd_pcm_hw_params_set_periods_first, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_buffer_time_first, unsigned int)
+__OLD_SET_FL(snd_pcm_hw_params_set_buffer_size_first, snd_pcm_uframes_t)
+__OLD_SET_FL1(snd_pcm_hw_params_set_tick_time_first, unsigned int)
+
+__OLD_SET_FL(snd_pcm_hw_params_set_access_last, snd_pcm_access_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_format_last, snd_pcm_format_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_subformat_last, snd_pcm_subformat_t)
+__OLD_SET_FL(snd_pcm_hw_params_set_channels_last, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_rate_last, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_period_time_last, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_period_size_last, snd_pcm_uframes_t)
+__OLD_SET_FL1(snd_pcm_hw_params_set_periods_last, unsigned int)
+__OLD_SET_FL1(snd_pcm_hw_params_set_buffer_time_last, unsigned int)
+__OLD_SET_FL(snd_pcm_hw_params_set_buffer_size_last, snd_pcm_uframes_t)
+__OLD_SET_FL1(snd_pcm_hw_params_set_tick_time_last, unsigned int)
+
+#define __P_OLD_GET_SW(pfx, name, ret_type) \
+ret_type pfx##name(snd_pcm_sw_params_t *params) \
+{ \
+ ret_type val; \
+ if (INTERNAL(name)(params, &val) < 0) \
+ return 0; \
+ return (ret_type)val; \
+}
+
+#define __OLD_GET_SW(name, ret_type) __P_OLD_GET_SW(__old_, name, ret_type)
+
+__OLD_GET_SW(snd_pcm_sw_params_get_tstamp_mode, snd_pcm_tstamp_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_sleep_min, unsigned int)
+__OLD_GET_SW(snd_pcm_sw_params_get_avail_min, snd_pcm_uframes_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_xfer_align, snd_pcm_uframes_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_start_threshold, snd_pcm_uframes_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_stop_threshold, snd_pcm_uframes_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_silence_threshold, snd_pcm_uframes_t)
+__OLD_GET_SW(snd_pcm_sw_params_get_silence_size, snd_pcm_uframes_t)
+
+OBSOLETE1(snd_pcm_hw_params_get_access, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_access_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_access_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_format, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_format_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_format_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_subformat, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_subformat_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_subformat_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_channels, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_channels_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_channels_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_channels_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_channels_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_channels_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_rate, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_rate_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_rate_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_rate_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_rate_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_rate_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_period_time, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_period_time_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_period_time_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_time_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_time_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_time_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_period_size, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_period_size_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_period_size_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_size_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_size_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_period_size_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_periods, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_periods_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_periods_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_periods_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_periods_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_periods_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_buffer_time, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_buffer_time_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_buffer_time_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_time_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_time_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_time_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_buffer_size, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_buffer_size_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_buffer_size_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_size_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_size_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_buffer_size_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_hw_params_get_tick_time, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_tick_time_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_get_tick_time_max, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_tick_time_near, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_tick_time_first, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_hw_params_set_tick_time_last, ALSA_0.9, ALSA_0.9.0rc4)
+
+OBSOLETE1(snd_pcm_sw_params_get_tstamp_mode, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_sleep_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_avail_min, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_xfer_align, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_start_threshold, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_stop_threshold, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_silence_threshold, ALSA_0.9, ALSA_0.9.0rc4)
+OBSOLETE1(snd_pcm_sw_params_get_silence_size, ALSA_0.9, ALSA_0.9.0rc4)
diff --git a/src/util/defs.h b/src/util/defs.h
new file mode 100644
index 0000000..6cfc877
--- /dev/null
+++ b/src/util/defs.h
@@ -0,0 +1,29 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef DEFS_H
+#define DEFS_H
+
+/*
+ * limits
+ */
+#define NCHAN_MAX 16 /* max channel in a stream */
+#define RATE_MIN 4000 /* min sample rate */
+#define RATE_MAX 192000 /* max sample rate */
+#define BITS_MIN 1 /* min bits per sample */
+#define BITS_MAX 32 /* max bits per sample */
+
+#endif /* !defined(DEFS_H) */
diff --git a/src/util/dsp.c b/src/util/dsp.c
new file mode 100644
index 0000000..62510b9
--- /dev/null
+++ b/src/util/dsp.c
@@ -0,0 +1,924 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include <string.h>
+#include "dsp.h"
+#include "utils.h"
+
+int aparams_ctltovol[128] = {
+ 0,
+ 256, 266, 276, 287, 299, 310, 323, 335,
+ 348, 362, 376, 391, 406, 422, 439, 456,
+ 474, 493, 512, 532, 553, 575, 597, 621,
+ 645, 670, 697, 724, 753, 782, 813, 845,
+ 878, 912, 948, 985, 1024, 1064, 1106, 1149,
+ 1195, 1241, 1290, 1341, 1393, 1448, 1505, 1564,
+ 1625, 1689, 1756, 1825, 1896, 1971, 2048, 2128,
+ 2212, 2299, 2389, 2483, 2580, 2682, 2787, 2896,
+ 3010, 3128, 3251, 3379, 3511, 3649, 3792, 3941,
+ 4096, 4257, 4424, 4598, 4778, 4966, 5161, 5363,
+ 5574, 5793, 6020, 6256, 6502, 6757, 7023, 7298,
+ 7585, 7883, 8192, 8514, 8848, 9195, 9556, 9931,
+ 10321, 10726, 11148, 11585, 12040, 12513, 13004, 13515,
+ 14045, 14596, 15170, 15765, 16384, 17027, 17696, 18390,
+ 19112, 19863, 20643, 21453, 22295, 23170, 24080, 25025,
+ 26008, 27029, 28090, 29193, 30339, 31530, 32768
+};
+
+short dec_ulawmap[256] = {
+ -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956,
+ -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764,
+ -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412,
+ -11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316,
+ -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140,
+ -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092,
+ -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004,
+ -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980,
+ -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436,
+ -1372, -1308, -1244, -1180, -1116, -1052, -988, -924,
+ -876, -844, -812, -780, -748, -716, -684, -652,
+ -620, -588, -556, -524, -492, -460, -428, -396,
+ -372, -356, -340, -324, -308, -292, -276, -260,
+ -244, -228, -212, -196, -180, -164, -148, -132,
+ -120, -112, -104, -96, -88, -80, -72, -64,
+ -56, -48, -40, -32, -24, -16, -8, 0,
+ 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956,
+ 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764,
+ 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412,
+ 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316,
+ 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140,
+ 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092,
+ 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004,
+ 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980,
+ 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436,
+ 1372, 1308, 1244, 1180, 1116, 1052, 988, 924,
+ 876, 844, 812, 780, 748, 716, 684, 652,
+ 620, 588, 556, 524, 492, 460, 428, 396,
+ 372, 356, 340, 324, 308, 292, 276, 260,
+ 244, 228, 212, 196, 180, 164, 148, 132,
+ 120, 112, 104, 96, 88, 80, 72, 64,
+ 56, 48, 40, 32, 24, 16, 8, 0
+};
+
+short dec_alawmap[256] = {
+ -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736,
+ -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784,
+ -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368,
+ -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392,
+ -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944,
+ -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136,
+ -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472,
+ -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568,
+ -344, -328, -376, -360, -280, -264, -312, -296,
+ -472, -456, -504, -488, -408, -392, -440, -424,
+ -88, -72, -120, -104, -24, -8, -56, -40,
+ -216, -200, -248, -232, -152, -136, -184, -168,
+ -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184,
+ -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696,
+ -688, -656, -752, -720, -560, -528, -624, -592,
+ -944, -912, -1008, -976, -816, -784, -880, -848,
+ 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736,
+ 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784,
+ 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368,
+ 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392,
+ 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944,
+ 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136,
+ 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472,
+ 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568,
+ 344, 328, 376, 360, 280, 264, 312, 296,
+ 472, 456, 504, 488, 408, 392, 440, 424,
+ 88, 72, 120, 104, 24, 8, 56, 40,
+ 216, 200, 248, 232, 152, 136, 184, 168,
+ 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184,
+ 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696,
+ 688, 656, 752, 720, 560, 528, 624, 592,
+ 944, 912, 1008, 976, 816, 784, 880, 848
+};
+
+/*
+ * Generate a string corresponding to the encoding in par,
+ * return the length of the resulting string.
+ */
+int
+aparams_enctostr(struct aparams *par, char *ostr)
+{
+ char *p = ostr;
+
+ *p++ = par->sig ? 's' : 'u';
+ if (par->bits > 9)
+ *p++ = '0' + par->bits / 10;
+ *p++ = '0' + par->bits % 10;
+ if (par->bps > 1) {
+ *p++ = par->le ? 'l' : 'b';
+ *p++ = 'e';
+ if (par->bps != APARAMS_BPS(par->bits) ||
+ par->bits < par->bps * 8) {
+ *p++ = par->bps + '0';
+ if (par->bits < par->bps * 8) {
+ *p++ = par->msb ? 'm' : 'l';
+ *p++ = 's';
+ *p++ = 'b';
+ }
+ }
+ }
+ *p++ = '\0';
+ return p - ostr - 1;
+}
+
+/*
+ * Parse an encoding string, examples: s8, u8, s16, s16le, s24be ...
+ * set *istr to the char following the encoding. Return the number
+ * of bytes consumed.
+ */
+int
+aparams_strtoenc(struct aparams *par, char *istr)
+{
+ char *p = istr;
+ int i, sig, bits, le, bps, msb;
+
+#define IS_SEP(c) \
+ (((c) < 'a' || (c) > 'z') && \
+ ((c) < 'A' || (c) > 'Z') && \
+ ((c) < '0' || (c) > '9'))
+
+ /*
+ * get signedness
+ */
+ if (*p == 's') {
+ sig = 1;
+ } else if (*p == 'u') {
+ sig = 0;
+ } else
+ return 0;
+ p++;
+
+ /*
+ * get number of bits per sample
+ */
+ bits = 0;
+ for (i = 0; i < 2; i++) {
+ if (*p < '0' || *p > '9')
+ break;
+ bits = (bits * 10) + *p - '0';
+ p++;
+ }
+ if (bits < BITS_MIN || bits > BITS_MAX)
+ return 0;
+ bps = APARAMS_BPS(bits);
+ msb = 1;
+ le = ADATA_LE;
+
+ /*
+ * get (optional) endianness
+ */
+ if (p[0] == 'l' && p[1] == 'e') {
+ le = 1;
+ p += 2;
+ } else if (p[0] == 'b' && p[1] == 'e') {
+ le = 0;
+ p += 2;
+ } else if (IS_SEP(*p)) {
+ goto done;
+ } else
+ return 0;
+
+ /*
+ * get (optional) number of bytes
+ */
+ if (*p >= '0' && *p <= '9') {
+ bps = *p - '0';
+ if (bps < (bits + 7) / 8 ||
+ bps > (BITS_MAX + 7) / 8)
+ return 0;
+ p++;
+
+ /*
+ * get (optional) alignment
+ */
+ if (p[0] == 'm' && p[1] == 's' && p[2] == 'b') {
+ msb = 1;
+ p += 3;
+ } else if (p[0] == 'l' && p[1] == 's' && p[2] == 'b') {
+ msb = 0;
+ p += 3;
+ } else if (IS_SEP(*p)) {
+ goto done;
+ } else
+ return 0;
+ } else if (!IS_SEP(*p))
+ return 0;
+
+done:
+ par->msb = msb;
+ par->sig = sig;
+ par->bits = bits;
+ par->bps = bps;
+ par->le = le;
+ return p - istr;
+}
+
+/*
+ * Initialise parameters structure with the defaults natively supported
+ * by the machine.
+ */
+void
+aparams_init(struct aparams *par)
+{
+ par->bps = sizeof(adata_t);
+ par->bits = ADATA_BITS;
+ par->le = ADATA_LE;
+ par->sig = 1;
+ par->msb = 0;
+}
+
+/*
+ * log the given format/channels/encoding
+ */
+void
+aparams_log(struct aparams *par)
+{
+#if DEBUG
+ char enc[ENCMAX];
+
+ aparams_enctostr(par, enc);
+ log_puts(enc);
+#endif
+}
+
+/*
+ * return true if encoding corresponds to what we store in adata_t
+ */
+int
+aparams_native(struct aparams *par)
+{
+ return par->bps == sizeof(adata_t) && par->bits == ADATA_BITS &&
+ (par->bps == 1 || par->le == ADATA_LE) &&
+ (par->bits == par->bps * 8 || !par->msb);
+}
+
+/*
+ * Return the number of input and output frame that would be consumed
+ * by resamp_do(p, *icnt, *ocnt).
+ */
+void
+resamp_getcnt(struct resamp *p, int *icnt, int *ocnt)
+{
+ long long idiff, odiff;
+ int cdiff;
+
+ cdiff = p->oblksz - p->diff;
+ idiff = (long long)*icnt * p->oblksz;
+ odiff = (long long)*ocnt * p->iblksz;
+ if (odiff - idiff >= cdiff)
+ *ocnt = (idiff + cdiff + p->iblksz - 1) / p->iblksz;
+ else
+ *icnt = (odiff + p->diff) / p->oblksz;
+}
+
+/*
+ * Resample the given number of frames. The number of output frames
+ * must match the coresponding number of input frames. Either always
+ * use icnt and ocnt such that:
+ *
+ * icnt * oblksz = ocnt * iblksz
+ *
+ * or use resamp_getcnt() to calculate the proper numbers.
+ */
+void
+resamp_do(struct resamp *p, adata_t *in, adata_t *out, int icnt, int ocnt)
+{
+ unsigned int nch;
+ adata_t *idata;
+ unsigned int oblksz;
+ unsigned int ifr;
+ int s, ds, diff;
+ adata_t *odata;
+ unsigned int iblksz;
+ unsigned int ofr;
+ unsigned int c;
+ adata_t *ctxbuf, *ctx;
+ unsigned int ctx_start;
+
+ /*
+ * Partially copy structures into local variables, to avoid
+ * unnecessary indirections; this also allows the compiler to
+ * order local variables more "cache-friendly".
+ */
+ idata = in;
+ odata = out;
+ diff = p->diff;
+ iblksz = p->iblksz;
+ oblksz = p->oblksz;
+ ctxbuf = p->ctx;
+ ctx_start = p->ctx_start;
+ nch = p->nch;
+ ifr = icnt;
+ ofr = ocnt;
+
+ /*
+ * Start conversion.
+ */
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("resamp: copying ");
+ log_puti(ifr);
+ log_puts(" -> ");
+ log_putu(ofr);
+ log_puts(" frames, diff = ");
+ log_puti(diff);
+ log_puts("\n");
+ }
+#endif
+ for (;;) {
+ if (diff >= (int)oblksz) {
+ if (ifr == 0)
+ break;
+ ctx_start ^= 1;
+ ctx = ctxbuf + ctx_start;
+ for (c = nch; c > 0; c--) {
+ *ctx = *idata++;
+ ctx += RESAMP_NCTX;
+ }
+ diff -= oblksz;
+ ifr--;
+ } else {
+ if (ofr == 0)
+ break;
+ ctx = ctxbuf;
+ for (c = nch; c > 0; c--) {
+ s = ctx[ctx_start ^ 1];
+ ds = ctx[ctx_start] - s;
+ ctx += RESAMP_NCTX;
+ *odata++ = s + ADATA_MULDIV(ds, diff, oblksz);
+ }
+ diff += iblksz;
+ ofr--;
+ }
+ }
+ p->diff = diff;
+ p->ctx_start = ctx_start;
+#ifdef DEBUG
+ if (ifr != 0) {
+ log_puts("resamp_do: ");
+ log_puti(ifr);
+ log_puts(": too many input frames\n");
+ panic();
+ }
+ if (ofr != 0) {
+ log_puts("resamp_do: ");
+ log_puti(ofr);
+ log_puts(": too many output frames\n");
+ panic();
+ }
+#endif
+}
+
+static unsigned int
+uint_gcd(unsigned int a, unsigned int b)
+{
+ unsigned int r;
+
+ while (b > 0) {
+ r = a % b;
+ a = b;
+ b = r;
+ }
+ return a;
+}
+
+/*
+ * initialize resampler with ibufsz/obufsz factor and "nch" channels
+ */
+void
+resamp_init(struct resamp *p, unsigned int iblksz,
+ unsigned int oblksz, int nch)
+{
+ unsigned int g;
+
+ /*
+ * reduce iblksz/oblksz fraction
+ */
+ g = uint_gcd(iblksz, oblksz);
+ iblksz /= g;
+ oblksz /= g;
+
+ /*
+ * ensure weird rates don't cause integer overflow
+ */
+ while (iblksz > ADATA_UNIT || oblksz > ADATA_UNIT) {
+ iblksz >>= 1;
+ oblksz >>= 1;
+ }
+
+ p->iblksz = iblksz;
+ p->oblksz = oblksz;
+ p->diff = 0;
+ p->nch = nch;
+ p->ctx_start = 0;
+ memset(p->ctx, 0, sizeof(p->ctx));
+#ifdef DEBUG
+ if (log_level >= 3) {
+ log_puts("resamp: ");
+ log_putu(iblksz);
+ log_puts("/");
+ log_putu(oblksz);
+ log_puts("\n");
+ }
+#endif
+}
+
+/*
+ * encode "todo" frames from native to foreign encoding
+ */
+void
+enc_do(struct conv *p, unsigned char *in, unsigned char *out, int todo)
+{
+ unsigned int f;
+ adata_t *idata;
+ unsigned int s;
+ unsigned int oshift;
+ unsigned int obias;
+ unsigned int obps;
+ unsigned int i;
+ unsigned char *odata;
+ int obnext;
+ int osnext;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("enc: copying ");
+ log_putu(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ /*
+ * Partially copy structures into local variables, to avoid
+ * unnecessary indirections; this also allows the compiler to
+ * order local variables more "cache-friendly".
+ */
+ idata = (adata_t *)in;
+ odata = out;
+ oshift = p->shift;
+ obias = p->bias;
+ obps = p->bps;
+ obnext = p->bnext;
+ osnext = p->snext;
+
+ /*
+ * Start conversion.
+ */
+ odata += p->bfirst;
+ for (f = todo * p->nch; f > 0; f--) {
+ /* convert adata to u32 */
+ s = (int)*idata++ + ADATA_UNIT;
+ s <<= 32 - ADATA_BITS;
+ /* convert u32 to uN */
+ s >>= oshift;
+ /* convert uN to sN */
+ s -= obias;
+ /* packetize sN */
+ for (i = obps; i > 0; i--) {
+ *odata = (unsigned char)s;
+ s >>= 8;
+ odata += obnext;
+ }
+ odata += osnext;
+ }
+}
+
+/*
+ * store "todo" frames of silence in foreign encoding
+ */
+void
+enc_sil_do(struct conv *p, unsigned char *out, int todo)
+{
+ unsigned int f;
+ unsigned int s;
+ unsigned int oshift;
+ int obias;
+ unsigned int obps;
+ unsigned int i;
+ unsigned char *odata;
+ int obnext;
+ int osnext;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("enc: silence ");
+ log_putu(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ /*
+ * Partially copy structures into local variables, to avoid
+ * unnecessary indirections; this also allows the compiler to
+ * order local variables more "cache-friendly".
+ */
+ odata = out;
+ oshift = p->shift;
+ obias = p->bias;
+ obps = p->bps;
+ obnext = p->bnext;
+ osnext = p->snext;
+
+ /*
+ * Start conversion.
+ */
+ odata += p->bfirst;
+ for (f = todo * p->nch; f > 0; f--) {
+ s = ((1U << 31) >> oshift) - obias;
+ for (i = obps; i > 0; i--) {
+ *odata = (unsigned char)s;
+ s >>= 8;
+ odata += obnext;
+ }
+ odata += osnext;
+ }
+}
+
+/*
+ * initialize encoder from native to foreign encoding
+ */
+void
+enc_init(struct conv *p, struct aparams *par, int nch)
+{
+ p->nch = nch;
+ p->bps = par->bps;
+ if (par->msb) {
+ p->shift = 32 - par->bps * 8;
+ } else {
+ p->shift = 32 - par->bits;
+ }
+ if (par->sig) {
+ p->bias = (1U << 31) >> p->shift;
+ } else {
+ p->bias = 0;
+ }
+ if (!par->le) {
+ p->bfirst = par->bps - 1;
+ p->bnext = -1;
+ p->snext = 2 * par->bps;
+ } else {
+ p->bfirst = 0;
+ p->bnext = 1;
+ p->snext = 0;
+ }
+#ifdef DEBUG
+ if (log_level >= 3) {
+ log_puts("enc: ");
+ aparams_log(par);
+ log_puts(", ");
+ log_puti(p->nch);
+ log_puts(" channels\n");
+ }
+#endif
+}
+
+/*
+ * decode "todo" frames from foreign to native encoding
+ */
+void
+dec_do(struct conv *p, unsigned char *in, unsigned char *out, int todo)
+{
+ unsigned int f;
+ unsigned int ibps;
+ unsigned int i;
+ unsigned int s = 0xdeadbeef;
+ unsigned char *idata;
+ int ibnext;
+ int isnext;
+ unsigned int ibias;
+ unsigned int ishift;
+ adata_t *odata;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("dec: copying ");
+ log_putu(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ /*
+ * Partially copy structures into local variables, to avoid
+ * unnecessary indirections; this also allows the compiler to
+ * order local variables more "cache-friendly".
+ */
+ idata = in;
+ odata = (adata_t *)out;
+ ibps = p->bps;
+ ibnext = p->bnext;
+ ibias = p->bias;
+ ishift = p->shift;
+ isnext = p->snext;
+
+ /*
+ * Start conversion.
+ */
+ idata += p->bfirst;
+ for (f = todo * p->nch; f > 0; f--) {
+ for (i = ibps; i > 0; i--) {
+ s <<= 8;
+ s |= *idata;
+ idata += ibnext;
+ }
+ idata += isnext;
+ s += ibias;
+ s <<= ishift;
+ s >>= 32 - ADATA_BITS;
+ *odata++ = s - ADATA_UNIT;
+ }
+}
+
+/*
+ * convert a 32-bit float to adata_t, clipping to -1:1, boundaries
+ * excluded
+ */
+static inline int
+f32_to_adata(unsigned int x)
+{
+ unsigned int s, e, m, y;
+
+ s = (x >> 31);
+ e = (x >> 23) & 0xff;
+ m = (x << 8) | 0x80000000;
+
+ /*
+ * f32 exponent is (e - 127) and the point is after the 31-th
+ * bit, thus the shift is:
+ *
+ * 31 - (BITS - 1) - (e - 127)
+ *
+ * to ensure output is in the 0..(2^BITS)-1 range, the minimum
+ * shift is 31 - (BITS - 1), and maximum shift is 31
+ */
+ if (e < 127 - (ADATA_BITS - 1))
+ y = 0;
+ else if (e > 127)
+ y = ADATA_UNIT - 1;
+ else
+ y = m >> (127 + (32 - ADATA_BITS) - e);
+ return (y ^ -s) + s;
+}
+
+/*
+ * convert samples from little endian ieee 754 floats to adata_t
+ */
+void
+dec_do_float(struct conv *p, unsigned char *in, unsigned char *out, int todo)
+{
+ unsigned int f;
+ unsigned int i;
+ unsigned int s = 0xdeadbeef;
+ unsigned char *idata;
+ int ibnext;
+ int isnext;
+ adata_t *odata;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("dec_float: copying ");
+ log_putu(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ /*
+ * Partially copy structures into local variables, to avoid
+ * unnecessary indirections; this also allows the compiler to
+ * order local variables more "cache-friendly".
+ */
+ idata = in;
+ odata = (adata_t *)out;
+ ibnext = p->bnext;
+ isnext = p->snext;
+
+ /*
+ * Start conversion.
+ */
+ idata += p->bfirst;
+ for (f = todo * p->nch; f > 0; f--) {
+ for (i = 4; i > 0; i--) {
+ s <<= 8;
+ s |= *idata;
+ idata += ibnext;
+ }
+ idata += isnext;
+ *odata++ = f32_to_adata(s);
+ }
+}
+
+/*
+ * convert samples from ulaw/alaw to adata_t
+ */
+void
+dec_do_ulaw(struct conv *p, unsigned char *in,
+ unsigned char *out, int todo, int is_alaw)
+{
+ unsigned int f;
+ unsigned char *idata;
+ adata_t *odata;
+ short *map;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("dec_ulaw: copying ");
+ log_putu(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ map = is_alaw ? dec_alawmap : dec_ulawmap;
+ idata = in;
+ odata = (adata_t *)out;
+ for (f = todo * p->nch; f > 0; f--)
+ *odata++ = map[*idata++] << (ADATA_BITS - 16);
+}
+
+/*
+ * initialize decoder from foreign to native encoding
+ */
+void
+dec_init(struct conv *p, struct aparams *par, int nch)
+{
+ p->bps = par->bps;
+ p->nch = nch;
+ if (par->msb) {
+ p->shift = 32 - par->bps * 8;
+ } else {
+ p->shift = 32 - par->bits;
+ }
+ if (par->sig) {
+ p->bias = (1U << 31) >> p->shift;
+ } else {
+ p->bias = 0;
+ }
+ if (par->le) {
+ p->bfirst = par->bps - 1;
+ p->bnext = -1;
+ p->snext = 2 * par->bps;
+ } else {
+ p->bfirst = 0;
+ p->bnext = 1;
+ p->snext = 0;
+ }
+#ifdef DEBUG
+ if (log_level >= 3) {
+ log_puts("dec: ");
+ aparams_log(par);
+ log_puts(", ");
+ log_puti(p->nch);
+ log_puts(" channels\n");
+ }
+#endif
+}
+
+/*
+ * mix "todo" input frames on the output with the given volume
+ */
+void
+cmap_add(struct cmap *p, void *in, void *out, int vol, int todo)
+{
+ adata_t *idata, *odata;
+ int i, j, nch, istart, inext, onext, ostart, y, v;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("cmap: adding ");
+ log_puti(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ idata = in;
+ odata = out;
+ ostart = p->ostart;
+ onext = p->onext;
+ istart = p->istart;
+ inext = p->inext;
+ nch = p->nch;
+ v = vol;
+
+ /*
+ * map/mix input on the output
+ */
+ for (i = todo; i > 0; i--) {
+ odata += ostart;
+ idata += istart;
+ for (j = nch; j > 0; j--) {
+ y = *odata + ADATA_MUL(*idata, v);
+ if (y >= ADATA_UNIT)
+ y = ADATA_UNIT - 1;
+ else if (y < -ADATA_UNIT)
+ y = -ADATA_UNIT;
+ *odata = y;
+ idata++;
+ odata++;
+ }
+ odata += onext;
+ idata += inext;
+ }
+}
+
+/*
+ * overwrite output with "todo" input frames with the given volume
+ */
+void
+cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo)
+{
+ adata_t *idata, *odata;
+ int i, j, nch, istart, inext, onext, ostart, v;
+
+#ifdef DEBUG
+ if (log_level >= 4) {
+ log_puts("cmap: copying ");
+ log_puti(todo);
+ log_puts(" frames\n");
+ }
+#endif
+ idata = in;
+ odata = out;
+ ostart = p->ostart;
+ onext = p->onext;
+ istart = p->istart;
+ inext = p->inext;
+ nch = p->nch;
+ v = vol;
+
+ /*
+ * copy to the output buffer
+ */
+ for (i = todo; i > 0; i--) {
+ idata += istart;
+ odata += ostart;
+ for (j = nch; j > 0; j--) {
+ *odata = ADATA_MUL(*idata, v);
+ odata++;
+ idata++;
+ }
+ odata += onext;
+ idata += inext;
+ }
+}
+
+/*
+ * initialize channel mapper, to map a subset of input channel range
+ * into a subset of the output channel range
+ */
+void
+cmap_init(struct cmap *p,
+ int imin, int imax, int isubmin, int isubmax,
+ int omin, int omax, int osubmin, int osubmax)
+{
+ int cmin, cmax;
+
+ cmin = -NCHAN_MAX;
+ if (osubmin > cmin)
+ cmin = osubmin;
+ if (omin > cmin)
+ cmin = omin;
+ if (isubmin > cmin)
+ cmin = isubmin;
+ if (imin > cmin)
+ cmin = imin;
+
+ cmax = NCHAN_MAX;
+ if (osubmax < cmax)
+ cmax = osubmax;
+ if (omax < cmax)
+ cmax = omax;
+ if (isubmax < cmax)
+ cmax = isubmax;
+ if (imax < cmax)
+ cmax = imax;
+
+ p->ostart = cmin - omin;
+ p->onext = omax - cmax;
+ p->istart = cmin - imin;
+ p->inext = imax - cmax;
+ p->nch = cmax - cmin + 1;
+#ifdef DEBUG
+ if (log_level >= 3) {
+ log_puts("cmap: nch = ");
+ log_puti(p->nch);
+ log_puts(", ostart = ");
+ log_puti(p->ostart);
+ log_puts(", onext = ");
+ log_puti(p->onext);
+ log_puts(", istart = ");
+ log_puti(p->istart);
+ log_puts(", inext = ");
+ log_puti(p->inext);
+ log_puts("\n");
+ }
+#endif
+}
diff --git a/src/util/dsp.h b/src/util/dsp.h
new file mode 100644
index 0000000..d057d37
--- /dev/null
+++ b/src/util/dsp.h
@@ -0,0 +1,163 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef DSP_H
+#define DSP_H
+
+#include <sys/types.h>
+#include "defs.h"
+
+/*
+ * Samples are numbers in the interval [-1, 1[, note that 1, the upper
+ * boundary is excluded. We represent them as signed fixed point numbers
+ * of ADATA_BITS. We also assume that 2^(ADATA_BITS - 1) fits in a int.
+ */
+#ifndef ADATA_BITS
+#define ADATA_BITS 16
+#endif
+#define ADATA_LE (BYTE_ORDER == LITTLE_ENDIAN)
+#define ADATA_UNIT (1 << (ADATA_BITS - 1))
+
+#if ADATA_BITS == 16
+
+#define ADATA_MUL(x,y) (((int)(x) * (int)(y)) >> (ADATA_BITS - 1))
+#define ADATA_MULDIV(x,y,z) ((int)(x) * (int)(y) / (int)(z))
+
+typedef short adata_t;
+
+#elif ADATA_BITS == 24
+
+#if defined(__i386__) && defined(__GNUC__)
+
+static inline int
+fp24_mul(int x, int a)
+{
+ int res;
+
+ asm volatile (
+ "imull %2\n\t"
+ "shrdl $23, %%edx, %%eax\n\t"
+ : "=a" (res)
+ : "a" (x), "r" (a)
+ : "%edx"
+ );
+ return res;
+}
+
+static inline int
+fp24_muldiv(int x, int a, int b)
+{
+ int res;
+
+ asm volatile (
+ "imull %2\n\t"
+ "idivl %3\n\t"
+ : "=a" (res)
+ : "a" (x), "d" (a), "r" (b)
+ );
+ return res;
+}
+
+#define ADATA_MUL(x,y) fp24_mul(x, y)
+#define ADATA_MULDIV(x,y,z) fp24_muldiv(x, y, z);
+
+#elif defined(__amd64__) || defined(__sparc64__)
+
+#define ADATA_MUL(x,y) \
+ ((int)(((long long)(x) * (long long)(y)) >> (ADATA_BITS - 1)))
+#define ADATA_MULDIV(x,y,z) \
+ ((int)((long long)(x) * (long long)(y) / (long long)(z)))
+
+#else
+#error "no 24-bit code for this architecture"
+#endif
+
+typedef int adata_t;
+
+#else
+#error "only 16-bit and 24-bit precisions are supported"
+#endif
+
+/*
+ * Maximum size of the encording string (the longest possible
+ * encoding is ``s24le3msb'').
+ */
+#define ENCMAX 10
+
+/*
+ * Default bytes per sample for the given bits per sample.
+ */
+#define APARAMS_BPS(bits) (((bits) <= 8) ? 1 : (((bits) <= 16) ? 2 : 4))
+
+struct aparams {
+ unsigned int bps; /* bytes per sample */
+ unsigned int bits; /* actually used bits */
+ unsigned int le; /* 1 if little endian, 0 if big endian */
+ unsigned int sig; /* 1 if signed, 0 if unsigned */
+ unsigned int msb; /* 1 if msb justified, 0 if lsb justified */
+};
+
+struct resamp {
+#define RESAMP_NCTX 2
+ unsigned int ctx_start;
+ adata_t ctx[NCHAN_MAX * RESAMP_NCTX];
+ unsigned int iblksz, oblksz;
+ int diff;
+ int nch;
+};
+
+struct conv {
+ int bfirst; /* bytes to skip at startup */
+ unsigned int bps; /* bytes per sample */
+ unsigned int shift; /* shift to get 32bit MSB */
+ unsigned int bias; /* bias of unsigned samples */
+ int bnext; /* to reach the next byte */
+ int snext; /* to reach the next sample */
+ int nch;
+};
+
+struct cmap {
+ int istart;
+ int inext;
+ int onext;
+ int ostart;
+ int nch;
+};
+
+#define MIDI_TO_ADATA(m) (aparams_ctltovol[m] << (ADATA_BITS - 16))
+extern int aparams_ctltovol[128];
+
+void aparams_init(struct aparams *);
+void aparams_log(struct aparams *);
+int aparams_strtoenc(struct aparams *, char *);
+int aparams_enctostr(struct aparams *, char *);
+int aparams_native(struct aparams *);
+
+void resamp_getcnt(struct resamp *, int *, int *);
+void resamp_do(struct resamp *, adata_t *, adata_t *, int, int);
+void resamp_init(struct resamp *, unsigned int, unsigned int, int);
+void enc_do(struct conv *, unsigned char *, unsigned char *, int);
+void enc_sil_do(struct conv *, unsigned char *, int);
+void enc_init(struct conv *, struct aparams *, int);
+void dec_do(struct conv *, unsigned char *, unsigned char *, int);
+void dec_do_float(struct conv *, unsigned char *, unsigned char *, int);
+void dec_do_ulaw(struct conv *, unsigned char *, unsigned char *, int, int);
+void dec_init(struct conv *, struct aparams *, int);
+void cmap_add(struct cmap *, void *, void *, int, int);
+void cmap_copy(struct cmap *, void *, void *, int, int);
+void cmap_init(struct cmap *, int, int, int, int, int, int, int, int);
+
+#endif /* !defined(DSP_H) */
diff --git a/src/util/sysex.h b/src/util/sysex.h
new file mode 100644
index 0000000..245cd2a
--- /dev/null
+++ b/src/util/sysex.h
@@ -0,0 +1,120 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2011 Alexandre Ratchov <alex@caoua.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef AUCAT_SYSEX_H
+#define AUCAT_SYSEX_H
+
+#include <stdint.h>
+
+/*
+ * start and end markers
+ */
+#define SYSEX_START 0xf0
+#define SYSEX_END 0xf7
+
+/*
+ * type/vendor namespace IDs we use
+ */
+#define SYSEX_TYPE_RT 0x7f /* real-time universal */
+#define SYSEX_TYPE_EDU 0x7d /* non-comercial */
+
+/*
+ * realtime messages in the "universal real-time" namespace
+ */
+#define SYSEX_MTC 0x01 /* mtc messages */
+#define SYSEX_MTC_FULL 0x01 /* mtc full frame message */
+#define SYSEX_CONTROL 0x04
+#define SYSEX_MASTER 0x01
+#define SYSEX_MMC 0x06
+#define SYSEX_MMC_STOP 0x01
+#define SYSEX_MMC_START 0x02
+#define SYSEX_MMC_LOC 0x44
+#define SYSEX_MMC_LOC_LEN 0x06
+#define SYSEX_MMC_LOC_CMD 0x01
+
+/*
+ * aucat-specific messages, in the "edu" namespace
+ */
+#define SYSEX_AUCAT 0x23 /* aucat-specific */
+#define SYSEX_AUCAT_MIXINFO 0x01 /* mixer info */
+#define SYSEX_AUCAT_DUMPREQ 0x02 /* dump request */
+#define SYSEX_AUCAT_DUMPEND 0x03 /* end of dump */
+
+/*
+ * minimum size of sysex message we accept
+ */
+#define SYSEX_SIZE(m) (5 + sizeof(struct sysex_ ## m))
+
+/*
+ * all possible system exclusive messages we support. For aucat-specific
+ * messages we use the same header as real-time messages to simplify the
+ * message parser
+ */
+struct sysex {
+ uint8_t start;
+ uint8_t type; /* type or vendor id */
+ uint8_t dev; /* device or product id */
+ uint8_t id0; /* message id */
+ uint8_t id1; /* sub-id */
+ union sysex_all {
+ struct sysex_empty {
+ uint8_t end;
+ } empty;
+ struct sysex_master {
+ uint8_t fine;
+ uint8_t coarse;
+ uint8_t end;
+ } master;
+ struct sysex_start {
+ uint8_t end;
+ } start;
+ struct sysex_stop {
+ uint8_t end;
+ } stop;
+ struct sysex_loc {
+ uint8_t len;
+ uint8_t cmd;
+ uint8_t hr;
+ uint8_t min;
+ uint8_t sec;
+ uint8_t fr;
+ uint8_t cent;
+ uint8_t end;
+ } loc;
+ struct sysex_full {
+ uint8_t hr;
+ uint8_t min;
+ uint8_t sec;
+ uint8_t fr;
+ uint8_t end;
+ } full;
+ struct sysex_mixinfo {
+ uint8_t chan; /* channel */
+ uint8_t vol; /* current volume */
+#define SYSEX_NAMELEN 10 /* \0 included */
+ uint8_t name[SYSEX_NAMELEN]; /* stream name */
+ uint8_t end;
+ } mixinfo;
+ struct sysex_dumpreq {
+ uint8_t end;
+ } dumpreq;
+ struct sysex_dumpend {
+ uint8_t end;
+ } dumpend;
+ } u;
+};
+
+#endif /* !defined(AUCAT_SYSEX_H) */
diff --git a/src/util/util.h b/src/util/util.h
new file mode 100644
index 0000000..9e118c2
--- /dev/null
+++ b/src/util/util.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+#include <err.h>
+
+#define WARN1(x) do { warn("asound: %s %s", __func__, x); } while (0)
+#define WARN(x, ...) do { warn("asound: %s " x, __func__, ##__VA_ARGS__); } while (0)
+#define WARNX1(x) do { warnx("asound: %s %s", __func__, x); } while (0)
+#define WARNX(x, ...) do { warnx("asound: %s " x, __func__, ##__VA_ARGS__); } while (0)
+#define ERRX1(x, y) do { errx(x, "asound: %s %s", __func__, y); } while (0)
+#define ERRX(x, y, ...) do { errx(x, "asound: %s " y, __func__, ##__VA_ARGS__); } while (0)
+#define ERR(x, y, ...) do { err(x, "asound: %s " y, __func__, ##__VA_ARGS__); } while (0)
+
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+
+static inline char*
+c_strdup(const char *str)
+{
+ size_t len = strlen(str);
+
+ char *copy;
+ if (!(copy = calloc(1, len + 1)))
+ return NULL;
+
+ memcpy(copy, str, len);
+ return copy;
+}