> > checking for strdup... yes
> >
> >     Not specific to NetBSD of course, but why are we running these
> >     tests (taking strdup as a random example)? Is there a POSIX
> >     system without strdup? And if we miss strdup, then what?
> >     With that configure.ac line changed to check for xstrdup instead,
> >     this will just become
> >
> >             checking for xstrdup... no
> >
> >     but everyting follows as before. Which means we have checked for
> >     a function (via AC_CHECK_FUNCS), found out it does not exist,
> >     and ignored the result. What is that for?
> 
> I already explained this about five times.

The only explanation I have seen so far is
"it was warranted in the olden days". Perhaps it was;
but why are we checking for e.g. strdup() in 2020
(and ingoring the result of AC_CHECK_FUNCS anyway)?

> > checking for sys/soundcard.h... yes
> >
> >     On NetBSD, sys/soundcard.h says
> >
> >             This is an OSS (Linux) audio emulator.
> >             Use the Native NetBSD API for developing new code,
> >             and this only for compiling Linux programs.
> >
> >     The check is
> >
> >     SOX_FMT_HEADERS([oss], [sys/soundcard.h], [SOUND_MIXER_MUTE],
> >             [], [devices])
> >
> >     so at least we correctly recognize this as OSS emulation.
> >     But the check does not work universaly: NetBSD has
> >     /usr/include/sys/soundcard.h -> ../soundcard.h, but e.g.
> >     OpenBSD only has /usr/include/soundcard.h (same code though).
> >     Apparently, the name makes a difference:
> >     a test for "sys/soundcard.h" will fail on OpenBSD.
> >
> > checking whether SOUND_MIXER_MUTE is declared... no
> >
> >     Why SOUND_MIXER_MUTE, specificaly, out of all the others?
> >     For example, SOUND_MIXER_INFO is declared, which would
> >     make the oss emulation detected (not saying this is
> >     the correct test).
> >
> >     Lastly, oss requires a library to be linked:
> >     https://netbsd.gw.com/cgi-bin/man-cgi?ossaudio
> >     That would be /usr/lib/libossaudio.so - I believe a recent
> >     commit has concluded that oss does not require any library
> >     (being a bunch of defined ioctls); on NetBSD, it maybe does.
> >
> >     $ nm /usr/lib/libossaudio.so | grep oss
> >     0000000000001f60 T _oss_ioctl
> 
> Real OSS does _not_ need a library.  That is _only_ used for the
> incomplete emulation that we don't want.  The test is chosen such that
> it passes on Linux, FreeBSD, and Solaris while failing on NetBSD and
> OpenBSD.

In case it is intended to detect OSS as not present
on OpenBSD and NetBSD (who only emulate OSS),
it seems to work as intended.

> > checking for sys/audioio.h... yes
> >
> >     This seems to be NetBSD's native audio interface.
> >     https://netbsd.gw.com/cgi-bin/man-cgi?audio
> >     It's what the NetBSD port of SoX uses:
> >     http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/audio/sox/
> >
> > checking whether AUDIO_HWFEATURE_DUPLEX is declared... no
> >
> >     ... but we miss that, because of this.
> >     It seems NetBSD's audio system came from Sun audio
> >     (/usr/pkg/bin/sox reports AUDIO DEVICE DRIVERS: sunau),
> >     but it's not quite the same; in particular,
> >     AUDIO_HWFEATURE_DUPLEX is not defined.
> 
> Already fixed.

The detectin works, thanks:

Audio devices:
  alsa                    no
  ao                      no
  coreaudio               no
  oss                     no
  pulseaudio              no
  sndio                   no
  sunaudio                yes
  waveaudio               no

It doesn't actually play though:

$ play -V -n -b 16 synth 1
play INFO sunaudio: Sun Audio driver only supports bytes and words
play:      SoX v14.4.2
play INFO nulfile: sample rate not specified; using 48000

Input File     : '' (null)
Channels       : 1
Sample Rate    : 48000
Precision      : 32-bit

Output File    : 'default' (sunau)
Channels       : 1
Sample Rate    : 48000
Precision      : 16-bit
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

play INFO sox: effects chain: input        48000Hz  1 channels
play INFO sox: effects chain: synth        48000Hz  1 channels
play INFO sox: effects chain: dither       48000Hz  1 channels
play INFO sox: effects chain: output       48000Hz  1 channels
In:0.00% 00:00:00.00 [00:00:00.00] Out:0     [      |      ]        Clip:0    
Memory fault (core dumped)

$ gdb ~/bin/sox sox.core
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/hans/bin/sox...done.
[New process 1]
Core was generated by `sox'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  sunwrite (ft=0x713985f0c400, pInput=0x713986083000, cInput=7040)
    at sunaudio.c:481
481                         SOX_SAMPLE_TO_SIGNED_16BIT(pInput[i], cClips);
(gdb) bt
#0  sunwrite (ft=0x713985f0c400, pInput=0x713986083000, cInput=7040)
    at sunaudio.c:481
#1  0x000071398601a3bd in sox_write (ft=0x713985f0c400, buf=<optimized out>,
    len=<optimized out>) at formats.c:1037
#2  0x0000000000404be0 in output_flow (effp=<optimized out>,
    ibuf=<optimized out>, obuf=<optimized out>, isamp=0x7f7ffff6b6b0,
    osamp=<optimized out>) at sox.c:644
#3  0x0000713986029f7d in flow_effect (n=3, chain=0x713985f1c0c0)
    at effects.c:257
#4  sox_flow_effects (chain=<optimized out>,
    callback=callback@entry=0x40443e <update_status>,
    client_data=client_data@entry=0x0) at effects.c:449
#5  0x0000000000408a33 in process () at sox.c:1780
#6  main (argc=<optimized out>, argv=<optimized out>) at sox.c:2988


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

Reply via email to