[MPlayer-dev-eng] [patch] prefer ALSA over OSS

Vladimir Mosgalin mosgalin at VM10124.spb.edu
Sat May 5 15:07:51 CEST 2007


Hi Rich Felker!

 On 2007.05.04 at 20:57:33 -0400, Rich Felker wrote next:

> And just a minute ago you were saying doing things in software (3d
> graphics) was a bad idea.. Now you say resampling should be done in
> software just because it can? Make up your mind!

Look, can't you really understand this?
Software processing is slow! CPU is fast enough for some audio
processing, but absolutely unacceptable for video processing.

Do you know that almost all shaders computation in modern graphics cards
have different "optimizations" and approximations? And computation
resolution is low. It's enough to get nice picture, though.. well..
usually. Unless card/driver developers didn't overoptimize it.  When
they develop their algorithms, they try them against reference
rendering. DirectX SDK has such thing as software renderer. Every new
directx version, which is the base of new features in graphics cards for
each new generation of them - sometimes very advanced features -
contains complete software implementation of these features. This
implementation does reference rendering. I don't even want to describe
how slow it is, but it's 100% in software, with high precision and
without approximate optimizations. And all real graphics cards calculate
this with approximations and in lower precision, but their final
rendering should be close enough to reference one. Sometimes it isn't,
and then a lot of people blame them, since as a result picture quality
is worse.  Sometimes it is, but it is never the same, due to different
nature of calculations.

Computation speed of latest graphics card can be over 10 times better
than FPU of latest cpus, but their command set is very limited and they
don't support same precision.

Therefore, for graphics cards pure software rendering CAN give slighlty
better quality but is 100-1000 times slower, so it's abosolutely
unacceptable. And there is no real point in it, since it's easier to
reduce amount of optimizations and increase GPU calculation precision if
needed, it's just not done because current result is acceptable. Still,
industry is moving, GPUs are becoming more and more universal and
someday they'll be very similar to modern CPUs.

As about sound cards, the situation is similar, but with two
differences. First, modern cpus are fast enough to do (almost) any kind
of audio processing. Second, sound cards are much cheaper than video
cards and carry much simpler DSPs. While some cards can do mixing, rate
conversion and apply processing effects, they don't do it good. Not
enough precision, too simple algorithms, too much optimizations.
Additionally, some complex effects can't be applied, so they have to be
done in software, cards can't mix too much audio streams at once
(required for professional applications) and so on.
Processor on the sound card is much slower than CPU, so it cannot do all
this kind of processing as good. Combined hardware/software processing
is more complex than pure software one and still limits precision,
that's why moving processing to CPU completely improves quality. Unlike
in video world, where doing it is simply impossible.

In video world, no one is striving for getting bit-accurate results, so
hardware approach, fast but inexact works fine. In audio world, people
want this, and that's why software (which can do processing with any
required precision and easily can be checked) together with very simple
hardware which does absolutely no processing and just delivers the
signal in a bit-accurate way is the right way.

Of course, there are exception from both rules. Professional 3d
rendering is done mostly in software (though nowadays combined with
hardware aid from GPU). Also hardware sound processors still exist, but
they are moved to hi-end professional sector. For example, this nice
card ($1700).
http://www.cwaudio.de/index.php?seite=scopeprofessional&lang=en
Probably the price is set high enough for people to stop wondering about
quality of its processing and instantly believe that it's absolute, but
who knows..

-- 

Vladimir



More information about the MPlayer-dev-eng mailing list