Log in

View Full Version : FFDShow Resampling Enhancement


Upsampler
6th March 2015, 07:55
Hi, I use ffdshow to listen music videos and dvds, I mainly use to use equalizer and resampler (to upsample). The reason I like ffdshow is that WMP and ffdshow have the best audio sound quality amongst media players I used. There are many media players with substandard audio quality. I don't understand how they code inferior sound.

Initially I checked this forum to ask new features. Then found out that further development has stopped. That's a pity! However if you still has some extension plans, you may include my wish list.

First is resampling. Upsampling is very important as there are many DACs handling higher frequencies, especially 192khz and 176.4khz. Supporting upsampling to include such frequency will be good. Supporting 2 times and 4 times sampling frequencies also useful. Improved upsampling sound quality will be very useful.

Second is that ffdshow only supports video tracks. So we cannot use resampler to audio-only contents such as CDs, FLAC, etc. If you add this, many audiophiles will enjoy superior sound.

Note that I installed ffdshow using "Media Player - Codec Pack".

filler56789
6th March 2015, 09:49
...

Second is that ffdshow only supports video tracks. So we cannot use resampler to audio-only contents such as CDs, FLAC, etc.

Completely false.

foxyshadis
6th March 2015, 10:09
First is resampling. Upsampling is very important as there are many DACs handling higher frequencies, especially 192khz and 176.4khz. Supporting upsampling to include such frequency will be good. Supporting 2 times and 4 times sampling frequencies also useful. Improved upsampling sound quality will be very useful.

What's wrong with the existing resampler?

e-t172
6th March 2015, 14:57
The reason I like ffdshow is that WMP and ffdshow have the best audio sound quality amongst media players I used. There are many media players with substandard audio quality. I don't understand how they code inferior sound.

They don't. You're imagining it. When it comes to pure audio playback software the programmer usually has to go out of its way to make it sound worse than the original. It's quite difficult to write audio playback software that degrades quality by accident, unless it's extremely obvious (e.g. drops, clipping). You're making quite an extraordinary claim, which I won't accept unless you have actual evidence to back it up.

Of course when I say that I'm assuming that your system is not broken, i.e. your audio drivers are working correctly, you're not injecting weird filters in between, etc.

First is resampling. Upsampling is very important as there are many DACs handling higher frequencies, especially 192khz and 176.4khz. Supporting upsampling to include such frequency will be good. Supporting 2 times and 4 times sampling frequencies also useful.

This is even less credible. There is absolutely no point whatsover in upsampling audio in a playback chain. None. At best it will make absolutely zero difference, at worst it will make it sound very slightly worse because DACs typically exhibit lesser audio performance when operating at higher sample rates.

There might be some terribly broken exotic DACs out there where higher sample rates do improve sound quality (e.g. broken antialiasing filters), but that just means your DAC is broken, not that you should upsample in software.

Upsampler
6th March 2015, 22:32
You're making quite an extraordinary claim, which I won't accept unless you have actual evidence to back it up.


In reality, sound quality differs significantly. I tried several media players using the same songs with the same settings back to back many many times for years. WMP and ffdshow have the best natural sound. vlc is also good. JRiver produce somewhat faded sound. feel like hearing over towels. resampler produce distortions like when you mix 5.1 to stereo. foobar2k is much worse. It looks like ultra-low and ultra-high sound are not properly amplified or missing. This problem is also present in Jriver to a lesser extent. Sound is uninspiring. So I don't use them

I used bass-rich smooth jazz titles to compare media players. How natural double bass and bass guitar sound is my main testing method. I use headphones. My DAC is plain and simple 24bit 192khz. It produces unaltered honest sound. It exposes sound difference quite well.

PS: This forum is very difficult to post due to crazy random question!

e-t172
7th March 2015, 00:31
In reality, sound quality differs significantly. I tried several media players using the same songs with the same settings back to back many many times for years. WMP and ffdshow have the best natural sound. vlc is also good. JRiver produce somewhat faded sound. feel like hearing over towels. resampler produce distortions like when you mix 5.1 to stereo. foobar2k is much worse. It looks like ultra-low and ultra-high sound are not properly amplified or missing. This problem is also present in Jriver to a lesser extent. Sound is uninspiring. So I don't use them

