Jan Stary <h...@stare.cz> writes:

> On Aug 11 14:58:20, m...@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

Reply via email to