Browse Source

[0.95.5] add OSS driver

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@656 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
joq 22 years ago
parent
commit
5d5dc82555
6 changed files with 1368 additions and 67 deletions
  1. +6
    -5
      AUTHORS
  2. +81
    -59
      configure.in
  3. +14
    -3
      drivers/Makefile.am
  4. +6
    -0
      drivers/oss/.cvsignore
  5. +1171
    -0
      drivers/oss/oss_driver.c
  6. +90
    -0
      drivers/oss/oss_driver.h

+ 6
- 5
AUTHORS View File

@@ -11,14 +11,15 @@ Many other members of LAD contributed ideas to JACK, particularly
Richard Guenther.

Paul Davis was the principal author of the JACK API and of the
implementation contained here. Andy Wingo and Kai Vehmanen provided
many small patches and documentation. Fernando Pablo Lopez-Lezcano
contributed the capabilities-based code. Jeremy Hall, Steve Harris,
implementation contained here. Andy Wingo and Kai Vehmanen provided
many small patches and documentation. Fernando Pablo Lopez-Lezcano
contributed the capabilities-based code. Jeremy Hall, Steve Harris,
and Martin Boer contributed sample clients and utilities. Jack O'Quin
contributed new transport interfaces, implemented the buffer size
callback, and added much documentation. Taybin Rutkin helps with
patch management and releases. Melanie Thielker contributed
patch management and releases. Melanie Thielker contributed
significantly to JACK's interaction with aspects of both POSIX and
System V APIs.
System V APIs. Stephane Letz ported JACK to Mac OS X. Jussi Laako
wrote the OSS driver interface.

Many others have contributed patches and/or test results.

+ 81
- 59
configure.in View File

@@ -15,7 +15,7 @@ dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=95
JACK_MICRO_VERSION=4
JACK_MICRO_VERSION=5

dnl ---
dnl HOWTO: updating the jack protocal version
@@ -114,9 +114,10 @@ else

fi

JACK_CORE_CFLAGS="-I\$(top_srcdir) -I\$(top_builddir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall"

JACK_CORE_CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_builddir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall"
JACK_CFLAGS="$JACK_CORE_CFLAGS -g"
JACK_OPT_CFLAGS="$JACK_CORE_CFLAGS -march=pentium2 -mcpu=pentium4 -O3 -ffast-math -funroll-loops -fprefetch-loop-arrays"

dnl
dnl figure out how best to optimize
dnl
@@ -128,14 +129,14 @@ if test "$target_cpu" = "powerpc"; then
AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?")
if test "$gcc_major_version" = "3"; then
dnl -mcpu=7450 does not reliably work with gcc 3.*
JACK_OPT_FLAGS="-D_REENTRANT -O2 -mcpu=7400 -maltivec -mabi=altivec"
JACK_OPT_CFLAGS="-D_REENTRANT -O2 -mcpu=7400 -maltivec -mabi=altivec"
else
JACK_OPT_FLAGS="-D_REENTRANT -O3 -mcpu=7400"
JACK_OPT_CFLAGS="-D_REENTRANT -O3 -mcpu=7400"
fi
else
JACK_OPT_FLAGS="-D_REENTRANT -O3 -mcpu=750 -mmultiple"
JACK_OPT_CFLAGS="-D_REENTRANT -O3 -mcpu=750 -mmultiple"
fi
JACK_OPT_FLAGS="$OPTIM_FLAGS -mhard-float -mpowerpc-gfxopt"
JACK_OPT_CFLAGS="$OPTIM_FLAGS -mhard-float -mpowerpc-gfxopt"
elif echo $target_cpu | grep "i*86" >/dev/null; then
cat /proc/cpuinfo | grep mmx >/dev/null
if test $? = 0; then
@@ -151,14 +152,14 @@ elif echo $target_cpu | grep "i*86" >/dev/null; then
fi
AC_DEFINE(x86, 1, "Nope its intel")
if test "$target_cpu" = "i586"; then
JACK_OPT_FLAGS="-DREENTRANT -O3 -march=i586 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
JACK_OPT_CFLAGS="-DREENTRANT -O3 -march=i586 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
elif test "$target_cpu" = "i686"; then
JACK_OPT_FLAGS="-D_REENTRANT -O3 -march=i686 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
JACK_OPT_CFLAGS="-D_REENTRANT -O3 -march=i686 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
if test "$gcc_major_version" = "3"; then
JACK_OPT_FLAGS="$OPTIM_FLAGS $mmx $sse $dreidnow"
JACK_OPT_CFLAGS="$OPTIM_FLAGS $mmx $sse $dreidnow"
fi
else
JACK_OPT_FLAGS="-D_REENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
JACK_OPT_CFLAGS="-D_REENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops -fmove-all-movables"
fi
fi