Anyone who has any experience writing audio software (such as myself, as I've been writing an audio filtering framework for a few years), or has even the slightest idea as to how audio playback software works, will find your statements laughable at best.

Audio playback is not rocket science. Unless you're using filters (and you shouldn't), all the player is doing is taking compressed audio, uncompressing it (using libraries that are mostly the same in all players, give the exact same output and have been thoroughly tested to be bit-perfect), and then feeding the PCM content to the system's audio API (DirectSound, WASAPI, etc.) using simple, completely mundane, bit-perfect memory copy operations.

It is extremely, extremely unlikely that any of these steps could go wrong in any non-obvious way (as opposed to obvious drops, glitches, etc.). And if it did, believe me, it would get reported, because it would be measurable (simply by measuring the output of the PC), and it would get fixed.

What you're claiming (sound differences between well-tested digital audio playback software with no filters enabled) is so ludicrous and makes so little technical sense that people would be foolish to believe anything you're saying unless you present them with extremely strong evidence to back up your claims (such as actual measurements done in controlled conditions). It is much more likely you're suffering from hearing bias (http://nwavguy.blogspot.co.uk/2012/04/what-we-hear.html).

I used bass-rich smooth jazz titles to compare media players. How natural double bass and bass guitar sound is my main testing method.

Are you testing double-blind? If you're not, I'm sorry, but it's all in your head.

