From alsa-devel-owner@alsa.jcu.cz  Mon Oct 26 05:28:34 1998
Received: from io.nu (qmailr@dogbert.advancenet.net [209.44.30.54])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id FAA00565
	for <alsa-devel@alsa.jcu.cz>; Mon, 26 Oct 1998 05:27:08 +0100
From: sterwill@io.nu
Received: (qmail 526 invoked by uid 1000); 26 Oct 1998 10:27:04 -0000
Message-ID: <19981026102704.525.qmail@io.nu>
Subject: Machine locks on record, ALSA to blame?
To: alsa-devel@alsa.jcu.cz
Date: Mon, 26 Oct 1998 10:27:04 +0000 (GMT)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

[this got to the user list, but not devel list because I screwed up
 the address, this is the devel copy.]

This is a long message, but it's a critical problem I'm trying to
solve.  If you're not Jaroslav (or the OSS emulator maintainer),
maybe you don't want to read it.  Or maybe you do; maybe you've
got the same problem (I hope I'm not the only one).

I've been using ALSA for a while now, before ALSA I used Jaroslav's
great Ultra driver set.  About the time I switched to ALSA and its OSS 
PCM emulation, I noticed that using CERES SoundStudio would lock the 
machine after recording more than 20 or so seconds of audio.

SoundStudio reads off /dev/dsp, and since it's designed for high 
performance audio (for a PC), I'm assuming it's using some very large
buffers.  If someone wants me to strace the recording process, I'll
gzip the file and send it on.  SoundStudio is proprietary software
and I wish I had source code for it.  I'll provide any system 
settings anyone wants to know.  I'm using default DMA buffer sizes
(auto?) and there aren't any other problems (IRQ/DMA/io port)
with any other applications.  This problem is only caused when
the recording stops (closes the /dev/dsp device) from SoundStudio.

I'm doing recording at 44.1 KHz, 16-bit, stereo, with the line-in
as the recording device.  The problem is that after recording audio
for more than about 20 seconds (short clips have no problem), and then
stopping the record (which is closing /dev/dsp and recovering data from
disk buffers (SoundStudio's own) to be analyzed and shown in a waveform
graph) then X locks, the mouse doesn't move, and the machine (Linux
2.1.125 SMP) stops responding to input.  I don't have a machine on this
local network, so I can't tell if it's still got network.  I presume
it does not.

Normally, if one has the special SysRq functions enabled, I could hit
Alt-PrnScrn-S to sync the disks, Alt-PrnScrn-U to unmount them, and
Alt-PrnScrn-B to reboot.  I can't sync or umount on this type of lock,
but the reboot function works.  This is weird, nothing else makes this
happen.  Just thought I'd throw that out.

Back to solving the problem... this has happened throughout many kernel
versions.  I'm sure, though, that after I switched to the 2.1 series
from the 2.0 series, things worked fine.  At that time, I was using
a 2.1 kernel, a Gravis UltraSound PnP with 4 MB RAM, and SoundStudio.
No problems with lockups... I could record 10 minutes of audio if 
I wanted (and had the free space).  I'm not sure if I was using ALSA
by then or not, maybe just the old Ultra drivers

About that time, I must have switched to ALSA, but I seem to remember
that recording worked just fine in SoundStudio (btw, no other 
app ever has this problem, like recording large amounts of data
with arecord, which doesn't use /dev/dsp, I presume).  So, if ALSA
worked then, with a Gus PNP and kernel 2.1, perhaps the day it stopped
working was after I'd upgraded ALSA.  Nothing else changed.

Now, I've got a Turtle Beach Malibu in there (because the GUS had
InterWave DSP noise problems), and I was hoping the problem would go
away; it didn't.  The new card is even in another ISA slot, so that's 
not it (as long a shot as that was).

I'm using 2.1.125, SoundStudio (long, highly buffered(?) /dev/dsp
reads), and the TB Malibu (latest ALSA, must be pre8) and I
REALLY want to be able to do multi-track recording again.  :)

My guess is something has changed in the ALSA PCM module since the
version that worked.  Or, if ALSA never really did work in the first
place with SoundStudio, maybe ALSA has slightly different behavior
on closing /dev/dsp than the old Ultra drivers did.  I'll trace
through the PCM emulation code and take a look, but actually testing
is dangerous (I hate rebooting, especially when I can't sync/umount
beforehand).

Or, someone could point me to a nice multi-track audio recorder
for Linux, something that allows graphical waveform editing would
be nice, but just something that would allow me to get my guitar
stuff saved would do.  :)

--
Shaw Terwilliger (twig@advancenet.net)

