Split OSS support in output and wrapper.

Since Fedora does not enable OSS output support at all, but still uses
padsp, and in Gentoo we could also make use of padsp without OSS output
support, split the two things in two parameters, although they both check
for sys/soundcard.h once.
This commit is contained in:
Diego Elio 'Flameeyes' Pettenò 2009-08-08 01:53:15 +02:00
parent 9ade13604e
commit 4c15115007
5 changed files with 40 additions and 24 deletions

View file

@ -664,26 +664,42 @@ AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
#### OSS support (optional) #### #### OSS support (optional) ####
AC_ARG_ENABLE([oss], AC_ARG_ENABLE([oss-output],
AS_HELP_STRING([--disable-oss],[Disable optional OSS support]), AS_HELP_STRING([--disable-oss-output],[Disable optional OSS output support]),
[ [
case "${enableval}" in case "${enableval}" in
yes) oss=yes ;; yes) oss_output=yes ;;
no) oss=no ;; no) oss_output=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-output) ;;
esac esac
], ],
[oss=auto]) [oss_output=auto])
if test "x${oss}" != xno ; then AC_ARG_ENABLE([oss-wrapper],
AS_HELP_STRING([--disable-oss-wrapper],[Disable optional OSS wrapper support]),
[
case "${enableval}" in
yes) oss_wrapper=yes ;;
no) oss_wrapper=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-wrapper) ;;
esac
],
[oss_wrapper=auto])
if test "x${oss_output}" != xno || test "x${oss_wrapper}" != "xno"; then
AC_CHECK_HEADERS([sys/soundcard.h], AC_CHECK_HEADERS([sys/soundcard.h],
[ [
if test "x${oss_output}" != "xno"; then
AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
fi
if test "x${oss_wrapper}" != "xno"; then
AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])
fi
HAVE_OSS=1 HAVE_OSS=1
AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
], ],
[ [
HAVE_OSS=0 HAVE_OSS=0
if test "x$oss" = xyes ; then if test "x$oss_output" = xyes || test "x$oss_wrapper" = "xyes"; then
AC_MSG_ERROR([*** OSS support not found]) AC_MSG_ERROR([*** OSS support not found])
fi fi
]) ])
@ -692,8 +708,8 @@ else
fi fi
AC_SUBST(HAVE_OSS) AC_SUBST(HAVE_OSS)
AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1]) AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS" = x1 && test "x${oss_output}" != "xno"])
AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS" = x1 && test "x${oss_wrapper}" != "xno"])
#### ALSA support (optional) #### #### ALSA support (optional) ####

View file

@ -776,7 +776,7 @@ libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version
# OSS emulation # # OSS emulation #
################################### ###################################
if HAVE_OSS if HAVE_OSS_WRAPPER
lib_LTLIBRARIES += libpulsedsp.la lib_LTLIBRARIES += libpulsedsp.la
bin_SCRIPTS += utils/padsp bin_SCRIPTS += utils/padsp
endif endif
@ -1031,7 +1031,7 @@ modlibexec_LTLIBRARIES += \
module-x11-cork-request.la module-x11-cork-request.la
endif endif
if HAVE_OSS if HAVE_OSS_OUTPUT
modlibexec_LTLIBRARIES += \ modlibexec_LTLIBRARIES += \
liboss-util.la \ liboss-util.la \
module-oss.la module-oss.la

View file

@ -113,7 +113,7 @@ int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING; int deny_severity = LOG_WARNING;
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_WRAPPER
/* padsp looks for this symbol in the running process and disables /* padsp looks for this symbol in the running process and disables
* itself if it finds it and it is set to 7 (which is actually a bit * itself if it finds it and it is set to 7 (which is actually a bit
* mask). For details see padsp. */ * mask). For details see padsp. */

View file