You could ask a friend to switch audio players for you without telling you which is which. Then, if you can still tell the audio players apart, and assuming your experiment is not flawed (e.g. different volume settings), you might have a case. But again, that's pretty much impossible because such results would violate most of what is known about basic computer science, and I'm not even talking sampling theory yet (because it's still bit perfect at this point anyway).

My DAC is plain and simple 24bit 192khz.

There's no point in going above 16bit/48kHz (http://xiph.org/~xiphmont/demo/neil-young.html). At best it's humanly impossible to hear the difference, at worst your making it sound worse because most audio equipment doesn't perform as well (in the audible range that is) when you run it with parameters that are beyond the audible range. And again, upsampling stuff to 24bit/192kHz makes even less sense, because the additional (non-audible) data isn't there to begin with.

Upsampler
7th March 2015, 01:44
At best it's humanly impossible to hear the difference, at worst your making it sound worse because most audio equipment doesn't perform as well (in the audible range that is) when you run it with parameters that are beyond the audible range. And again, upsampling stuff to 24bit/192kHz makes even less sense, because the additional (non-audible) data isn't there to begin with.

My hearing test using a function generator shows that I can hear 10Hz with higher volume boost. So I can hear low frequency sound very well.

At decoder level, all media players may produce the same sound. But after going through various filters, final sound become very different. I use equalizers to correct my hearing and equipment characteristics. Quality of filters may play part.

Regarding upsampling. You seem to suggest that ffdshow resampler is no good. Assume that there is a perfect resampler which "guess" original sound "precisely". With such resampler, upsampling will produce better sound. Agreed?

In reality, such perfect algorithm does not exist. However it's easy to "closely guess" low and mid frequency sound. But high frequency will be difficult to guess closely. So there will be distortions. If distortions in high frequency does not matter, sound can be improved. Sound tracks dominated by low and mid frequency seems doing well with upsampling. This is my perception. Most of my favorate tracks are rich in low and mid frequency sound! So I prefer upsampling.

foxyshadis
7th March 2015, 08:52
https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Paris_Tuileries_Garden_Facepalm_statue.jpg/640px-Paris_Tuileries_Garden_Facepalm_statue.jpg

Sound does not work that way. Turning high frequencies into distorted garbage is actually your goal? That would do nothing but sound worse, and certainly won't improve the lows and mids.

Stick to your equalizers, boost the low/mid, use whatever resamplers you want, but ffdshow will not be changed in any way for this use case.

e-t172
7th March 2015, 11:22
My hearing test using a function generator shows that I can hear 10Hz with higher volume boost. So I can hear low frequency sound very well.

You're not hearing the 10Hz tone. You're hearing the non-linear distortion that results from trying to play a 10Hz tone at high volume on equipment that's not designed to do that. Harmonic distortion on a 10Hz tone will typically produce 20Hz, 30Hz, 40Hz... components, which are audible, but are obviously undesirable.

In addition, I'm not sure what your point is. Higher sample rates are about high frequencies, not low frequencies.

At decoder level, all media players may produce the same sound. But after going through various filters, final sound become very different. Quality of filters may play part.

Okay. Finally something I can somewhat agree with. Indeed, if you use the various filters that are bundled with the players, quality differences could be perceived because these filters can be implemented in several different ways. That said it depends on the filter type - it would be surprising to hear differences between parametric EQs that are configured in exactly the same way, for example.

Regarding upsampling. You seem to suggest that ffdshow resampler is no good.

No, that's not what I'm saying at all. I'm saying upsampling audio (no matter what software you use to do it) makes absolutely no technical sense in a playback chain. It will not improve the sound, in fact it will likely make it worse. You are gaining absolutely nothing by doing that. If you think you can hear a difference, you're either imagining it (most likely), or it means your DAC requires a high sample rate to perform correctly, which makes no sense and most likely means your DAC is broken.

nevcairiel
7th March 2015, 11:52
There actually are a couple of DACs that will internally over-sample the audio before doing the Digital-to-Analog conversion, so it is a concept that has some merit (and its actually mentioned on the Xiph page e-t172 linked earlier as well).
However, if your DAC has this characteristic, it will usually do this itself, and there is little to nothing to gain by doing it in the playback chain.

e-t172
7th March 2015, 12:49
There actually are a couple of DACs that will internally over-sample the audio before doing the Digital-to-Analog conversion

Not just "a couple", pretty much all modern DACs do that, as it relaxes the requirements for the analog antialiasing filter. Which makes software upsampling look even more useless.

That said this is an implementation detail of the DAC - what counts is how the DAC measures (black box), how it manages to achieve its performance is not particularly relevant.

Upsampler
8th March 2015, 08:00
You're not hearing the 10Hz tone. You're hearing the non-linear distortion that results from trying to play a 10Hz tone at high volume on equipment that's not designed to do that. Harmonic distortion on a 10Hz tone will typically produce 20Hz, 30Hz, 40Hz... components, which are audible, but are obviously undesirable.


I might be hearing "decorated" impure sound which makes me easy to hear. I used a "program" function generator. It must be producing impure sound. At 10Hz, I hear sound like helicopter sound moving away from far distance. It may be difficult to produce "pure" frequency sound from programs. My lower frequency limit may be somewhere higher.

Upsampler
8th March 2015, 08:12
Not just "a couple", pretty much all modern DACs do that, as it relaxes the requirements for the analog antialiasing filter. Which makes software upsampling look even more useless.

We agree that upsampling introduces distortion. I only use on certain specific conditions. DACs which always upsample is "NO BUY". Upsampling should be handled at media player level as an option. When I look for a DAC, I always check whether it "processes bit-by-bit which means no resampling".

e-t172
8th March 2015, 11:47
I might be hearing "decorated" impure sound which makes me easy to hear. I used a "program" function generator. It must be producing impure sound. It may be difficult to produce "pure" frequency sound from programs. My lower frequency limit may be somewhere higher.

It's not the program that's generating "impure" sound (by the way, the actual term for that is "non-linear distortion"). It's quite easy to implement a perfect software signal generator, because it's easy to implement "perfect" anything as long as it's pure software. It's when you enter the electrical, and, most importantly, the acoustical realm that trouble starts.

It's much more likely your headphones are at fault, as they are not designed to produce 10Hz tones at high volume (and this applies to pretty much all headphones and speakers). In other words they're clipping, or on the onset of clipping, and you get harmonic distortion as a result.

You seem to have this misguided view that software and electronics are more likely to produce distortion than headphones/speakers. It's the exact opposite. Often focusing on software or DACs is a waste a time; it's the transducers (and room acoustics when using speakers) that you need to worry about. They introduce distortion that's orders of magnitude higher than the other parts of the chain. Transducers like headphones and speakers are very likely to produce audible non-linear distortion when pushed outside of their operating bandwidth.

We agree that upsampling introduces distortion.

Technically that's true. If done correctly, however, the distortion is way, way below any audible thresholds (any competent upsampler will push aliasing artifacts below -100dB). Besides, the distortion is located near the Nyquist frequency, which is beyond the audible range for 44.1kHz and above. I do agree that one should not upsample if there's no reason to do it though, which is why what you're doing makes no sense.

DACs do have a very good reason to upsample internally though, as described below.

DACs which always upsample is "NO BUY".

Oh well, prepare to reject just about 99.99% of DACs currently on the market then :)

