Re: [linux-audio-user] [OT?] Sound card hardware buffers and other questions

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Wed Nov 02 2005 - 19:27:44 EET

John Anderson wrote:
> First question: I'm trying to get my head around how sound cards work.
> My Terratec, for instance, has several IO ports. Are there buffers on
> the card itself "behind" those IO ports?

Yes.

> If so, how big would they be?

So big that the card can get the following samples from the computer while the
samples in the buffer are being played.

USB devices use buffers that are bigger than one millisecond because data
packets are sent once per millisecond. PCI devices usually use about 32 or 64
bytes because the following samples are only a memory access away (though PCI
bus master memory reads are slower than those from the processor). The AD1848
in PIO mode has a buffer of one sample.

> Second question: I've noticed that with jackd, the lower the period
> size, the more interrupts per second there are from the sound card. This
> is because smaller buffers need to be cleared out more often, right?

Yes.

> So how many interrupts per second would be "too many"?

When the computer uses up too much time handling all those interrupts.
"Too much" is, of course, rather subjective.

> Obviously this isn't a fixed number but would depend on CPU speed, system
> load etc etc. How does one go about finding a good balance between interrupts
> / second and throughput?

Test various settings.

HTH
Clemens
Received on Thu Nov 3 00:15:05 2005

This archive was generated by hypermail 2.1.8 : Thu Nov 03 2005 - 00:15:05 EET