PLEX86  x86- Virtual Machine (VM) Program
 CVS  |  Mailing List  |  Download  |     Newsgroups    

More Ubuntu 5.04 observations 168 plus 136


Your Ad Here

Your Ad Here

Technically, it's possible to do software mixing with low latency, but then your CPU usage gets significantly higher.

The way most sound hardware works these days is with a buffer of data. You give it N bytes and say, 'here, play this'. Then the card DMAs the data and plays it. The program needs to have a new buffer ready when the old one is finished. If not, the card will usually just start playing the buffer over from the beginning. (This, BTW, is why a crash often results in the sound card playing a short fragment of sound over and over.)

Now, the bigger the buffer, the less overhead the program has to worry about to feed the sound card. But, since it's not generally possible to interrupt the card before the buffer's done, there's a delay of up to one buffer's length before a new sound can be played - hence latency. So, a balance needs to be struck between 'big enough buffer not to needlessly eat CPU' and 'small enough buffer to prevent noticeable latency'.

When playing multiple sounds, you have to sum them up and normalize them (to prevent overflow). Many modern sound cards can do this in hardware - the card can accept multiple buffers at a time and mix them itself, without the CPU having to do all the summing and normalizing. One side benefit of this is that multiple programs can have the card open and be playing sounds - they don't have to know or care what other programs may be doing. (Google for "hardware mixing" and "multi open".)

But lots of sound hardware (the most common these days being the venerable AC97 codec built in to many (most?) motherboards) doesn't mix in hardware. It can only play one buffer at a time, and thus only one program can talk to the sound card at a time.

One in three music CDs 'illegal
One in three music CDs 'illegal' inset: Compact discs An estimated 1.2 billion pirate CDs were sold in 2004 One in three...

So, a software mixing daemon can be used. Lots of programs talk to the daemon, and the daemon does the mixing and sends it to the sound card. Nice in theory, but there are issues with the practice. How big a buffer should it use, for example?

A smaller buffer pumps up the CPU usage, a bigger buffer is nicer on the rest of the system but increases latency. ESD aims toward lower CPU usage and its buffers are relatively large. It can be problematic using it for a game, but for music and random desktop sound effects it's pretty good. On the other end of the spectrum, you have, say, the built-in sound mixing that Id software wrote for Doom3, which can consume up to 5% of a *modern* CPU (imagine it on an older machine...), but mixes in realtime.

More Ubuntu 5.04 observations 168 plus 137
begin Error Log for Sat, 25 Jun 2005 04:49:52 +0000 - GeneralPF Haven't played much with Rhythmbox, or any other audio media player-manager since I discovered amarok, it's the...
Microshaft website discriminating against Mozilla
In comp.os.linux.advocacy, 7 wrote on Mon, 27 Jun 2005 22:03:00 GMT Just out of curiosity: can you or someone identify those webpages? This is clear as mud at this point. Of course...

Microsoft appears to have decided to prioritize reducing latency, and is willing to take the CPU hit involved. Me, I just make sure

In the future there's JACK and ALSA has a 'direct mixing' module that should allow transparent multi-open even on cards that don't support it (falling back to software mixing behind the scenes). Hopefully in the end all common sound hardware will be multi-open

-- Sincerely,

To: AntiLinux Trolls
begin KillFileMe.vbs I don't know anything about Kontact. But I have doubts about it having the same capability and flexibility he mentioned. You could...

Ray Ingles (313) 227-2317

"Many people would sooner die than think. In fact, they do." - Bertrand Russell



Your Ad Here

Linux | Previous | Next

More Ubuntu 5.04 observations 168 plus 137

Linux Advocacy from Newsgroups

The #1 Usenet Provider on the Internet

SUSE LINUX 9.3 Released to Mirrors 168 plus 135