From owner-freebsd-hackers Sat Feb 21 07:33:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA03524 for freebsd-hackers-outgoing; Sat, 21 Feb 1998 07:33:14 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA03518 for ; Sat, 21 Feb 1998 07:33:07 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id OAA02827; Sat, 21 Feb 1998 14:58:41 +0100 From: Luigi Rizzo Message-Id: <199802211358.OAA02827@labinfo.iet.unipi.it> Subject: minor bug (fix) in pcaudio and pcm drivers To: hackers@FreeBSD.ORG Date: Sat, 21 Feb 1998 14:58:40 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG A minor bugfix for my audio driver and pcaudio. The problem is with signals delivered to a process writing to the audio device the system: if you try cat /dev/zero > /dev/dsp (or cat /dev/zero > /dev/pcaudio) and press Ctrl-C : for a second or two the system appears to freeze (e.g. the cursor will disappear if you move the mouse, xclock blocks, etc.). I think that interrupts etc. still run so the problem is not too terrible, but still annoying The problem has been there for a long time, since I thought that a ctrl-c would cause tsleep() to return EINTR, not ERESTART. If someone can explain why i'd be glad to know... In any case the fix is trivial (attached below -- file dmabuf.c). The same problem is present in /sys/i386/isa/pcaudio.c (at least on 2.2.1 -- i am not too -current so i don't know if it has been fixed recently) where an ERESTART returned by the tsleep() is discarded. The fix there is equally simple -- remove the test for ERESTART in the two lines which use it, which look like this: if (error != 0 && error != ERESTART) { While you are at it, there is a minor bug in sb_dsp.c -- the driver reports ESS cards as able to do 16-bit, but it has no support for it. So, in file /sys/i386/isa/snd/sb_dsp.c line 621 below should be removed: 621: d->audio_fmt |= AFMT_S16_LE; /* not yet... */ Ok, here follows the simple patch to /sys/i386/isa/snd/dmabuf.c cheers luigi --- /tmp/dmabuf.c Sat Feb 21 14:10:48 1998 +++ dmabuf.c Sat Feb 21 14:03:07 1998 @@ -273,7 +273,7 @@ if (ret == EINTR) d->flags |= SND_F_ABORTING ; splx(s); - if (ret == EINTR) + if (ret == EINTR || ret == ERESTART) break ; continue; } @@ -556,7 +556,7 @@ if (ret == EINTR) d->flags |= SND_F_ABORTING ; splx(s); - if (ret == EINTR) + if (ret == EINTR || ret == ERESTART) break ; continue; } -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message