Moved pcm_jack plugin to src/pcm/ext directory (must be build manually).

The pcm open functions looks to /usr/lib/alsa-lib directory for plugins
like jack.
This commit is contained in:
Jaroslav Kysela 2003-03-05 19:56:55 +00:00
parent eb3bd553ea
commit 3cc4c86fb2
8 changed files with 81 additions and 46 deletions

View file

@ -1,13 +1,7 @@
if HAVE_JACK
JACK_LIB = -ljack
else
JACK_LIB =
endif
bin_PROGRAMS = aserver bin_PROGRAMS = aserver
aserver_SOURCES = aserver.c aserver_SOURCES = aserver.c
# aserver_LDADD = -lasound # aserver_LDADD = -lasound
aserver_LDADD = ../src/libasound.la $(JACK_LIB) aserver_LDADD = ../src/libasound.la
all: aserver all: aserver

View file

@ -66,6 +66,15 @@ case "$dir" in
esac esac
AC_DEFINE_UNQUOTED(DATADIR, "$dir", [directory containing ALSA configuration database]) AC_DEFINE_UNQUOTED(DATADIR, "$dir", [directory containing ALSA configuration database])
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
eval dir="$libdir"
case "$dir" in
/*) ;;
*) dir="$PWD/$dir"
esac
AC_DEFINE_UNQUOTED(PKGLIBDIR, "$dir/$PACKAGE", [directory containing ALSA add-on modules])
dnl Check for versioned symbols dnl Check for versioned symbols
AC_MSG_CHECKING(for versioned symbols) AC_MSG_CHECKING(for versioned symbols)
AC_ARG_WITH(versioned, AC_ARG_WITH(versioned,
@ -118,19 +127,6 @@ else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
dnl Check for jack...
AC_MSG_CHECKING(for jack)
AC_ARG_WITH(jack,
[ --with-jack do you have installed Jack Audio Connection Kit (optional)],
[ AC_DEFINE(HAVE_JACK, "1", [enabled])
jack=yes ],)
if test "$jack" = "yes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(HAVE_JACK, test x$jack = xyes)
dnl Check for architecture dnl Check for architecture
AC_MSG_CHECKING(for architecture) AC_MSG_CHECKING(for architecture)
case "$target" in case "$target" in
@ -164,7 +160,8 @@ esac
AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile
include/sound/Makefile src/Makefile \ include/sound/Makefile src/Makefile \
src/control/Makefile src/mixer/Makefile src/pcm/Makefile \ src/control/Makefile src/mixer/Makefile
src/pcm/Makefile src/pcm/ext/Makefile \
src/rawmidi/Makefile src/timer/Makefile \ src/rawmidi/Makefile src/timer/Makefile \
src/hwdep/Makefile src/seq/Makefile src/instr/Makefile \ src/hwdep/Makefile src/seq/Makefile src/instr/Makefile \
src/compat/Makefile src/conf/Makefile \ src/compat/Makefile src/conf/Makefile \

View file

@ -2,12 +2,6 @@ SUBDIRS=control mixer pcm rawmidi timer hwdep seq instr compat conf
EXTRA_DIST=Versions EXTRA_DIST=Versions
COMPATNUM=@LIBTOOL_VERSION_INFO@ COMPATNUM=@LIBTOOL_VERSION_INFO@
if HAVE_JACK
JACK_LIB = -ljack
else
JACK_LIB =
endif
lib_LTLIBRARIES = libasound.la lib_LTLIBRARIES = libasound.la
libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c
libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \ libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \

View file

@ -1,10 +1,6 @@
EXTRA_LTLIBRARIES = libpcm.la SUBDIRS = ext
if HAVE_JACK EXTRA_LTLIBRARIES = libpcm.la
JACK_PLUGIN = pcm_jack.c
else
JACK_PLUGIN =
endif
libpcm_la_SOURCES = atomic.c mask.c interval.c \ libpcm_la_SOURCES = atomic.c mask.c interval.c \
pcm.c pcm_params.c \ pcm.c pcm_params.c \
@ -13,13 +9,11 @@ libpcm_la_SOURCES = atomic.c mask.c interval.c \
pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \ pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \
pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \ pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \
pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \ pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \
pcm_dmix.c $(JACK_PLUGIN) pcm_symbols.c pcm_dmix.c pcm_symbols.c
noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \ noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \
interval.h interval_inline.h plugin_ops.h ladspa.h \ interval.h interval_inline.h plugin_ops.h ladspa.h \
pcm_dmix_i386.h pcm_dmix_i386.h
EXTRA_libpcm_la_SOURCES = pcm_jack.c
alsadir = $(datadir)/alsa alsadir = $(datadir)/alsa
all: libpcm.la all: libpcm.la

30
src/pcm/ext/Makefile.am Normal file
View file

@ -0,0 +1,30 @@
COMPATNUM=@LIBTOOL_VERSION_INFO@
pkglib_LTLIBRARIES = libasound_module_pcm_jack.la
libasound_module_pcm_jack_la_SOURCES = pcm_jack.c
libasound_module_pcm_jack_la_LDFLAGS = -version-info $(COMPATNUM)
libasound_module_pcm_jack_la_LIBADD = -ljack
alsadir = $(libdir)/alsa_modules
INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/src/pcm
.PHONY : help
help:
@echo "Specify target by hand, please"
@echo "Type 'make jack' to build the jack pcm plugin..."
@echo "Type 'make install-jack' to install the jack pcm plugin..."
all: help
all-am: help
install-am: help
hand-install: install-exec-am
jack: libasound_module_pcm_jack.la
install-jack:
$(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) libasound_module_pcm_jack.la $(DESTDIR)$(pkglibdir)/libasound_module_pcm_jack.la

View file

@ -1706,12 +1706,18 @@ snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler)
return handler->u.pcm; return handler->u.pcm;
} }
static char *build_in_pcms[] = {
"adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat",
"linear", "meter", "mulaw", "multi", "null", "plug", "rate", "route", "share",
"shm", NULL
};
static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
snd_config_t *pcm_root, snd_config_t *pcm_conf, snd_config_t *pcm_root, snd_config_t *pcm_conf,
snd_pcm_stream_t stream, int mode) snd_pcm_stream_t stream, int mode)
{ {
const char *str; const char *str;
char buf[256]; char *buf = NULL, *buf1 = NULL;
int err; int err;
snd_config_t *conf, *type_conf = NULL; snd_config_t *conf, *type_conf = NULL;
snd_config_iterator_t i, next; snd_config_iterator_t i, next;
@ -1785,8 +1791,30 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
} }
} }
if (!open_name) { if (!open_name) {
buf = malloc(strlen(str) + 32);
if (buf == NULL) {
err = -ENOMEM;
goto _err;
}
open_name = buf; open_name = buf;
snprintf(buf, sizeof(buf), "_snd_pcm_%s_open", str); sprintf(buf, "_snd_pcm_%s_open", str);
}
if (!lib) {
char **build_in = build_in_pcms;
while (*build_in) {
if (!strcmp(*build_in, str))
break;
build_in++;
}
if (*build_in == NULL) {
buf1 = malloc(strlen(str) + sizeof(PKGLIBDIR) + 32);
if (buf1 == NULL) {
err = -ENOMEM;
goto _err;
}
lib = buf1;
sprintf(buf1, "%s/libasound_module_pcm_%s.so", PKGLIBDIR, str);
}
} }
#ifndef PIC #ifndef PIC
snd_pcm_open_symbols(); /* this call is for static linking only */ snd_pcm_open_symbols(); /* this call is for static linking only */
@ -1810,11 +1838,15 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode); err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode);
if (err >= 0) { if (err >= 0) {
(*pcmp)->dl_handle = h; (*pcmp)->dl_handle = h;
return 0; err = 0;
} else { } else {
snd_dlclose(h); snd_dlclose(h);
} }
} }
if (buf)
free(buf);
if (buf1)
free(buf1);
return err; return err;
} }

View file

@ -41,9 +41,6 @@ extern const char *_snd_module_pcm_shm;
extern const char *_snd_module_pcm_lfloat; extern const char *_snd_module_pcm_lfloat;
extern const char *_snd_module_pcm_ladspa; extern const char *_snd_module_pcm_ladspa;
extern const char *_snd_module_pcm_dmix; extern const char *_snd_module_pcm_dmix;
#ifdef HAVE_JACK
extern const char *_snd_module_pcm_jack;
#endif
static const char **snd_pcm_open_objects[] = { static const char **snd_pcm_open_objects[] = {
&_snd_module_pcm_adpcm, &_snd_module_pcm_adpcm,
@ -64,10 +61,7 @@ static const char **snd_pcm_open_objects[] = {
&_snd_module_pcm_shm, &_snd_module_pcm_shm,
&_snd_module_pcm_lfloat, &_snd_module_pcm_lfloat,
&_snd_module_pcm_ladspa, &_snd_module_pcm_ladspa,
&_snd_module_pcm_dmix, &_snd_module_pcm_dmix
#ifdef HAVE_JACK
&_snd_module_pcm_jack
#endif
}; };
void *snd_pcm_open_symbols(void) void *snd_pcm_open_symbols(void)