@@ -254,7 +255,7 @@ AC_ARG_ENABLE(stripped-jackd,
)

AC_ARG_ENABLE(timestamps,
[ --enable-timestamps allow clients to use the JACK timestamp API ],
[ --enable-timestamps allow clients to use the JACK timestamp API ],
[ if test "x$enable_debug" != "xno" ; then
AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
fi
@@ -292,43 +293,67 @@ fi
AC_SUBST(DEFAULT_TMP_DIR)
AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])

# check for barrier functions in the pthreads library
AC_ARG_WITH(barrier,
AC_HELP_STRING([--without-barrier],
[avoid using pthread barrier functions]),
[ USE_BARRIER=$withval ],
[ USE_BARRIER="yes" ]
)
if test "x$USE_BARRIER" = "xyes"
then
AC_CHECK_LIB([pthread], [pthread_barrier_init],
AC_DEFINE(USE_BARRIER, 1, [Use pthread barrier functions]))
fi

# check which drivers can be built

jack_have_driver="no"

# jack depends on alsa 0.9. some example apps depend on libsndfile.
AC_CHECK_LIB(asound,snd_pcm_drop,
[
HAVE_ALSA="true"
ALSA_LIBS=-lasound
jack_have_driver="yes"
],
[
HAVE_ALSA="false"
AC_MSG_WARN([ALSA 0.9 support not found])
],
[-lm]
)
AC_SUBST(ALSA_LIBS)
AM_CONDITIONAL(ALSA, test x$HAVE_ALSA = xtrue)

AC_ARG_ENABLE(alsa, [ --disable-alsa ignore ALSA driver ],
TRY_ALSA=$enableval , TRY_ALSA=yes )
HAVE_ALSA="false"
if test "x$TRY_ALSA" = "xyes"
then
# check for ALSA >= 0.9
AC_CHECK_LIB(asound,snd_pcm_drop,
[HAVE_ALSA="true"
ALSA_LIBS=-lasound
jack_have_driver="yes"
], [], [-lm]
)
AC_SUBST(ALSA_LIBS)
fi
AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)

AC_ARG_ENABLE(portaudio, [ --disable-portaudio ignore PortAudio driver ],
TRY_PORTAUDIO=$enableval , TRY_PORTAUDIO=yes )


HAVE_PA="false"
if test "x$TRY_PORTAUDIO" = "xyes"
then
# check for portaudio V18
AC_CHECK_LIB(portaudio, Pa_Initialize,
[HAVE_PA="true"
PA_LIBS=-lportaudio
jack_have_driver="yes"
], [], [-lm -lpthread]
)
[ AC_CHECK_HEADERS(portaudio.h PortAudio.h,
[ HAVE_PA="true"
PA_LIBS=-lportaudio
jack_have_driver="yes"
])
], [], [-lm -lpthread])
AC_SUBST(PA_LIBS)
fi
AM_CONDITIONAL(PORTAUDIO, test x$HAVE_PA = xtrue)
AM_CONDITIONAL(HAVE_PA, $HAVE_PA)

AC_ARG_ENABLE(oss, [ --disable-oss ignore OSS driver ],
TRY_OSS=$enableval , TRY_OSS=yes )
HAVE_OSS="false"
if test "x$TRY_OSS" = "xyes"
then
# check for Open Sound System
AC_CHECK_HEADER([sys/soundcard.h],
[HAVE_OSS="true"
jack_have_driver="yes"])
fi
AM_CONDITIONAL(HAVE_OSS, $HAVE_OSS)

jack_enable_iec61883="no"
AC_ARG_ENABLE(iec61883,
@@ -346,30 +371,28 @@ AC_ARG_ENABLE(iec61883,
])

if test x$jack_enable_iec61883 != xno; then
AC_CHECK_LIB(raw1394, raw1394_iso_xmit_init,
[
AC_CHECK_HEADER(libraw1394/raw1394.h,
[
HAVE_RAW1394="true"
RAW1394_LIBS=-lraw1394
jack_have_driver="yes";
],
HAVE_RAW1394="false"
)
],
)
AC_CHECK_LIB(raw1394, raw1394_iso_xmit_init,
[ AC_CHECK_HEADER(libraw1394/raw1394.h,
[ HAVE_RAW1394="true"
RAW1394_LIBS=-lraw1394
jack_have_driver="yes"
AC_MSG_WARN([IEC61883 driver is experimental])
],
HAVE_RAW1394="false")
])
else
HAVE_RAW1394="false"
fi

