From 1767596cfc7d7e2a1655ae142dedc13624da0508 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 2 Jun 2008 17:08:12 +0000 Subject: 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 --- usr.bin/aucat/aucat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'usr.bin/aucat/aucat.c') 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 * @@ -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; -- cgit v1.2.3