sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* [PATCH] oss: remove check for machine/soundcard.h and libossaudio
@ 2020-08-10 12:17 Mans Rullgard
  2020-08-11 13:34 ` Jan Stary
  0 siblings, 1 reply; 9+ messages in thread
From: Mans Rullgard @ 2020-08-10 12:17 UTC (permalink / raw)
  To: sox-devel

Near as I can tell, no system actually has a machine/soundcard.h file.
The libossaudio library on NetBSD and OpenBSD is meant to emulate a
few ioctl() commands to facilitate porting of Linux applications.  As
we have proper sndio support, this is of no use for SoX.
---
Are there any BSD users here who can comment on this?
---
 configure.ac | 5 +----
 src/oss.c    | 3 ---
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index b1440560181c..9f55b5f8a55c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -609,10 +609,7 @@ AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile])
 
 
 
-AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
-      [AC_CHECK_HEADERS(machine/soundcard.h,
-	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
-	  using_oss=no)])])
+AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
 
 
 
diff --git a/src/oss.c b/src/oss.c
index 9c6682f1d478..35c7cd2fae9b 100644
--- a/src/oss.c
+++ b/src/oss.c
@@ -32,9 +32,6 @@
 #ifdef HAVE_SYS_SOUNDCARD_H
   #include <sys/soundcard.h>
 #endif
-#ifdef HAVE_MACHINE_SOUNDCARD_H
-  #include <machine/soundcard.h>
-#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-- 
2.28.0



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-10 12:17 [PATCH] oss: remove check for machine/soundcard.h and libossaudio Mans Rullgard
@ 2020-08-11 13:34 ` Jan Stary
  2020-08-11 13:41   ` Jan Stary
  2020-08-11 13:58   ` Måns Rullgård
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Stary @ 2020-08-11 13:34 UTC (permalink / raw)
  To: sox-devel

This is OpenBSD/current.

On Aug 10 13:17:07, mans@mansr.com wrote:
> Near as I can tell, no system actually has a machine/soundcard.h file.

OpenBSD has neither <machine/soundcard.h> nor <sys/soundcard.h>;
it has <soundcard.h>, as documented in http://man.openbsd.org/ossaudio

> The libossaudio library on NetBSD and OpenBSD is meant to emulate a
> few ioctl() commands to facilitate porting of Linux applications.

Yes.

> As we have proper sndio support, this is of no use for SoX.

On OpenBSD, yes (I will look at NetBSD and FreeBSD in separate emails).
Current SoX git builds and runs fine on OpenBSD
(except the recent -Wl,--as-needed) using sndio,
if ./configure'd right. The OpenBSD port of SoX 14.4.2
http://cvsweb.openbsd.org/ports/audio/sox/Makefile?rev=1.72
explicitly builds --without-oss	--without-sunaudio --with-sndio

In fact, these options are necessary (that is to say,
the autodetection is broken); when ./configure'd without options,
it detects each of sndio, ossaudio and sunaudio, and fails with

sox.c: In function 'adjust_volume':
sox.c:1337: error: 'audio_info_t' undeclared (first use in this function)
sox.c:1337: error: (Each undeclared identifier is reported only once
sox.c:1337: error: for each function it appears in.)
sox.c:1337: error: expected ';' before 'audio_info'
sox.c:1338: error: 'AUDIO_GETINFO' undeclared (first use in this function)
sox.c:1338: error: 'audio_info' undeclared (first use in this function)
sox.c:1341: warning: implicit declaration of function 'AUDIO_INITINFO'
sox.c:1345: error: 'AUDIO_SETINFO' undeclared (first use in this function)

(These are artifacts of sunaudio, right?)
A naive 'grep -Fr audio_info_t .' reveals that SoX ships with

	src/bit-rot/
	src/bit-rot/CoreAudio
	src/bit-rot/CoreAudio/CoreAudio.h
	src/bit-rot/mmreg.h
	src/bit-rot/mmsystem.h
	src/bit-rot/sndio.h
	src/bit-rot/sys
	src/bit-rot/sys/audioio.h
	src/bit-rot/windows.h

