Commit Graph

230 Commits

Author SHA1 Message Date
Alexandre Ratchov 2606d3f24e Add support for FreeBSD raw usb-midi devices. Bits from Tobias
Kortkamp <t@tobik.me> plus configure script tweaks.
2016-11-06 12:21:59 +01:00
Alexandre Ratchov 9cb5193ca7 sio_oss.c: In full duplex-mode, don't require play and rec
buffer sizes to be the same. Only the block sizes need to be the
same.
2016-11-05 07:21:28 +01:00
Alexandre Ratchov 8c95537698 sio_oss.c: Disallow tiny fragment sizes, as they may overload
the system. And as sndiod runs with increased priority, it would
consume all the cpu and could in turn hang the system.
2016-11-05 07:14:46 +01:00
Alexandre Ratchov c25d86c7db sio_oss.c: if the requrested block size is a power of two
make the oss block size calculation return the requested value.
2016-11-05 07:11:08 +01:00
Alexandre Ratchov 4f56ff6181 In sio_oss_revents() use the fifo_samples counter returned
by SNDCTL_DSP_CURRENT_{I,O}PTR to determine the device current
position. Besides being simpler than using the absolute position,
this fixes hangs in record-only mode.
2016-11-05 07:02:39 +01:00
Alexandre Ratchov c5daeee294 On OSS/FreeBSD, set poll(2) threshold to 1 byte, so that it returs
POLLIN/POLLOUT whenever read/write can be called without blocking. By
default OSS use 1 block of threshold.
2016-11-04 19:12:07 +01:00
Alexandre Ratchov 2b58ec0677 Remove forgotten debug printf in sio_oss.c 2016-11-04 14:14:52 +01:00
Alexandre Ratchov db20298468 Use the SNDCTL_DSP_SETTRIGGER interface to start/stop the device, this
allows the "onmove" callback to be called whenever the DMA actually
starts (and not on the first write). This also removes the need for
sio_osee_setpar() call every time the device is stopped.
2016-11-04 14:09:42 +01:00
Alexandre Ratchov 9be2c65600 Allow programs using OSS/FreeBSD backend to select the buffer size.
According to kernel sources, SNDCTL_DSP_POLICY ioctl doesn't seem to
always set play and rec buffer sizes to the same value.  That's why we
use the SNDCTL_DSP_SETFRAGMENT ioctl instead.
2016-11-04 11:03:41 +01:00
Alexandre Ratchov a282420a49 In OSS/FreeBSD sio_setpar(), validate the encoding, ensuring we
never end-up with an unknown one.
2016-11-04 09:18:04 +01:00
Alexandre Ratchov 4d6d7700a4 Make sio_getpar() on OSS/FreeBSD return the device block size/count
instead of saved ones. Fixes busy loops caused by poll(2) returning
POLLOUT after the program has filled its play buffer.
2016-11-04 08:05:47 +01:00
Alexandre Ratchov e867d773fa Tweak spacing of sio_oss.c to look more like other files. 2016-11-03 08:09:11 +01:00
Alexandre Ratchov d396d690d1 Add support for OSS/FreeBSD. From Tobias Kortkamp <t@tobik.me>. 2016-11-03 08:04:47 +01:00
Alexandre Ratchov 20a7e3c46e switch back into using a single "filling" flag to determine
whether playback is started
2016-05-16 07:53:05 +02:00
Alexandre Ratchov 85c75911dc switch to new obsd audio api 2016-03-16 07:48:13 +01:00
Alexandre Ratchov b5a1760af3 unexpand tabs 2016-01-09 09:23:56 +01:00
Alexandre Ratchov cbaa92d4d8 better debug mesg 2016-01-09 09:20:46 +01:00
Alexandre Ratchov 99cfc04004 fit code in 80 columns, remove traing spaces 2016-01-08 21:51:12 +01:00
Alexandre Ratchov aa4fc43964 move sndiod manual to sec 8 2016-01-07 17:48:47 +01:00
Alexandre Ratchov 37cdacd0aa crank major (openbsd specific changes) 2015-12-30 12:54:40 +01:00
Alexandre Ratchov 7530bbf6d2 Pass full device name to audio/midi backends. 2015-12-09 11:13:11 +01:00
Alexandre Ratchov 8bb88f248f if no -f or -q are used, attach rsnd/[0-3] and rmidi/[0-7] 2015-10-20 15:25:54 +02:00
Alexandre Ratchov bbfde03621 please gcc 2015-10-20 09:15:09 +02:00
Alexandre Ratchov 5d431d3616 Replace hard-coded strings with macros, replace PATH_MAX with actual
string length, validate audio and midi device numbers
2015-10-02 14:28:17 +02:00
Alexandre Ratchov 6ddedf6c9f remove unused AUCAT_COOKIE environment variable 2015-10-01 08:50:13 +02:00
Alexandre Ratchov 7062d226ac remove useless quoting and fix typos, from schwarze@ 2015-10-01 08:49:47 +02:00
Alexandre Ratchov a162cfd9e6 remove mixer api files 2015-08-28 09:03:49 +02:00
Alexandre Ratchov e8007feb00 move the mixer api to a dedicated "mixer" branch 2015-08-28 08:57:47 +02:00
Alexandre Ratchov 9ff8e621d0 typos in comments and strings 2015-08-26 10:27:22 +02:00
Alexandre Ratchov dbebd9982f Fix typos, from Peter Piwowarski <peterjpiwowarski at gmail.com> 2015-08-13 17:37:45 +02:00
Alexandre Ratchov 29516de2c3 Use "Ev" macro for AUCAT_COOKIE environment variable. From Michael
Reed <m.reed at mykolab.com>. Thanks.
2015-08-01 12:31:36 +02:00
Alexandre Ratchov 5edf525314 switch to now AUDIO_GETPOS interface 2015-07-31 17:35:54 +02:00
Alexandre Ratchov f4aff492a8 use single .so.min.maj link for .so 2015-07-15 10:37:46 +02:00
Alexandre Ratchov 07ee111086 readd soname with major, needed on linux 2015-07-09 17:13:01 +02:00
Alexandre Ratchov 72e727b865 drop soname 2015-07-08 17:59:05 +02:00
Alexandre Ratchov 8468b9f0a0 rename grp->func 2015-06-04 06:12:38 +02:00
Alexandre Ratchov 33ad1a504d fix missing brace mistake, from jsg@ 2015-05-05 14:45:55 +02:00
Alexandre Ratchov b3a8f99047 make the label use chan1 as parameter 2015-03-12 08:20:23 +01:00
Alexandre Ratchov 0c4e64484d append _in _out to mic/spkr/hp/... only 2015-03-06 10:39:51 +01:00
Alexandre Ratchov 99ca91c6b3 suffix stream names with -in, -out, -rec 2015-03-06 08:53:40 +01:00
Alexandre Ratchov 905c319315 use strings rather than channel numbers 2015-03-05 10:12:34 +01:00
Alexandre Ratchov 4717cf976d include limits.h and unbreak build 2015-02-25 08:37:50 +01:00
Alexandre Ratchov 52e645e422 handle EINTR when reading /dev/urandom 2015-02-16 18:56:30 +01:00
Alexandre Ratchov 98027ba688 use SOCK_CLOEXEC 2015-02-16 11:52:36 +01:00
Alexandre Ratchov d27e0e138f don't force poll to sleep at block boundaries 2015-01-19 18:22:42 +01:00
Alexandre Ratchov b989e17c05 don't use openbsd-specific SOCK_CLOEXEC 2015-01-18 00:16:36 +01:00
Alexandre Ratchov debf3b302c stop using param.h, from deraadt@ 2015-01-18 00:09:04 +01:00
Alexandre Ratchov 26400ac4de set default xrun mode 2015-01-17 21:08:11 +01:00
Alexandre Ratchov e36de0d10b fix bsd-compat related warnings on linux 2014-12-29 12:55:43 +01:00
Alexandre Ratchov 7834cb2a56 drop support for ":" in device names 2014-11-18 10:31:18 +01:00