From owner-freebsd-multimedia Fri Jul 18 03:11:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA13717 for multimedia-outgoing; Fri, 18 Jul 1997 03:11:56 -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 DAA13712 for ; Fri, 18 Jul 1997 03:11:47 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA17413 for multimedia@freebsd.org; Fri, 18 Jul 1997 11:07:33 +0200 From: Luigi Rizzo Message-Id: <199707180907.LAA17413@labinfo.iet.unipi.it> Subject: sound and dma ... To: multimedia@freebsd.org Date: Fri, 18 Jul 1997 11:07:33 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-multimedia@freebsd.org X-Loop: FreeBSD.org Precedence: bulk looking at the dma code in the sound driver (dmabuf.c) it appears that the driver supports the splitting of the buffers in a number of sub-buffers, so that some can be initialized with data while another one can be in use for the dma engine. This should serve to avoid clicks and interruptions in the flow of sound data especially at high speeds. However: - this mechanism really seems overkill, two buffers being sufficient (and additional buffering can be implemented separately if needed); - i am not sure if the mechanism is really used at all. The default in the code is to use only ONE buffer, and can be overridden only if some application issues one of these two ioctls: SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE (and still... they could be implemented as nops and let two buffers be the default as in pcaudio.) Can you please do a grep on the sources of your favourite sound applications to see if they happen to use one of the two ioctls above ? In rewriting the dma code I would certainly prefer not to deal with this overly complex mechanism and go with plain double buffering. Thanks 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/ _____________________________|______________________________________