What are these for?

> ---
> Are there any BSD users here who can comment on this?
> ---
>  configure.ac | 5 +----
>  src/oss.c    | 3 ---
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index b1440560181c..9f55b5f8a55c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -609,10 +609,7 @@ AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile])
>  
>  
>  
> -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
> -      [AC_CHECK_HEADERS(machine/soundcard.h,
> -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
> -	  using_oss=no)])])
> +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])

Apparently, the presence of <sys/soundcard.h> is not
a correct test of ossaudio being available in the system.

'uing_oss' is a typo I guess.

(God I hate autotools.)

	Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 13:34 ` Jan Stary
@ 2020-08-11 13:41   ` Jan Stary
  2020-08-11 14:14     ` Måns Rullgård
  2020-08-11 13:58   ` Måns Rullgård
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Stary @ 2020-08-11 13:41 UTC (permalink / raw)
  To: sox-devel

> > -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
> > -      [AC_CHECK_HEADERS(machine/soundcard.h,
> > -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
> > -	  using_oss=no)])])
> > +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
> 
> Apparently, the presence of <sys/soundcard.h> is not
> a correct test of ossaudio being available in the system.

Maybe I am confused by the Subject:
"remove check for machine/soundcard.h and libossaudio"
It seems this diff does not remove, but change the way
ossaudio is detected; namely, if sys/soundcard.h is present,
we have oss (which is wrong, at least on OpenBSD);
also, even with oss detected, we no longer set -libossaudio,
which also seems wrong 9anywhere we want to use it).

Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 13:34 ` Jan Stary
  2020-08-11 13:41   ` Jan Stary
@ 2020-08-11 13:58   ` Måns Rullgård
  2020-08-11 14:40     ` Jan Stary
  1 sibling, 1 reply; 9+ messages in thread
From: Måns Rullgård @ 2020-08-11 13:58 UTC (permalink / raw)
  To: Jan Stary; +Cc: sox-devel

Jan Stary <hans@stare.cz> writes:

> This is OpenBSD/current.
>
> On Aug 10 13:17:07, mans@mansr.com wrote:
>> Near as I can tell, no system actually has a machine/soundcard.h file.
>
> OpenBSD has neither <machine/soundcard.h> nor <sys/soundcard.h>;
> it has <soundcard.h>, as documented in http://man.openbsd.org/ossaudio

Right, and we don't want it anyway.

>> The libossaudio library on NetBSD and OpenBSD is meant to emulate a
>> few ioctl() commands to facilitate porting of Linux applications.
>
> Yes.
>
>> As we have proper sndio support, this is of no use for SoX.
>
> On OpenBSD, yes (I will look at NetBSD and FreeBSD in separate emails).
> Current SoX git builds and runs fine on OpenBSD
> (except the recent -Wl,--as-needed) using sndio,
> if ./configure'd right. The OpenBSD port of SoX 14.4.2
> http://cvsweb.openbsd.org/ports/audio/sox/Makefile?rev=1.72
> explicitly builds --without-oss	--without-sunaudio --with-sndio
>
> In fact, these options are necessary (that is to say,
> the autodetection is broken); when ./configure'd without options,
> it detects each of sndio, ossaudio and sunaudio, and fails with
>
> sox.c: In function 'adjust_volume':
> sox.c:1337: error: 'audio_info_t' undeclared (first use in this function)
> sox.c:1337: error: (Each undeclared identifier is reported only once
> sox.c:1337: error: for each function it appears in.)
> sox.c:1337: error: expected ';' before 'audio_info'
> sox.c:1338: error: 'AUDIO_GETINFO' undeclared (first use in this function)
> sox.c:1338: error: 'audio_info' undeclared (first use in this function)
> sox.c:1341: warning: implicit declaration of function 'AUDIO_INITINFO'
> sox.c:1345: error: 'AUDIO_SETINFO' undeclared (first use in this function)
>
> (These are artifacts of sunaudio, right?)

That's what it looks like.  Does OpenBSD have an audioio.h file for some
other purpose?

