[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 :
http://bugzilla.gnome.org/attachment.cgi?id=22893&action=view

+have_oss=no
+AC_TRY_COMPILE([
+	#ifdef __NetBSD__
+	#include <soundcard.h>
+	#else
+	#include <sys/soundcard.h>
+	#endif
+	],[
+	int arg = SNDCTL_DSP_SETFRAGMENT;
+	],[
+	have_oss=yes
+])
+AC_MSG_CHECKING(for OSS audio support)
+AC_MSG_RESULT($have_oss)
+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 :
http://www.jpj.net/~trevor/aumix/patches/freebsd-soundcard.h.diff

+ /* "The nice thing about standards..." */
+-#if defined (__FreeBSD__)
+-#include <machine/soundcard.h>
+-#else
+ #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