Commit Graph

1095 Commits

Author SHA1 Message Date
Alexandre Ratchov a62cf921ae tweak spacing in configure 2017-02-14 14:33:33 +01:00
Alexandre Ratchov e7fb8de7bd redice difference in aucat/utils.c 2017-02-14 14:32:46 +01:00
Alexandre Ratchov 7cfbabca97 tweak spacing in Makefile 2017-02-14 14:31:18 +01:00
Alexandre Ratchov 644aec6aa9 Remove unnecessary includes. From Michael W. Bombardieri <mb at ii.net>. 2017-02-14 14:29:23 +01:00
Alexandre Ratchov 4ea9d75c66 Set device rate to calculated rate. 2017-02-14 14:28:15 +01:00
Alexandre Ratchov 3de9779a59 Use -io options to specify files and -q option to specify one
or two ports, allowing port-to-port transfers.
2017-02-14 14:24:08 +01:00
Alexandre Ratchov 610a0fa247 Include sys/socket.h to minimize differences with pledged code 2017-02-14 14:23:53 +01:00
Alexandre Ratchov a560f09bb6 sync utils.c to sndiod one 2017-02-14 14:23:40 +01:00
Alexandre Ratchov 7d9db26e38 Use a goto to factor all calls to close() when listen_in() returns
an error. From Michael W. Bombardieri. Thanks.
2017-02-14 14:23:31 +01:00
Alexandre Ratchov 1b8223b94b Many typos in comments. From Michael W. Bombardieri. Thanks. 2017-02-14 14:23:24 +01:00
Alexandre Ratchov 0540006ea1 log file volume 2017-02-14 14:23:18 +01:00
Alexandre Ratchov 0c783bd3b0 Add support for FreeBSD raw usb-midi devices. Bits from Tobias
Kortkamp <t@tobik.me> plus configure script tweaks.
2017-02-14 14:22:57 +01:00
Alexandre Ratchov 8744522757 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.
2017-02-14 14:22:10 +01:00
Alexandre Ratchov b3acce35f8 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.
2017-02-14 14:21:38 +01:00
Alexandre Ratchov fdca3c2678 sio_oss.c: if the requrested block size is a power of two
make the oss block size calculation return the requested value.
2017-02-14 14:21:27 +01:00
Alexandre Ratchov 39d885892e 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.
2017-02-14 14:21:07 +01:00
Alexandre Ratchov 0eaaa8eb20 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.
2017-02-14 14:20:58 +01:00
Alexandre Ratchov 3896b504e3 Remove forgotten debug printf in sio_oss.c 2017-02-14 14:20:50 +01:00
Alexandre Ratchov 486b490756 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.
2017-02-14 14:20:43 +01:00
Alexandre Ratchov c2be662282 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.
2017-02-14 14:20:31 +01:00
Alexandre Ratchov a25bc8355a In OSS/FreeBSD sio_setpar(), validate the encoding, ensuring we
never end-up with an unknown one.
2017-02-14 14:20:17 +01:00
Alexandre Ratchov a88873c661 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.
2017-02-14 14:20:03 +01:00
Alexandre Ratchov 89f3ea0426 Tweak spacing of sio_oss.c to look more like other files. 2017-02-14 14:19:33 +01:00
Alexandre Ratchov 02c2d1521c Add support for OSS/FreeBSD. From Tobias Kortkamp <t@tobik.me>. 2017-02-14 14:19:25 +01:00
Alexandre Ratchov dd3f3ee5ee Fix many typos in comments, from Michael W. Bombardieri <mb at ii.net> 2017-02-14 14:16:57 +01:00
Alexandre Ratchov 3d710ac721 Use -io options to specify files and -q option to specify one
or two ports, allowing port-to-port transfers.
2017-01-18 10:26:27 +01:00
Alexandre Ratchov 044421aad7 Include sys/socket.h to minimize differences with pledged code 2017-01-03 08:50:48 +01:00
Alexandre Ratchov 2f5165d92f sync utils.c to sndiod one 2017-01-03 08:20:49 +01:00
Alexandre Ratchov 209e88bbde Use a goto to factor all calls to close() when listen_in() returns
an error. From Michael W. Bombardieri. Thanks.
2017-01-03 08:10:11 +01:00
Alexandre Ratchov 22a64d1845 Many typos in comments. From Michael W. Bombardieri. Thanks. 2017-01-03 08:08:17 +01:00
Alexandre Ratchov 6c1c0d3ff6 Remove unnecessary includes. From Michael W. Bombardieri <mb at ii.net>. 2017-01-03 08:05:41 +01:00
Alexandre Ratchov 474ac8d426 log file volume 2017-01-03 07:28:52 +01:00
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 bcb3014206 Fix many typos in comments, from Michael W. Bombardieri <mb at ii.net> 2016-10-27 06:38:21 +02:00
Alexandre Ratchov c8f92682a4 use setgid() and setuid() 2016-10-24 17:06:28 +02:00
Alexandre Ratchov 017e60c967 use setgid() and setuid() 2016-10-24 17:05:47 +02:00
Alexandre Ratchov efcb274355 drop privs after daemonizing, reorder clean-up 2016-10-20 07:34:38 +02:00
Alexandre Ratchov 4dcfed9dce remove braces around single-statement block 2016-10-20 07:32:27 +02:00