> A naive 'grep -Fr audio_info_t .' reveals that SoX ships with
>
> 	src/bit-rot/
> 	src/bit-rot/CoreAudio
> 	src/bit-rot/CoreAudio/CoreAudio.h
> 	src/bit-rot/mmreg.h
> 	src/bit-rot/mmsystem.h
> 	src/bit-rot/sndio.h
> 	src/bit-rot/sys
> 	src/bit-rot/sys/audioio.h
> 	src/bit-rot/windows.h
>
> What are these for?

Probably to compile-test the related source files on other systems.

>> ---
>> Are there any BSD users here who can comment on this?
>> ---
>>  configure.ac | 5 +----
>>  src/oss.c    | 3 ---
>>  2 files changed, 1 insertion(+), 7 deletions(-)
>> 
>> diff --git a/configure.ac b/configure.ac
>> index b1440560181c..9f55b5f8a55c 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -609,10 +609,7 @@ AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile])
>>  
>>  
>>  
>> -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
>> -      [AC_CHECK_HEADERS(machine/soundcard.h,
>> -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
>> -	  using_oss=no)])])
>> +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
>
> Apparently, the presence of <sys/soundcard.h> is not
> a correct test of ossaudio being available in the system.
>
> 'uing_oss' is a typo I guess.

Yes, sorry about that.  Does it still mis-detect it with that fixed?

> (God I hate autotools.)

I hate cmake more.

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 13:41   ` Jan Stary
@ 2020-08-11 14:14     ` Måns Rullgård
  2020-08-11 14:33       ` Jan Stary
  0 siblings, 1 reply; 9+ messages in thread
From: Måns Rullgård @ 2020-08-11 14:14 UTC (permalink / raw)
  To: Jan Stary; +Cc: sox-devel

Jan Stary <hans@stare.cz> writes:

>> > -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
>> > -      [AC_CHECK_HEADERS(machine/soundcard.h,
>> > -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
>> > -	  using_oss=no)])])
>> > +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
>> 
>> Apparently, the presence of <sys/soundcard.h> is not
>> a correct test of ossaudio being available in the system.
>
> Maybe I am confused by the Subject:
> "remove check for machine/soundcard.h and libossaudio"

The checks for those things have been removed.  It now only checks for
sys/soundcard.h since that better reflects what we actually want.

> It seems this diff does not remove, but change the way
> ossaudio is detected; namely, if sys/soundcard.h is present,
> we have oss (which is wrong, at least on OpenBSD);

Did you fix that typo (a git pull will do it)?  If not, it would
definitely "detect" it as present on any system.

> also, even with oss detected, we no longer set -libossaudio,
> which also seems wrong (anywhere we want to use it).

-lossaudio is _only_ for the emulation on *BSD.  No library is required
on systems with real OSS drivers.  We shouldn't be using the emulation,
so there is no need to link with the library either.

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 14:14     ` Måns Rullgård
@ 2020-08-11 14:33       ` Jan Stary
  2020-08-11 14:39         ` Måns Rullgård
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Stary @ 2020-08-11 14:33 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-devel

On Aug 11 15:14:29, mans@mansr.com wrote:
> Jan Stary <hans@stare.cz> writes:
> 
> >> > -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
> >> > -      [AC_CHECK_HEADERS(machine/soundcard.h,
> >> > -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
> >> > -	  using_oss=no)])])
> >> > +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
> >> 
> >> Apparently, the presence of <sys/soundcard.h> is not
> >> a correct test of ossaudio being available in the system.
> >
> > Maybe I am confused by the Subject:
> > "remove check for machine/soundcard.h and libossaudio"
> 
> The checks for those things have been removed.  It now only checks for
> sys/soundcard.h since that better reflects what we actually want.

Does that mean "if sys/soundcard.h was found,
we are on a system where we want to use OSS"?

> > It seems this diff does not remove, but change the way
> > ossaudio is detected; namely, if sys/soundcard.h is present,
> > we have oss (which is wrong, at least on OpenBSD);
> 
> Did you fix that typo (a git pull will do it)?  If not, it would
> definitely "detect" it as present on any system.

