[Ffmpeg-devel] alsa input / output

Vladimir Mosgalin mosgalin
Wed Mar 21 02:19:12 CET 2007


Hi Michael Niedermayer!

 On 2007.03.21 at 00:57:20 +0100, Michael Niedermayer wrote next:

> so the low quality resampler from libsamplerate sounds better to you then

What do you mean, "low quality"? Does it sound THAT low to you? It
sounds perfectly fine to me.

SINC resamplers better than FASTEST just aren't better. Then can even
sound worse. Not really a big deal, they are all pretty good though. I
understand that they are better when it comes to math, but what my ears
tell be matters more. It's not like I'm denying the math, everything can
be explained with it, but perceived audio quality is a very difficult
subject, often things that aren't even considered matter a lot.

Also please note that I'm not using libsamplerate directly, I'm using
alsa rate converting filters based on libsamplerate. I doubt that it
matters though.

> the high quality ones from libsamplerate, while i dont have much faith
> in libsamplerate i cant belive that their fast low quality code sounds
> better then their hq code, maybe your audio hardware is broken and the
> additional low pass filtering done by low quality resamplers mask that
> your furher comment below points strongly in that direction, only very
> odd hardware is limited to 24bit/sample

Well.. I'm outputting sound to external DAC, so sound card does no
processing at all (yes, I checked it by recording what I'm playing back
from s/pdif in). It's the matter of quality of s/pdif coax cables and
transmitter/receiver circuits, but they should be pretty good (besides,
I'm using wordclock, external synchronization from DAC). At least output
from this (external USB) sound card is much better than from Audigy 2
ZS, which I used before and still have plugged it - its digital output
is worse and analog is pure crap compared to this one.

> besides this it would be interresting to run proper double blind tests
> between libsamplerate and the lavc resampler, if libsamplerate beats us

Well, as a biased way of doing this, with special fragments of sound
that expose some of the resamplers' problems the difference should be
clear for everyone. (it's not that these fragments are artificial, it's
just that human's ear is really sensitive to distortion in their sound).
They won't show you very subtle difference between resamplers on real
content, but you will be able to hear which resamplers produce more
distortion. Google for Chenoa_16KHz.wav, Androgyny_16KHz.wav, udial.wav,
SB_test.wav. (they are about 500khz each, I can send you them by email
if you are interested). Making them sound perfect would be a good start,
and necessary step before moving to double blind tests on real content.

Btw, I tried lavcresample on 44100 material with these settings:
lavcresample=48000:32:1:12
lavcresample=48000:64:0:14
lavcresample=48000:32:0:12
lavcresample=96000:32:0:12
("linear" flag improves quality a bit with low "count" number, but isn't
useful otherwise)

> it would be trivial to use their filter, after all samplerate conversation
> is just a trivial linear equation with coefficients choosen to please

I don't know why you care about that. If you care about quality of audio
processing in ffmpeg or mplayer, things that need to be done are pretty
clear: pure 32-bit int of float processing for audio chain with
configurable dithering and noise shaping to 16/24 bits at the last
stage. Picking up on resampler isn't really a good place to start..

If you have soundcard that supports 44100hz output, I can send you a
patch which adds dithered (24 bit to 16) output to mplayer's mad decoder
(I guess no explanation needed why other decoders are much worse). Of
course, if sound card or mplayer or alsa will have to do 44.1-48khz
16bit->16bit resampling, you won't see any effect. But otherwise, you
can hear the difference for yourself. Of course, mp3 quality doesn't
really matter much, but if one can get more quality, why not?

> the latest audophile trend

Very funny. You really believe that you have to choose between
"pleasant-sounding" and "mathematically correct" when it comes to this
kind of digital processing?

-- 

Vladimir




More information about the ffmpeg-devel mailing list