From owner-freebsd-multimedia Tue Jul 16 3:22:40 2002 Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8618237B400; Tue, 16 Jul 2002 03:22:38 -0700 (PDT) Received: from polaris.we.lc.ehu.es (polaris.we.lc.ehu.es [158.227.6.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06E0343E31; Tue, 16 Jul 2002 03:22:32 -0700 (PDT) (envelope-from jose@we.lc.ehu.es) Received: from v-ger.we.lc.ehu.es (v-ger-wl.we.lc.ehu.es [158.227.6.241]) by polaris.we.lc.ehu.es (8.11.6/8.11.6) with ESMTP id g6GAMTf27505; Tue, 16 Jul 2002 12:22:30 +0200 (MET DST) Received: from v-ger.we.lc.ehu.es (localhost [127.0.0.1]) by v-ger.we.lc.ehu.es (8.12.3/8.12.3) with ESMTP id g6GAN2gv000746; Tue, 16 Jul 2002 12:23:02 +0200 (CEST) (envelope-from jose@v-ger.we.lc.ehu.es) Received: (from jose@localhost) by v-ger.we.lc.ehu.es (8.12.3/8.12.3/Submit) id g6GAMwWu000745; Tue, 16 Jul 2002 12:22:58 +0200 (CEST) Date: Tue, 16 Jul 2002 12:22:58 +0200 From: "Jose M. Alcaide" To: Orion Hodson Cc: multimedia@FreeBSD.ORG Subject: Re: interrupts from pcm(4) while no sound is being played Message-ID: <20020716102258.GC259@v-ger.we.lc.ehu.es> References: <20020714224531.GA784@v-ger.we.lc.ehu.es> <200207151652.g6FGqbb18219@puma.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207151652.g6FGqbb18219@puma.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 4.6-RELEASE Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Jul 15, 2002 at 09:52:37AM -0700, Orion Hodson wrote: > | Is that the expected pcm(4) behaviour? > > Yes. > > Your application is holding the device open after writing data. By writing > data it starts the dma engine on the card, and as a result interrupts start > being generated by the audio device. With each interrupt, an attempt to pull > data from the s/w buffers is made. Your sound plays out, but then the > application does nothing anything to stop the dma engine (ie close the device > or use trigger ioctl) and so interrupts keep getting generated, the device > underflows, silence is written out. OK, thanks for your clear explanation. > There are quite a few applications where this behaviour is useful, ie games > that want to write sounds periodically and not continuously. And in general > it helps avoid weirdness when audio apps are struggling to get cpu cycles on > heavily loaded systems. My only concern is the possible impact of a high interrupt rate (~705 per second after playing a 44KHz, 16 bit sound) on the system performance. For example, that adds a CPU load of ~1.5% in my laptop (Celeron 433) while esd is holding the audio device open (I configured esd for using -and never freeing- /dev/dsp0.1). Cheers, JMA -- ****** Jose M. Alcaide // jose@we.lc.ehu.es // jmas@FreeBSD.org ****** ** "Beware of Programmers who carry screwdrivers" -- Leonard Brandwein ** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message