With that typo fixed, ./configure on OpenBSD thinks that

	OPTIONAL DEVICE DRIVERS
	ao (Xiph)..................no
	alsa (Linux)...............no
	coreaudio (Mac OS X).......no
	sndio (OpenBSD)............yes
	oss........................no
	pulseaudio.................no
	sunaudio...................yes
	waveaudio (MS-Windows).....no

and the compilatiopn fails as in my previous email.
But ./configure --without-sunaudio results in

	OPTIONAL DEVICE DRIVERS
	ao (Xiph)..................no
	alsa (Linux)...............no
	coreaudio (Mac OS X).......no
	sndio (OpenBSD)............yes
	oss........................no
	pulseaudio.................no
	sunaudio...................no
	waveaudio (MS-Windows).....no

and it builds fine.

> > also, even with oss detected, we no longer set -libossaudio,
> > which also seems wrong (anywhere we want to use it).
> 
> -lossaudio is _only_ for the emulation on *BSD.  No library is required
> on systems with real OSS drivers.  We shouldn't be using the emulation,
> so there is no need to link with the library either.

Right; sorry for the confusion.

	Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 14:33       ` Jan Stary
@ 2020-08-11 14:39         ` Måns Rullgård
  0 siblings, 0 replies; 9+ messages in thread
From: Måns Rullgård @ 2020-08-11 14:39 UTC (permalink / raw)
  To: Jan Stary; +Cc: sox-devel

Jan Stary <hans@stare.cz> writes:

> On Aug 11 15:14:29, mans@mansr.com wrote:
>> Jan Stary <hans@stare.cz> writes:
>> 
>> >> > -AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,,
>> >> > -      [AC_CHECK_HEADERS(machine/soundcard.h,
>> >> > -	  [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")],
>> >> > -	  using_oss=no)])])
>> >> > +AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, uing_oss=no)])
>> >> 
>> >> Apparently, the presence of <sys/soundcard.h> is not
>> >> a correct test of ossaudio being available in the system.
>> >
>> > Maybe I am confused by the Subject:
>> > "remove check for machine/soundcard.h and libossaudio"
>> 
>> The checks for those things have been removed.  It now only checks for
>> sys/soundcard.h since that better reflects what we actually want.
>
> Does that mean "if sys/soundcard.h was found,
> we are on a system where we want to use OSS"?

For want of a more specific test, yes.  Maybe we should check for one of
the SNDCTL_ macros as well.

