From 21235f87d82b23ba58bfad1901cb76ec88de61ae3b83e002524b7cc639cceead Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 5 Dec 2007 22:22:36 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=28 --- alsa-lib-avail_min-fix.diff | 26 - alsa-lib-dmix-error-code-fix.diff | 40 - alsa-lib-dmix-tstamp-fix.diff | 298 --- alsa-lib-hg-fixes.diff | 3932 ++++++++++++++++++++++++++++- alsa-lib-ioplug-fix.diff | 50 - alsa-lib-multi-mmap-fix.diff | 70 - alsa-lib-rate-plugin-fix.diff | 66 - alsa-lib-smixer-range-fix.diff | 54 - alsa.changes | 8 + alsa.spec | 21 +- 10 files changed, 3898 insertions(+), 667 deletions(-) delete mode 100644 alsa-lib-avail_min-fix.diff delete mode 100644 alsa-lib-dmix-error-code-fix.diff delete mode 100644 alsa-lib-dmix-tstamp-fix.diff delete mode 100644 alsa-lib-ioplug-fix.diff delete mode 100644 alsa-lib-multi-mmap-fix.diff delete mode 100644 alsa-lib-rate-plugin-fix.diff delete mode 100644 alsa-lib-smixer-range-fix.diff diff --git a/alsa-lib-avail_min-fix.diff b/alsa-lib-avail_min-fix.diff deleted file mode 100644 index f078635..0000000 --- a/alsa-lib-avail_min-fix.diff +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# User tiwai -# Date 1195568950 -3600 -# Node ID 39d34d6a4587ffa6462e42308fb3519f55a2781c -# Parent b1d1733e52f8baf293ffa2af1c2b9cf5212006ec -pcm - Limit the avail_min minimum size - -Fix avail_min if it's less than period_size. The too small avail_min -is simply useless and the cause of CPU hog with rate plugin. - -diff -r b1d1733e52f8 -r 39d34d6a4587 src/pcm/pcm.c ---- a/src/pcm/pcm.c Mon Nov 19 08:07:19 2007 +0100 -+++ b/src/pcm/pcm.c Tue Nov 20 15:29:10 2007 +0100 -@@ -5577,6 +5577,12 @@ int snd_pcm_sw_params_set_avail_min(snd_ - #endif - { - assert(pcm && params); -+ /* Fix avail_min if it's below period size. The period_size -+ * defines the minimal wake-up timing accuracy, so it doesn't -+ * make sense to set below that. -+ */ -+ if (val < pcm->period_size) -+ val = pcm->period_size; - params->avail_min = val; - return 0; - } diff --git a/alsa-lib-dmix-error-code-fix.diff b/alsa-lib-dmix-error-code-fix.diff deleted file mode 100644 index 188a625..0000000 --- a/alsa-lib-dmix-error-code-fix.diff +++ /dev/null @@ -1,40 +0,0 @@ -# HG changeset patch -# User tiwai -# Date 1195211203 -3600 -# Node ID 7330dde50d0b760789f2264ff6893f6a8b6e8021 -# Parent 95e6e03f2e9d147a6f557de4e4f33d4f865502b8 -Fix wrong return values in direct plugins - -Fixed the codes returning error values that are not set properly -via errno. - -diff -r 95e6e03f2e9d -r 7330dde50d0b src/pcm/pcm_direct.c ---- a/src/pcm/pcm_direct.c Mon Nov 12 12:01:16 2007 +0100 -+++ b/src/pcm/pcm_direct.c Fri Nov 16 12:06:43 2007 +0100 -@@ -109,13 +109,15 @@ retryget: - } - dmix->shmptr = shmat(dmix->shmid, 0, 0); - if (dmix->shmptr == (void *) -1) { -+ err = -errno; - snd_pcm_direct_shm_discard(dmix); -- return -errno; -+ return err; - } - mlock(dmix->shmptr, sizeof(snd_pcm_direct_share_t)); - if (shmctl(dmix->shmid, IPC_STAT, &buf) < 0) { -+ err = -errno; - snd_pcm_direct_shm_discard(dmix); -- return -errno; -+ return err; - } - if (buf.shm_nattch == 1) { /* we're the first user, clear the segment */ - memset(dmix->shmptr, 0, sizeof(snd_pcm_direct_share_t)); -@@ -128,7 +130,7 @@ retryget: - } else { - if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC) { - snd_pcm_direct_shm_discard(dmix); -- return -errno; -+ return -EINVAL; - } - } - return 0; diff --git a/alsa-lib-dmix-tstamp-fix.diff b/alsa-lib-dmix-tstamp-fix.diff deleted file mode 100644 index af9cb5f..0000000 --- a/alsa-lib-dmix-tstamp-fix.diff +++ /dev/null @@ -1,298 +0,0 @@ -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_direct.c ---- a/src/pcm/pcm_direct.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_direct.c Wed Nov 21 12:19:43 2007 +0100 -@@ -1001,6 +1001,17 @@ int snd_pcm_direct_initialize_slave(snd_ - return ret; - } - -+ /* set timestamp mode to MMAP -+ * the slave timestamp is copied appropriately in dsnoop/dmix/dshare -+ * based on the tstamp_mode of each client -+ */ -+ ret = snd_pcm_sw_params_set_tstamp_mode(spcm, sw_params, -+ SND_PCM_TSTAMP_MMAP); -+ if (ret < 0) { -+ SNDERR("unable to tstamp mode MMAP"); -+ return ret; -+ } -+ - if (dmix->type != SND_PCM_TYPE_DMIX) - goto __skip_silencing; - -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_dmix.c ---- a/src/pcm/pcm_dmix.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_dmix.c Wed Nov 21 12:19:43 2007 +0100 -@@ -367,11 +367,8 @@ static int snd_pcm_dmix_sync_ptr(snd_pcm - if (avail > dmix->avail_max) - dmix->avail_max = avail; - if (avail >= pcm->stop_threshold) { -- struct timeval tv; - snd_timer_stop(dmix->timer); -- gettimeofday(&tv, 0); -- dmix->trigger_tstamp.tv_sec = tv.tv_sec; -- dmix->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dmix->trigger_tstamp); - if (dmix->state == SND_PCM_STATE_RUNNING) { - dmix->state = SND_PCM_STATE_XRUN; - return -EPIPE; -@@ -420,7 +417,10 @@ static int snd_pcm_dmix_status(snd_pcm_t - memset(status, 0, sizeof(*status)); - status->state = snd_pcm_dmix_state(pcm); - status->trigger_tstamp = dmix->trigger_tstamp; -- status->tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm); -+ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) -+ status->tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm); -+ else -+ gettimestamp(&status->tstamp); - status->avail = snd_pcm_mmap_playback_avail(pcm); - status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max; - dmix->avail_max = 0; -@@ -525,7 +525,6 @@ static int snd_pcm_dmix_start(snd_pcm_t - { - snd_pcm_direct_t *dmix = pcm->private_data; - snd_pcm_sframes_t avail; -- struct timeval tv; - int err; - - if (dmix->state != SND_PCM_STATE_PREPARED) -@@ -540,9 +539,7 @@ static int snd_pcm_dmix_start(snd_pcm_t - return err; - snd_pcm_dmix_sync_area(pcm); - } -- gettimeofday(&tv, 0); -- dmix->trigger_tstamp.tv_sec = tv.tv_sec; -- dmix->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dmix->trigger_tstamp); - return 0; - } - -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_dshare.c ---- a/src/pcm/pcm_dshare.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_dshare.c Wed Nov 21 12:19:43 2007 +0100 -@@ -194,11 +194,8 @@ static int snd_pcm_dshare_sync_ptr(snd_p - if (avail > dshare->avail_max) - dshare->avail_max = avail; - if (avail >= pcm->stop_threshold) { -- struct timeval tv; - snd_timer_stop(dshare->timer); -- gettimeofday(&tv, 0); -- dshare->trigger_tstamp.tv_sec = tv.tv_sec; -- dshare->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dshare->trigger_tstamp); - if (dshare->state == SND_PCM_STATE_RUNNING) { - dshare->state = SND_PCM_STATE_XRUN; - return -EPIPE; -@@ -229,7 +226,10 @@ static int snd_pcm_dshare_status(snd_pcm - memset(status, 0, sizeof(*status)); - status->state = snd_pcm_state(dshare->spcm); - status->trigger_tstamp = dshare->trigger_tstamp; -- status->tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm); -+ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) -+ status->tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm); -+ else -+ gettimestamp(&status->tstamp); - status->avail = snd_pcm_mmap_playback_avail(pcm); - status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max; - dshare->avail_max = 0; -@@ -335,7 +335,6 @@ static int snd_pcm_dshare_start(snd_pcm_ - { - snd_pcm_direct_t *dshare = pcm->private_data; - snd_pcm_sframes_t avail; -- struct timeval tv; - int err; - - if (dshare->state != SND_PCM_STATE_PREPARED) -@@ -350,9 +349,7 @@ static int snd_pcm_dshare_start(snd_pcm_ - return err; - snd_pcm_dshare_sync_area(pcm); - } -- gettimeofday(&tv, 0); -- dshare->trigger_tstamp.tv_sec = tv.tv_sec; -- dshare->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dshare->trigger_tstamp); - return 0; - } - -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_dsnoop.c ---- a/src/pcm/pcm_dsnoop.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_dsnoop.c Wed Nov 21 12:19:43 2007 +0100 -@@ -141,10 +141,7 @@ static int snd_pcm_dsnoop_sync_ptr(snd_p - if (pcm->stop_threshold >= pcm->boundary) /* don't care */ - return 0; - if ((avail = snd_pcm_mmap_capture_hw_avail(pcm)) >= pcm->stop_threshold) { -- struct timeval tv; -- gettimeofday(&tv, 0); -- dsnoop->trigger_tstamp.tv_sec = tv.tv_sec; -- dsnoop->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dsnoop->trigger_tstamp); - dsnoop->state = SND_PCM_STATE_XRUN; - dsnoop->avail_max = avail; - return -EPIPE; -@@ -175,7 +172,10 @@ static int snd_pcm_dsnoop_status(snd_pcm - state = snd_pcm_state(dsnoop->spcm); - status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; - status->trigger_tstamp = dsnoop->trigger_tstamp; -- status->tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm); -+ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) -+ status->tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm); -+ else -+ gettimestamp(&status->tstamp); - status->avail = snd_pcm_mmap_capture_avail(pcm); - status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max; - dsnoop->avail_max = 0; -@@ -264,7 +264,6 @@ static int snd_pcm_dsnoop_start(snd_pcm_ - static int snd_pcm_dsnoop_start(snd_pcm_t *pcm) - { - snd_pcm_direct_t *dsnoop = pcm->private_data; -- struct timeval tv; - int err; - - if (dsnoop->state != SND_PCM_STATE_PREPARED) -@@ -275,9 +274,7 @@ static int snd_pcm_dsnoop_start(snd_pcm_ - if (err < 0) - return err; - dsnoop->state = SND_PCM_STATE_RUNNING; -- gettimeofday(&tv, 0); -- dsnoop->trigger_tstamp.tv_sec = tv.tv_sec; -- dsnoop->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&dsnoop->trigger_tstamp); - return 0; - } - -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_ioplug.c ---- a/src/pcm/pcm_ioplug.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_ioplug.c Wed Nov 21 12:19:43 2007 +0100 -@@ -438,7 +438,6 @@ static int snd_pcm_ioplug_start(snd_pcm_ - static int snd_pcm_ioplug_start(snd_pcm_t *pcm) - { - ioplug_priv_t *io = pcm->private_data; -- struct timeval tv; - int err; - - if (io->data->state != SND_PCM_STATE_PREPARED) -@@ -448,9 +447,7 @@ static int snd_pcm_ioplug_start(snd_pcm_ - if (err < 0) - return err; - -- gettimeofday(&tv, 0); -- io->trigger_tstamp.tv_sec = tv.tv_sec; -- io->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&io->trigger_tstamp); - io->data->state = SND_PCM_STATE_RUNNING; - - return 0; -@@ -459,16 +456,13 @@ static int snd_pcm_ioplug_drop(snd_pcm_t - static int snd_pcm_ioplug_drop(snd_pcm_t *pcm) - { - ioplug_priv_t *io = pcm->private_data; -- struct timeval tv; - - if (io->data->state == SND_PCM_STATE_OPEN) - return -EBADFD; - - io->data->callback->stop(io->data); - -- gettimeofday(&tv, 0); -- io->trigger_tstamp.tv_sec = tv.tv_sec; -- io->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&io->trigger_tstamp); - io->data->state = SND_PCM_STATE_SETUP; - - return 0; -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_local.h ---- a/src/pcm/pcm_local.h Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_local.h Wed Nov 21 12:19:43 2007 +0100 -@@ -838,3 +838,13 @@ typedef union snd_tmp_double { - double d; - int64_t l; - } snd_tmp_double_t; -+ -+/* get the current timestamp */ -+static inline void gettimestamp(snd_htimestamp_t *tstamp) -+{ -+ struct timeval tv; -+ -+ gettimeofday(&tv, 0); -+ tstamp->tv_sec = tv.tv_sec; -+ tstamp->tv_nsec = tv.tv_usec * 1000L; -+} -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_null.c ---- a/src/pcm/pcm_null.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_null.c Wed Nov 21 12:19:43 2007 +0100 -@@ -82,13 +82,10 @@ static int snd_pcm_null_status(snd_pcm_t - static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - { - snd_pcm_null_t *null = pcm->private_data; -- struct timeval tv; - memset(status, 0, sizeof(*status)); - status->state = null->state; - status->trigger_tstamp = null->trigger_tstamp; -- gettimeofday(&tv, 0); -- status->tstamp.tv_sec = tv.tv_sec; -- status->tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&status->tstamp); - status->avail = pcm->buffer_size; - status->avail_max = status->avail; - return 0; -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_rate.c ---- a/src/pcm/pcm_rate.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_rate.c Wed Nov 21 12:19:43 2007 +0100 -@@ -1090,7 +1090,6 @@ static int snd_pcm_rate_start(snd_pcm_t - { - snd_pcm_rate_t *rate = pcm->private_data; - snd_pcm_uframes_t avail; -- struct timeval tv; - - if (pcm->stream == SND_PCM_STREAM_CAPTURE) - return snd_pcm_start(rate->gen.slave); -@@ -1098,9 +1097,7 @@ static int snd_pcm_rate_start(snd_pcm_t - if (snd_pcm_state(rate->gen.slave) != SND_PCM_STATE_PREPARED) - return -EBADFD; - -- gettimeofday(&tv, 0); -- rate->trigger_tstamp.tv_sec = tv.tv_sec; -- rate->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&rate->trigger_tstamp); - - avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave); - if (avail == 0) { -diff -r 39d34d6a4587 -r 3539f279ec38 src/pcm/pcm_share.c ---- a/src/pcm/pcm_share.c Tue Nov 20 15:29:10 2007 +0100 -+++ b/src/pcm/pcm_share.c Wed Nov 21 12:19:43 2007 +0100 -@@ -914,7 +914,6 @@ static int snd_pcm_share_start(snd_pcm_t - snd_pcm_share_t *share = pcm->private_data; - snd_pcm_share_slave_t *slave = share->slave; - snd_pcm_t *spcm = slave->pcm; -- struct timeval tv; - int err = 0; - if (share->state != SND_PCM_STATE_PREPARED) - return -EBADFD; -@@ -970,9 +969,7 @@ static int snd_pcm_share_start(snd_pcm_t - } - slave->running_count++; - _snd_pcm_share_update(pcm); -- gettimeofday(&tv, 0); -- share->trigger_tstamp.tv_sec = tv.tv_sec; -- share->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&share->trigger_tstamp); - _end: - Pthread_mutex_unlock(&slave->mutex); - return err; -@@ -1099,16 +1096,13 @@ static void _snd_pcm_share_stop(snd_pcm_ - { - snd_pcm_share_t *share = pcm->private_data; - snd_pcm_share_slave_t *slave = share->slave; -- struct timeval tv; - #if 0 - if (!pcm->mmap_channels) { - /* PCM closing already begun in the main thread */ - return; - } - #endif -- gettimeofday(&tv, 0); -- share->trigger_tstamp.tv_sec = tv.tv_sec; -- share->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; -+ gettimestamp(&share->trigger_tstamp); - if (pcm->stream == SND_PCM_STREAM_CAPTURE) { - snd_pcm_areas_copy(pcm->stopped_areas, 0, - pcm->running_areas, 0, diff --git a/alsa-lib-hg-fixes.diff b/alsa-lib-hg-fixes.diff index e75a32f..b520f54 100644 --- a/alsa-lib-hg-fixes.diff +++ b/alsa-lib-hg-fixes.diff @@ -1,6 +1,6 @@ diff -r 9e2f117f24b9 NOTES --- a/NOTES Mon Oct 15 10:36:46 2007 +0200 -+++ b/NOTES Fri Oct 26 02:01:39 2007 +0200 ++++ b/NOTES Fri Nov 30 18:33:19 2007 +0100 @@ -27,11 +27,14 @@ When LIBASOUND_DEBUG=1 is set, the error When LIBASOUND_DEBUG=1 is set, the errors in hw_params configuration will be dumped to stderr. Note that this will show even the non-fatal @@ -20,7 +20,7 @@ diff -r 9e2f117f24b9 NOTES Blocking Open Mode diff -r 9e2f117f24b9 configure.in --- a/configure.in Mon Oct 15 10:36:46 2007 +0200 -+++ b/configure.in Fri Oct 26 02:01:39 2007 +0200 ++++ b/configure.in Fri Nov 30 18:33:19 2007 +0100 @@ -167,6 +167,20 @@ else else AC_DEFINE(NDEBUG,,[No assert debug]) @@ -42,9 +42,89 @@ diff -r 9e2f117f24b9 configure.in fi dnl Temporary directory +@@ -330,12 +344,14 @@ AC_ARG_ENABLE(seq, + AC_ARG_ENABLE(seq, + AS_HELP_STRING([--disable-seq], [disable the sequencer component]), + [build_seq="$enableval"], [build_seq="yes"]) +-AC_ARG_ENABLE(instr, +- AS_HELP_STRING([--disable-instr], [disable the instrument component]), +- [build_instr="$enableval"], [build_instr="yes"]) + AC_ARG_ENABLE(alisp, + AS_HELP_STRING([--disable-alisp], [disable the alisp component]), + [build_alisp="$enableval"], [build_alisp="yes"]) ++AC_ARG_ENABLE(old-symbols, ++ AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]), ++ [keep_old_symbols="$enableval"], [keep_old_symbols="yes"]) ++AM_CONDITIONAL(KEEP_OLD_SYMBOLS, test x$keep_old_symbols = xyes) ++ + AC_ARG_ENABLE(python, + AS_HELP_STRING([--disable-python], [disable the python components]), + [build_python="$enableval"], [build_python="yes"]) +@@ -363,16 +379,11 @@ AC_SUBST(PYTHON_LIBS) + AC_SUBST(PYTHON_LIBS) + AC_SUBST(PYTHON_INCLUDES) + +-if test "$build_seq" != "yes"; then +- build_instr="no" +-fi +- + AM_CONDITIONAL(BUILD_MIXER, test x$build_mixer = xyes) + AM_CONDITIONAL(BUILD_PCM, test x$build_pcm = xyes) + AM_CONDITIONAL(BUILD_RAWMIDI, test x$build_rawmidi = xyes) + AM_CONDITIONAL(BUILD_HWDEP, test x$build_hwdep = xyes) + AM_CONDITIONAL(BUILD_SEQ, test x$build_seq = xyes) +-AM_CONDITIONAL(BUILD_INSTR, test x$build_instr = xyes) + AM_CONDITIONAL(BUILD_ALISP, test x$build_alisp = xyes) + AM_CONDITIONAL(BUILD_PYTHON, test x$build_python = xyes) + +@@ -390,9 +401,6 @@ fi + fi + if test "$build_seq" = "yes"; then + AC_DEFINE([BUILD_SEQ], "1", [Build sequencer component]) +-fi +-if test "$build_instr" = "yes"; then +- AC_DEFINE([BUILD_INSTR], "1", [Build instrument component]) + fi + + dnl PCM Plugins +@@ -556,7 +564,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pict + src/control/Makefile src/mixer/Makefile \ + src/pcm/Makefile src/pcm/scopes/Makefile \ + src/rawmidi/Makefile src/timer/Makefile \ +- src/hwdep/Makefile src/seq/Makefile src/instr/Makefile \ ++ src/hwdep/Makefile src/seq/Makefile \ + src/compat/Makefile src/alisp/Makefile src/conf/Makefile \ + src/conf/cards/Makefile \ + src/conf/pcm/Makefile \ +diff -r 9e2f117f24b9 doc/doxygen.cfg +--- a/doc/doxygen.cfg Mon Oct 15 10:36:46 2007 +0200 ++++ b/doc/doxygen.cfg Fri Nov 30 18:33:19 2007 +0100 +@@ -28,8 +28,6 @@ INPUT = index.doxygen \ + ../include/pcm_ioplug.h \ + ../include/control_external.h \ + ../include/mixer.h \ +- ../include/conv.h \ +- ../include/instr.h \ + ../src/error.c \ + ../src/dlmisc.c \ + ../src/async.c \ +diff -r 9e2f117f24b9 include/Makefile.am +--- a/include/Makefile.am Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/Makefile.am Fri Nov 30 18:33:19 2007 +0100 +@@ -44,10 +44,6 @@ endif + + if BUILD_SEQ + alsainclude_HEADERS += seq_event.h seq.h seqmid.h seq_midi_event.h +-endif +- +-if BUILD_INSTR +-alsainclude_HEADERS += conv.h instr.h + endif + + if BUILD_ALISP diff -r 9e2f117f24b9 include/control.h --- a/include/control.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/control.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/control.h Fri Nov 30 18:33:19 2007 +0100 @@ -279,7 +279,7 @@ size_t snd_ctl_elem_id_sizeof(void); * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca * \param ptr returned pointer @@ -121,9 +201,70 @@ diff -r 9e2f117f24b9 include/control.h /** * \defgroup HControl High level Control Interface +diff -r 9e2f117f24b9 include/conv.h +--- a/include/conv.h Mon Oct 15 10:36:46 2007 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,57 +0,0 @@ +-/** +- * \file include/conv.h +- * \brief Application interface library for the ALSA driver +- * \author Jaroslav Kysela +- * \author Abramo Bagnara +- * \author Takashi Iwai +- * \date 1998-2001 +- * +- * Application interface library for the ALSA driver +- */ +-/* +- * This library is free software; you can redistribute it and/or modify +- * it under the terms of the GNU Lesser General Public License as +- * published by the Free Software Foundation; either version 2.1 of +- * the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __ALSA_CONV_H +-#define __ALSA_CONV_H +- +-/** +- * \defgroup BConv Binary Value Conversion +- * Helper macros to convert binary values to/from a specific byte order. +- * \{ +- */ +- +-/** Converts a 16-bit value from host to little endian byte order. */ +-#define snd_host_to_LE_16(val) __cpu_to_le16(val) +-/** Converts a 16-bit value from little endian to host byte order. */ +-#define snd_LE_to_host_16(val) __le16_to_cpu(val) +-/** Converts a 32-bit value from host to little endian byte order. */ +-#define snd_host_to_LE_32(val) __cpu_to_le32(val) +-/** Converts a 32-bit value from little endian to host byte order. */ +-#define snd_LE_to_host_32(val) __le32_to_cpu(val) +-/** Converts a 16-bit value from host to big endian byte order. */ +-#define snd_host_to_BE_16(val) __cpu_to_be16(val) +-/** Converts a 16-bit value from big endian to host byte order. */ +-#define snd_BE_to_host_16(val) __be16_to_cpu(val) +-/** Converts a 32-bit value from host to big endian byte order. */ +-#define snd_host_to_BE_32(val) __cpu_to_be32(val) +-/** Converts a 32-bit value from big endian to host byte order. */ +-#define snd_BE_to_host_32(val) __be32_to_cpu(val) +- +-/** \} */ +- +-#endif /* __ALSA_CONV_H */ +- diff -r 9e2f117f24b9 include/global.h --- a/include/global.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/global.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/global.h Fri Nov 30 18:33:19 2007 +0100 @@ -102,6 +102,9 @@ int snd_dlclose(void *handle); int snd_dlclose(void *handle); @@ -136,7 +277,7 @@ diff -r 9e2f117f24b9 include/global.h * diff -r 9e2f117f24b9 include/hwdep.h --- a/include/hwdep.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/hwdep.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/hwdep.h Fri Nov 30 18:33:19 2007 +0100 @@ -108,7 +108,7 @@ ssize_t snd_hwdep_read(snd_hwdep_t *hwde size_t snd_hwdep_info_sizeof(void); @@ -166,25 +307,246 @@ diff -r 9e2f117f24b9 include/hwdep.h void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src); diff -r 9e2f117f24b9 include/instr.h --- a/include/instr.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/instr.h Fri Oct 26 02:01:39 2007 +0200 -@@ -44,12 +44,8 @@ typedef struct _snd_instr_header snd_ins - typedef struct _snd_instr_header snd_instr_header_t; - - size_t snd_instr_header_sizeof(void); ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,177 +0,0 @@ +-/** +- * \file include/instr.h +- * \brief Application interface library for the ALSA driver +- * \author Jaroslav Kysela +- * \author Abramo Bagnara +- * \author Takashi Iwai +- * \date 1998-2001 +- * +- * Application interface library for the ALSA driver +- */ +-/* +- * This library is free software; you can redistribute it and/or modify +- * it under the terms of the GNU Lesser General Public License as +- * published by the Free Software Foundation; either version 2.1 of +- * the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __ALSA_INSTR_H +-#define __ALSA_INSTR_H +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-/** +- * \defgroup Instrument Instrument Interface +- * The Instrument Interface. +- * \{ +- */ +- +-/* instrument get/put */ +- +-/** container for sequencer instrument header */ +-typedef struct _snd_instr_header snd_instr_header_t; +- +-size_t snd_instr_header_sizeof(void); -#define snd_instr_header_alloca(ptr) \ -do {\ - assert(ptr);\ - *ptr = (snd_instr_header_t *)alloca(snd_instr_header_sizeof());\ - memset(*ptr, 0, snd_instr_header_sizeof());\ -} while (0) /**< allocate instrument header on stack */ -+/** allocate instrument header on stack */ -+#define snd_instr_header_alloca(ptr) __snd_alloca(ptr, snd_instr_header) - int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len); - void snd_instr_header_free(snd_instr_header_t *ptr); - void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src); +-int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len); +-void snd_instr_header_free(snd_instr_header_t *ptr); +-void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src); +- +-const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info); +-snd_seq_instr_cluster_t snd_instr_header_get_cluster(const snd_instr_header_t *info); +-unsigned int snd_instr_header_get_cmd(const snd_instr_header_t *info); +-size_t snd_instr_header_get_len(const snd_instr_header_t *info); +-const char *snd_instr_header_get_name(const snd_instr_header_t *info); +-int snd_instr_header_get_type(const snd_instr_header_t *info); +-const char *snd_instr_header_get_format(const snd_instr_header_t *info); +-const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info); +-void *snd_instr_header_get_data(const snd_instr_header_t *info); +-int snd_instr_header_get_follow_alias(const snd_instr_header_t *info); +- +-void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id); +-void snd_instr_header_set_cluster(snd_instr_header_t *info, snd_seq_instr_cluster_t cluster); +-void snd_instr_header_set_cmd(snd_instr_header_t *info, unsigned int cmd); +-void snd_instr_header_set_len(snd_instr_header_t *info, size_t len); +-void snd_instr_header_set_name(snd_instr_header_t *info, const char *name); +-void snd_instr_header_set_type(snd_instr_header_t *info, int type); +-void snd_instr_header_set_format(snd_instr_header_t *info, const char *format); +-void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr); +-void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val); +- +-/** +- * Instrument abstraction layer +- * - based on events +- */ +- +-/** instrument types */ +-#define SND_SEQ_INSTR_ATYPE_DATA 0 /**< instrument data */ +-#define SND_SEQ_INSTR_ATYPE_ALIAS 1 /**< instrument alias */ +- +-/** instrument ASCII identifiers */ +-#define SND_SEQ_INSTR_ID_DLS1 "DLS1" /**< DLS1 */ +-#define SND_SEQ_INSTR_ID_DLS2 "DLS2" /**< DLS2 */ +-#define SND_SEQ_INSTR_ID_SIMPLE "Simple Wave" /**< Simple Wave */ +-#define SND_SEQ_INSTR_ID_SOUNDFONT "SoundFont" /**< SoundFont */ +-#define SND_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" /**< Gravis Patch */ +-#define SND_SEQ_INSTR_ID_INTERWAVE "Interwave FFFF" /**< InterWave FFFF */ +-#define SND_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" /**< OPL2/3 FM */ +-#define SND_SEQ_INSTR_ID_OPL4 "OPL4" /**< OPL4 */ +- +-/** instrument types */ +-#define SND_SEQ_INSTR_TYPE0_DLS1 (1<<0) /**< MIDI DLS v1 */ +-#define SND_SEQ_INSTR_TYPE0_DLS2 (1<<1) /**< MIDI DLS v2 */ +-#define SND_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /**< Simple Wave */ +-#define SND_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /**< EMU SoundFont */ +-#define SND_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /**< Gravis UltraSound Patch */ +-#define SND_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /**< InterWave FFFF */ +-#define SND_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /**< Yamaha OPL2/3 FM */ +-#define SND_SEQ_INSTR_TYPE2_OPL4 (1<<1) /**< Yamaha OPL4 */ +- +-/** put commands */ +-#define SND_SEQ_INSTR_PUT_CMD_CREATE 0 /**< create a new layer */ +-#define SND_SEQ_INSTR_PUT_CMD_REPLACE 1 /**< replace the old layer with new one */ +-#define SND_SEQ_INSTR_PUT_CMD_MODIFY 2 /**< modify the existing layer */ +-#define SND_SEQ_INSTR_PUT_CMD_ADD 3 /**< add one to the existing layer */ +-#define SND_SEQ_INSTR_PUT_CMD_REMOVE 4 /**< remove the layer */ +- +-/** get commands */ +-#define SND_SEQ_INSTR_GET_CMD_FULL 0 /**< get the full data stream */ +-#define SND_SEQ_INSTR_GET_CMD_PARTIAL 1 /**< get the partial data stream */ +- +-/* query flags */ +-#define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) /**< follow alias to get the instrument data */ +- +-/** free commands */ +-#define SND_SEQ_INSTR_FREE_CMD_ALL 0 /**< remove all matching instruments */ +-#define SND_SEQ_INSTR_FREE_CMD_PRIVATE 1 /**< remove only private instruments */ +-#define SND_SEQ_INSTR_FREE_CMD_CLUSTER 2 /**< remove only cluster instruments */ +-#define SND_SEQ_INSTR_FREE_CMD_SINGLE 3 /**< remove single instrument */ +- +- +-/** +- * FM instrument support +- */ +- +-/** FM instrument data structure */ +-typedef void snd_instr_fm_t; +- +-int snd_instr_fm_convert_to_stream(snd_instr_fm_t *fm, const char *name, snd_instr_header_t **put, size_t *size); +-int snd_instr_fm_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_fm_t **fm); +-int snd_instr_fm_free(snd_instr_fm_t *fm); +- +- +-/** +- * Simple Wave support +- */ +- +-/** simple instrument data structure */ +-typedef void snd_instr_simple_t; +- +-int snd_instr_simple_convert_to_stream(snd_instr_simple_t *simple, const char *name, snd_instr_header_t **put, size_t *size); +-int snd_instr_simple_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_simple_t **simple); +-int snd_instr_simple_free(snd_instr_simple_t *simple); +- +- +-/** +- * InterWave FFFF support +- */ +- +-/** IW FFFF instrument data structure */ +-typedef void snd_instr_iwffff_t; +-/** IW FFFF handler */ +-typedef struct _snd_iwffff_handle snd_iwffff_handle_t; +- +-int snd_instr_iwffff_open(snd_iwffff_handle_t **handle, const char *name_fff, const char *name_dta); +-int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank, int file); +-int snd_instr_iwffff_open_rom_file(snd_iwffff_handle_t **handle, const char *name, int bank, int file); +-int snd_instr_iwffff_close(snd_iwffff_handle_t *handle); +-int snd_instr_iwffff_load(snd_iwffff_handle_t *handle, int bank, int prg, snd_instr_iwffff_t **iwffff); +-int snd_instr_iwffff_convert_to_stream(snd_instr_iwffff_t *iwffff, const char *name, snd_instr_header_t **data, size_t *size); +-int snd_instr_iwffff_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_iwffff_t **iwffff); +-int snd_instr_iwffff_free(snd_instr_iwffff_t *iwffff); +- +-/** \} */ +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif /* __ALSA_INSTR_H */ +- +diff -r 9e2f117f24b9 include/local.h +--- a/include/local.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/local.h Fri Nov 30 18:33:19 2007 +0100 +@@ -76,24 +76,19 @@ + #define _snd_seq_query_subscribe sndrv_seq_query_subs + #define _snd_seq_client_pool sndrv_seq_client_pool + #define _snd_seq_remove_events sndrv_seq_remove_events +-#define _snd_instr_header sndrv_seq_instr_header + + #define sndrv_seq_addr snd_seq_addr + #define sndrv_seq_tick_time_t snd_seq_tick_time_t + #define sndrv_seq_real_time snd_seq_real_time + #define sndrv_seq_timestamp snd_seq_timestamp +-#define sndrv_seq_instr snd_seq_instr + #define sndrv_seq_event snd_seq_event +-#define sndrv_seq_instr_cluster_t snd_seq_instr_cluster_t + + #if 0 + typedef struct sndrv_seq_addr snd_seq_addr_t; + #define snd_seq_tick_time_t sndrv_seq_tick_time_t + typedef struct sndrv_seq_real_time snd_seq_real_time_t; + typedef union sndrv_seq_timestamp snd_seq_timestamp_t; +-typedef struct sndrv_seq_instr snd_seq_instr_t; + typedef struct sndrv_seq_event snd_seq_event_t; +-#define snd_seq_instr_cluster_t sndrv_seq_instr_cluster_t + #endif + + #define _snd_timer_id sndrv_timer_id +@@ -128,8 +123,6 @@ typedef struct sndrv_seq_event snd_seq_e + #include + #include "seqmid.h" + #include "seq_midi_event.h" +-#include "conv.h" +-#include "instr.h" + #include "list.h" + + #if __BYTE_ORDER == __LITTLE_ENDIAN +@@ -254,6 +247,20 @@ static inline int snd_open_device(const + #define snd_open_device(filename, fmode) open(filename, fmode); + #endif + ++/* make local functions really local */ ++#define snd_dlobj_cache_lookup \ ++ snd1_dlobj_cache_lookup ++#define snd_dlobj_cache_add \ ++ snd1_dlobj_cache_add ++#define snd_dlobj_cache_cleanup \ ++ snd1_dlobj_cache_cleanup ++#define snd_config_set_hop \ ++ snd1_config_set_hop ++#define snd_config_check_hop \ ++ snd1_config_check_hop ++#define snd_config_search_alias_hooks \ ++ snd1_config_search_alias_hooks ++ + /* dlobj cache */ + void *snd_dlobj_cache_lookup(const char *name); + int snd_dlobj_cache_add(const char *name, void *dlobj, void *open_func); diff -r 9e2f117f24b9 include/mixer.h --- a/include/mixer.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/mixer.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/mixer.h Fri Nov 30 18:33:19 2007 +0100 @@ -146,7 +146,7 @@ size_t snd_mixer_class_sizeof(void); * \brief allocate an invalid #snd_mixer_class_t using standard alloca * \param ptr returned pointer @@ -205,7 +567,7 @@ diff -r 9e2f117f24b9 include/mixer.h void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src); diff -r 9e2f117f24b9 include/pcm.h --- a/include/pcm.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/pcm.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/pcm.h Fri Nov 30 18:33:19 2007 +0100 @@ -470,7 +470,7 @@ size_t snd_pcm_info_sizeof(void); * \brief allocate an invalid #snd_pcm_info_t using standard alloca * \param ptr returned pointer @@ -271,7 +633,7 @@ diff -r 9e2f117f24b9 include/pcm.h void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src); diff -r 9e2f117f24b9 include/rawmidi.h --- a/include/rawmidi.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/rawmidi.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/rawmidi.h Fri Nov 30 18:33:19 2007 +0100 @@ -93,7 +93,7 @@ size_t snd_rawmidi_info_sizeof(void); * \brief allocate an invalid #snd_rawmidi_info_t using standard alloca * \param ptr returned pointer @@ -301,7 +663,7 @@ diff -r 9e2f117f24b9 include/rawmidi.h void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src); diff -r 9e2f117f24b9 include/seq.h --- a/include/seq.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/seq.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/seq.h Fri Nov 30 18:33:19 2007 +0100 @@ -45,15 +45,6 @@ extern "C" { /** Sequencer handle */ @@ -417,9 +779,1480 @@ diff -r 9e2f117f24b9 include/seq.h int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr); void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr); void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src); +diff -r 9e2f117f24b9 include/seq_event.h +--- a/include/seq_event.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/seq_event.h Fri Nov 30 18:33:19 2007 +0100 +@@ -133,25 +133,6 @@ enum snd_seq_event_type { + /** Ports disconnected; event data type = #snd_seq_connect_t */ + SND_SEQ_EVENT_PORT_UNSUBSCRIBED, + +- /** Sample select; event data type = #snd_seq_ev_sample_control_t */ +- SND_SEQ_EVENT_SAMPLE = 70, +- /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */ +- SND_SEQ_EVENT_SAMPLE_CLUSTER, +- /** voice start */ +- SND_SEQ_EVENT_SAMPLE_START, +- /** voice stop */ +- SND_SEQ_EVENT_SAMPLE_STOP, +- /** playback frequency */ +- SND_SEQ_EVENT_SAMPLE_FREQ, +- /** volume and balance */ +- SND_SEQ_EVENT_SAMPLE_VOLUME, +- /** sample loop */ +- SND_SEQ_EVENT_SAMPLE_LOOP, +- /** sample position */ +- SND_SEQ_EVENT_SAMPLE_POSITION, +- /** private (hardware dependent) event */ +- SND_SEQ_EVENT_SAMPLE_PRIVATE1, +- + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR0 = 90, + /** user-defined event; event data type = any (fixed size) */ +@@ -172,45 +153,6 @@ enum snd_seq_event_type { + SND_SEQ_EVENT_USR8, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR9, +- +- /** begin of instrument management */ +- SND_SEQ_EVENT_INSTR_BEGIN = 100, +- /** end of instrument management */ +- SND_SEQ_EVENT_INSTR_END, +- /** query instrument interface info */ +- SND_SEQ_EVENT_INSTR_INFO, +- /** result of instrument interface info */ +- SND_SEQ_EVENT_INSTR_INFO_RESULT, +- /** query instrument format info */ +- SND_SEQ_EVENT_INSTR_FINFO, +- /** result of instrument format info */ +- SND_SEQ_EVENT_INSTR_FINFO_RESULT, +- /** reset instrument instrument memory */ +- SND_SEQ_EVENT_INSTR_RESET, +- /** get instrument interface status */ +- SND_SEQ_EVENT_INSTR_STATUS, +- /** result of instrument interface status */ +- SND_SEQ_EVENT_INSTR_STATUS_RESULT, +- /** put an instrument to port */ +- SND_SEQ_EVENT_INSTR_PUT, +- /** get an instrument from port */ +- SND_SEQ_EVENT_INSTR_GET, +- /** result of instrument query */ +- SND_SEQ_EVENT_INSTR_GET_RESULT, +- /** free instrument(s) */ +- SND_SEQ_EVENT_INSTR_FREE, +- /** get instrument list */ +- SND_SEQ_EVENT_INSTR_LIST, +- /** result of instrument list */ +- SND_SEQ_EVENT_INSTR_LIST_RESULT, +- /** set cluster parameters */ +- SND_SEQ_EVENT_INSTR_CLUSTER, +- /** get cluster parameters */ +- SND_SEQ_EVENT_INSTR_CLUSTER_GET, +- /** result of cluster parameters */ +- SND_SEQ_EVENT_INSTR_CLUSTER_RESULT, +- /** instrument change */ +- SND_SEQ_EVENT_INSTR_CHANGE, + + /** system exclusive data (variable length); event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_SYSEX = 130, +@@ -317,79 +259,6 @@ typedef struct snd_seq_ev_ext { + void *ptr; /**< pointer to data (note: can be 64-bit) */ + } __attribute__((packed)) snd_seq_ev_ext_t; + +-/** Instrument cluster type */ +-typedef unsigned int snd_seq_instr_cluster_t; +- +-/** Instrument type */ +-typedef struct snd_seq_instr { +- snd_seq_instr_cluster_t cluster; /**< cluster id */ +- unsigned int std; /**< instrument standard id; the upper byte means a private instrument (owner - client id) */ +- unsigned short bank; /**< instrument bank id */ +- unsigned short prg; /**< instrument program id */ +-} snd_seq_instr_t; +- +-/** sample number */ +-typedef struct snd_seq_ev_sample { +- unsigned int std; /**< sample standard id */ +- unsigned short bank; /**< sample bank id */ +- unsigned short prg; /**< sample program id */ +-} snd_seq_ev_sample_t; +- +-/** sample cluster */ +-typedef struct snd_seq_ev_cluster { +- snd_seq_instr_cluster_t cluster; /**< cluster id */ +-} snd_seq_ev_cluster_t; +- +-/** sample position */ +-typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */ +- +-/** sample stop mode */ +-typedef enum snd_seq_stop_mode { +- SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0, /**< terminate playing immediately */ +- SND_SEQ_SAMPLE_STOP_VENVELOPE = 1, /**< finish volume envelope */ +- SND_SEQ_SAMPLE_STOP_LOOP = 2 /**< terminate loop and finish wave */ +-} snd_seq_stop_mode_t; +- +-/** sample frequency */ +-typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */ +- +-/** sample volume control; if any value is set to -1 == do not change */ +-typedef struct snd_seq_ev_volume { +- signed short volume; /**< range: 0-16383 */ +- signed short lr; /**< left-right balance; range: 0-16383 */ +- signed short fr; /**< front-rear balance; range: 0-16383 */ +- signed short du; /**< down-up balance; range: 0-16383 */ +-} snd_seq_ev_volume_t; +- +-/** simple loop redefinition */ +-typedef struct snd_seq_ev_loop { +- unsigned int start; /**< loop start (in samples) * 16 */ +- unsigned int end; /**< loop end (in samples) * 16 */ +-} snd_seq_ev_loop_t; +- +-/** Sample control events */ +-typedef struct snd_seq_ev_sample_control { +- unsigned char channel; /**< channel */ +- unsigned char unused[3]; /**< reserved */ +- union { +- snd_seq_ev_sample_t sample; /**< sample number */ +- snd_seq_ev_cluster_t cluster; /**< cluster number */ +- snd_seq_position_t position; /**< position */ +- snd_seq_stop_mode_t stop_mode; /**< stop mode */ +- snd_seq_frequency_t frequency; /**< frequency */ +- snd_seq_ev_volume_t volume; /**< volume */ +- snd_seq_ev_loop_t loop; /**< loop control */ +- unsigned char raw8[8]; /**< raw 8-bit */ +- } param; /**< control parameters */ +-} snd_seq_ev_sample_control_t; +- +- +- +-/** INSTR_BEGIN event */ +-typedef struct snd_seq_ev_instr_begin { +- int timeout; /**< zero = forever, otherwise timeout in ms */ +-} snd_seq_ev_instr_begin_t; +- + /** Result events */ + typedef struct snd_seq_result { + int event; /**< processed event type */ +@@ -440,8 +309,6 @@ typedef struct snd_seq_event { + snd_seq_addr_t addr; /**< address */ + snd_seq_connect_t connect; /**< connect information */ + snd_seq_result_t result; /**< operation result code */ +- snd_seq_ev_instr_begin_t instr_begin; /**< instrument */ +- snd_seq_ev_sample_control_t sample; /**< sample control */ + } data; /**< event data... */ + } snd_seq_event_t; + +diff -r 9e2f117f24b9 include/sound/Makefile.am +--- a/include/sound/Makefile.am Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/sound/Makefile.am Fri Nov 30 18:33:19 2007 +0100 +@@ -1,7 +1,6 @@ alsasoundincludedir = ${includedir}/alsa + alsasoundincludedir = ${includedir}/alsa/sound + +-alsasoundinclude_HEADERS = ainstr_fm.h ainstr_gf1.h ainstr_simple.h ainstr_iw.h \ +- asound_fm.h hdsp.h sb16_csp.h sscape_ioctl.h emu10k1.h \ ++alsasoundinclude_HEADERS = asound_fm.h hdsp.h sb16_csp.h sscape_ioctl.h emu10k1.h \ + type_compat.h + + noinst_HEADERS = asound.h asoundef.h asequencer.h +diff -r 9e2f117f24b9 include/sound/ainstr_fm.h +--- a/include/sound/ainstr_fm.h Mon Oct 15 10:36:46 2007 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,129 +0,0 @@ +-/* +- * Advanced Linux Sound Architecture +- * +- * FM (OPL2/3) Instrument Format +- * Copyright (c) 2000 Uros Bizjak +- * +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __SOUND_AINSTR_FM_H +-#define __SOUND_AINSTR_FM_H +- +-#include "type_compat.h" +- +-/* +- * share types (share ID 1) +- */ +- +-#define FM_SHARE_FILE 0 +- +-/* +- * FM operator +- */ +- +-typedef struct fm_operator { +- unsigned char am_vib; +- unsigned char ksl_level; +- unsigned char attack_decay; +- unsigned char sustain_release; +- unsigned char wave_select; +-} fm_operator_t; +- +-/* +- * Instrument +- */ +- +-#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */ +-#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */ +- +-typedef struct { +- unsigned int share_id[4]; /* share id - zero = no sharing */ +- unsigned char type; /* instrument type */ +- +- fm_operator_t op[4]; +- unsigned char feedback_connection[2]; +- +- unsigned char echo_delay; +- unsigned char echo_atten; +- unsigned char chorus_spread; +- unsigned char trnsps; +- unsigned char fix_dur; +- unsigned char modes; +- unsigned char fix_key; +-} fm_instrument_t; +- +-/* +- * +- * Kernel <-> user space +- * Hardware (CPU) independent section +- * +- * * = zero or more +- * + = one or more +- * +- * fm_xinstrument FM_STRU_INSTR +- * +- */ +- +-#define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') +- +-/* +- * FM operator +- */ +- +-typedef struct fm_xoperator { +- __u8 am_vib; +- __u8 ksl_level; +- __u8 attack_decay; +- __u8 sustain_release; +- __u8 wave_select; +-} fm_xoperator_t; +- +-/* +- * Instrument +- */ +- +-typedef struct fm_xinstrument { +- __u32 stype; /* structure type */ +- +- __u32 share_id[4]; /* share id - zero = no sharing */ +- __u8 type; /* instrument type */ +- +- fm_xoperator_t op[4]; /* fm operators */ +- __u8 feedback_connection[2]; +- +- __u8 echo_delay; +- __u8 echo_atten; +- __u8 chorus_spread; +- __u8 trnsps; +- __u8 fix_dur; +- __u8 modes; +- __u8 fix_key; +-} fm_xinstrument_t; +- +-#ifdef __KERNEL__ +- +-#include "seq_instr.h" +- +-extern char *snd_seq_fm_id; +- +-int snd_seq_fm_init(snd_seq_kinstr_ops_t * ops, +- snd_seq_kinstr_ops_t * next); +- +-#endif +- +-#endif /* __SOUND_AINSTR_FM_H */ +diff -r 9e2f117f24b9 include/sound/ainstr_gf1.h +--- a/include/sound/ainstr_gf1.h Mon Oct 15 10:36:46 2007 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,224 +0,0 @@ +-/* +- * Advanced Linux Sound Architecture +- * +- * GF1 (GUS) Patch Instrument Format +- * Copyright (c) 1994-99 by Jaroslav Kysela +- * +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __SOUND_AINSTR_GF1_H +-#define __SOUND_AINSTR_GF1_H +- +-#include "type_compat.h" +- +-/* +- * share types (share ID 1) +- */ +- +-#define GF1_SHARE_FILE 0 +- +-/* +- * wave formats +- */ +- +-#define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */ +-#define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +-#define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */ +-#define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +-#define GF1_WAVE_LOOP 0x0008 /* loop mode */ +-#define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */ +-#define GF1_WAVE_STEREO 0x0100 /* stereo mode */ +-#define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */ +- +-/* +- * Wavetable definitions +- */ +- +-typedef struct gf1_wave { +- unsigned int share_id[4]; /* share id - zero = no sharing */ +- unsigned int format; /* wave format */ +- +- struct { +- unsigned int number; /* some other ID for this instrument */ +- unsigned int memory; /* begin of waveform in onboard memory */ +- unsigned char *ptr; /* pointer to waveform in system memory */ +- } address; +- +- unsigned int size; /* size of waveform in samples */ +- unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned short loop_repeat; /* loop repeat - 0 = forever */ +- +- unsigned char flags; /* GF1 patch flags */ +- unsigned char pad; +- unsigned int sample_rate; /* sample rate in Hz */ +- unsigned int low_frequency; /* low frequency range */ +- unsigned int high_frequency; /* high frequency range */ +- unsigned int root_frequency; /* root frequency range */ +- signed short tune; +- unsigned char balance; +- unsigned char envelope_rate[6]; +- unsigned char envelope_offset[6]; +- unsigned char tremolo_sweep; +- unsigned char tremolo_rate; +- unsigned char tremolo_depth; +- unsigned char vibrato_sweep; +- unsigned char vibrato_rate; +- unsigned char vibrato_depth; +- unsigned short scale_frequency; +- unsigned short scale_factor; /* 0-2048 or 0-2 */ +- +- struct gf1_wave *next; +-} gf1_wave_t; +- +-/* +- * Instrument +- */ +- +-#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ +-#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ +-#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ +- +-#define IWFFFF_EFFECT_NONE 0 +-#define IWFFFF_EFFECT_REVERB 1 +-#define IWFFFF_EFFECT_CHORUS 2 +-#define IWFFFF_EFFECT_ECHO 3 +- +-typedef struct { +- unsigned short exclusion; +- unsigned short exclusion_group; /* 0 - none, 1-65535 */ +- +- unsigned char effect1; /* effect 1 */ +- unsigned char effect1_depth; /* 0-127 */ +- unsigned char effect2; /* effect 2 */ +- unsigned char effect2_depth; /* 0-127 */ +- +- gf1_wave_t *wave; /* first waveform */ +-} gf1_instrument_t; +- +-/* +- * +- * Kernel <-> user space +- * Hardware (CPU) independent section +- * +- * * = zero or more +- * + = one or more +- * +- * gf1_xinstrument IWFFFF_STRU_INSTR +- * +gf1_xwave IWFFFF_STRU_WAVE +- * +- */ +- +-#define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') +-#define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') +- +-/* +- * Wavetable definitions +- */ +- +-typedef struct gf1_xwave { +- __u32 stype; /* structure type */ +- +- __u32 share_id[4]; /* share id - zero = no sharing */ +- __u32 format; /* wave format */ +- +- __u32 size; /* size of waveform in samples */ +- __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u16 loop_repeat; /* loop repeat - 0 = forever */ +- +- __u8 flags; /* GF1 patch flags */ +- __u8 pad; +- __u32 sample_rate; /* sample rate in Hz */ +- __u32 low_frequency; /* low frequency range */ +- __u32 high_frequency; /* high frequency range */ +- __u32 root_frequency; /* root frequency range */ +- __s16 tune; +- __u8 balance; +- __u8 envelope_rate[6]; +- __u8 envelope_offset[6]; +- __u8 tremolo_sweep; +- __u8 tremolo_rate; +- __u8 tremolo_depth; +- __u8 vibrato_sweep; +- __u8 vibrato_rate; +- __u8 vibrato_depth; +- __u16 scale_frequency; +- __u16 scale_factor; /* 0-2048 or 0-2 */ +-} gf1_xwave_t; +- +-/* +- * Instrument +- */ +- +-typedef struct gf1_xinstrument { +- __u32 stype; +- +- __u16 exclusion; +- __u16 exclusion_group; /* 0 - none, 1-65535 */ +- +- __u8 effect1; /* effect 1 */ +- __u8 effect1_depth; /* 0-127 */ +- __u8 effect2; /* effect 2 */ +- __u8 effect2_depth; /* 0-127 */ +-} gf1_xinstrument_t; +- +-/* +- * Instrument info +- */ +- +-#define GF1_INFO_ENVELOPE (1<<0) +-#define GF1_INFO_TREMOLO (1<<1) +-#define GF1_INFO_VIBRATO (1<<2) +- +-typedef struct gf1_info { +- unsigned char flags; /* supported wave flags */ +- unsigned char pad[3]; +- unsigned int features; /* supported features */ +- unsigned int max8_len; /* maximum 8-bit wave length */ +- unsigned int max16_len; /* maximum 16-bit wave length */ +-} gf1_info_t; +- +-#ifdef __KERNEL__ +- +-#include "seq_instr.h" +- +-extern char *snd_seq_gf1_id; +- +-typedef struct { +- void *private_data; +- int (*info)(void *private_data, gf1_info_t *info); +- int (*put_sample)(void *private_data, gf1_wave_t *wave, +- char *data, long len, int atomic); +- int (*get_sample)(void *private_data, gf1_wave_t *wave, +- char *data, long len, int atomic); +- int (*remove_sample)(void *private_data, gf1_wave_t *wave, +- int atomic); +- void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); +- snd_seq_kinstr_ops_t kops; +-} snd_gf1_ops_t; +- +-int snd_seq_gf1_init(snd_gf1_ops_t *ops, +- void *private_data, +- snd_seq_kinstr_ops_t *next); +- +-#endif +- +-#endif /* __SOUND_AINSTR_GF1_H */ +diff -r 9e2f117f24b9 include/sound/ainstr_iw.h +--- a/include/sound/ainstr_iw.h Mon Oct 15 10:36:46 2007 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,372 +0,0 @@ +-/* +- * Advanced Linux Sound Architecture +- * +- * InterWave FFFF Instrument Format +- * Copyright (c) 1994-99 by Jaroslav Kysela +- * +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __SOUND_AINSTR_IW_H +-#define __SOUND_AINSTR_IW_H +- +-#include "type_compat.h" +- +-/* +- * share types (share ID 1) +- */ +- +-#define IWFFFF_SHARE_FILE 0 +- +-/* +- * wave formats +- */ +- +-#define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */ +-#define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +-#define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */ +-#define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +-#define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */ +-#define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */ +-#define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */ +-#define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */ +-#define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */ +-#define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */ +- +-/* +- * Wavetable definitions +- */ +- +-typedef struct iwffff_wave { +- unsigned int share_id[4]; /* share id - zero = no sharing */ +- unsigned int format; /* wave format */ +- +- struct { +- unsigned int number; /* some other ID for this wave */ +- unsigned int memory; /* begin of waveform in onboard memory */ +- unsigned char *ptr; /* pointer to waveform in system memory */ +- } address; +- +- unsigned int size; /* size of waveform in samples */ +- unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned short loop_repeat; /* loop repeat - 0 = forever */ +- unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */ +- unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */ +- unsigned char low_note; /* lower frequency range for this waveform */ +- unsigned char high_note; /* higher frequency range for this waveform */ +- unsigned char pad; +- +- struct iwffff_wave *next; +-} iwffff_wave_t; +- +-/* +- * Layer +- */ +- +-#define IWFFFF_LFO_SHAPE_TRIANGLE 0 +-#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1 +- +-typedef struct iwffff_lfo { +- unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ +- signed short depth; /* volume +- (0-255) 0.48675dB/step */ +- signed short sweep; /* 0 - 950 deciseconds */ +- unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ +- unsigned char delay; /* 0 - 255 deciseconds */ +-} iwffff_lfo_t; +- +-#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */ +- +-#define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */ +-#define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */ +-#define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */ +- +-#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */ +-#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */ +- +-typedef struct iwffff_env_point { +- unsigned short offset; +- unsigned short rate; +-} iwffff_env_point_t; +- +-typedef struct iwffff_env_record { +- unsigned short nattack; +- unsigned short nrelease; +- unsigned short sustain_offset; +- unsigned short sustain_rate; +- unsigned short release_rate; +- unsigned char hirange; +- unsigned char pad; +- struct iwffff_env_record *next; +- /* points are stored here */ +- /* count of points = nattack + nrelease */ +-} iwffff_env_record_t; +- +-typedef struct iwffff_env { +- unsigned char flags; +- unsigned char mode; +- unsigned char index; +- unsigned char pad; +- struct iwffff_env_record *record; +-} iwffff_env_t; +- +-#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */ +- +-#define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */ +-#define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */ +- +-#define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */ +-#define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */ +-#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */ +-#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */ +- +-typedef struct iwffff_layer { +- unsigned char flags; +- unsigned char velocity_mode; +- unsigned char layer_event; +- unsigned char low_range; /* range for layer based */ +- unsigned char high_range; /* on either velocity or frequency */ +- unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ +- unsigned char pan_freq_scale; /* position based on frequency (0-127) */ +- unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ +- iwffff_lfo_t tremolo; /* tremolo effect */ +- iwffff_lfo_t vibrato; /* vibrato effect */ +- unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ +- unsigned char freq_center; /* center for keyboard frequency scaling */ +- unsigned char pad; +- iwffff_env_t penv; /* pitch envelope */ +- iwffff_env_t venv; /* volume envelope */ +- +- iwffff_wave_t *wave; +- struct iwffff_layer *next; +-} iwffff_layer_t; +- +-/* +- * Instrument +- */ +- +-#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ +-#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ +-#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ +- +-#define IWFFFF_LAYER_NONE 0x0000 /* not layered */ +-#define IWFFFF_LAYER_ON 0x0001 /* layered */ +-#define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */ +-#define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */ +- +-#define IWFFFF_EFFECT_NONE 0 +-#define IWFFFF_EFFECT_REVERB 1 +-#define IWFFFF_EFFECT_CHORUS 2 +-#define IWFFFF_EFFECT_ECHO 3 +- +-typedef struct { +- unsigned short exclusion; +- unsigned short layer_type; +- unsigned short exclusion_group; /* 0 - none, 1-65535 */ +- +- unsigned char effect1; /* effect 1 */ +- unsigned char effect1_depth; /* 0-127 */ +- unsigned char effect2; /* effect 2 */ +- unsigned char effect2_depth; /* 0-127 */ +- +- iwffff_layer_t *layer; /* first layer */ +-} iwffff_instrument_t; +- +-/* +- * +- * Kernel <-> user space +- * Hardware (CPU) independent section +- * +- * * = zero or more +- * + = one or more +- * +- * iwffff_xinstrument IWFFFF_STRU_INSTR +- * +iwffff_xlayer IWFFFF_STRU_LAYER +- * *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo) +- * *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato) +- * +iwffff_xwave IWFFFF_STRU_WAVE +- * +- */ +- +-#define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') +-#define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P') +-#define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V') +-#define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R') +-#define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') +- +-/* +- * Wavetable definitions +- */ +- +-typedef struct iwffff_xwave { +- __u32 stype; /* structure type */ +- +- __u32 share_id[4]; /* share id - zero = no sharing */ +- +- __u32 format; /* wave format */ +- __u32 offset; /* offset to ROM (address) */ +- +- __u32 size; /* size of waveform in samples */ +- __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u16 loop_repeat; /* loop repeat - 0 = forever */ +- __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */ +- __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */ +- __u8 low_note; /* lower frequency range for this waveform */ +- __u8 high_note; /* higher frequency range for this waveform */ +- __u8 pad; +-} iwffff_xwave_t; +- +-/* +- * Layer +- */ +- +-typedef struct iwffff_xlfo { +- __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ +- __s16 depth; /* volume +- (0-255) 0.48675dB/step */ +- __s16 sweep; /* 0 - 950 deciseconds */ +- __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ +- __u8 delay; /* 0 - 255 deciseconds */ +-} iwffff_xlfo_t; +- +-typedef struct iwffff_xenv_point { +- __u16 offset; +- __u16 rate; +-} iwffff_xenv_point_t; +- +-typedef struct iwffff_xenv_record { +- __u32 stype; +- __u16 nattack; +- __u16 nrelease; +- __u16 sustain_offset; +- __u16 sustain_rate; +- __u16 release_rate; +- __u8 hirange; +- __u8 pad; +- /* points are stored here.. */ +- /* count of points = nattack + nrelease */ +-} iwffff_xenv_record_t; +- +-typedef struct iwffff_xenv { +- __u8 flags; +- __u8 mode; +- __u8 index; +- __u8 pad; +-} iwffff_xenv_t; +- +-typedef struct iwffff_xlayer { +- __u32 stype; +- __u8 flags; +- __u8 velocity_mode; +- __u8 layer_event; +- __u8 low_range; /* range for layer based */ +- __u8 high_range; /* on either velocity or frequency */ +- __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ +- __u8 pan_freq_scale; /* position based on frequency (0-127) */ +- __u8 attenuation; /* 0-127 (no corresponding midi controller) */ +- iwffff_xlfo_t tremolo; /* tremolo effect */ +- iwffff_xlfo_t vibrato; /* vibrato effect */ +- __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ +- __u8 freq_center; /* center for keyboard frequency scaling */ +- __u8 pad; +- iwffff_xenv_t penv; /* pitch envelope */ +- iwffff_xenv_t venv; /* volume envelope */ +-} iwffff_xlayer_t; +- +-/* +- * Instrument +- */ +- +-typedef struct iwffff_xinstrument { +- __u32 stype; +- +- __u16 exclusion; +- __u16 layer_type; +- __u16 exclusion_group; /* 0 - none, 1-65535 */ +- +- __u8 effect1; /* effect 1 */ +- __u8 effect1_depth; /* 0-127 */ +- __u8 effect2; /* effect 2 */ +- __u8 effect2_depth; /* 0-127 */ +-} iwffff_xinstrument_t; +- +-/* +- * ROM support +- * InterWave ROMs are Little-Endian (x86) +- */ +- +-#define IWFFFF_ROM_HDR_SIZE 512 +- +-typedef struct { +- __u8 iwave[8]; +- __u8 revision; +- __u8 series_number; +- __u8 series_name[16]; +- __u8 date[10]; +- __u16 vendor_revision_major; +- __u16 vendor_revision_minor; +- __u32 rom_size; +- __u8 copyright[128]; +- __u8 vendor_name[64]; +- __u8 description[128]; +-} iwffff_rom_header_t; +- +-/* +- * Instrument info +- */ +- +-#define IWFFFF_INFO_LFO_VIBRATO (1<<0) +-#define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1) +-#define IWFFFF_INFO_LFO_TREMOLO (1<<2) +-#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3) +- +-typedef struct iwffff_info { +- unsigned int format; /* supported format bits */ +- unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ +- unsigned int lfos; /* LFO effects */ +- unsigned int max8_len; /* maximum 8-bit wave length */ +- unsigned int max16_len; /* maximum 16-bit wave length */ +-} iwffff_info_t; +- +-#ifdef __KERNEL__ +- +-#include "seq_instr.h" +- +-extern char *snd_seq_iwffff_id; +- +-typedef struct { +- void *private_data; +- int (*info)(void *private_data, iwffff_info_t *info); +- int (*put_sample)(void *private_data, iwffff_wave_t *wave, +- char *data, long len, int atomic); +- int (*get_sample)(void *private_data, iwffff_wave_t *wave, +- char *data, long len, int atomic); +- int (*remove_sample)(void *private_data, iwffff_wave_t *wave, +- int atomic); +- void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); +- snd_seq_kinstr_ops_t kops; +-} snd_iwffff_ops_t; +- +-int snd_seq_iwffff_init(snd_iwffff_ops_t *ops, +- void *private_data, +- snd_seq_kinstr_ops_t *next); +- +-#endif +- +-#endif /* __SOUND_AINSTR_IW_H */ +diff -r 9e2f117f24b9 include/sound/ainstr_simple.h +--- a/include/sound/ainstr_simple.h Mon Oct 15 10:36:46 2007 +0200 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,155 +0,0 @@ +-/* +- * Advanced Linux Sound Architecture +- * +- * Simple (MOD player) Instrument Format +- * Copyright (c) 1994-99 by Jaroslav Kysela +- * +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-#ifndef __SOUND_AINSTR_SIMPLE_H +-#define __SOUND_AINSTR_SIMPLE_H +- +-#include "type_compat.h" +- +-/* +- * share types (share ID 1) +- */ +- +-#define SIMPLE_SHARE_FILE 0 +- +-/* +- * wave formats +- */ +- +-#define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */ +-#define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +-#define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */ +-#define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +-#define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */ +-#define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */ +-#define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */ +-#define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */ +- +-/* +- * instrument effects +- */ +- +-#define SIMPLE_EFFECT_NONE 0 +-#define SIMPLE_EFFECT_REVERB 1 +-#define SIMPLE_EFFECT_CHORUS 2 +-#define SIMPLE_EFFECT_ECHO 3 +- +-/* +- * instrument info +- */ +- +-typedef struct simple_instrument_info { +- unsigned int format; /* supported format bits */ +- unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */ +- unsigned int max8_len; /* maximum 8-bit wave length */ +- unsigned int max16_len; /* maximum 16-bit wave length */ +-} simple_instrument_info_t; +- +-/* +- * Instrument +- */ +- +-typedef struct { +- unsigned int share_id[4]; /* share id - zero = no sharing */ +- unsigned int format; /* wave format */ +- +- struct { +- unsigned int number; /* some other ID for this instrument */ +- unsigned int memory; /* begin of waveform in onboard memory */ +- unsigned char *ptr; /* pointer to waveform in system memory */ +- } address; +- +- unsigned int size; /* size of waveform in samples */ +- unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */ +- unsigned short loop_repeat; /* loop repeat - 0 = forever */ +- +- unsigned char effect1; /* effect 1 */ +- unsigned char effect1_depth; /* 0-127 */ +- unsigned char effect2; /* effect 2 */ +- unsigned char effect2_depth; /* 0-127 */ +-} simple_instrument_t; +- +-/* +- * +- * Kernel <-> user space +- * Hardware (CPU) independent section +- * +- * * = zero or more +- * + = one or more +- * +- * simple_xinstrument SIMPLE_STRU_INSTR +- * +- */ +- +-#define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') +- +-/* +- * Instrument +- */ +- +-typedef struct simple_xinstrument { +- __u32 stype; +- +- __u32 share_id[4]; /* share id - zero = no sharing */ +- __u32 format; /* wave format */ +- +- __u32 size; /* size of waveform in samples */ +- __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ +- __u16 loop_repeat; /* loop repeat - 0 = forever */ +- +- __u8 effect1; /* effect 1 */ +- __u8 effect1_depth; /* 0-127 */ +- __u8 effect2; /* effect 2 */ +- __u8 effect2_depth; /* 0-127 */ +-} simple_xinstrument_t; +- +-#ifdef __KERNEL__ +- +-#include "seq_instr.h" +- +-extern char *snd_seq_simple_id; +- +-typedef struct { +- void *private_data; +- int (*info)(void *private_data, simple_instrument_info_t *info); +- int (*put_sample)(void *private_data, simple_instrument_t *instr, +- char *data, long len, int atomic); +- int (*get_sample)(void *private_data, simple_instrument_t *instr, +- char *data, long len, int atomic); +- int (*remove_sample)(void *private_data, simple_instrument_t *instr, +- int atomic); +- void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); +- snd_seq_kinstr_ops_t kops; +-} snd_simple_ops_t; +- +-int snd_seq_simple_init(snd_simple_ops_t *ops, +- void *private_data, +- snd_seq_kinstr_ops_t *next); +- +-#endif +- +-#endif /* __SOUND_AINSTR_SIMPLE_H */ +diff -r 9e2f117f24b9 include/sound/asequencer.h +--- a/include/sound/asequencer.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/sound/asequencer.h Fri Nov 30 18:33:19 2007 +0100 +@@ -22,7 +22,7 @@ + #ifndef __SOUND_ASEQUENCER_H + #define __SOUND_ASEQUENCER_H + +-#ifndef __KERNEL__ ++#ifdef __KERNEL__ + #include + #endif + +@@ -112,18 +112,7 @@ + #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ + #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ + +-/** synthesizer events +- * event data type = sndrv_seq_eve_sample_control_t +- */ +-#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */ +-#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */ +-#define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */ +-#define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */ +-#define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */ +-#define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */ +-#define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */ +-#define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */ +-#define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */ ++/* 70-89: synthesizer events - obsoleted */ + + /** user-defined events with fixed length + * event data type = any +@@ -139,28 +128,7 @@ + #define SNDRV_SEQ_EVENT_USR8 98 + #define SNDRV_SEQ_EVENT_USR9 99 + +-/** instrument layer +- * variable length data can be passed directly to the driver +- */ +-#define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */ +-#define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */ +-#define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */ +-#define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */ +-#define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */ +-#define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */ +-#define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */ +-#define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */ +-#define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */ +-#define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */ +-#define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */ +-#define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */ +-#define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */ +-#define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */ +-#define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */ +-#define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */ +-#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */ +-#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */ +-#define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */ ++/* 100-118: instrument layer - obsoleted */ + /* 119-129: reserved */ + + /* 130-139: variable length events +@@ -259,78 +227,6 @@ struct sndrv_seq_ev_ext { + unsigned int len; /* length of data */ + void *ptr; /* pointer to data (note: maybe 64-bit) */ + } __attribute__((packed)); +- +-/* Instrument cluster type */ +-typedef unsigned int sndrv_seq_instr_cluster_t; +- +-/* Instrument type */ +-struct sndrv_seq_instr { +- sndrv_seq_instr_cluster_t cluster; +- unsigned int std; /* the upper byte means a private instrument (owner - client #) */ +- unsigned short bank; +- unsigned short prg; +-}; +- +- /* sample number */ +-struct sndrv_seq_ev_sample { +- unsigned int std; +- unsigned short bank; +- unsigned short prg; +-}; +- +- /* sample cluster */ +-struct sndrv_seq_ev_cluster { +- sndrv_seq_instr_cluster_t cluster; +-}; +- +- /* sample position */ +-typedef unsigned int sndrv_seq_position_t; /* playback position (in samples) * 16 */ +- +- /* sample stop mode */ +-enum sndrv_seq_stop_mode { +- SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */ +- SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */ +- SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */ +-}; +- +- /* sample frequency */ +-typedef int sndrv_seq_frequency_t; /* playback frequency in HZ * 16 */ +- +- /* sample volume control; if any value is set to -1 == do not change */ +-struct sndrv_seq_ev_volume { +- signed short volume; /* range: 0-16383 */ +- signed short lr; /* left-right balance; range: 0-16383 */ +- signed short fr; /* front-rear balance; range: 0-16383 */ +- signed short du; /* down-up balance; range: 0-16383 */ +-}; +- +- /* simple loop redefinition */ +-struct sndrv_seq_ev_loop { +- unsigned int start; /* loop start (in samples) * 16 */ +- unsigned int end; /* loop end (in samples) * 16 */ +-}; +- +-struct sndrv_seq_ev_sample_control { +- unsigned char channel; +- unsigned char unused1, unused2, unused3; /* pad */ +- union { +- struct sndrv_seq_ev_sample sample; +- struct sndrv_seq_ev_cluster cluster; +- sndrv_seq_position_t position; +- int stop_mode; +- sndrv_seq_frequency_t frequency; +- struct sndrv_seq_ev_volume volume; +- struct sndrv_seq_ev_loop loop; +- unsigned char raw8[8]; +- } param; +-}; +- +- +- +-/* INSTR_BEGIN event */ +-struct sndrv_seq_ev_instr_begin { +- int timeout; /* zero = forever, otherwise timeout in ms */ +-}; + + struct sndrv_seq_result { + int event; /* processed event type */ +@@ -401,8 +297,6 @@ struct sndrv_seq_event { + struct sndrv_seq_addr addr; + struct sndrv_seq_connect connect; + struct sndrv_seq_result result; +- struct sndrv_seq_ev_instr_begin instr_begin; +- struct sndrv_seq_ev_sample_control sample; + struct sndrv_seq_ev_quote quote; + } data; + }; +@@ -440,8 +334,6 @@ struct sndrv_seq_event_bounce { + #define sndrv_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) + /* fixed length events: 0-99 */ + #define sndrv_seq_ev_is_fixed_type(ev) ((ev)->type < 100) +-/* instrument layer events: 100-129 */ +-#define sndrv_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130) + /* variable length events: 130-139 */ + #define sndrv_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) + /* reserved for kernel */ +@@ -738,136 +630,6 @@ struct sndrv_seq_query_subs { + + + /* +- * Instrument abstraction layer +- * - based on events +- */ +- +-/* instrument types */ +-#define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */ +-#define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */ +- +-/* instrument ASCII identifiers */ +-#define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1" +-#define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2" +-#define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave" +-#define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont" +-#define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" +-#define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF" +-#define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" +-#define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4" +- +-/* instrument types */ +-#define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */ +-#define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */ +-#define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */ +-#define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */ +-#define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */ +-#define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */ +-#define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */ +-#define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */ +- +-/* put commands */ +-#define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0 +-#define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1 +-#define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2 +-#define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3 +-#define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4 +- +-/* get commands */ +-#define SNDRV_SEQ_INSTR_GET_CMD_FULL 0 +-#define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1 +- +-/* query flags */ +-#define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) +- +-/* free commands */ +-#define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0 +-#define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1 +-#define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2 +-#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3 +- +-/* size of ROM/RAM */ +-typedef unsigned int sndrv_seq_instr_size_t; +- +-/* INSTR_INFO */ +- +-struct sndrv_seq_instr_info { +- int result; /* operation result */ +- unsigned int formats[8]; /* bitmap of supported formats */ +- int ram_count; /* count of RAM banks */ +- sndrv_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ +- int rom_count; /* count of ROM banks */ +- sndrv_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ +- char reserved[128]; +-}; +- +-/* INSTR_STATUS */ +- +-struct sndrv_seq_instr_status { +- int result; /* operation result */ +- sndrv_seq_instr_size_t free_ram[16]; /* free RAM in banks */ +- int instrument_count; /* count of downloaded instruments */ +- char reserved[128]; +-}; +- +-/* INSTR_FORMAT_INFO */ +- +-struct sndrv_seq_instr_format_info { +- char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ +- unsigned int len; /* max data length (without this structure) */ +-}; +- +-struct sndrv_seq_instr_format_info_result { +- int result; /* operation result */ +- char format[16]; /* format identifier */ +- unsigned int len; /* filled data length (without this structure) */ +-}; +- +-/* instrument data */ +-struct sndrv_seq_instr_data { +- char name[32]; /* instrument name */ +- char reserved[16]; /* for the future use */ +- int type; /* instrument type */ +- union { +- char format[16]; /* format identifier */ +- struct sndrv_seq_instr alias; +- } data; +-}; +- +-/* INSTR_PUT/GET, data are stored in one block (extended), header + data */ +- +-struct sndrv_seq_instr_header { +- union { +- struct sndrv_seq_instr instr; +- sndrv_seq_instr_cluster_t cluster; +- } id; /* instrument identifier */ +- unsigned int cmd; /* get/put/free command */ +- unsigned int flags; /* query flags (only for get) */ +- unsigned int len; /* real instrument data length (without header) */ +- int result; /* operation result */ +- char reserved[16]; /* for the future */ +- struct sndrv_seq_instr_data data; /* instrument data (for put/get result) */ +-}; +- +-/* INSTR_CLUSTER_SET */ +- +-struct sndrv_seq_instr_cluster_set { +- sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ +- char name[32]; /* cluster name */ +- int priority; /* cluster priority */ +- char reserved[64]; /* for the future use */ +-}; +- +-/* INSTR_CLUSTER_GET */ +- +-struct sndrv_seq_instr_cluster_get { +- sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ +- char name[32]; /* cluster name */ +- int priority; /* cluster priority */ +- char reserved[64]; /* for the future use */ +-}; +- +-/* + * IOCTL commands + */ + +diff -r 9e2f117f24b9 include/sound/asound_fm.h +--- a/include/sound/asound_fm.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/include/sound/asound_fm.h Fri Nov 30 18:33:19 2007 +0100 +@@ -29,16 +29,16 @@ + #define SNDRV_DM_FM_MODE_OPL2 0x00 + #define SNDRV_DM_FM_MODE_OPL3 0x01 + +-typedef struct snd_dm_fm_info { ++struct snd_dm_fm_info { + unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ + unsigned char rhythm; /* percussion mode flag */ +-} snd_dm_fm_info_t; ++}; + + /* + * Data structure composing an FM "note" or sound event. + */ + +-typedef struct snd_dm_fm_voice { ++struct snd_dm_fm_voice { + unsigned char op; /* operator cell (0 or 1) */ + unsigned char voice; /* FM voice (0 to 17) */ + +@@ -60,25 +60,25 @@ typedef struct snd_dm_fm_voice { + unsigned char left; /* stereo left */ + unsigned char right; /* stereo right */ + unsigned char waveform; /* 3 bits: waveform shape */ +-} snd_dm_fm_voice_t; ++}; + + /* + * This describes an FM note by its voice, octave, frequency number (10bit) + * and key on/off. + */ + +-typedef struct snd_dm_fm_note { ++struct snd_dm_fm_note { + unsigned char voice; /* 0-17 voice channel */ + unsigned char octave; /* 3 bits: what octave to play */ + unsigned int fnum; /* 10 bits: frequency number */ + unsigned char key_on; /* set for active, clear for silent */ +-} snd_dm_fm_note_t; ++}; + + /* + * FM parameters that apply globally to all voices, and thus are not "notes" + */ + +-typedef struct snd_dm_fm_params { ++struct snd_dm_fm_params { + unsigned char am_depth; /* amplitude modulation depth (1=hi) */ + unsigned char vib_depth; /* vibrato depth (1=hi) */ + unsigned char kbd_split; /* keyboard split */ +@@ -90,20 +90,22 @@ typedef struct snd_dm_fm_params { + unsigned char tomtom; + unsigned char cymbal; + unsigned char hihat; +-} snd_dm_fm_params_t; ++}; + + /* + * FM mode ioctl settings + */ + +-#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, snd_dm_fm_info_t) ++#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info) + #define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21) +-#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, snd_dm_fm_note_t) +-#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, snd_dm_fm_voice_t) +-#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, snd_dm_fm_params_t) ++#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note) ++#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice) ++#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params) + #define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) + /* for OPL3 only */ + #define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) ++/* SBI patch management */ ++#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40) + + #define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 + #define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 +@@ -112,4 +114,21 @@ typedef struct snd_dm_fm_params { + #define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 + #define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 + ++/* ++ * Patch Record - fixed size for write ++ */ ++ ++#define FM_KEY_SBI "SBI\032" ++#define FM_KEY_2OP "2OP\032" ++#define FM_KEY_4OP "4OP\032" ++ ++struct sbi_patch { ++ unsigned char prog; ++ unsigned char bank; ++ char key[4]; ++ char name[25]; ++ char extension[7]; ++ unsigned char data[32]; ++}; ++ + #endif /* __SOUND_ASOUND_FM_H */ diff -r 9e2f117f24b9 include/timer.h --- a/include/timer.h Mon Oct 15 10:36:46 2007 +0200 -+++ b/include/timer.h Fri Oct 26 02:01:39 2007 +0200 ++++ b/include/timer.h Fri Nov 30 18:33:19 2007 +0100 @@ -164,7 +164,7 @@ ssize_t snd_timer_read(snd_timer_t *hand size_t snd_timer_id_sizeof(void); @@ -465,27 +2298,426 @@ diff -r 9e2f117f24b9 include/timer.h int snd_timer_status_malloc(snd_timer_status_t **ptr); void snd_timer_status_free(snd_timer_status_t *obj); void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src); +diff -r 9e2f117f24b9 src/Makefile.am +--- a/src/Makefile.am Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/Makefile.am Fri Nov 30 18:33:19 2007 +0100 +@@ -37,10 +37,6 @@ if BUILD_SEQ + if BUILD_SEQ + SUBDIRS += seq + libasound_la_LIBADD += seq/libseq.la +-endif +-if BUILD_INSTR +-SUBDIRS += instr +-libasound_la_LIBADD += instr/libinstr.la + endif + if BUILD_ALISP + SUBDIRS += alisp diff -r 9e2f117f24b9 src/Versions.in --- a/src/Versions.in Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/Versions.in Fri Oct 26 02:01:39 2007 +0200 -@@ -296,3 +296,14 @@ ALSA_1.0.14 { - @SYMBOL_PREFIX@snd_device_name_free_hint; - @SYMBOL_PREFIX@snd_device_name_get_hint; - } ALSA_1.0.12; ++++ b/src/Versions.in Fri Nov 30 18:33:19 2007 +0100 +@@ -1,8 +1,16 @@ ALSA_0.9 { + ALSA_0.9 { + global: +- @SYMBOL_PREFIX@__snd_*; +- @SYMBOL_PREFIX@_snd_*; + @SYMBOL_PREFIX@snd_*; + -+ALSA_1.0.16 { -+ global: -+ @SYMBOL_PREFIX@snd_tlv_parse_dB_info; -+ @SYMBOL_PREFIX@snd_tlv_get_dB_range; -+ @SYMBOL_PREFIX@snd_tlv_convert_to_dB; -+ @SYMBOL_PREFIX@snd_tlv_convert_from_dB; -+ @SYMBOL_PREFIX@snd_ctl_get_dB_range; -+ @SYMBOL_PREFIX@snd_ctl_convert_to_dB; -+ @SYMBOL_PREFIX@snd_ctl_convert_from_dB; -+} ALSA_1.0.14; ++ @SYMBOL_PREFIX@_snd_*_open; ++ @SYMBOL_PREFIX@_snd_*_dlsym_*; ++ @SYMBOL_PREFIX@_snd_*_poll_descriptor; ++ @SYMBOL_PREFIX@_snd_pcm_hook_*; ++ ++ @SYMBOL_PREFIX@__snd_hw_params_*; ++ @SYMBOL_PREFIX@__snd_hw_params_*; ++ @SYMBOL_PREFIX@__snd_*_open_dlsym_*; ++ + local: + *; + }; +@@ -115,184 +123,9 @@ ALSA_0.9.5 { + @SYMBOL_PREFIX@alsa_lisp; + } ALSA_0.9.3; + +-ALSA_0.9.6 { +- global: +- +- @SYMBOL_PREFIX@snd_hctl_open_ctl; +- @SYMBOL_PREFIX@snd_seq_port_info_get_timestamping; +- @SYMBOL_PREFIX@snd_seq_port_info_get_timestamp_real; +- @SYMBOL_PREFIX@snd_seq_port_info_get_timestamp_queue; +- @SYMBOL_PREFIX@snd_seq_port_info_set_timestamping; +- @SYMBOL_PREFIX@snd_seq_port_info_set_timestamp_real; +- @SYMBOL_PREFIX@snd_seq_port_info_set_timestamp_queue; +-} ALSA_0.9.5; +- + ALSA_0.9.7 { + global: + +- @SYMBOL_PREFIX@snd_user_file; +- @SYMBOL_PREFIX@snd_hctl_ctl; +- @SYMBOL_PREFIX@sndo_*; + @SYMBOL_PREFIX@alsa_lisp_*; +-} ALSA_0.9.6; ++} ALSA_0.9.5; + +-ALSA_0.9.8 { +- global: +- +- @SYMBOL_PREFIX@snd_ctl_elem_add; +- @SYMBOL_PREFIX@snd_ctl_elem_replace; +- @SYMBOL_PREFIX@snd_ctl_elem_remove; +- @SYMBOL_PREFIX@snd_hctl_poll_descriptors_revents; +-} ALSA_0.9.7; +- +-ALSA_1.0.4 { +- global: +- +- @SYMBOL_PREFIX@snd_spcm_init; +- @SYMBOL_PREFIX@snd_spcm_init_duplex; +- @SYMBOL_PREFIX@snd_spcm_init_get_params; +-} ALSA_0.9.8; +- +-ALSA_1.0.5 { +- global: +- +- @SYMBOL_PREFIX@snd_asoundlib_version; +- @SYMBOL_PREFIX@snd_timer_params_set_early_event; +- @SYMBOL_PREFIX@snd_timer_params_get_early_event; +-} ALSA_1.0.4; +- +-ALSA_1.0.8 { +- global: +- +- @SYMBOL_PREFIX@snd_ctl_elem_add_integer; +- @SYMBOL_PREFIX@snd_ctl_elem_add_integer64; +- @SYMBOL_PREFIX@snd_ctl_elem_add_boolean; +- @SYMBOL_PREFIX@snd_ctl_elem_add_iec958; +- @SYMBOL_PREFIX@snd_ctl_elem_remove; +-} ALSA_1.0.5; +- +-ALSA_1.0.9 { +- global: +- +- @SYMBOL_PREFIX@snd_names_list; +- @SYMBOL_PREFIX@snd_names_list_free; +- +- @SYMBOL_PREFIX@snd_pcm_hw_params_set_rate_resample; +- @SYMBOL_PREFIX@snd_pcm_hw_params_get_rate_resample; +- @SYMBOL_PREFIX@snd_pcm_hw_params_set_export_buffer; +- @SYMBOL_PREFIX@snd_pcm_hw_params_get_export_buffer; +- +- @SYMBOL_PREFIX@snd_pcm_ioplug_create; +- @SYMBOL_PREFIX@snd_pcm_ioplug_delete; +- @SYMBOL_PREFIX@snd_pcm_ioplug_reinit_status; +- @SYMBOL_PREFIX@snd_pcm_ioplug_params_reset; +- @SYMBOL_PREFIX@snd_pcm_ioplug_set_param_minmax; +- @SYMBOL_PREFIX@snd_pcm_ioplug_set_param_list; +- +- @SYMBOL_PREFIX@snd_pcm_extplug_create; +- @SYMBOL_PREFIX@snd_pcm_extplug_delete; +- @SYMBOL_PREFIX@snd_pcm_extplug_params_reset; +- @SYMBOL_PREFIX@snd_pcm_extplug_set_param_list; +- @SYMBOL_PREFIX@snd_pcm_extplug_set_param_minmax; +- @SYMBOL_PREFIX@snd_pcm_extplug_set_slave_param_list; +- @SYMBOL_PREFIX@snd_pcm_extplug_set_slave_param_minmax; +- +- @SYMBOL_PREFIX@snd_pcm_parse_control_id; +- +- @SYMBOL_PREFIX@snd_async_add_timer_handler; +- @SYMBOL_PREFIX@snd_async_handler_get_timer; +- +- @SYMBOL_PREFIX@snd_timer_ginfo_sizeof; +- @SYMBOL_PREFIX@snd_timer_ginfo_malloc; +- @SYMBOL_PREFIX@snd_timer_ginfo_free; +- @SYMBOL_PREFIX@snd_timer_ginfo_copy; +- @SYMBOL_PREFIX@snd_timer_ginfo_set_tid; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_tid; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_flags; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_card; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_id; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_name; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_resolution; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_resolution_min; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_resolution_max; +- @SYMBOL_PREFIX@snd_timer_ginfo_get_clients; +- +-} ALSA_1.0.8; +- +-ALSA_1.0.10 { +- global: +- +- @SYMBOL_PREFIX@snd_mixer_get_hctl; +- @SYMBOL_PREFIX@snd_mixer_elem_get_private; +- @SYMBOL_PREFIX@snd_mixer_attach_hctl; +- @SYMBOL_PREFIX@snd_mixer_detach_hctl; +- +- @SYMBOL_PREFIX@snd_mixer_class_register; +- @SYMBOL_PREFIX@snd_mixer_add_elem; +- @SYMBOL_PREFIX@snd_mixer_remove_elem; +- @SYMBOL_PREFIX@snd_mixer_elem_new; +- @SYMBOL_PREFIX@snd_mixer_elem_add; +- @SYMBOL_PREFIX@snd_mixer_elem_remove; +- @SYMBOL_PREFIX@snd_mixer_elem_free; +- @SYMBOL_PREFIX@snd_mixer_elem_info; +- @SYMBOL_PREFIX@snd_mixer_elem_value; +- @SYMBOL_PREFIX@snd_mixer_elem_attach; +- @SYMBOL_PREFIX@snd_mixer_elem_detach; +- @SYMBOL_PREFIX@snd_mixer_elem_empty; +- +- @SYMBOL_PREFIX@snd_mixer_class_malloc; +- @SYMBOL_PREFIX@snd_mixer_class_free; +- @SYMBOL_PREFIX@snd_mixer_class_copy; +- @SYMBOL_PREFIX@snd_mixer_class_get_mixer; +- @SYMBOL_PREFIX@snd_mixer_class_get_event; +- @SYMBOL_PREFIX@snd_mixer_class_get_private; +- @SYMBOL_PREFIX@snd_mixer_class_get_compare; +- @SYMBOL_PREFIX@snd_mixer_class_set_event; +- @SYMBOL_PREFIX@snd_mixer_class_set_private; +- @SYMBOL_PREFIX@snd_mixer_class_set_private_free; +- @SYMBOL_PREFIX@snd_mixer_class_set_compare; +- +- @SYMBOL_PREFIX@snd_mixer_selem_set_playback_dB_all; +- @SYMBOL_PREFIX@snd_mixer_selem_set_capture_dB_all; +- @SYMBOL_PREFIX@snd_mixer_selem_is_enum_playback; +- @SYMBOL_PREFIX@snd_mixer_selem_is_enum_capture; +- @SYMBOL_PREFIX@snd_mixer_selem_compare; +- @SYMBOL_PREFIX@snd_mixer_sbasic_info; +- @SYMBOL_PREFIX@snd_mixer_sbasic_get_private; +- @SYMBOL_PREFIX@snd_mixer_sbasic_set_private; +- @SYMBOL_PREFIX@snd_mixer_sbasic_set_private_free; +- +- @SYMBOL_PREFIX@snd_ctl_ext_create; +- @SYMBOL_PREFIX@snd_ctl_ext_delete; +- +-} ALSA_1.0.9; +- +-ALSA_1.0.11 { +- global: +- +- @SYMBOL_PREFIX@snd_pcm_recover; +- @SYMBOL_PREFIX@snd_pcm_set_params; +- @SYMBOL_PREFIX@snd_pcm_get_params; +-} ALSA_1.0.10; +- +-ALSA_1.0.12 { +- global: +- +- @SYMBOL_PREFIX@snd_ctl_elem_tlv_read; +- @SYMBOL_PREFIX@snd_ctl_elem_tlv_write; +- @SYMBOL_PREFIX@snd_ctl_elem_tlv_command; +- @SYMBOL_PREFIX@snd_ctl_elem_info_is_tlv_readable; +- @SYMBOL_PREFIX@snd_ctl_elem_info_is_tlv_writable; +- @SYMBOL_PREFIX@snd_ctl_elem_info_is_tlv_commandable; +- @SYMBOL_PREFIX@snd_hctl_elem_tlv_read; +- @SYMBOL_PREFIX@snd_hctl_elem_tlv_write; +- @SYMBOL_PREFIX@snd_hctl_elem_tlv_command; +-} ALSA_1.0.11; +- +-ALSA_1.0.14 { +- global: +- +- @SYMBOL_PREFIX@snd_device_name_hint; +- @SYMBOL_PREFIX@snd_device_name_free_hint; +- @SYMBOL_PREFIX@snd_device_name_get_hint; +-} ALSA_1.0.12; +diff -r 9e2f117f24b9 src/conf.c +--- a/src/conf.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/conf.c Fri Nov 30 18:33:19 2007 +0100 +@@ -2897,7 +2897,7 @@ int snd_config_hook_load_for_all_cards(s + return err; + if (snd_config_search(root, fdriver, &n) >= 0) { + if (snd_config_get_string(n, &driver) < 0) +- continue; ++ goto __err; + while (1) { + char *s = strchr(driver, '.'); + if (s == NULL) +@@ -2905,7 +2905,7 @@ int snd_config_hook_load_for_all_cards(s + driver = s + 1; + } + if (snd_config_search(root, driver, &n) >= 0) +- continue; ++ goto __err; + } else { + driver = fdriver; + } +diff -r 9e2f117f24b9 src/conf/alsa.conf +--- a/src/conf/alsa.conf Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/conf/alsa.conf Fri Nov 30 18:33:19 2007 +0100 +@@ -317,7 +317,7 @@ ctl.default { + } + + ctl.hw { +- @args[ CARD ] ++ @args [ CARD ] + @args.CARD { + type string + default { +diff -r 9e2f117f24b9 src/conf/cards/CMI8788.conf +--- a/src/conf/cards/CMI8788.conf Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/conf/cards/CMI8788.conf Fri Nov 30 18:33:19 2007 +0100 +@@ -1,10 +1,6 @@ + # + # Configuration for the CMI8788 chip + # +- +-# TODO: use 96 or 192 kHz for dmix? +-# TODO: remove softvol +-# TODO: add hooks for SPDIF mixer controls + + + +@@ -13,18 +9,11 @@ CMI8788.pcm.front.0 { + @args.CARD { + type string + } +- type softvol +- slave.pcm { +- type hw +- card $CARD +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ type hw ++ card $CARD + } + +-# default with dmix+softvol & dsnoop ++# default with dmix & dsnoop + CMI8788.pcm.default { + @args [ CARD ] + @args.CARD { +@@ -34,22 +23,15 @@ CMI8788.pcm.default { + playback.pcm { + type plug + slave.pcm { +- type softvol +- slave.pcm { +- @func concat +- strings [ "dmix:" $CARD ] +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ @func concat ++ strings [ "dmix:" $CARD ",FORMAT=S32_LE" ] + } + } + capture.pcm { + type plug + slave.pcm { + @func concat +- strings [ "dsnoop:" $CARD ] ++ strings [ "dsnoop:" $CARD ",FORMAT=S32_LE" ] + } + } + } +@@ -61,16 +43,9 @@ CMI8788.pcm.surround40.0 { + @args.CARD { + type string + } +- type softvol +- slave.pcm { +- type hw +- card $CARD +- channels 4 +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ type hw ++ card $CARD ++ channels 4 + } + + +@@ -83,16 +58,9 @@ CMI8788.pcm.surround51.0 { + @args.CARD { + type string + } +- type softvol +- slave.pcm { +- type hw +- card $CARD +- channels 6 +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ type hw ++ card $CARD ++ channels 6 + } + + +@@ -102,16 +70,9 @@ CMI8788.pcm.surround71.0 { + @args.CARD { + type string + } +- type softvol +- slave.pcm { +- type hw +- card $CARD +- channels 8 +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ type hw ++ card $CARD ++ channels 8 + } + + +@@ -135,9 +96,25 @@ CMI8788.pcm.iec958.0 { + } + type asym + playback.pcm { +- type hw +- card $CARD +- device 1 ++ type hooks ++ slave.pcm { ++ type hw ++ card $CARD ++ device 1 ++ } ++ hooks.0 { ++ type ctl_elems ++ hook_args [ ++ { ++ interface PCM ++ device 1 ++ name "IEC958 Playback PCM Stream" ++ lock true ++ preserve true ++ value [ $AES0 $AES1 $AES2 $AES3 ] ++ } ++ ] ++ } + } + capture.pcm { + type hw +diff -r 9e2f117f24b9 src/conf/cards/aliases.conf +--- a/src/conf/cards/aliases.conf Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/conf/cards/aliases.conf Fri Nov 30 18:33:19 2007 +0100 +@@ -49,6 +49,7 @@ Canyon3D-2 cards.Maestro3 + Canyon3D-2 cards.Maestro3 + Azalia cards.HDA-Intel + aaci-pl041 cards.AACI ++AV200 cards.CMI8788 + + + diff -r 9e2f117f24b9 src/control/Makefile.am --- a/src/control/Makefile.am Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/control/Makefile.am Fri Oct 26 02:01:39 2007 +0200 ++++ b/src/control/Makefile.am Fri Nov 30 18:33:19 2007 +0100 @@ -1,6 +1,6 @@ EXTRA_LTLIBRARIES = libcontrol.la EXTRA_LTLIBRARIES = libcontrol.la @@ -494,9 +2726,90 @@ diff -r 9e2f117f24b9 src/control/Makefile.am control.c control_hw.c setup.c control_symbols.c if BUILD_CTL_PLUGIN_SHM libcontrol_la_SOURCES += control_shm.c +diff -r 9e2f117f24b9 src/control/cards.c +--- a/src/control/cards.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/control/cards.c Fri Nov 30 18:33:19 2007 +0100 +@@ -39,12 +39,7 @@ + #define SND_FILE_LOAD ALOAD_DEVICE_DIRECTORY "aloadC%i" + #endif + +-/** +- * \brief Try to load the driver for a card. +- * \param card Card number. +- * \return 1 if driver is present, zero if driver is not present +- */ +-int snd_card_load(int card) ++static int snd_card_load1(int card) + { + int open_dev; + char control[sizeof(SND_FILE_CONTROL) + 10]; +@@ -61,9 +56,20 @@ int snd_card_load(int card) + #endif + if (open_dev >= 0) { + close (open_dev); +- return 1; ++ return 0; ++ } else { ++ return -errno; + } +- return 0; ++} ++ ++/** ++ * \brief Try to load the driver for a card. ++ * \param card Card number. ++ * \return 1 if driver is present, zero if driver is not present ++ */ ++int snd_card_load(int card) ++{ ++ return !!(snd_card_load1(card) == 0); + } + + /** +@@ -104,7 +110,7 @@ int snd_card_next(int *rcard) + */ + int snd_card_get_index(const char *string) + { +- int card; ++ int card, err; + snd_ctl_t *handle; + snd_ctl_card_info_t info; + +@@ -116,13 +122,16 @@ int snd_card_get_index(const char *strin + return -EINVAL; + if (card < 0 || card > 31) + return -EINVAL; +- if (snd_card_load(card)) ++ err = snd_card_load1(card); ++ if (err >= 0) + return card; +- return -ENODEV; ++ return err; + } + for (card = 0; card < 32; card++) { ++#ifdef SUPPORT_ALOAD + if (! snd_card_load(card)) + continue; ++#endif + if (snd_ctl_hw_open(&handle, NULL, card, 0) < 0) + continue; + if (snd_ctl_card_info(handle, &info) < 0) { +diff -r 9e2f117f24b9 src/control/control_local.h +--- a/src/control/control_local.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/control/control_local.h Fri Nov 30 18:33:19 2007 +0100 +@@ -89,6 +89,9 @@ struct _snd_hctl { + }; + + ++/* make local functions really local */ ++#define snd_ctl_new snd1_ctl_new ++ + int snd_ctl_new(snd_ctl_t **ctlp, snd_ctl_type_t type, const char *name); + int _snd_ctl_poll_descriptor(snd_ctl_t *ctl); + #define _snd_ctl_async_descriptor _snd_ctl_poll_descriptor diff -r 9e2f117f24b9 src/control/tlv.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/src/control/tlv.c Fri Oct 26 02:01:39 2007 +0200 ++++ b/src/control/tlv.c Fri Nov 30 18:33:19 2007 +0100 @@ -0,0 +1,429 @@ +/** + * \file control/tlv.c @@ -929,7 +3242,7 @@ diff -r 9e2f117f24b9 src/control/tlv.c +} diff -r 9e2f117f24b9 src/error.c --- a/src/error.c Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/error.c Fri Oct 26 02:01:39 2007 +0200 ++++ b/src/error.c Fri Nov 30 18:33:19 2007 +0100 @@ -135,8 +135,11 @@ static void snd_err_msg_default(const ch fprintf(stderr, ": %s", snd_strerror(err)); putc('\n', stderr); @@ -943,18 +3256,67 @@ diff -r 9e2f117f24b9 src/error.c } /** +diff -r 9e2f117f24b9 src/mixer/mixer_simple.h +--- a/src/mixer/mixer_simple.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/mixer/mixer_simple.h Fri Nov 30 18:33:19 2007 +0100 +@@ -21,5 +21,11 @@ + + #include "mixer_abst.h" + ++/* make local functions really local */ ++#define snd_mixer_simple_none_register \ ++ snd1_mixer_simple_none_register ++#define snd_mixer_simple_basic_register \ ++ snd1_mixer_simple_basic_register ++ + int snd_mixer_simple_none_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp); + int snd_mixer_simple_basic_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp); diff -r 9e2f117f24b9 src/mixer/simple_none.c --- a/src/mixer/simple_none.c Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/mixer/simple_none.c Fri Oct 26 02:01:39 2007 +0200 -@@ -35,6 +35,7 @@ ++++ b/src/mixer/simple_none.c Fri Nov 30 18:33:19 2007 +0100 +@@ -35,7 +35,9 @@ #include #include #include +#include #include ++#include #include #include "mixer_simple.h" -@@ -1068,150 +1069,13 @@ static int get_volume_ops(snd_mixer_elem + +@@ -671,9 +673,11 @@ static int simple_update(snd_mixer_elem_ + + caps = 0; + pchannels = 0; +- pmin = pmax = 0; ++ pmin = LONG_MAX; ++ pmax = LONG_MIN; + cchannels = 0; +- cmin = cmax = 0; ++ cmin = LONG_MAX; ++ cmax = LONG_MIN; + assert(snd_mixer_elem_get_type(melem) == SND_MIXER_ELEM_SIMPLE); + simple = snd_mixer_elem_get_private(melem); + name = snd_mixer_selem_get_name(melem); +@@ -867,13 +871,13 @@ static int simple_update(snd_mixer_elem_ + simple->selem.caps = caps; + simple->str[SM_PLAY].channels = pchannels; + if (!simple->str[SM_PLAY].range) { +- simple->str[SM_PLAY].min = pmin; +- simple->str[SM_PLAY].max = pmax; ++ simple->str[SM_PLAY].min = pmin != LONG_MAX ? pmin : 0; ++ simple->str[SM_PLAY].max = pmax != LONG_MIN ? pmax : 0; + } + simple->str[SM_CAPT].channels = cchannels; + if (!simple->str[SM_CAPT].range) { +- simple->str[SM_CAPT].min = cmin; +- simple->str[SM_CAPT].max = cmax; ++ simple->str[SM_CAPT].min = cmin != LONG_MAX ? cmin : 0; ++ simple->str[SM_CAPT].max = cmax != LONG_MIN ? cmax : 0; + } + return 0; + } +@@ -1068,150 +1072,13 @@ static int get_volume_ops(snd_mixer_elem static int init_db_range(snd_hctl_elem_t *ctl, struct selem_str *rec); @@ -1107,7 +3469,7 @@ diff -r 9e2f117f24b9 src/mixer/simple_none.c } /* initialize dB range information, reading TLV via hcontrol -@@ -1221,6 +1085,8 @@ static int init_db_range(snd_hctl_elem_t +@@ -1221,6 +1088,8 @@ static int init_db_range(snd_hctl_elem_t snd_ctl_elem_info_t *info; unsigned int *tlv = NULL; const unsigned int tlv_size = 4096; @@ -1116,7 +3478,7 @@ diff -r 9e2f117f24b9 src/mixer/simple_none.c if (rec->db_init_error) return -EINVAL; -@@ -1237,8 +1103,13 @@ static int init_db_range(snd_hctl_elem_t +@@ -1237,8 +1106,13 @@ static int init_db_range(snd_hctl_elem_t return -ENOMEM; if (snd_hctl_elem_tlv_read(ctl, tlv, tlv_size) < 0) goto error; @@ -1131,7 +3493,7 @@ diff -r 9e2f117f24b9 src/mixer/simple_none.c free(tlv); rec->db_initialized = 1; return 0; -@@ -1269,59 +1140,13 @@ static selem_ctl_t *get_selem_ctl(selem_ +@@ -1269,59 +1143,13 @@ static selem_ctl_t *get_selem_ctl(selem_ return c; } @@ -1192,7 +3554,7 @@ diff -r 9e2f117f24b9 src/mixer/simple_none.c } static int get_dB_range_ops(snd_mixer_elem_t *elem, int dir, -@@ -1336,89 +1161,14 @@ static int get_dB_range_ops(snd_mixer_el +@@ -1336,89 +1164,14 @@ static int get_dB_range_ops(snd_mixer_el return get_dB_range(c->elem, &s->str[dir], min, max); } @@ -1284,10 +3646,250 @@ diff -r 9e2f117f24b9 src/mixer/simple_none.c } static int get_dB_ops(snd_mixer_elem_t *elem, +diff -r 9e2f117f24b9 src/pcm/interval.h +--- a/src/pcm/interval.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/interval.h Fri Nov 30 18:33:19 2007 +0100 +@@ -42,6 +42,22 @@ int snd_interval_never_eq(const snd_inte + int snd_interval_never_eq(const snd_interval_t *i1, const snd_interval_t *i2); + #endif + ++/* make local functions really local */ ++#define snd_interval_add snd1_interval_add ++#define snd_interval_sub snd1_interval_sub ++#define snd_interval_mul snd1_interval_mul ++#define snd_interval_div snd1_interval_div ++#define snd_interval_muldiv snd1_interval_muldiv ++#define snd_interval_muldivk snd1_interval_muldivk ++#define snd_interval_mulkdiv snd1_interval_mulkdiv ++#define snd_interval_print snd1_interval_print ++#define snd_interval_refine_min snd1_interval_refine_min ++#define snd_interval_refine_max snd1_interval_refine_max ++#define snd_interval_refine snd1_interval_refine ++#define snd_interval_refine_first snd1_interval_refine_first ++#define snd_interval_refine_last snd1_interval_refine_last ++#define snd_interval_refine_set snd1_interval_refine_set ++ + void snd_interval_add(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); + void snd_interval_sub(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); + void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); +diff -r 9e2f117f24b9 src/pcm/pcm.c +--- a/src/pcm/pcm.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm.c Fri Nov 30 18:33:19 2007 +0100 +@@ -2226,9 +2226,10 @@ int snd_pcm_free(snd_pcm_t *pcm) + return 0; + } + +-int snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root, +- snd_config_t *conf, snd_pcm_stream_t stream, +- int mode, snd_config_t *parent_conf) ++int snd_pcm_open_named_slave(snd_pcm_t **pcmp, const char *name, ++ snd_config_t *root, ++ snd_config_t *conf, snd_pcm_stream_t stream, ++ int mode, snd_config_t *parent_conf) + { + const char *str; + int hop; +@@ -2238,7 +2239,7 @@ int snd_pcm_open_slave(snd_pcm_t **pcmp, + if (snd_config_get_string(conf, &str) >= 0) + return snd_pcm_open_noupdate(pcmp, root, str, stream, mode, + hop + 1); +- return snd_pcm_open_conf(pcmp, NULL, root, conf, stream, mode); ++ return snd_pcm_open_conf(pcmp, name, root, conf, stream, mode); + } + #endif + +@@ -5577,6 +5578,12 @@ int snd_pcm_sw_params_set_avail_min(snd_ + #endif + { + assert(pcm && params); ++ /* Fix avail_min if it's below period size. The period_size ++ * defines the minimal wake-up timing accuracy, so it doesn't ++ * make sense to set below that. ++ */ ++ if (val < pcm->period_size) ++ val = pcm->period_size; + params->avail_min = val; + return 0; + } +diff -r 9e2f117f24b9 src/pcm/pcm_asym.c +--- a/src/pcm/pcm_asym.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_asym.c Fri Nov 30 18:33:19 2007 +0100 +@@ -109,7 +109,8 @@ int _snd_pcm_asym_open(snd_pcm_t **pcmp, + err = snd_pcm_slave_conf(root, slave, &sconf, 0); + if (err < 0) + return err; +- err = snd_pcm_open_slave(pcmp, root, sconf, stream, mode, conf); ++ err = snd_pcm_open_named_slave(pcmp, name, root, sconf, stream, ++ mode, conf); + snd_config_delete(sconf); + return err; + } +diff -r 9e2f117f24b9 src/pcm/pcm_direct.c +--- a/src/pcm/pcm_direct.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_direct.c Fri Nov 30 18:33:19 2007 +0100 +@@ -109,13 +109,15 @@ retryget: + } + dmix->shmptr = shmat(dmix->shmid, 0, 0); + if (dmix->shmptr == (void *) -1) { ++ err = -errno; + snd_pcm_direct_shm_discard(dmix); +- return -errno; ++ return err; + } + mlock(dmix->shmptr, sizeof(snd_pcm_direct_share_t)); + if (shmctl(dmix->shmid, IPC_STAT, &buf) < 0) { ++ err = -errno; + snd_pcm_direct_shm_discard(dmix); +- return -errno; ++ return err; + } + if (buf.shm_nattch == 1) { /* we're the first user, clear the segment */ + memset(dmix->shmptr, 0, sizeof(snd_pcm_direct_share_t)); +@@ -128,7 +130,7 @@ retryget: + } else { + if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC) { + snd_pcm_direct_shm_discard(dmix); +- return -errno; ++ return -EINVAL; + } + } + return 0; +@@ -999,6 +1001,17 @@ int snd_pcm_direct_initialize_slave(snd_ + return ret; + } + ++ /* set timestamp mode to MMAP ++ * the slave timestamp is copied appropriately in dsnoop/dmix/dshare ++ * based on the tstamp_mode of each client ++ */ ++ ret = snd_pcm_sw_params_set_tstamp_mode(spcm, sw_params, ++ SND_PCM_TSTAMP_MMAP); ++ if (ret < 0) { ++ SNDERR("unable to tstamp mode MMAP"); ++ return ret; ++ } ++ + if (dmix->type != SND_PCM_TYPE_DMIX) + goto __skip_silencing; + +diff -r 9e2f117f24b9 src/pcm/pcm_direct.h +--- a/src/pcm/pcm_direct.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_direct.h Fri Nov 30 18:33:19 2007 +0100 +@@ -161,6 +161,66 @@ struct snd_pcm_direct { + void (*server_free)(snd_pcm_direct_t *direct); + }; + ++/* make local functions really local */ ++#define snd_pcm_direct_semaphore_create_or_connect \ ++ snd1_pcm_direct_semaphore_create_or_connect ++#define snd_pcm_direct_shm_create_or_connect \ ++ snd1_pcm_direct_shm_create_or_connect ++#define snd_pcm_direct_shm_discard \ ++ snd1_pcm_direct_shm_discard ++#define snd_pcm_direct_server_create \ ++ snd1_pcm_direct_server_create ++#define snd_pcm_direct_server_discard \ ++ snd1_pcm_direct_server_discard ++#define snd_pcm_direct_client_connect \ ++ snd1_pcm_direct_client_connect ++#define snd_pcm_direct_client_discard \ ++ snd1_pcm_direct_client_discard ++#define snd_pcm_direct_initialize_slave \ ++ snd1_pcm_direct_initialize_slave ++#define snd_pcm_direct_initialize_secondary_slave \ ++ snd1_pcm_direct_initialize_secondary_slave ++#define snd_pcm_direct_initialize_poll_fd \ ++ snd1_pcm_direct_initialize_poll_fd ++#define snd_pcm_direct_check_interleave \ ++ snd1_pcm_direct_check_interleave ++#define snd_pcm_direct_parse_bindings \ ++ snd1_pcm_direct_parse_bindings ++#define snd_pcm_direct_nonblock \ ++ snd1_pcm_direct_nonblock ++#define snd_pcm_direct_async \ ++ snd1_pcm_direct_async ++#define snd_pcm_direct_poll_revents \ ++ snd1_pcm_direct_poll_revents ++#define snd_pcm_direct_info \ ++ snd1_pcm_direct_info ++#define snd_pcm_direct_hw_refine \ ++ snd1_pcm_direct_hw_refine ++#define snd_pcm_direct_hw_params \ ++ snd1_pcm_direct_hw_params ++#define snd_pcm_direct_hw_free \ ++ snd1_pcm_direct_hw_free ++#define snd_pcm_direct_sw_params \ ++ snd1_pcm_direct_sw_params ++#define snd_pcm_direct_channel_info \ ++ snd1_pcm_direct_channel_info ++#define snd_pcm_direct_mmap \ ++ snd1_pcm_direct_mmap ++#define snd_pcm_direct_munmap \ ++ snd1_pcm_direct_munmap ++#define snd_pcm_direct_resume \ ++ snd1_pcm_direct_resume ++#define snd_pcm_direct_timer_stop \ ++ snd1_pcm_direct_timer_stop ++#define snd_pcm_direct_clear_timer_queue \ ++ snd1_pcm_direct_clear_timer_queue ++#define snd_pcm_direct_set_timer_params \ ++ snd1_pcm_direct_set_timer_params ++#define snd_pcm_direct_open_secondary_client \ ++ snd1_pcm_direct_open_secondary_client ++#define snd_pcm_direct_parse_open_conf \ ++ snd1_pcm_direct_parse_open_conf ++ + int snd_pcm_direct_semaphore_create_or_connect(snd_pcm_direct_t *dmix); + + static inline int snd_pcm_direct_semaphore_discard(snd_pcm_direct_t *dmix) diff -r 9e2f117f24b9 src/pcm/pcm_dmix.c --- a/src/pcm/pcm_dmix.c Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/pcm/pcm_dmix.c Fri Oct 26 02:01:39 2007 +0200 -@@ -652,9 +652,10 @@ static int snd_pcm_dmix_close(snd_pcm_t ++++ b/src/pcm/pcm_dmix.c Fri Nov 30 18:33:19 2007 +0100 +@@ -367,11 +367,8 @@ static int snd_pcm_dmix_sync_ptr(snd_pcm + if (avail > dmix->avail_max) + dmix->avail_max = avail; + if (avail >= pcm->stop_threshold) { +- struct timeval tv; + snd_timer_stop(dmix->timer); +- gettimeofday(&tv, 0); +- dmix->trigger_tstamp.tv_sec = tv.tv_sec; +- dmix->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dmix->trigger_tstamp); + if (dmix->state == SND_PCM_STATE_RUNNING) { + dmix->state = SND_PCM_STATE_XRUN; + return -EPIPE; +@@ -420,7 +417,10 @@ static int snd_pcm_dmix_status(snd_pcm_t + memset(status, 0, sizeof(*status)); + status->state = snd_pcm_dmix_state(pcm); + status->trigger_tstamp = dmix->trigger_tstamp; +- status->tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm); ++ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) ++ status->tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm); ++ else ++ gettimestamp(&status->tstamp); + status->avail = snd_pcm_mmap_playback_avail(pcm); + status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max; + dmix->avail_max = 0; +@@ -525,7 +525,6 @@ static int snd_pcm_dmix_start(snd_pcm_t + { + snd_pcm_direct_t *dmix = pcm->private_data; + snd_pcm_sframes_t avail; +- struct timeval tv; + int err; + + if (dmix->state != SND_PCM_STATE_PREPARED) +@@ -540,9 +539,7 @@ static int snd_pcm_dmix_start(snd_pcm_t + return err; + snd_pcm_dmix_sync_area(pcm); + } +- gettimeofday(&tv, 0); +- dmix->trigger_tstamp.tv_sec = tv.tv_sec; +- dmix->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dmix->trigger_tstamp); + return 0; + } + +@@ -652,9 +649,10 @@ static int snd_pcm_dmix_close(snd_pcm_t if (dmix->client) snd_pcm_direct_client_discard(dmix); shm_sum_discard(dmix); @@ -1301,9 +3903,533 @@ diff -r 9e2f117f24b9 src/pcm/pcm_dmix.c snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); free(dmix->bindings); pcm->private_data = NULL; +diff -r 9e2f117f24b9 src/pcm/pcm_dshare.c +--- a/src/pcm/pcm_dshare.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_dshare.c Fri Nov 30 18:33:19 2007 +0100 +@@ -194,11 +194,8 @@ static int snd_pcm_dshare_sync_ptr(snd_p + if (avail > dshare->avail_max) + dshare->avail_max = avail; + if (avail >= pcm->stop_threshold) { +- struct timeval tv; + snd_timer_stop(dshare->timer); +- gettimeofday(&tv, 0); +- dshare->trigger_tstamp.tv_sec = tv.tv_sec; +- dshare->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dshare->trigger_tstamp); + if (dshare->state == SND_PCM_STATE_RUNNING) { + dshare->state = SND_PCM_STATE_XRUN; + return -EPIPE; +@@ -229,7 +226,10 @@ static int snd_pcm_dshare_status(snd_pcm + memset(status, 0, sizeof(*status)); + status->state = snd_pcm_state(dshare->spcm); + status->trigger_tstamp = dshare->trigger_tstamp; +- status->tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm); ++ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) ++ status->tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm); ++ else ++ gettimestamp(&status->tstamp); + status->avail = snd_pcm_mmap_playback_avail(pcm); + status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max; + dshare->avail_max = 0; +@@ -335,7 +335,6 @@ static int snd_pcm_dshare_start(snd_pcm_ + { + snd_pcm_direct_t *dshare = pcm->private_data; + snd_pcm_sframes_t avail; +- struct timeval tv; + int err; + + if (dshare->state != SND_PCM_STATE_PREPARED) +@@ -350,9 +349,7 @@ static int snd_pcm_dshare_start(snd_pcm_ + return err; + snd_pcm_dshare_sync_area(pcm); + } +- gettimeofday(&tv, 0); +- dshare->trigger_tstamp.tv_sec = tv.tv_sec; +- dshare->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dshare->trigger_tstamp); + return 0; + } + +diff -r 9e2f117f24b9 src/pcm/pcm_dsnoop.c +--- a/src/pcm/pcm_dsnoop.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_dsnoop.c Fri Nov 30 18:33:19 2007 +0100 +@@ -141,10 +141,7 @@ static int snd_pcm_dsnoop_sync_ptr(snd_p + if (pcm->stop_threshold >= pcm->boundary) /* don't care */ + return 0; + if ((avail = snd_pcm_mmap_capture_hw_avail(pcm)) >= pcm->stop_threshold) { +- struct timeval tv; +- gettimeofday(&tv, 0); +- dsnoop->trigger_tstamp.tv_sec = tv.tv_sec; +- dsnoop->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dsnoop->trigger_tstamp); + dsnoop->state = SND_PCM_STATE_XRUN; + dsnoop->avail_max = avail; + return -EPIPE; +@@ -175,7 +172,10 @@ static int snd_pcm_dsnoop_status(snd_pcm + state = snd_pcm_state(dsnoop->spcm); + status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; + status->trigger_tstamp = dsnoop->trigger_tstamp; +- status->tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm); ++ if (pcm->tstamp_mode == SND_PCM_TSTAMP_MMAP) ++ status->tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm); ++ else ++ gettimestamp(&status->tstamp); + status->avail = snd_pcm_mmap_capture_avail(pcm); + status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max; + dsnoop->avail_max = 0; +@@ -264,7 +264,6 @@ static int snd_pcm_dsnoop_start(snd_pcm_ + static int snd_pcm_dsnoop_start(snd_pcm_t *pcm) + { + snd_pcm_direct_t *dsnoop = pcm->private_data; +- struct timeval tv; + int err; + + if (dsnoop->state != SND_PCM_STATE_PREPARED) +@@ -275,9 +274,7 @@ static int snd_pcm_dsnoop_start(snd_pcm_ + if (err < 0) + return err; + dsnoop->state = SND_PCM_STATE_RUNNING; +- gettimeofday(&tv, 0); +- dsnoop->trigger_tstamp.tv_sec = tv.tv_sec; +- dsnoop->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&dsnoop->trigger_tstamp); + return 0; + } + +diff -r 9e2f117f24b9 src/pcm/pcm_empty.c +--- a/src/pcm/pcm_empty.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_empty.c Fri Nov 30 18:33:19 2007 +0100 +@@ -100,7 +100,8 @@ int _snd_pcm_empty_open(snd_pcm_t **pcmp + err = snd_pcm_slave_conf(root, slave, &sconf, 0); + if (err < 0) + return err; +- err = snd_pcm_open_slave(pcmp, root, sconf, stream, mode, conf); ++ err = snd_pcm_open_named_slave(pcmp, name, root, sconf, stream, ++ mode, conf); + snd_config_delete(sconf); + return err; + } +diff -r 9e2f117f24b9 src/pcm/pcm_ext_parm.h +--- a/src/pcm/pcm_ext_parm.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_ext_parm.h Fri Nov 30 18:33:19 2007 +0100 +@@ -19,6 +19,20 @@ static inline snd_interval_t *hw_param_i + return ¶ms->intervals[var - SND_PCM_HW_PARAM_FIRST_INTERVAL]; + } + ++/* make local functions really local */ ++#define snd_ext_parm_set_minmax \ ++ snd1_ext_parm_set_minmax ++#define snd_ext_parm_set_list \ ++ snd1_ext_parm_set_list ++#define snd_ext_parm_clear \ ++ snd1_ext_parm_clear ++#define snd_interval_list \ ++ snd1_interval_list ++#define snd_ext_parm_interval_refine \ ++ snd1_ext_parm_interval_refine ++#define snd_ext_parm_mask_refine \ ++ snd1_ext_parm_mask_refine ++ + int snd_ext_parm_set_minmax(struct snd_ext_parm *parm, unsigned int min, unsigned int max); + int snd_ext_parm_set_list(struct snd_ext_parm *parm, unsigned int num_list, const unsigned int *list); + void snd_ext_parm_clear(struct snd_ext_parm *parm); +diff -r 9e2f117f24b9 src/pcm/pcm_generic.h +--- a/src/pcm/pcm_generic.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_generic.h Fri Nov 30 18:33:19 2007 +0100 +@@ -23,6 +23,82 @@ typedef struct { + snd_pcm_t *slave; + int close_slave; + } snd_pcm_generic_t; ++ ++/* make local functions really local */ ++#define snd_pcm_generic_close \ ++ snd1_pcm_generic_close ++#define snd_pcm_generic_nonblock \ ++ snd1_pcm_generic_nonblock ++#define snd_pcm_generic_async \ ++ snd1_pcm_generic_async ++#define snd_pcm_generic_poll_descriptors_count \ ++ snd1_pcm_generic_poll_descriptors_count ++#define snd_pcm_generic_poll_descriptors \ ++ snd1_pcm_generic_poll_descriptors ++#define snd_pcm_generic_poll_revents \ ++ snd1_pcm_generic_poll_revents ++#define snd_pcm_generic_info \ ++ snd1_pcm_generic_info ++#define snd_pcm_generic_hw_free \ ++ snd1_pcm_generic_hw_free ++#define snd_pcm_generic_sw_params \ ++ snd1_pcm_generic_sw_params ++#define snd_pcm_generic_hw_refine \ ++ snd1_pcm_generic_hw_refine ++#define snd_pcm_generic_hw_params \ ++ snd1_pcm_generic_hw_params ++#define snd_pcm_generic_channel_info \ ++ snd1_pcm_generic_channel_info ++#define snd_pcm_generic_channel_info_no_buffer \ ++ snd1_pcm_generic_channel_info_no_buffer ++#define snd_pcm_generic_status \ ++ snd1_pcm_generic_status ++#define snd_pcm_generic_state \ ++ snd1_pcm_generic_state ++#define snd_pcm_generic_prepare \ ++ snd1_pcm_generic_prepare ++#define snd_pcm_generic_hwsync \ ++ snd1_pcm_generic_hwsync ++#define snd_pcm_generic_reset \ ++ snd1_pcm_generic_reset ++#define snd_pcm_generic_start \ ++ snd1_pcm_generic_start ++#define snd_pcm_generic_drop \ ++ snd1_pcm_generic_drop ++#define snd_pcm_generic_drain \ ++ snd1_pcm_generic_drain ++#define snd_pcm_generic_pause \ ++ snd1_pcm_generic_pause ++#define snd_pcm_generic_resume \ ++ snd1_pcm_generic_resume ++#define snd_pcm_generic_delay \ ++ snd1_pcm_generic_delay ++#define snd_pcm_generic_forward \ ++ snd1_pcm_generic_forward ++#define snd_pcm_generic_rewind \ ++ snd1_pcm_generic_rewind ++#define snd_pcm_generic_link \ ++ snd1_pcm_generic_link ++#define snd_pcm_generic_link_slaves \ ++ snd1_pcm_generic_link_slaves ++#define snd_pcm_generic_unlink \ ++ snd1_pcm_generic_unlink ++#define snd_pcm_generic_writei \ ++ snd1_pcm_generic_writei ++#define snd_pcm_generic_writen \ ++ snd1_pcm_generic_writen ++#define snd_pcm_generic_readi \ ++ snd1_pcm_generic_readi ++#define snd_pcm_generic_readn \ ++ snd1_pcm_generic_readn ++#define snd_pcm_generic_mmap_commit \ ++ snd1_pcm_generic_mmap_commit ++#define snd_pcm_generic_avail_update \ ++ snd1_pcm_generic_avail_update ++#define snd_pcm_generic_mmap \ ++ snd1_pcm_generic_mmap ++#define snd_pcm_generic_munmap \ ++ snd1_pcm_generic_munmap + + int snd_pcm_generic_close(snd_pcm_t *pcm); + int snd_pcm_generic_nonblock(snd_pcm_t *pcm, int nonblock); +diff -r 9e2f117f24b9 src/pcm/pcm_ioplug.c +--- a/src/pcm/pcm_ioplug.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_ioplug.c Fri Nov 30 18:33:19 2007 +0100 +@@ -313,7 +313,7 @@ static int snd_pcm_ioplug_hw_refine(snd_ + if (err < 0) + return err; + change2 |= err; +- /* periods = buffer_bytes / periods */ ++ /* periods = buffer_bytes / period_bytes */ + err = rule_div(params, SND_PCM_HW_PARAM_PERIODS, + SND_PCM_HW_PARAM_BUFFER_BYTES, + SND_PCM_HW_PARAM_PERIOD_BYTES); +@@ -340,6 +340,26 @@ static int snd_pcm_ioplug_hw_refine(snd_ + err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_BUFFER_TIME, + SND_PCM_HW_PARAM_BUFFER_SIZE, + SND_PCM_HW_PARAM_BUFFER_BYTES); ++ if (err < 0) ++ return err; ++ } ++ ++ /* period_bytes = buffer_bytes / periods */ ++ err = rule_div(params, SND_PCM_HW_PARAM_PERIOD_BYTES, ++ SND_PCM_HW_PARAM_BUFFER_BYTES, ++ SND_PCM_HW_PARAM_PERIODS); ++ if (err < 0) ++ return err; ++ if (err) { ++ /* update period_size and period_time */ ++ change |= err; ++ err = snd_ext_parm_interval_refine(hw_param_interval(params, SND_PCM_HW_PARAM_PERIOD_BYTES), ++ io->params, SND_PCM_IOPLUG_HW_PERIOD_BYTES); ++ if (err < 0) ++ return err; ++ err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_PERIOD_TIME, ++ SND_PCM_HW_PARAM_PERIOD_SIZE, ++ SND_PCM_HW_PARAM_PERIOD_BYTES); + if (err < 0) + return err; + } +@@ -418,7 +438,6 @@ static int snd_pcm_ioplug_start(snd_pcm_ + static int snd_pcm_ioplug_start(snd_pcm_t *pcm) + { + ioplug_priv_t *io = pcm->private_data; +- struct timeval tv; + int err; + + if (io->data->state != SND_PCM_STATE_PREPARED) +@@ -428,9 +447,7 @@ static int snd_pcm_ioplug_start(snd_pcm_ + if (err < 0) + return err; + +- gettimeofday(&tv, 0); +- io->trigger_tstamp.tv_sec = tv.tv_sec; +- io->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&io->trigger_tstamp); + io->data->state = SND_PCM_STATE_RUNNING; + + return 0; +@@ -439,16 +456,13 @@ static int snd_pcm_ioplug_drop(snd_pcm_t + static int snd_pcm_ioplug_drop(snd_pcm_t *pcm) + { + ioplug_priv_t *io = pcm->private_data; +- struct timeval tv; + + if (io->data->state == SND_PCM_STATE_OPEN) + return -EBADFD; + + io->data->callback->stop(io->data); + +- gettimeofday(&tv, 0); +- io->trigger_tstamp.tv_sec = tv.tv_sec; +- io->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&io->trigger_tstamp); + io->data->state = SND_PCM_STATE_SETUP; + + return 0; +diff -r 9e2f117f24b9 src/pcm/pcm_local.h +--- a/src/pcm/pcm_local.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_local.h Fri Nov 30 18:33:19 2007 +0100 +@@ -226,6 +226,116 @@ struct _snd_pcm { + void *private_data; + struct list_head async_handlers; + }; ++ ++/* make local functions really local */ ++/* Grrr, these cannot be local - a bad aserver uses them! ++#define snd_pcm_async \ ++ snd1_pcm_async ++#define snd_pcm_mmap \ ++ snd1_pcm_mmap ++#define snd_pcm_munmap \ ++ snd1_pcm_munmap ++#define snd_pcm_hw_refine \ ++ snd1_pcm_hw_refine ++*/ ++#define snd_pcm_new \ ++ snd1_pcm_new ++#define snd_pcm_free \ ++ snd1_pcm_free ++#define snd_pcm_areas_from_buf \ ++ snd1_pcm_areas_from_buf ++#define snd_pcm_areas_from_bufs \ ++ snd1_pcm_areas_from_bufs ++#define snd_pcm_open_named_slave \ ++ snd1_pcm_open_named_slave ++#define snd_pcm_conf_generic_id \ ++ snd1_pcm_conf_generic_id ++#define snd_pcm_hw_open_fd \ ++ snd1_pcm_hw_open_fd ++#define snd_pcm_wait_nocheck \ ++ snd1_pcm_wait_nocheck ++#define snd_pcm_rate_get_default_converter \ ++ snd1_pcm_rate_get_default_converter ++#define snd_pcm_set_hw_ptr \ ++ snd1_pcm_set_hw_ptr ++#define snd_pcm_set_appl_ptr \ ++ snd1_pcm_set_appl_ptr ++#define snd_pcm_link_hw_ptr \ ++ snd1_pcm_link_hw_ptr ++#define snd_pcm_link_appl_ptr \ ++ snd1_pcm_link_appl_ptr ++#define snd_pcm_unlink_hw_ptr \ ++ snd1_pcm_unlink_hw_ptr ++#define snd_pcm_unlink_appl_ptr \ ++ snd1_pcm_unlink_appl_ptr ++#define snd_pcm_mmap_appl_ptr \ ++ snd1_pcm_mmap_appl_ptr ++#define snd_pcm_mmap_appl_backward \ ++ snd1_pcm_mmap_appl_backward ++#define snd_pcm_mmap_appl_forward \ ++ snd1_pcm_mmap_appl_forward ++#define snd_pcm_mmap_hw_backward \ ++ snd1_pcm_mmap_hw_backward ++#define snd_pcm_mmap_hw_forward \ ++ snd1_pcm_mmap_hw_forward ++#define snd_pcm_read_areas \ ++ snd1_pcm_read_areas ++#define snd_pcm_write_areas \ ++ snd1_pcm_write_areas ++#define snd_pcm_read_mmap \ ++ snd1_pcm_read_mmap ++#define snd_pcm_write_mmap \ ++ snd1_pcm_write_mmap ++#define snd_pcm_channel_info_shm \ ++ snd1_pcm_channel_info_shm ++#define snd_pcm_hw_refine_soft \ ++ snd1_pcm_hw_refine_soft ++#define snd_pcm_hw_refine_slave \ ++ snd1_pcm_hw_refine_slave ++#define snd_pcm_hw_params_slave \ ++ snd1_pcm_hw_params_slave ++#define snd_pcm_hw_param_refine_near \ ++ snd1_pcm_hw_param_refine_near ++#define snd_pcm_hw_param_refine_multiple \ ++ snd1_pcm_hw_param_refine_multiple ++#define snd_pcm_hw_param_empty \ ++ snd1_pcm_hw_param_empty ++#define snd_pcm_hw_param_always_eq \ ++ snd1_pcm_hw_param_always_eq ++#define snd_pcm_hw_param_never_eq \ ++ snd1_pcm_hw_param_never_eq ++#define snd_pcm_hw_param_get_mask \ ++ snd1_pcm_hw_param_get_mask ++#define snd_pcm_hw_param_get_interval \ ++ snd1_pcm_hw_param_get_interval ++#define snd_pcm_hw_param_any \ ++ snd1_pcm_hw_param_any ++#define snd_pcm_hw_param_set_integer \ ++ snd1_pcm_hw_param_set_integer ++#define snd_pcm_hw_param_set_first \ ++ snd1_pcm_hw_param_set_first ++#define snd_pcm_hw_param_set_last \ ++ snd1_pcm_hw_param_set_last ++#define snd_pcm_hw_param_set_near \ ++ snd1_pcm_hw_param_set_near ++#define snd_pcm_hw_param_set_min \ ++ snd1_pcm_hw_param_set_min ++#define snd_pcm_hw_param_set_max \ ++ snd1_pcm_hw_param_set_max ++#define snd_pcm_hw_param_set_minmax \ ++ snd1_pcm_hw_param_set_minmax ++#define snd_pcm_hw_param_set \ ++ snd1_pcm_hw_param_set ++#define snd_pcm_hw_param_set_mask \ ++ snd1_pcm_hw_param_set_mask ++#define snd_pcm_hw_param_get \ ++ snd1_pcm_hw_param_get ++#define snd_pcm_hw_param_get_min \ ++ snd1_pcm_hw_param_get_min ++#define snd_pcm_hw_param_get_max \ ++ snd1_pcm_hw_param_get_max ++#define snd_pcm_hw_param_name \ ++ snd1_pcm_hw_param_name + + int snd_pcm_new(snd_pcm_t **pcmp, snd_pcm_type_t type, const char *name, + snd_pcm_stream_t stream, int mode); +@@ -749,9 +859,18 @@ int snd_pcm_slave_conf(snd_config_t *roo + + #define SND_PCM_APPEND (1<<8) + +-int snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root, +- snd_config_t *conf, snd_pcm_stream_t stream, +- int mode, snd_config_t *parent_conf); ++int snd_pcm_open_named_slave(snd_pcm_t **pcmp, const char *name, ++ snd_config_t *root, ++ snd_config_t *conf, snd_pcm_stream_t stream, ++ int mode, snd_config_t *parent_conf); ++static inline int ++snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root, ++ snd_config_t *conf, snd_pcm_stream_t stream, ++ int mode, snd_config_t *parent_conf) ++{ ++ return snd_pcm_open_named_slave(pcmp, NULL, root, conf, stream, ++ mode, parent_conf); ++} + int snd_pcm_conf_generic_id(const char *id); + + int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name, int fd, int mmap_emulation, int sync_ptr_ioctl); +@@ -838,3 +957,13 @@ typedef union snd_tmp_double { + double d; + int64_t l; + } snd_tmp_double_t; ++ ++/* get the current timestamp */ ++static inline void gettimestamp(snd_htimestamp_t *tstamp) ++{ ++ struct timeval tv; ++ ++ gettimeofday(&tv, 0); ++ tstamp->tv_sec = tv.tv_sec; ++ tstamp->tv_nsec = tv.tv_usec * 1000L; ++} +diff -r 9e2f117f24b9 src/pcm/pcm_multi.c +--- a/src/pcm/pcm_multi.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_multi.c Fri Nov 30 18:33:19 2007 +0100 +@@ -690,13 +690,44 @@ static snd_pcm_sframes_t snd_pcm_multi_m + return size; + } + +-static int snd_pcm_multi_mmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED) ++static int snd_pcm_multi_munmap(snd_pcm_t *pcm) + { ++ free(pcm->mmap_channels); ++ free(pcm->running_areas); ++ pcm->mmap_channels = NULL; ++ pcm->running_areas = NULL; + return 0; + } + +-static int snd_pcm_multi_munmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED) ++static int snd_pcm_multi_mmap(snd_pcm_t *pcm) + { ++ snd_pcm_multi_t *multi = pcm->private_data; ++ unsigned int c; ++ ++ pcm->mmap_channels = calloc(pcm->channels, ++ sizeof(pcm->mmap_channels[0])); ++ pcm->running_areas = calloc(pcm->channels, ++ sizeof(pcm->running_areas[0])); ++ if (!pcm->mmap_channels || !pcm->running_areas) { ++ snd_pcm_multi_munmap(pcm); ++ return -ENOMEM; ++ } ++ ++ /* Copy the slave mmapped buffer data */ ++ for (c = 0; c < pcm->channels; c++) { ++ snd_pcm_multi_channel_t *chan = &multi->channels[c]; ++ snd_pcm_t *slave; ++ if (chan->slave_idx < 0) { ++ snd_pcm_multi_munmap(pcm); ++ return -ENXIO; ++ } ++ slave = multi->slaves[chan->slave_idx].pcm; ++ pcm->mmap_channels[c] = ++ slave->mmap_channels[chan->slave_channel]; ++ pcm->mmap_channels[c].channel = c; ++ pcm->running_areas[c] = ++ slave->running_areas[chan->slave_channel]; ++ } + return 0; + } + +@@ -850,6 +881,7 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, + return err; + } + pcm->mmap_rw = 1; ++ pcm->mmap_shadow = 1; /* has own mmap method */ + pcm->ops = &snd_pcm_multi_ops; + pcm->fast_ops = &snd_pcm_multi_fast_ops; + pcm->private_data = multi; +diff -r 9e2f117f24b9 src/pcm/pcm_null.c +--- a/src/pcm/pcm_null.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_null.c Fri Nov 30 18:33:19 2007 +0100 +@@ -82,13 +82,10 @@ static int snd_pcm_null_status(snd_pcm_t + static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + { + snd_pcm_null_t *null = pcm->private_data; +- struct timeval tv; + memset(status, 0, sizeof(*status)); + status->state = null->state; + status->trigger_tstamp = null->trigger_tstamp; +- gettimeofday(&tv, 0); +- status->tstamp.tv_sec = tv.tv_sec; +- status->tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&status->tstamp); + status->avail = pcm->buffer_size; + status->avail_max = status->avail; + return 0; diff -r 9e2f117f24b9 src/pcm/pcm_params.c --- a/src/pcm/pcm_params.c Mon Oct 15 10:36:46 2007 +0200 -+++ b/src/pcm/pcm_params.c Fri Oct 26 02:01:39 2007 +0200 ++++ b/src/pcm/pcm_params.c Fri Nov 30 18:33:19 2007 +0100 @@ -78,31 +78,14 @@ static inline int hw_is_interval(snd_pcm var <= SND_PCM_HW_PARAM_LAST_INTERVAL; } @@ -1342,3 +4468,713 @@ diff -r 9e2f117f24b9 src/pcm/pcm_params.c static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var) { +diff -r 9e2f117f24b9 src/pcm/pcm_plugin.h +--- a/src/pcm/pcm_plugin.h Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_plugin.h Fri Nov 30 18:33:19 2007 +0100 +@@ -51,6 +51,16 @@ typedef struct { + snd_atomic_write_t watom; + } snd_pcm_plugin_t; + ++/* make local functions really local */ ++#define snd_pcm_plugin_init \ ++ snd1_pcm_plugin_init ++#define snd_pcm_plugin_fast_ops \ ++ snd1_pcm_plugin_fast_ops ++#define snd_pcm_plugin_undo_read_generic \ ++ snd1_pcm_plugin_undo_read_generic ++#define snd_pcm_plugin_undo_write_generic \ ++ snd1_pcm_plugin_undo_write_generic ++ + void snd_pcm_plugin_init(snd_pcm_plugin_t *plugin); + + extern snd_pcm_fast_ops_t snd_pcm_plugin_fast_ops; +@@ -68,6 +78,21 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_wr + snd_pcm_uframes_t res_offset, /* offset of result areas */ + snd_pcm_uframes_t res_size, /* size of result areas */ + snd_pcm_uframes_t slave_undo_size); ++ ++/* make local functions really local */ ++#define snd_pcm_linear_get_index snd1_pcm_linear_get_index ++#define snd_pcm_linear_put_index snd1_pcm_linear_put_index ++#define snd_pcm_linear_get32_index snd1_pcm_linear_get32_index ++#define snd_pcm_linear_put32_index snd1_pcm_linear_put32_index ++#define snd_pcm_linear_convert_index snd1_pcm_linear_convert_index ++#define snd_pcm_linear_convert snd1_pcm_linear_convert ++#define snd_pcm_linear_getput snd1_pcm_linear_getput ++#define snd_pcm_alaw_decode snd1_pcm_alaw_decode ++#define snd_pcm_alaw_encode snd1_pcm_alaw_encode ++#define snd_pcm_mulaw_decode snd1_pcm_mulaw_decode ++#define snd_pcm_mulaw_encode snd1_pcm_mulaw_encode ++#define snd_pcm_adpcm_decode snd1_pcm_adpcm_decode ++#define snd_pcm_adpcm_encode snd1_pcm_adpcm_encode + + int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format); + int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format); +diff -r 9e2f117f24b9 src/pcm/pcm_rate.c +--- a/src/pcm/pcm_rate.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_rate.c Fri Nov 30 18:33:19 2007 +0100 +@@ -715,38 +715,6 @@ static snd_pcm_sframes_t snd_pcm_rate_fo + return n; + } + +-static int snd_pcm_rate_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space) +-{ +- snd_pcm_rate_t *rate = pcm->private_data; +- snd_pcm_uframes_t avail_min; +- int ret, err; +- +- ret = snd_pcm_generic_poll_descriptors(pcm, pfds, space); +- if (ret < 0) +- return ret; +- +- avail_min = rate->appl_ptr % pcm->period_size; +- if (avail_min > 0) { +- recalc(pcm, &avail_min); +- if (avail_min < rate->gen.slave->buffer_size && +- avail_min != rate->gen.slave->period_size) +- avail_min++; /* 1st small little rounding correction */ +- if (avail_min < rate->gen.slave->buffer_size && +- avail_min != rate->gen.slave->period_size) +- avail_min++; /* 2nd small little rounding correction */ +- avail_min += rate->orig_avail_min; +- } else { +- avail_min = rate->orig_avail_min; +- } +- if (rate->sw_params.avail_min == avail_min) +- return ret; +- rate->sw_params.avail_min = avail_min; +- err = snd_pcm_sw_params(rate->gen.slave, &rate->sw_params); +- if (err < 0) +- return err; +- return ret; +-} +- + static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate, + snd_pcm_uframes_t appl_offset, + snd_pcm_uframes_t size, +@@ -1122,7 +1090,6 @@ static int snd_pcm_rate_start(snd_pcm_t + { + snd_pcm_rate_t *rate = pcm->private_data; + snd_pcm_uframes_t avail; +- struct timeval tv; + + if (pcm->stream == SND_PCM_STREAM_CAPTURE) + return snd_pcm_start(rate->gen.slave); +@@ -1130,9 +1097,7 @@ static int snd_pcm_rate_start(snd_pcm_t + if (snd_pcm_state(rate->gen.slave) != SND_PCM_STATE_PREPARED) + return -EBADFD; + +- gettimeofday(&tv, 0); +- rate->trigger_tstamp.tv_sec = tv.tv_sec; +- rate->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&rate->trigger_tstamp); + + avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave); + if (avail == 0) { +@@ -1229,7 +1194,7 @@ static snd_pcm_fast_ops_t snd_pcm_rate_f + .avail_update = snd_pcm_rate_avail_update, + .mmap_commit = snd_pcm_rate_mmap_commit, + .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count, +- .poll_descriptors = snd_pcm_rate_poll_descriptors, ++ .poll_descriptors = snd_pcm_generic_poll_descriptors, + .poll_revents = snd_pcm_rate_poll_revents, + }; + +diff -r 9e2f117f24b9 src/pcm/pcm_share.c +--- a/src/pcm/pcm_share.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_share.c Fri Nov 30 18:33:19 2007 +0100 +@@ -914,7 +914,6 @@ static int snd_pcm_share_start(snd_pcm_t + snd_pcm_share_t *share = pcm->private_data; + snd_pcm_share_slave_t *slave = share->slave; + snd_pcm_t *spcm = slave->pcm; +- struct timeval tv; + int err = 0; + if (share->state != SND_PCM_STATE_PREPARED) + return -EBADFD; +@@ -970,9 +969,7 @@ static int snd_pcm_share_start(snd_pcm_t + } + slave->running_count++; + _snd_pcm_share_update(pcm); +- gettimeofday(&tv, 0); +- share->trigger_tstamp.tv_sec = tv.tv_sec; +- share->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&share->trigger_tstamp); + _end: + Pthread_mutex_unlock(&slave->mutex); + return err; +@@ -1099,16 +1096,13 @@ static void _snd_pcm_share_stop(snd_pcm_ + { + snd_pcm_share_t *share = pcm->private_data; + snd_pcm_share_slave_t *slave = share->slave; +- struct timeval tv; + #if 0 + if (!pcm->mmap_channels) { + /* PCM closing already begun in the main thread */ + return; + } + #endif +- gettimeofday(&tv, 0); +- share->trigger_tstamp.tv_sec = tv.tv_sec; +- share->trigger_tstamp.tv_nsec = tv.tv_usec * 1000L; ++ gettimestamp(&share->trigger_tstamp); + if (pcm->stream == SND_PCM_STREAM_CAPTURE) { + snd_pcm_areas_copy(pcm->stopped_areas, 0, + pcm->running_areas, 0, +diff -r 9e2f117f24b9 src/pcm/pcm_softvol.c +--- a/src/pcm/pcm_softvol.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/pcm/pcm_softvol.c Fri Nov 30 18:33:19 2007 +0100 +@@ -782,6 +782,8 @@ int snd_pcm_softvol_open(snd_pcm_t **pcm + if (err > 0) { /* hardware control - no need for softvol! */ + softvol_free(svol); + *pcmp = slave; /* just pass the slave */ ++ if (!slave->name) ++ slave->name = strdup(name); + return 0; + } + +diff -r 9e2f117f24b9 src/seq/Makefile.am +--- a/src/seq/Makefile.am Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/seq/Makefile.am Fri Nov 30 18:33:19 2007 +0100 +@@ -2,6 +2,9 @@ EXTRA_LTLIBRARIES=libseq.la + + libseq_la_SOURCES = seq_hw.c seq.c seq_event.c seqmid.c seq_midi_event.c \ + seq_symbols.c ++if KEEP_OLD_SYMBOLS ++libseq_la_SOURCES += seq_old.c ++endif + noinst_HEADERS = seq_local.h + + all: libseq.la +diff -r 9e2f117f24b9 src/seq/seq.c +--- a/src/seq/seq.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/seq/seq.c Fri Nov 30 18:33:19 2007 +0100 +@@ -2178,9 +2178,6 @@ void snd_seq_port_info_set_timestamp_que + * - #SND_SEQ_PORT_TYPE_MIDI_GS GS compatible device + * - #SND_SEQ_PORT_TYPE_MIDI_XG XG compatible device + * - #SND_SEQ_PORT_TYPE_MIDI_MT32 MT-32 compatible device +- * - #SND_SEQ_PORT_TYPE_SYNTH Understands SND_SEQ_EVENT_SAMPLE_xxx messages +- * - #SND_SEQ_PORT_TYPE_DIRECT_SAMPLE Supports SND_SEQ_EVENT_INSTR_xxx messages sent directly +- * - #SND_SEQ_PORT_TYPE_SAMPLE Supports SND_SEQ_EVENT_INSTR_xxx messages + * - #SND_SEQ_PORT_TYPE_HARDWARE Implemented in hardware + * - #SND_SEQ_PORT_TYPE_SOFTWARE Implemented in software + * - #SND_SEQ_PORT_TYPE_SYNTHESIZER Generates sound +@@ -4684,265 +4681,3 @@ int snd_seq_get_bit(int nr, void *array) + { + return ((((unsigned int *)array)[nr >> 5]) & (1UL << (nr & 31))) ? 1 : 0; + } +- +- +-/** +- * instrument layer +- */ +- +-/** +- * \brief get size of #snd_instr_header_t +- * \return size in bytes +- */ +-size_t snd_instr_header_sizeof(void) +-{ +- return sizeof(snd_instr_header_t); +-} +- +-/** +- * \brief allocate an empty #snd_instr_header_t using standard malloc +- * \param ptr returned pointer +- * \param len additional data length +- * \return 0 on success otherwise negative error code +- */ +-int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len) +-{ +- assert(ptr); +- *ptr = calloc(1, sizeof(snd_instr_header_t) + len); +- if (!*ptr) +- return -ENOMEM; +- (*ptr)->len = len; +- return 0; +-} +- +-/** +- * \brief frees a previously allocated #snd_instr_header_t +- * \param obj poitner to object to free +- */ +-void snd_instr_header_free(snd_instr_header_t *obj) +-{ +- free(obj); +-} +- +-/** +- * \brief copy one #snd_instr_header_t to another +- * \param dst pointer to destination +- * \param src pointer to source +- */ +-void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src) +-{ +- assert(dst && src); +- *dst = *src; +-} +- +-/** +- * \brief Get the instrument id of an instr_header container +- * \param info instr_header container +- * \return instrument id pointer +- */ +-const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info) +-{ +- assert(info); +- return &info->id.instr; +-} +- +-/** +- * \brief Get the cluster id of an instr_header container +- * \param info instr_header container +- * \return cluster id +- */ +-snd_seq_instr_cluster_t snd_instr_header_get_cluster(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->id.cluster; +-} +- +-/** +- * \brief Get the command of an instr_header container +- * \param info instr_header container +- * \return command type +- */ +-unsigned int snd_instr_header_get_cmd(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->cmd; +-} +- +-/** +- * \brief Get the length of extra data of an instr_header container +- * \param info instr_header container +- * \return the length in bytes +- */ +-size_t snd_instr_header_get_len(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->len; +-} +- +-/** +- * \brief Get the data name of an instr_header container +- * \param info instr_header container +- * \return the name string +- */ +-const char *snd_instr_header_get_name(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->data.name; +-} +- +-/** +- * \brief Get the data type of an instr_header container +- * \param info instr_header container +- * \return the data type +- */ +-int snd_instr_header_get_type(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->data.type; +-} +- +-/** +- * \brief Get the data format of an instr_header container +- * \param info instr_header container +- * \return the data format string +- */ +-const char *snd_instr_header_get_format(const snd_instr_header_t *info) +-{ +- assert(info); +- return info->data.data.format; +-} +- +-/** +- * \brief Get the data alias of an instr_header container +- * \param info instr_header container +- * \return the data alias id +- */ +-const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info) +-{ +- assert(info); +- return &info->data.data.alias; +-} +- +-/** +- * \brief Get the extra data pointer of an instr_header container +- * \param info instr_header container +- * \return the extra data pointer +- */ +-void *snd_instr_header_get_data(const snd_instr_header_t *info) +-{ +- assert(info); +- return (void*)((char*)info + sizeof(*info)); +-} +- +-/** +- * \brief Get the flag to follow alias of an instr_header container +- * \param info instr_header container +- * \return 1 if follow alias +- */ +-int snd_instr_header_get_follow_alias(const snd_instr_header_t *info) +-{ +- assert(info); +- return (info->flags & SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS) ? 1 : 0; +-} +- +-/** +- * \brief Set the instrument id of an instr_header container +- * \param info instr_header container +- * \param id instrument id pointer +- */ +-void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id) +-{ +- assert(info && id); +- info->id.instr = *id; +-} +- +-/** +- * \brief Set the cluster id of an instr_header container +- * \param info instr_header container +- * \param cluster cluster id +- */ +-void snd_instr_header_set_cluster(snd_instr_header_t *info, snd_seq_instr_cluster_t cluster) +-{ +- assert(info); +- info->id.cluster = cluster; +-} +- +-/** +- * \brief Set the command of an instr_header container +- * \param info instr_header container +- * \param cmd command type +- */ +-void snd_instr_header_set_cmd(snd_instr_header_t *info, unsigned int cmd) +-{ +- assert(info); +- info->cmd = cmd; +-} +- +-/** +- * \brief Set the length of extra data of an instr_header container +- * \param info instr_header container +- * \param len size of extra data in bytes +- */ +-void snd_instr_header_set_len(snd_instr_header_t *info, size_t len) +-{ +- assert(info); +- info->len = len; +-} +- +-/** +- * \brief Set the data name of an instr_header container +- * \param info instr_header container +- * \param name the name string +- */ +-void snd_instr_header_set_name(snd_instr_header_t *info, const char *name) +-{ +- assert(info && name); +- strncpy(info->data.name, name, sizeof(info->data.name)); +-} +- +-/** +- * \brief Set the data type of an instr_header container +- * \param info instr_header container +- * \param type the data type +- */ +-void snd_instr_header_set_type(snd_instr_header_t *info, int type) +-{ +- assert(info); +- info->data.type = type; +-} +- +-/** +- * \brief Set the data format of an instr_header container +- * \param info instr_header container +- * \param format the data format string +- */ +-void snd_instr_header_set_format(snd_instr_header_t *info, const char *format) +-{ +- assert(info && format); +- strncpy(info->data.data.format, format, sizeof(info->data.data.format)); +-} +- +-/** +- * \brief Set the data alias id of an instr_header container +- * \param info instr_header container +- * \param instr alias instrument id +- */ +-void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr) +-{ +- assert(info && instr); +- info->data.data.alias = *instr; +-} +- +-/** +- * \brief Set the flag to follow alias of an instr_header container +- * \param info instr_header container +- * \param val 1 if follow alias +- */ +-void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val) +-{ +- assert(info); +- if (val) +- info->flags |= SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS; +- else +- info->flags &= ~SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS; +-} +diff -r 9e2f117f24b9 src/seq/seq_event.c +--- a/src/seq/seq_event.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/src/seq/seq_event.c Fri Nov 30 18:33:19 2007 +0100 +@@ -37,12 +37,8 @@ const unsigned int snd_seq_event_types[2 + = FIXED_EV(SND_SEQ_EVFLG_MESSAGE), + [SND_SEQ_EVENT_PORT_SUBSCRIBED ... SND_SEQ_EVENT_PORT_UNSUBSCRIBED] + = FIXED_EV(SND_SEQ_EVFLG_CONNECTION), +- [SND_SEQ_EVENT_SAMPLE ... SND_SEQ_EVENT_SAMPLE_PRIVATE1] +- = FIXED_EV(SND_SEQ_EVFLG_SAMPLE), + [SND_SEQ_EVENT_USR0 ... SND_SEQ_EVENT_USR9] + = FIXED_EV(SND_SEQ_EVFLG_RAW) | FIXED_EV(SND_SEQ_EVFLG_USERS), +- [SND_SEQ_EVENT_INSTR_BEGIN ... SND_SEQ_EVENT_INSTR_CHANGE] +- = _SND_SEQ_TYPE(SND_SEQ_EVFLG_INSTR) | _SND_SEQ_TYPE(SND_SEQ_EVFLG_VARUSR), + [SND_SEQ_EVENT_SYSEX ... SND_SEQ_EVENT_BOUNCE] + = _SND_SEQ_TYPE(SND_SEQ_EVFLG_VARIABLE), + [SND_SEQ_EVENT_USR_VAR0 ... SND_SEQ_EVENT_USR_VAR4] +diff -r 9e2f117f24b9 src/seq/seq_old.c +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/src/seq/seq_old.c Fri Nov 30 18:33:19 2007 +0100 +@@ -0,0 +1,222 @@ ++/* ++ * place-holders to keep libasound linkable to old binaries ++ */ ++ ++#ifndef DOXYGEN ++ ++#include "local.h" ++ ++size_t snd_instr_header_sizeof(void) ++{ ++ return 0; ++} ++ ++int snd_instr_header_malloc(void **ptr ATTRIBUTE_UNUSED, ++ size_t len ATTRIBUTE_UNUSED) ++{ ++ return -ENOMEM; ++} ++ ++void snd_instr_header_free(void *obj ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_copy(void *dst ATTRIBUTE_UNUSED, ++ const void *src ATTRIBUTE_UNUSED) ++{ ++} ++ ++const void *snd_instr_header_get_id(const void *info ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++int snd_instr_header_get_cluster(const void *info ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++unsigned int snd_instr_header_get_cmd(const void *info ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++size_t snd_instr_header_get_len(const void *info ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++const char *snd_instr_header_get_name(const void *info ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++int snd_instr_header_get_type(const void *info ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++const char *snd_instr_header_get_format(const void *info ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++const void *snd_instr_header_get_alias(const void *info ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++void *snd_instr_header_get_data(const void *info ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++int snd_instr_header_get_follow_alias(const void *info ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++void snd_instr_header_set_id(void *info ATTRIBUTE_UNUSED, ++ const void *id ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_cluster(void *info ATTRIBUTE_UNUSED, ++ int cluster ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_cmd(void *info ATTRIBUTE_UNUSED, ++ unsigned int cmd ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_len(void *info ATTRIBUTE_UNUSED, ++ size_t len ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_name(void *info ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_type(void *info ATTRIBUTE_UNUSED, ++ int type ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_format(void *info ATTRIBUTE_UNUSED, ++ const char *format ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_alias(void *info ATTRIBUTE_UNUSED, ++ const void *instr ATTRIBUTE_UNUSED) ++{ ++} ++ ++void snd_instr_header_set_follow_alias(void *info ATTRIBUTE_UNUSED, ++ int val ATTRIBUTE_UNUSED) ++{ ++} ++ ++int snd_instr_fm_free(void *fm ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++int snd_instr_fm_convert_to_stream(void *fm ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED, ++ void **__data ATTRIBUTE_UNUSED, ++ size_t *__size ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_fm_convert_from_stream(void *__data ATTRIBUTE_UNUSED, ++ size_t size ATTRIBUTE_UNUSED, ++ void **simple ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++ ++int snd_instr_iwffff_open(void **handle ATTRIBUTE_UNUSED, ++ const char *name_fff ATTRIBUTE_UNUSED, ++ const char *name_dat ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_iwffff_open_rom(void **handle ATTRIBUTE_UNUSED, ++ int card ATTRIBUTE_UNUSED, ++ int bank ATTRIBUTE_UNUSED, ++ int file ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_iwffff_open_rom_file(void **handle ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED, ++ int bank ATTRIBUTE_UNUSED, ++ int file ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_iwffff_close(void *handle ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++int snd_instr_iwffff_free(void *__instr ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++int snd_instr_iwffff_load(void *iwf ATTRIBUTE_UNUSED, ++ int bank ATTRIBUTE_UNUSED, ++ int prg ATTRIBUTE_UNUSED, ++ void **__iwffff ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_iwffff_convert_to_stream(void *iwffff ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED, ++ void **__data ATTRIBUTE_UNUSED, ++ size_t *__size ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_iwffff_convert_from_stream(void *data ATTRIBUTE_UNUSED, ++ size_t size ATTRIBUTE_UNUSED, ++ void **iwffff ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++ ++int snd_instr_simple_free(void *simple ATTRIBUTE_UNUSED) ++{ ++ return 0; ++} ++ ++int snd_instr_simple_convert_to_stream(void *simple ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED, ++ void **__data ATTRIBUTE_UNUSED, ++ size_t *__size ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++int snd_instr_simple_convert_from_stream(void *__data ATTRIBUTE_UNUSED, ++ size_t size ATTRIBUTE_UNUSED, ++ void **simple ATTRIBUTE_UNUSED) ++{ ++ return -ENXIO; ++} ++ ++#endif /* !DOXYGEN */ +diff -r 9e2f117f24b9 test/midiloop.c +--- a/test/midiloop.c Mon Oct 15 10:36:46 2007 +0200 ++++ b/test/midiloop.c Fri Nov 30 18:33:19 2007 +0100 +@@ -133,6 +133,8 @@ int main(int argc, char** argv) + exit(EXIT_FAILURE); + } + ++ snd_rawmidi_nonblock(handle_in, 0); ++ + patsize = writepattern(handle_out, obuf); + gettimeofday(&start, NULL); + patsize = writepattern(handle_out, obuf); diff --git a/alsa-lib-ioplug-fix.diff b/alsa-lib-ioplug-fix.diff deleted file mode 100644 index f001f83..0000000 --- a/alsa-lib-ioplug-fix.diff +++ /dev/null @@ -1,50 +0,0 @@ -# HG changeset patch -# User tiwai -# Date 1194263206 -3600 -# Node ID c82755151f76b40eb0f99dec961b073f450763bb -# Parent 8069595414f25236461492265786670352ac4d3a -ioplug - Fix the refinement of period_* after periods - -When changing only PERIODS after BUFFER_*, ioplug doesn't update -the corresponding PERIOD_* parameters properly. This should fix -ALSA bug#2601. - -diff -r 8069595414f2 -r c82755151f76 src/pcm/pcm_ioplug.c ---- a/src/pcm/pcm_ioplug.c Tue Oct 30 14:28:30 2007 +0100 -+++ b/src/pcm/pcm_ioplug.c Mon Nov 05 12:46:46 2007 +0100 -@@ -313,7 +313,7 @@ static int snd_pcm_ioplug_hw_refine(snd_ - if (err < 0) - return err; - change2 |= err; -- /* periods = buffer_bytes / periods */ -+ /* periods = buffer_bytes / period_bytes */ - err = rule_div(params, SND_PCM_HW_PARAM_PERIODS, - SND_PCM_HW_PARAM_BUFFER_BYTES, - SND_PCM_HW_PARAM_PERIOD_BYTES); -@@ -340,6 +340,26 @@ static int snd_pcm_ioplug_hw_refine(snd_ - err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_BUFFER_TIME, - SND_PCM_HW_PARAM_BUFFER_SIZE, - SND_PCM_HW_PARAM_BUFFER_BYTES); -+ if (err < 0) -+ return err; -+ } -+ -+ /* period_bytes = buffer_bytes / periods */ -+ err = rule_div(params, SND_PCM_HW_PARAM_PERIOD_BYTES, -+ SND_PCM_HW_PARAM_BUFFER_BYTES, -+ SND_PCM_HW_PARAM_PERIODS); -+ if (err < 0) -+ return err; -+ if (err) { -+ /* update period_size and period_time */ -+ change |= err; -+ err = snd_ext_parm_interval_refine(hw_param_interval(params, SND_PCM_HW_PARAM_PERIOD_BYTES), -+ io->params, SND_PCM_IOPLUG_HW_PERIOD_BYTES); -+ if (err < 0) -+ return err; -+ err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_PERIOD_TIME, -+ SND_PCM_HW_PARAM_PERIOD_SIZE, -+ SND_PCM_HW_PARAM_PERIOD_BYTES); - if (err < 0) - return err; - } diff --git a/alsa-lib-multi-mmap-fix.diff b/alsa-lib-multi-mmap-fix.diff deleted file mode 100644 index 37c6878..0000000 --- a/alsa-lib-multi-mmap-fix.diff +++ /dev/null @@ -1,70 +0,0 @@ -# HG changeset patch -# User tiwai -# Date 1195829208 -3600 -# Node ID 672c5387645d33ec98157257b5221476064ac810 -# Parent 3539f279ec3847636ec20110e9237b88382722a9 -Fix mmap with multi plugin - -The mmap of multi plugin seems broken (for a long time!) due to its -creation of local buffer via snd_pcm_mmap(). Since the multi plugin -just needs to shadow the mmap buffer of each slave, it now has -mmap_shadow=1 and its own mmap/unmap method to do shadowing. - -diff -r 3539f279ec38 -r 672c5387645d src/pcm/pcm_multi.c ---- a/src/pcm/pcm_multi.c Wed Nov 21 12:19:43 2007 +0100 -+++ b/src/pcm/pcm_multi.c Fri Nov 23 15:46:48 2007 +0100 -@@ -690,13 +690,44 @@ static snd_pcm_sframes_t snd_pcm_multi_m - return size; - } - --static int snd_pcm_multi_mmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED) -+static int snd_pcm_multi_munmap(snd_pcm_t *pcm) - { -+ free(pcm->mmap_channels); -+ free(pcm->running_areas); -+ pcm->mmap_channels = NULL; -+ pcm->running_areas = NULL; - return 0; - } - --static int snd_pcm_multi_munmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED) -+static int snd_pcm_multi_mmap(snd_pcm_t *pcm) - { -+ snd_pcm_multi_t *multi = pcm->private_data; -+ unsigned int c; -+ -+ pcm->mmap_channels = calloc(pcm->channels, -+ sizeof(pcm->mmap_channels[0])); -+ pcm->running_areas = calloc(pcm->channels, -+ sizeof(pcm->running_areas[0])); -+ if (!pcm->mmap_channels || !pcm->running_areas) { -+ snd_pcm_multi_munmap(pcm); -+ return -ENOMEM; -+ } -+ -+ /* Copy the slave mmapped buffer data */ -+ for (c = 0; c < pcm->channels; c++) { -+ snd_pcm_multi_channel_t *chan = &multi->channels[c]; -+ snd_pcm_t *slave; -+ if (chan->slave_idx < 0) { -+ snd_pcm_multi_munmap(pcm); -+ return -ENXIO; -+ } -+ slave = multi->slaves[chan->slave_idx].pcm; -+ pcm->mmap_channels[c] = -+ slave->mmap_channels[chan->slave_channel]; -+ pcm->mmap_channels[c].channel = c; -+ pcm->running_areas[c] = -+ slave->running_areas[chan->slave_channel]; -+ } - return 0; - } - -@@ -850,6 +881,7 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, - return err; - } - pcm->mmap_rw = 1; -+ pcm->mmap_shadow = 1; /* has own mmap method */ - pcm->ops = &snd_pcm_multi_ops; - pcm->fast_ops = &snd_pcm_multi_fast_ops; - pcm->private_data = multi; diff --git a/alsa-lib-rate-plugin-fix.diff b/alsa-lib-rate-plugin-fix.diff deleted file mode 100644 index c38f99a..0000000 --- a/alsa-lib-rate-plugin-fix.diff +++ /dev/null @@ -1,66 +0,0 @@ -# HG changeset patch -# User tiwai -# Date 1194865276 -3600 -# Node ID 95e6e03f2e9d147a6f557de4e4f33d4f865502b8 -# Parent 93f4991e860b4eb310183c3a73331ca209e8f2c9 -Remove ugly hack in rate plugin poll_descriptors callback - -The rate plugin has ugly hacks in poll_descriptors callback to adjust -avail_min when partial read/write occurs. This causes often unexpected -problems like XRUNs, especially with two-period cases. - -Let's remove that beast, it's rather harmful than useful. - -Signed-off-by: Stas Sergeev - -diff -r 93f4991e860b -r 95e6e03f2e9d src/pcm/pcm_rate.c ---- a/src/pcm/pcm_rate.c Mon Nov 12 08:50:08 2007 +0100 -+++ b/src/pcm/pcm_rate.c Mon Nov 12 12:01:16 2007 +0100 -@@ -715,38 +715,6 @@ static snd_pcm_sframes_t snd_pcm_rate_fo - return n; - } - --static int snd_pcm_rate_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space) --{ -- snd_pcm_rate_t *rate = pcm->private_data; -- snd_pcm_uframes_t avail_min; -- int ret, err; -- -- ret = snd_pcm_generic_poll_descriptors(pcm, pfds, space); -- if (ret < 0) -- return ret; -- -- avail_min = rate->appl_ptr % pcm->period_size; -- if (avail_min > 0) { -- recalc(pcm, &avail_min); -- if (avail_min < rate->gen.slave->buffer_size && -- avail_min != rate->gen.slave->period_size) -- avail_min++; /* 1st small little rounding correction */ -- if (avail_min < rate->gen.slave->buffer_size && -- avail_min != rate->gen.slave->period_size) -- avail_min++; /* 2nd small little rounding correction */ -- avail_min += rate->orig_avail_min; -- } else { -- avail_min = rate->orig_avail_min; -- } -- if (rate->sw_params.avail_min == avail_min) -- return ret; -- rate->sw_params.avail_min = avail_min; -- err = snd_pcm_sw_params(rate->gen.slave, &rate->sw_params); -- if (err < 0) -- return err; -- return ret; --} -- - static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate, - snd_pcm_uframes_t appl_offset, - snd_pcm_uframes_t size, -@@ -1229,7 +1197,7 @@ static snd_pcm_fast_ops_t snd_pcm_rate_f - .avail_update = snd_pcm_rate_avail_update, - .mmap_commit = snd_pcm_rate_mmap_commit, - .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count, -- .poll_descriptors = snd_pcm_rate_poll_descriptors, -+ .poll_descriptors = snd_pcm_generic_poll_descriptors, - .poll_revents = snd_pcm_rate_poll_revents, - }; - diff --git a/alsa-lib-smixer-range-fix.diff b/alsa-lib-smixer-range-fix.diff deleted file mode 100644 index fc864ff..0000000 --- a/alsa-lib-smixer-range-fix.diff +++ /dev/null @@ -1,54 +0,0 @@ -# HG changeset patch -# User cladisch -# Date 1194853808 -3600 -# Node ID 93f4991e860b4eb310183c3a73331ca209e8f2c9 -# Parent 952759593988850e847bebc33872e8b68bf9bce7 -simple mixer: fix calculation of control range - -When calculating the value range of a control, the variables cannot be -initialized with zero because this would prevent the minimum from having -a value above zero or the maximum from having a value below zero. - -diff -r 952759593988 -r 93f4991e860b src/mixer/simple_none.c ---- a/src/mixer/simple_none.c Mon Nov 12 08:49:10 2007 +0100 -+++ b/src/mixer/simple_none.c Mon Nov 12 08:50:08 2007 +0100 -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - #include "mixer_simple.h" - -@@ -672,9 +673,11 @@ static int simple_update(snd_mixer_elem_ - - caps = 0; - pchannels = 0; -- pmin = pmax = 0; -+ pmin = LONG_MAX; -+ pmax = LONG_MIN; - cchannels = 0; -- cmin = cmax = 0; -+ cmin = LONG_MAX; -+ cmax = LONG_MIN; - assert(snd_mixer_elem_get_type(melem) == SND_MIXER_ELEM_SIMPLE); - simple = snd_mixer_elem_get_private(melem); - name = snd_mixer_selem_get_name(melem); -@@ -868,13 +871,13 @@ static int simple_update(snd_mixer_elem_ - simple->selem.caps = caps; - simple->str[SM_PLAY].channels = pchannels; - if (!simple->str[SM_PLAY].range) { -- simple->str[SM_PLAY].min = pmin; -- simple->str[SM_PLAY].max = pmax; -+ simple->str[SM_PLAY].min = pmin != LONG_MAX ? pmin : 0; -+ simple->str[SM_PLAY].max = pmax != LONG_MIN ? pmax : 0; - } - simple->str[SM_CAPT].channels = cchannels; - if (!simple->str[SM_CAPT].range) { -- simple->str[SM_CAPT].min = cmin; -- simple->str[SM_CAPT].max = cmax; -+ simple->str[SM_CAPT].min = cmin != LONG_MAX ? cmin : 0; -+ simple->str[SM_CAPT].max = cmax != LONG_MIN ? cmax : 0; - } - return 0; - } diff --git a/alsa.changes b/alsa.changes index 7edc484..dc000d0 100644 --- a/alsa.changes +++ b/alsa.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Nov 30 18:22:34 CET 2007 - tiwai@suse.de + +- updated to 2007.11.30 HG version + * Fix Versions file to reduce unneeded exported symbols + * fix NULL name strings in pcm plugins + * fix error codes in card probing + ------------------------------------------------------------------- Fri Nov 23 16:48:19 CET 2007 - tiwai@suse.de diff --git a/alsa.spec b/alsa.spec index 5f76443..f1d30d4 100644 --- a/alsa.spec +++ b/alsa.spec @@ -21,7 +21,7 @@ PreReq: %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Advanced Linux Sound Architecture Version: 1.0.15 -Release: 13 +Release: 17 Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2 Source8: 40-alsa.rules Source11: alsasound @@ -36,13 +36,6 @@ Source30: all_notes_off Source31: all_notes_off.bin Source32: all_notes_off.mid Patch: alsa-lib-hg-fixes.diff -Patch1: alsa-lib-ioplug-fix.diff -Patch2: alsa-lib-smixer-range-fix.diff -Patch3: alsa-lib-rate-plugin-fix.diff -Patch4: alsa-lib-dmix-error-code-fix.diff -Patch5: alsa-lib-avail_min-fix.diff -Patch6: alsa-lib-dmix-tstamp-fix.diff -Patch7: alsa-lib-multi-mmap-fix.diff Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -115,13 +108,6 @@ Authors: %prep %setup -q -n alsa-lib-%{package_version} %patch -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 %{?suse_update_config:%{suse_update_config -f .}} %build @@ -263,6 +249,11 @@ exit 0 %{_datadir}/alsa %changelog +* Fri Nov 30 2007 - tiwai@suse.de +- updated to 2007.11.30 HG version + * Fix Versions file to reduce unneeded exported symbols + * fix NULL name strings in pcm plugins + * fix error codes in card probing * Fri Nov 23 2007 - tiwai@suse.de - fix possible CPU hog problem with too small avail_min - fix time-stamp with dmix/dsnoop plugins