[gst-devel] OSS support for *BSDs (soundcard.h not in /usr/include/sys/)

Stéphane LOEUILLET stephane.loeuillet at tiscali.fr
Mon Jun 7 07:37:13 CEST 2004

hello list,

looking at gnome control-center code (volume control part), i saw this :

+	#ifdef __NetBSD__
+	#include <soundcard.h>
+	#else
+	#include <sys/soundcard.h>
+	#endif
+	],[
+	],[
+	have_oss=yes
+AC_MSG_CHECKING(for OSS audio support)
+AM_CONDITIONAL(HAVE_OSS, test x"$have_oss" = "xyes")

so, it looks like in NetBSD, soundcard.h is in the root of the include dir.

looking for more code on the net, i found this :

+ /* "The nice thing about standards..." */
+-#if defined (__FreeBSD__)
+-#include <machine/soundcard.h>
+ #if defined (__NetBSD__) || defined (__OpenBSD__)
+ #include <soundcard.h>		/* OSS emulation */
+ #undef ioctl
+ #else
+-/* BSDI, Linux, Solaris */
++/* BSDI, FreeBSD, Linux, Solaris */
+ #include <sys/soundcard.h>
+ #endif				/* __NetBSD__ or __OpenBSD__ */
+-#endif				/* __FreeBSD__ */

so, it looks like some versions of FreeBSD had this issue too (and it was moved to sys/ at some time)
OpenBSD seems affected too. other Unixes are perhaps also affected.

so, we should check for soundcard.h in the 2/3 places (look at this beautifull machine/soundcard.h)

any BSD user can confirm where their soundcard.h is for which version ?

affected files :

./sys/oss/gstosssrc.c:#include <sys/soundcard.h>
./sys/oss/gstosssink.c:#include <sys/soundcard.h>
./sys/oss/oss_probe.c:#include <sys/soundcard.h>
./sys/oss/gstosselement.c:#include <sys/soundcard.h>
./sys/oss/gstosselement.c:#include <sys/soundcard.h>
./sys/oss/gstossmixer.c:#include <sys/soundcard.h>
./ext/arts/gst_arts.c:#include <sys/soundcard.h>
./configure.ac:  AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS="yes", HAVE_OSS="no")

as we had no report for now, i suppose we have few BSD users. but who knows ...

Stéphane LOEUILLET <stephane.loeuillet at tiscali.fr>

More information about the gstreamer-devel mailing list