AC_DEFINE([BUILD_PCM_PLUGIN_MMAP_EMUL], "1", [Build PCM mmap-emul plugin])
fi
+if test "$build_pcm_dmix" = "yes"; then
+AC_MSG_CHECKING(for default lockless dmix)
+AC_ARG_ENABLE(lockless-dmix,
+ AS_HELP_STRING([--enable-lockless-dmix],
+ [use lockless dmix as default on x86]),
+ lockless_dmix="$enableval", lockless_dmix="no")
+if test "$lockless_dmix" = "yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([LOCKLESS_DMIX_DEFAULT], "1", [Lockless dmix as default])
+else
+ AC_MSG_RESULT(no)
+fi
+fi
dnl Create PCM plugin symbol list for static library
rm -f "$srcdir"/src/pcm/pcm_symbols_list.c
return 0;
}
-#define SND_PCM_DIRECT_MAGIC (0xa15ad300 + sizeof(snd_pcm_direct_share_t))
+static unsigned int snd_pcm_direct_magic(snd_pcm_direct_t *dmix)
+{
+ if (!dmix->direct_memory_access)
+ return 0xa15ad300 + sizeof(snd_pcm_direct_share_t);
+ else
+ return 0xb15ad300 + sizeof(snd_pcm_direct_share_t);
+}
/*
* global shared memory area
buf.shm_perm.gid = dmix->ipc_gid;
shmctl(dmix->shmid, IPC_SET, &buf);
}
- dmix->shmptr->magic = SND_PCM_DIRECT_MAGIC;
+ dmix->shmptr->magic = snd_pcm_direct_magic(dmix);
return 1;
} else {
- if (dmix->shmptr->magic != SND_PCM_DIRECT_MAGIC) {
+ if (dmix->shmptr->magic != snd_pcm_direct_magic(dmix)) {
snd_pcm_direct_shm_discard(dmix);
return -EINVAL;
}
rec->slowptr = 1;
rec->max_periods = 0;
rec->var_periodsize = 0;
+#ifdef LOCKLESS_DMIX_DEFAULT
rec->direct_memory_access = 1;
+#else
+ rec->direct_memory_access = 0;
+#endif
rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_AUTO;
rec->tstamp_type = -1;