diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-06-02 17:08:12 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-06-02 17:08:12 +0000 |
commit | 1767596cfc7d7e2a1655ae142dedc13624da0508 (patch) | |
tree | 5a38d9a2ae03857c9324a5ed28f692d2d1d9e607 /usr.bin/aucat/aucat.c | |
parent | ccd1e262894f7acabd967326df8b448735c875c1 (diff) |
if aucat is suspended, then the kernel continues running the device
(produces silence) and later, once aucat is resumed the kernel starts
dropping samples, it will try to drop as many samples as silence was
produced. So suspending breaks the aucat process permanently.
workaround this by blocking the signals ie disabling suspending of aucat
from the tty. The long term solution would be to catch SIGCONT and to stop
the device, resync/refill buffers and restart the device. That's really a
lot of work...
ok jakemsr
Diffstat (limited to 'usr.bin/aucat/aucat.c')
-rw-r--r-- | usr.bin/aucat/aucat.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 93cedcf5560..50d2143b0c4 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.22 2008/06/02 17:06:36 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.23 2008/06/02 17:08:11 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -359,6 +359,7 @@ sighdl(int s) int main(int argc, char **argv) { + sigset_t sigset; struct sigaction sa; int c, u_flag, quiet_flag, ohdr, ihdr, ixrun, oxrun; struct farg *fa; @@ -481,6 +482,12 @@ main(int argc, char **argv) sa.sa_handler = sighdl; if (sigaction(SIGINT, &sa, NULL) < 0) err(1, "sigaction"); + + sigemptyset(&sigset); + (void)sigaddset(&sigset, SIGTSTP); + (void)sigaddset(&sigset, SIGCONT); + if (sigprocmask(SIG_BLOCK, &sigset, NULL)) + err(1, "sigprocmask"); file_start(); play = rec = mix = sub = NULL; |