From owner-freebsd-multimedia Thu Jul 24 07:48:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA02378 for multimedia-outgoing; Thu, 24 Jul 1997 07:48:15 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id HAA02373 for ; Thu, 24 Jul 1997 07:48:09 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id PAA26145; Thu, 24 Jul 1997 15:38:55 +0200 From: Luigi Rizzo Message-Id: <199707241338.PAA26145@labinfo.iet.unipi.it> Subject: Re: dma handling in the sound driver To: brianc@milkyway.com (Brian Campbell) Date: Thu, 24 Jul 1997 15:38:55 +0200 (MET DST) Cc: freebsd-multimedia@FreeBSD.ORG In-Reply-To: <19970724092558.31924@milkyway.com> from "Brian Campbell" at Jul 24, 97 09:25:39 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > |Thanks for the detailed list. > > | > > |I am looking at the DSP_SETFRAGMENT thing, and while I have no problem > > |to implement it with the required features, it sounds quite odd that > > |the application requires many small buffers. If they are small it means > > |the app wants low latency, so why ask for many ? > > > > Small buffers gets it low latency on write()s. Many buffers minimizes the > > chance that the driver will have played everything by the time that it gets > > around to feeding it again. > > In addition, many small buffers allow applications do occasional large > write()s and not have to worry about waiting for several buffers to > empty before the write() can return. Well my point was that that way of requesting buffers is vstrictly related to the particular implementation. I believe the correct request should be 'I want X bytes of total buffering, and be guaranteed that the chunk size is at most Y bytes'. Of course I can assume X = Y*n_buffers. As a matter of fact, I believe that the small buffer size is really important on reads, not on writes, since the chunk size (Y) determines how long an already scheduled dma operation will take, and this is only critical for a read. If you do a short write, either there is no pending data, and you can start a dma op with the correct size, or there is a pending dma transfer, and you have no other choice of queueing the data and waiting. In the read case, a short read with no pending dma transfer can request the exact number of bytes, but a if a dma read has already been started, you are stuck with whatever size was requested before, unless you can poll the status of a dma transfer (which we can now :> ) and invoke tsleep() to wait for data to arrive. BTW the new driver is progressing fast. Yesterday I could hear my PnP CS4236 play audio using SB emulation, and as soon as I get a few spare hours for testing other modes should be ready. Cheers Luigi -----------------------------+-------------------------------------- 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/ _____________________________|______________________________________