@ -119,7 +119,7 @@ static int detect_alsa(pa_core *c, int just_one) {
} }
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
static int detect_oss(pa_core *c, int just_one) { static int detect_oss(pa_core *c, int just_one) {
FILE *f; FILE *f;
int n = 0, b = 0; int n = 0, b = 0;
@ -240,7 +240,7 @@ int pa__init(pa_module*m) {
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
if ((n = detect_alsa(m->core, just_one)) <= 0) if ((n = detect_alsa(m->core, just_one)) <= 0)
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
if ((n = detect_oss(m->core, just_one)) <= 0) if ((n = detect_oss(m->core, just_one)) <= 0)
#endif #endif
#ifdef HAVE_SOLARIS #ifdef HAVE_SOLARIS

View file

@ -55,14 +55,14 @@ PA_MODULE_AUTHOR("Shahms King");
PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers"); PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers");
PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_VERSION(PACKAGE_VERSION);
PA_MODULE_LOAD_ONCE(TRUE); PA_MODULE_LOAD_ONCE(TRUE);
#if defined(HAVE_ALSA) && defined(HAVE_OSS) #if defined(HAVE_ALSA) && defined(HAVE_OSS_OUTPUT)
PA_MODULE_USAGE("api=<alsa or oss> " PA_MODULE_USAGE("api=<alsa or oss> "
"tsched=<enable system timer based scheduling mode?>" "tsched=<enable system timer based scheduling mode?>"
"subdevs=<init all subdevices>"); "subdevs=<init all subdevices>");
#elif defined(HAVE_ALSA) #elif defined(HAVE_ALSA)
PA_MODULE_USAGE("api=<alsa> " PA_MODULE_USAGE("api=<alsa> "
"tsched=<enable system timer based scheduling mode?>"); "tsched=<enable system timer based scheduling mode?>");
#elif defined(HAVE_OSS) #elif defined(HAVE_OSS_OUTPUT)
PA_MODULE_USAGE("api=<oss>" PA_MODULE_USAGE("api=<oss>"
"subdevs=<init all subdevices>"); "subdevs=<init all subdevices>");
#endif #endif
@ -84,7 +84,7 @@ struct userdata {
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
pa_bool_t use_tsched; pa_bool_t use_tsched;
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
pa_bool_t init_subdevs; pa_bool_t init_subdevs;
#endif #endif
}; };
@ -97,7 +97,7 @@ static const char* const valid_modargs[] = {
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
"tsched", "tsched",
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
"subdevs", "subdevs",
#endif #endif
NULL NULL
@ -270,7 +270,7 @@ fail:
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
static pa_bool_t hal_oss_device_is_pcm(LibHalContext *context, const char *udi, pa_bool_t init_subdevices) { static pa_bool_t hal_oss_device_is_pcm(LibHalContext *context, const char *udi, pa_bool_t init_subdevices) {
char *class = NULL, *dev = NULL, *e; char *class = NULL, *dev = NULL, *e;
@ -402,7 +402,7 @@ static struct device* hal_device_add(struct userdata *u, const char *udi) {
if (pa_streq(u->capability, CAPABILITY_ALSA)) if (pa_streq(u->capability, CAPABILITY_ALSA))
r = hal_device_load_alsa(u, udi, d); r = hal_device_load_alsa(u, udi, d);
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
if (pa_streq(u->capability, CAPABILITY_OSS)) if (pa_streq(u->capability, CAPABILITY_OSS))
r = hal_device_load_oss(u, udi, d); r = hal_device_load_oss(u, udi, d);
#endif #endif
@ -761,7 +761,7 @@ int pa__init(pa_module*m) {
api = pa_modargs_get_value(ma, "api", "oss"); api = pa_modargs_get_value(ma, "api", "oss");
#endif #endif
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
if (pa_streq(api, "oss")) if (pa_streq(api, "oss"))
u->capability = CAPABILITY_OSS; u->capability = CAPABILITY_OSS;
#endif #endif
@ -771,7 +771,7 @@ int pa__init(pa_module*m) {
goto fail; goto fail;
} }
#ifdef HAVE_OSS #ifdef HAVE_OSS_OUTPUT
if (pa_modargs_get_value_boolean(ma, "subdevs", &u->init_subdevs) < 0) { if (pa_modargs_get_value_boolean(ma, "subdevs", &u->init_subdevs) < 0) {
pa_log("Failed to parse subdevs argument."); pa_log("Failed to parse subdevs argument.");
goto fail; goto fail;