From 62546a3a32119dc28284b9debf390be24458451c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 12 Feb 2003 21:57:49 +0000 Subject: [PATCH] More pcm_jack plugin changes --- aserver/Makefile.am | 7 ++++++- configure.in | 13 +++++++++++++ include/pcm.h | 4 +++- include/pcm_plugin.h | 10 ++++++++++ src/Makefile.am | 8 +++++++- src/control/control.c | 2 +- src/pcm/pcm_plug.c | 2 +- 7 files changed, 41 insertions(+), 5 deletions(-) diff --git a/aserver/Makefile.am b/aserver/Makefile.am index 5b88a747..32caa5d4 100644 --- a/aserver/Makefile.am +++ b/aserver/Makefile.am @@ -1,8 +1,13 @@ +if HAVE_JACK +JACK_LIB = -ljack +else +JACK_LIB = +endif bin_PROGRAMS = aserver aserver_SOURCES = aserver.c # aserver_LDADD = -lasound -aserver_LDADD = ../src/libasound.la +aserver_LDADD = ../src/libasound.la $(JACK_LIB) all: aserver diff --git a/configure.in b/configure.in index 5406d0c4..4bcbeb7c 100644 --- a/configure.in +++ b/configure.in @@ -118,6 +118,19 @@ else AC_MSG_RESULT(no) 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 AC_MSG_CHECKING(for architecture) case "$target" in diff --git a/include/pcm.h b/include/pcm.h index 880c749d..eb7a91b8 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -347,7 +347,9 @@ enum _snd_pcm_type { /** LADSPA integration plugin */ SND_PCM_TYPE_LADSPA, /** Direct Mixing plugin */ - SND_PCM_TYPE_DMIX + SND_PCM_TYPE_DMIX, + /** Jack Audio Connection Kit plugin */ + SND_PCM_TYPE_JACK, }; /** PCM type */ diff --git a/include/pcm_plugin.h b/include/pcm_plugin.h index 5db88d89..17f19cfc 100644 --- a/include/pcm_plugin.h +++ b/include/pcm_plugin.h @@ -183,6 +183,16 @@ int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode); +/* + * Jack plugin + */ +int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_stream_t stream, int mode); +int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + + /** \} */ #endif /* __ALSA_PCM_PLUGIN_H */ diff --git a/src/Makefile.am b/src/Makefile.am index 95c7c587..1a7d7dfd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,12 +2,18 @@ SUBDIRS=control mixer pcm rawmidi timer hwdep seq instr compat conf EXTRA_DIST=Versions COMPATNUM=@LIBTOOL_VERSION_INFO@ +if HAVE_JACK +JACK_LIB = -ljack +else +JACK_LIB = +endif + lib_LTLIBRARIES = libasound.la 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 \ rawmidi/librawmidi.la timer/libtimer.la \ hwdep/libhwdep.la seq/libseq.la instr/libinstr.la \ - compat/libcompat.la -lm -ldl -lpthread + compat/libcompat.la -lm -ldl -lpthread $(JACK_LIB) libasound_la_LDFLAGS = -version-info $(COMPATNUM) LDFLAGS = -Wl,--version-script=Versions diff --git a/src/control/control.c b/src/control/control.c index 29c81434..f589202d 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -512,7 +512,7 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, #ifndef PIC extern void *snd_control_open_symbols(void); #endif - void *h; + void *h = NULL; if (snd_config_get_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) { if (name) SNDERR("Invalid type for CTL %s definition", name); diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 6328d147..e2b03961 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -627,9 +627,9 @@ static int snd_pcm_plug_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_ static int snd_pcm_plug_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams) { snd_pcm_plug_t *plug = pcm->private_data; - _snd_pcm_hw_params_any(sparams); int err; + _snd_pcm_hw_params_any(sparams); if (plug->sformat >= 0) { _snd_pcm_hw_params_set_format(sparams, plug->sformat); _snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD); -- 2.47.1