>> > It seems this diff does not remove, but change the way
>> > ossaudio is detected; namely, if sys/soundcard.h is present,
>> > we have oss (which is wrong, at least on OpenBSD);
>> 
>> Did you fix that typo (a git pull will do it)?  If not, it would
>> definitely "detect" it as present on any system.
>
> With that typo fixed, ./configure on OpenBSD thinks that
>
> 	OPTIONAL DEVICE DRIVERS
> 	ao (Xiph)..................no
> 	alsa (Linux)...............no
> 	coreaudio (Mac OS X).......no
> 	sndio (OpenBSD)............yes
> 	oss........................no
> 	pulseaudio.................no
> 	sunaudio...................yes
> 	waveaudio (MS-Windows).....no
>
> and the compilatiopn fails as in my previous email.
> But ./configure --without-sunaudio results in
>
> 	OPTIONAL DEVICE DRIVERS
> 	ao (Xiph)..................no
> 	alsa (Linux)...............no
> 	coreaudio (Mac OS X).......no
> 	sndio (OpenBSD)............yes
> 	oss........................no
> 	pulseaudio.................no
> 	sunaudio...................no
> 	waveaudio (MS-Windows).....no
>
> and it builds fine.
>
>> > also, even with oss detected, we no longer set -libossaudio,
>> > which also seems wrong (anywhere we want to use it).
>> 
>> -lossaudio is _only_ for the emulation on *BSD.  No library is required
>> on systems with real OSS drivers.  We shouldn't be using the emulation,
>> so there is no need to link with the library either.
>
> Right; sorry for the confusion.
>
> 	Jan
>

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 13:58   ` Måns Rullgård
@ 2020-08-11 14:40     ` Jan Stary
  2020-08-11 15:17       ` Måns Rullgård
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Stary @ 2020-08-11 14:40 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-devel

On Aug 11 14:58:20, mans@mansr.com wrote:
> > Current SoX git builds and runs fine on OpenBSD
> > (except the recent -Wl,--as-needed) using sndio,
> > if ./configure'd right. The OpenBSD port of SoX 14.4.2
> > http://cvsweb.openbsd.org/ports/audio/sox/Makefile?rev=1.72
> > explicitly builds --without-oss	--without-sunaudio --with-sndio
> >
> > In fact, these options are necessary (that is to say,
> > the autodetection is broken); when ./configure'd without options,
> > it detects each of sndio, ossaudio and sunaudio, and fails with
> >
> > sox.c: In function 'adjust_volume':
> > sox.c:1337: error: 'audio_info_t' undeclared (first use in this function)
> > sox.c:1337: error: (Each undeclared identifier is reported only once
> > sox.c:1337: error: for each function it appears in.)
> > sox.c:1337: error: expected ';' before 'audio_info'
> > sox.c:1338: error: 'AUDIO_GETINFO' undeclared (first use in this function)
> > sox.c:1338: error: 'audio_info' undeclared (first use in this function)
> > sox.c:1341: warning: implicit declaration of function 'AUDIO_INITINFO'
> > sox.c:1345: error: 'AUDIO_SETINFO' undeclared (first use in this function)
> >
> > (These are artifacts of sunaudio, right?)
> 
> That's what it looks like.  Does OpenBSD have an audioio.h file for some
> other purpose?

There is <sys/audioio.h>, see http://man.openbsd.org/audio
Apparently, this is the uniform audio HW abstraction
implemented by the individual audio card drivers:

./dev/pci/auacer.c:#include <sys/audioio.h>
./dev/pci/auglx.c:#include <sys/audioio.h>
./dev/pci/auich.c:#include <sys/audioio.h>
./dev/pci/auixp.c:#include <sys/audioio.h>
./dev/pci/autri.c:#include <sys/audioio.h>
./dev/pci/auvia.c:#include <sys/audioio.h>
[...]

> > A naive 'grep -Fr audio_info_t .' reveals that SoX ships with
> >
> > 	src/bit-rot/
> > 	src/bit-rot/CoreAudio
> > 	src/bit-rot/CoreAudio/CoreAudio.h
> > 	src/bit-rot/mmreg.h
> > 	src/bit-rot/mmsystem.h
> > 	src/bit-rot/sndio.h
> > 	src/bit-rot/sys
> > 	src/bit-rot/sys/audioio.h
> > 	src/bit-rot/windows.h
> >
> > What are these for?
> 
> Probably to compile-test the related source files on other systems.

I don't understand: what compile-test?

Why do we have e.g. src/bit-rot/sndio.h?
If we are on a sndio system (such as OpenBSD),
there will be a sndio.h we can use;
on other systems, how would we use src/bit-rot/sndio.h?

> Yes, sorry about that.  Does it still mis-detect it with that fixed?

Not oss; sunaudio is still mis-detected though, see above.

> > (God I hate autotools.)
> 
> I hate cmake more.

That goes without saying :-)

	Jan



_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] oss: remove check for machine/soundcard.h and libossaudio
  2020-08-11 14:40     ` Jan Stary
