From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.programmer,comp.os.msdos,comp.os.msdos.djgpp,comp.os.msdos.misc Subject: Re: Control timing Date: 2 Nov 2001 11:50:13 GMT Organization: Aachen University of Technology (RWTH) Lines: 40 Message-ID: <9ru19l$940$1@nets3.rz.RWTH-Aachen.DE> References: <8ea1626e DOT 0110280229 DOT 68dc811b AT posting DOT google DOT com> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1004701813 9344 137.226.32.75 (2 Nov 2001 11:50:13 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 2 Nov 2001 11:50:13 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In comp.os.msdos.djgpp jeffchan wrote: > Actually, the input data is analog voice data. I need to control an > capture card to read and store it into hard drive. Now i find that > some strange sound like "tak" in my recorded file. It appears in each > times i use fwrite() to put the data from buffer into a file. When i > change the buffer size, the period of the "tak" is also changed. That "tak" is almost certainly caused by those sound IRQ that are lost while the fwrite() call is working. This kind of problem is what caused the makes of Soundblaster cards to add DMA capabilities. Those allow you to let your sound card work on its own, for a while, instead of having to poll it or handle IRQ's at a very high frequency. If your capturing hardware doesn't support DMA, I suspect you'll have to avoid doing file I/O until you're done capturing to be really certain you avoid such problems. Today's computers should be able to handle several minutes of incoming data in RAM. 64 MB is about 10 minutes's worth of CD-quality stereo audio data, after all. It may be possible to make do with an additional real-mode IRQ handler, but that would raise the complexity of the whole task by quite a bit. > On the other hand, i create the file's name be around 23 > characters(including extension). Of course under dos will cuts it out. > Does any method let me use long file name? Under raw DOS, you'ld need a special TSR driver for that. The FAQ has pointers to a few of those, IIRC. But unless you have a very pressing need to have such long names, I'd suggest to avoid that additional complexity to ease solving your IRQ latency problems, first. That TSR has to wedge itself rather deeply into DOS' inner machinery, and that quite certainly won't make your fwrite()'s any faster. [And please don't quote a whole article body you're replying to if you're not *referring* to any of it. Text-at-top-with-fullquote-below is regarded terribly bad style in most of Usenet.] -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.