Upsampling should be handled at media player level as an option.

There's no reason software upsampling would be audibly better than upsampling done internally by the DAC, and there are measurements to prove it, which you can even do yourself using something like RMAA.

Besides, this is a false comparison. The DAC upsamples internally because that relaxes the requirements on the analog antialiasing filter. For example, if the DAC internally upsamples 48kHz to 192kHz, the DAC is safe in assuming that the 24-96kHz part of the spectrum is empty, so that can be used as the antialiasing filter passband. On the other hand, if you upsample in the media player, the DAC receives a 192kHz signal and can't assume anything; therefore it will most likely upsample to 768kHz, with a 192-768kHz transition band. (Note that these numbers are just examples - actual resampling ratios are higher than that in practice)

As a rule of thumb, the larger the bandwidth, the worse the DAC performs (simply because you're pushing it more), so by feeding upsampled 192kHz to the DAC, the signal that comes out at the other end is slightly worse than if you were feeding it the original 44.1/48kHz signal.

When I look for a DAC, I always check whether it "processes bit-by-bit which means no resampling".

You are misguided. What matters is how the DAC measures, not what it's doing internally to achieve the measured performance. You shouldn't care about what happens in the DAC as long as you get an accurate signal at the other end. It's the job of the DAC designers to make the chip as accurate as possible, and they know their stuff way better than you do.

You have to understand that DAC design involves tradeoffs. Oversampling is a tradeoff between the extremely slight, way-below-audible distortion that results from digital upsampling and the very real, likely audible distortion introduced by a less-than-perfect antialiasing filter. In other words, by insisting on "no resampling", you're getting a worse tradeoff, and therefore worse sound, not better sound.

Ask yourself why modern DAC designers always include oversampling in their designs, even though this alone makes the chip more expensive. It's not because DAC designers are stupid (far from it). It's because it makes the DAC's analog filter's job easier: all else being equal, digital "brickwall" filters are way cheaper to implement than the analog equivalent, so you end up with better sound for the same amount of money (or same sound quality for cheaper).

In-DAC oversampling might sound like heresy to you, but I assure you, the alternative sounds way worse - it would sound like a 1980-era DAC from before oversampling was invented. There's a reason why delta-sigma oversampling DACs were invented and are used pretty much everywhere today: it provides better performance for cheaper.

pandy
9th March 2015, 10:58
All Delta Sigma (and similar concepts) are upsampling by definition (at least 64 - 256 times, SACD is build around massively upsampled/oversampled concept).

Side to this all monolithic PCM DAC (from ancient PCM54 but not only) may (usually are) and should (desired!) be oversampled - concept of NOS DAC is totally misunderstood and overhyped.
All what you guys considering better sound in NOS DAC are distortions related to poor reconstruction filter (or provide me schematics working for linear phase e.g. Bessel or similar concept low pass filter able to suppress in 2kHz band 90dB or more - good luck).

Please, watch this http://www.youtube.com/watch?v=cIQ9IXSUzuM

To be not OT - ffdshow can be used as filter in Windows signal chain - go for graphedit and insert between source and destination ffdshow audiofilter (i use sometimes 'crystality' filter to perform spectral band replication/extrapolation).

Don't buy Ethernet cables or HDMI cables for hundreds or thousands $ - it doesn't work, same rule apply to memory cards for audiophiles...

We agree that upsampling introduces distortion. I only use on certain specific conditions. DACs which always upsample is "NO BUY". Upsampling should be handled at media player level as an option. When I look for a DAC, I always check whether it "processes bit-by-bit which means no resampling".

Nope - it is no true - real upsampling is mathematically transparent (separating samples by silence samples is perfect from mathematical perspective, same apply to repeating samples - there is no distortions there) - 'distortions' may appear in low pass filter (reconstruction filter) but in real life they can be eliminated.