AC_SUBST(RAW1394_LIBS)
AM_CONDITIONAL(IEC61883, test x$HAVE_RAW1394 = xtrue)
AM_CONDITIONAL(HAVE_RAW1394, $HAVE_RAW1394)

if test x$jack_have_driver = xno; then
AC_ERROR([No drivers can be built])
fi

# some example-clients need libsndfile
HAVE_SNDFILE=false
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
if test x$HAVE_SNDFILE = xfalse; then
@@ -399,11 +422,18 @@ AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
AM_CONDITIONAL(HAVE_PA, $HAVE_PA)

AC_OUTPUT(
Makefile
doc/Makefile
doc/reference.doxygen
drivers/Makefile
drivers/alsa/Makefile
drivers/dummy/Makefile
drivers/iec61883/Makefile
drivers/oss/Makefile
drivers/portaudio/Makefile
example-clients/Makefile
jack.pc
jack.spec
jack/Makefile
@@ -411,12 +441,4 @@ jack/version.h
jackd/Makefile
jackd/jackd.1
libjack/Makefile
drivers/Makefile
drivers/alsa/Makefile
drivers/dummy/Makefile
drivers/portaudio/Makefile
drivers/iec61883/Makefile
example-clients/Makefile
doc/Makefile
doc/reference.doxygen
)

+ 14
- 3
drivers/Makefile.am View File

@@ -6,12 +6,23 @@ else
ALSA_DIR =
endif

if HAVE_RAW1394
IEC61883_DIR = iec61883
else
IEC61883_DIR =
endif

if HAVE_OSS
OSS_DIR = oss
else
OSS_DIR =
endif

if HAVE_PA
PA_DIR = portaudio
else
PA_DIR =
endif

SUBDIRS = dummy iec61883 $(ALSA_DIR) $(PA_DIR)

DIST_SUBDIRS = dummy iec61883 alsa portaudio
SUBDIRS = $(ALSA_DIR) dummy $(IEC61883_DIR) $(OSS_DIR) $(PA_DIR)
DIST_SUBDIRS = alsa dummy iec61883 oss portaudio

+ 6
- 0
drivers/oss/.cvsignore View File

@@ -0,0 +1,6 @@
Makefile
Makefile.in
.deps
.libs
*.lo
*.la

+ 1171
- 0
drivers/oss/oss_driver.c
File diff suppressed because it is too large
View File


+ 90
- 0
drivers/oss/oss_driver.h View File

@@ -0,0 +1,90 @@
/*

OSS driver for Jack
Copyright (C) 2003-2004 Jussi Laako <jussi@sonarnerd.net>

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 __JACK_OSS_DRIVER_H__
#define __JACK_OSS_DRIVER_H__

#include <pthread.h>
#ifdef USE_BARRIER
#include <semaphore.h>
#endif

#include <jack/types.h>
#include <jack/jslist.h>
#include <jack/driver.h>
#include <jack/jack.h>


#define OSS_DRIVER_DEF_FS 44100
#define OSS_DRIVER_DEF_BLKSIZE 1024
#define OSS_DRIVER_DEF_BITS 16
#define OSS_DRIVER_DEF_INS 2
#define OSS_DRIVER_DEF_OUTS 2


typedef jack_default_audio_sample_t jack_sample_t;

typedef struct _oss_driver
{
JACK_DRIVER_DECL

jack_nframes_t sample_rate;
jack_nframes_t period_size;
int bits;
unsigned int capture_channels;
unsigned int playback_channels;

char *indev;
char *outdev;
int infd;
int outfd;
int format;
int ignorehwbuf;

size_t indevbufsize;
size_t outdevbufsize;
size_t portbufsize;
void *indevbuf;
void *outdevbuf;

JSList *capture_ports;
JSList *playback_ports;

jack_engine_t *engine;
jack_client_t *client;

volatile int run;
volatile int threads;
pthread_t thread_in;
pthread_t thread_out;
pthread_mutex_t mutex_in;
pthread_mutex_t mutex_out;
# ifdef USE_BARRIER
pthread_barrier_t barrier;
sem_t sem_start;
# endif
} oss_driver_t;


#endif


Loading…
Cancel
Save