summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-06-02 17:08:12 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-06-02 17:08:12 +0000
commit1767596cfc7d7e2a1655ae142dedc13624da0508 (patch)
tree5a38d9a2ae03857c9324a5ed28f692d2d1d9e607 /usr.bin/aucat
parentccd1e262894f7acabd967326df8b448735c875c1 (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')
-rw-r--r--usr.bin/aucat/aucat.c9
-rw-r--r--usr.bin/aucat/dev_sun.c3
2 files changed, 10 insertions, 2 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;
diff --git a/usr.bin/aucat/dev_sun.c b/usr.bin/aucat/dev_sun.c
index 951a8a484f0..a2ab57684ad 100644
--- a/usr.bin/aucat/dev_sun.c
+++ b/usr.bin/aucat/dev_sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_sun.c,v 1.2 2008/05/28 07:36:23 ratchov Exp $ */
+/* $OpenBSD: dev_sun.c,v 1.3 2008/06/02 17:08:11 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -202,6 +202,7 @@ void
dev_done(int fd)
{
close(fd);
+ DPRINTF("dev_done: closed\n");
}
/*