@ 2020-08-11 15:17       ` Måns Rullgård
  0 siblings, 0 replies; 9+ messages in thread
From: Måns Rullgård @ 2020-08-11 15:17 UTC (permalink / raw)
  To: Jan Stary; +Cc: sox-devel

Jan Stary <hans@stare.cz> writes:

> On Aug 11 14:58:20, mans@mansr.com wrote:
>> > Current SoX git builds and runs fine on OpenBSD
>> > (except the recent -Wl,--as-needed) using sndio,
>> > if ./configure'd right. The OpenBSD port of SoX 14.4.2
>> > http://cvsweb.openbsd.org/ports/audio/sox/Makefile?rev=1.72
>> > explicitly builds --without-oss	--without-sunaudio --with-sndio
>> >
>> > In fact, these options are necessary (that is to say,
>> > the autodetection is broken); when ./configure'd without options,
>> > it detects each of sndio, ossaudio and sunaudio, and fails with
>> >
>> > sox.c: In function 'adjust_volume':
>> > sox.c:1337: error: 'audio_info_t' undeclared (first use in this function)
>> > sox.c:1337: error: (Each undeclared identifier is reported only once
>> > sox.c:1337: error: for each function it appears in.)
>> > sox.c:1337: error: expected ';' before 'audio_info'
>> > sox.c:1338: error: 'AUDIO_GETINFO' undeclared (first use in this function)
>> > sox.c:1338: error: 'audio_info' undeclared (first use in this function)
>> > sox.c:1341: warning: implicit declaration of function 'AUDIO_INITINFO'
>> > sox.c:1345: error: 'AUDIO_SETINFO' undeclared (first use in this function)
>> >
>> > (These are artifacts of sunaudio, right?)
>> 
>> That's what it looks like.  Does OpenBSD have an audioio.h file for some
>> other purpose?
>
> There is <sys/audioio.h>, see http://man.openbsd.org/audio
> Apparently, this is the uniform audio HW abstraction
> implemented by the individual audio card drivers:
>
> ./dev/pci/auacer.c:#include <sys/audioio.h>
> ./dev/pci/auglx.c:#include <sys/audioio.h>
> ./dev/pci/auich.c:#include <sys/audioio.h>
> ./dev/pci/auixp.c:#include <sys/audioio.h>
> ./dev/pci/autri.c:#include <sys/audioio.h>
> ./dev/pci/auvia.c:#include <sys/audioio.h>
> [...]

OK, so we definitely need a more specific test here.  It also seems[1]
like in Solaris 8 that file was to sys/audio.h where it remains[2].

[1] https://docs.oracle.com/cd/E19455-01/816-3330/6m9kamh4f/index.html
[2] https://docs.oracle.com/cd/E88353_01/html/E37851/audio-4i.html

>> > A naive 'grep -Fr audio_info_t .' reveals that SoX ships with
>> >
>> > 	src/bit-rot/
>> > 	src/bit-rot/CoreAudio
>> > 	src/bit-rot/CoreAudio/CoreAudio.h
>> > 	src/bit-rot/mmreg.h
>> > 	src/bit-rot/mmsystem.h
>> > 	src/bit-rot/sndio.h
>> > 	src/bit-rot/sys
>> > 	src/bit-rot/sys/audioio.h
>> > 	src/bit-rot/windows.h
>> >
>> > What are these for?
>> 
>> Probably to compile-test the related source files on other systems.
>
> I don't understand: what compile-test?
>
> Why do we have e.g. src/bit-rot/sndio.h?
> If we are on a sndio system (such as OpenBSD),
> there will be a sndio.h we can use;
> on other systems, how would we use src/bit-rot/sndio.h?

There's a commented-out line in the Makefile that adds -Ibit-rot to the
compiler flags.  I'm guessing someone used (or intended to use) this to
compile e.g. sndio.c.  It would obviously still fail to link.  The
purpose of this would (presumably) be to make sure those files are kept
up to date if changes are made to the libsox internal interface.

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-11 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 12:17 [PATCH] oss: remove check for machine/soundcard.h and libossaudio Mans Rullgard
2020-08-11 13:34 ` Jan Stary
2020-08-11 13:41   ` Jan Stary
2020-08-11 14:14     ` Måns Rullgård
2020-08-11 14:33       ` Jan Stary
2020-08-11 14:39         ` Måns Rullgård
2020-08-11 13:58   ` Måns Rullgård
2020-08-11 14:40     ` Jan Stary
2020-08-11 15:17       ` Måns Rullgård

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).