Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2002 12:22:58 +0200
From:      "Jose M. Alcaide" <jose@we.lc.ehu.es>
To:        Orion Hodson <orion@FreeBSD.ORG>
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>
In-Reply-To: <200207151652.g6FGqbb18219@puma.icir.org>
References:  <20020714224531.GA784@v-ger.we.lc.ehu.es> <200207151652.g6FGqbb18219@puma.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020716102258.GC259>