Compression Level in FLAC

Posted by: Rockingdoc on 29 January 2011

dBpoweramp, and I suppose other rippers, offers a choice of compression applied in FLAC. The default is set in the middle at "5". Any ideas what level of compression we should use?
Posted on: 30 January 2011 by jfritzen
When I still had the SqueezeBox I thought I could hear a difference between FLAC and WAV, but since I own a DS I never could notice that difference again. I never listened to the NDX myself but my dealer claims that Naim sounds better with WAV than with FLAC, just as likesmusic suggests.

The good thing is of course: If you have a lossless music collection and plan to switch from, say, DS to NDX, you could always convert from one to the other format or compression level with one batch job. You don't have to re-rip or re-buy all your music.
Posted on: 31 January 2011 by js
Yawn. Try for yourselves. Is the kit bad if you do hear a difference or is it less revealing if you don't. Is there a bit of both going on. Who knows? Try the same file on 2 bits and see which you like better and try different file types on the same kit to get your own perspective.
Posted on: 31 January 2011 by likesmusic
"Is the kit bad if you do hear a difference"

If there shouldn't be a difference, then yes the kit is bad if you hear one. 

Presumably if you fork out the money for an extra power supply or two, and add a NAIM DAC then the NDX will sound the same with FLACs and WAVs - or will there still be interactions?

"Who knows?"

Hopefully the engineers that design the kit. Otherwise it's voodoo over which they have no control.
Posted on: 31 January 2011 by Aleg
@LikesMusic
quote:
If there shouldn't be a difference


"Shouldn't be" or "wouldn't want there to be"?

My feeling is that you talk in absolutes as if there is total control of what happens.
I think that's not possible, because IMHO we don't know all that happens, so there is no absolute control possible.

Best thing IMO is to listen and judge on what you actually hear and not try to theorise about what you would want it to be or think it should be and subsequently reject it because it doesn't fit your theorised objectives.

IMHO this one of the big faults of our modern 'scientific' world, the misconception that we know and can control all.

-
aleg
Posted on: 31 January 2011 by james n
Hopefully the engineers that design the kit. Otherwise it's voodoo over which they have no control

Of course they do. But they've got design constraints and in the end, budgets to meet. Any form of engineering normally involves some compromises.

Look at the CD5i compared to the CD555. Both fine CD players, but the engineers are clearly have less compromises to make when designing the 555 and the results show.

With the differences in the file formats, we're not talking night and day changes in sound quality but small differences between them. As Naim say in the NDX white paper, they have found that uncompressed files deliver lower processor loading and less power supply noise. Use that as a recommendation, try it and use whatever works for you.  

Out of interest, what kit do you use Likesmusic ?

James
Posted on: 31 January 2011 by DavidDever
likesmusic–you may find that there are others who hear a small but distinct difference between FLAC and WAV, especially at hi-res (e.g., 24-bit / 88.2 kHz and higher) on a variety of hardware rendering systems (including Linn DS). Do the dem first–if you can't hear the difference, don't worry about it–but it's probably a bit flippant to dismiss on basis of opinion.

The computational mathematics are explicitly different between the two formats (regardless of whether one implements FLAC decoding in software, or in FPGA hardware, for example).
Posted on: 31 January 2011 by likesmusic
David - my point was not that I don't believe an audible difference exists, but that if it does it signifies poor hardware and software design in the decoding equipment. As I said earlier there is an average 3% difference in the CPU time required to decode FLAC 5 and FLAC 0 - if this causes audible problems, then something is seriously amiss somewhere.

When you say that "the computational mathematics are explicitly different between the two formats" what do you actually mean?  Obviously FLAC involves some (simple) maths to decode, whereas WAV does not, but what on earth is your point?  The end result is the same; a FLAC encoded WAV file can be decoded perfectly to the original WAV. A FLAC 5 decodes to the same data as a FLAC 0.

Does a FLAC file transcoded to WAV on the fly on a server sound different to the corresponding WAV file served up as is?
Posted on: 31 January 2011 by DavidDever
Different levels of FLAC compression necessarily require different decoding resources, as with any look-ahead encoding process.

Also–it is worth noting which version of the encoder and decoder libraries are used. In theory, there should be no difference in performance (measured by CPU cycles) between decoding from the same compression level across platforms, except when you throw the compiling process for the encode/decode library into the mix!

(A portion of) my undergraduate maths was spent in grad-level numerical analysis, where we used predictive algebras to compare expected vs measured (tallied) results for various algorithmic processes, across computing platforms, plus computational error sideband analysis. It was a pretty boring existence, tempered by many a pint of Guinness (at the time), but quite instructive.

In general–as storage and bandwidth get cheaper, the relative value of storage-compressed / bit-perfect processes diminishes relative to the resources used by CPU cycles–this is even more important as we all move to less-powerful (than general-purpose) but portable (embedded) devices with, for example, ARM-based processors.

Of course, if one was feeling particularly spry, one could argue that WAV is a greener audio file format, as it requires fewer CPU cycles to encode and decode. (This would be a pretty naïve statement, though, without considering storage-management CPU overhead.)
Posted on: 31 January 2011 by lhau
It all comes down to implementation.

It may surprise you what "theoretical" can be different from "reality"
Posted on: 31 January 2011 by Tog
"Besides being invisible, your Highness, this cloth will be woven in colours and patterns created especially for you."  The emperor gave the two men a bag of gold coins in exchange for their promise to begin working on the fabric immediately."

Flac and wav are different, they are spelt differently and they behave differently. - I like aiff as well but then I'm just awkward as my Uniti doesn't. 

The level of computation required to decompress flac is minimal - I don't know what a "noise floor" is but I hope it doesn't involve carpet as I hate carpet - perhaps a nice aged oak noise floor. I understood David's post but it left me with a headache and a desire to drink wine.

I worry about the kids - the mortgage - the price of diesel and why we have a dreadful rightwing government drawn from the very worst that a privileged upbringing can create ... yet I don't worry about the sound quality of flac.

Why is this?

Tog

"If the muse is there, you just don’t push it."  
The late John Barry
Posted on: 31 January 2011 by Simon-in-Suffolk
tog, I agree I share many of your observations. Yes many of us can detect subtle differences with our equipment and iits varying parameters and options and surely that's what they are, differences,  rather than perhaps neccesarily always getting closer to the absolute 'perfection'. I re assembled my Fraim supporting my CDS3 this evening and I am sure the rendition of Don Giovani I am now listening to is different and possibly better than before but I am not certain.. But I am enjoying it immensely all the same and in the full knowledge that nothing has worked it's way loose...

BTW I worry about the ghastly legacy that terrible left wing government left us, but that's another story.



Simon

Posted on: 31 January 2011 by likesmusic
"Different levels of FLAC compression necessarily require different decoding resources, as with any look-ahead encoding process".

The differences are trivial. According to the official FLAC site, FLAC 5 requires roughly 3% more CPU time to decode than FLAC 0. This varies with the type of music; sometimes FLAC 5 requires fewer CPU cycles than FLAC 0.

I wouldn't buy anything that struggled to decode any level of FLAC.
Posted on: 31 January 2011 by js
No money spent is a good thing. Music is better. I use FLAC on my portable.
Posted on: 31 January 2011 by lhau
I think *theory* is nice for helping you to eliminate unnecessary trial and error, but in the end, it is the trial and error that establish whether the *theory* is true.

Mind you that if people believed in Newton forever, Einstein's theories wouldn't have been born.

I am not saying if the *theory* is right or wrong. I am just saying, you bought this equipment exactly to enjoy the very process of this "experiment"  - listening to music.

Why don't you jump out of your box of theory and try experimentation. I think it is quite universal that experiment has the final say about the validity of theory, not the other way around.

If you personally detected *absolutely* no difference in your case, then it is fantastic for you. For some people using different network/system/environment and have perhaps different sensitivity, perhaps it is different for *them*, and it is all that matter, because our hobby is all about personal perception.

I am not saying you are wrong. I tend to agree your theory, but I do wanna try. After all, I believed "bits are bits" and that all decent cable carry the same signal in theory (I still do believe), yet I have moved from computer audio to this insane Naim (yes insane given my belief) and also upgraded my speaker cable to Naim cable and seems to detect a much more dynamic presentation of sound.
Posted on: 01 February 2011 by Tog
Listen to both with your system - have a glass of wine - decide which one you like the sound of the most. On second thoughts make that two glasses....


Tog
Posted on: 04 February 2011 by sbilotta
Reading a Linn Klimax DS review (...sorry) I read the following: "Keith Johnson, inventor of HDCD, claims that only WAV files guarantee perfect sound reproduction which can't be achieved with any compression, even lossless compression. He says that any file processing even in the digital domain alters it and that executing FLAC decoding affects the sound."

FWIW of course...
Posted on: 04 February 2011 by likesmusic
To repeat some of a previous post, according to the Linn engineers, with respect to a DS playing FLAC "If we measure the power rails that feed the audio clock and the DAC we see no evidence of any processor related disturbances. There is no measurable difference (down to a noise floor measured in micro-volts) between FLAC and WAV in any of the audio power rails".

So Linn cannot, down to the limits of measurement, find any measurable difference between FLAC and WAV in any of the audio power rails of a DS.

It is up to those who claim otherwise to produce measurements to substantiate their claims. They have not, probably because they haven't made any.   There may be other reasons that a Linn DS sounds different when playing FLAC rather than WAVs, but noise on the power supply to the DAC or clock does not seem to be an explanation.

Other products may have issues, but Linn's engineering seems to be first rate.
Posted on: 04 February 2011 by manicm

Linn's engineering may be first rate - but some Linn engineers on the official DS forums have went on record saying they prefer the sound of FLAC.

This puts paid to 'lossless is lossless' and 'bit-perfect'. In perfect hardware and engineering FLAC and WAV should sound the same.

I maintain the digital medium, especially ripping, is still in its infancy. Ripping to me is not an exact science yet. And don't give me that AccurateRip horsepoop. I've tried it and my ears tell me otherwise.

Posted on: 04 February 2011 by Tog
Hmmm is that The Keith Johnson of Pacific Microsonics Inc, now owned by Microsoft whose patents library now includes HDCD? Only Wav guarantees perfect sound reproduction? .... and is that the same Wav sometimes referred to as Audio for Windows?

Immediately you hear the word "only" ... start running ....

Tog
Posted on: 04 February 2011 by manicm

Well Tog, how does one get to FLAC anyway?? Through WAV!!! Or am I wrong? Can a CD be transcoded directly to FLAC using PCM data?

Does it really matter that Microsoft invented WAV??

Posted on: 04 February 2011 by likesmusic
manicm - could you post a link to the Linn engineers posts  you refer to? Or quote them?

Can you or anyone else hear the difference between FLAC transcoded to WAV and then streamed and WAV streamed directly? 

Ripping is actually a completely deterministic precise process. No magic involved. Nor sorcery or witchcraft. Or guesswork. If it isn't exact, do you mean that Naim don't do it perfectly?

What are you saying is 'horsepoop' about Accuraterip?
Posted on: 04 February 2011 by pcstockton
How is any of this an issue?  You can covert back and forth between FLAC, WAV, ALAC, and AIFF thousands of times (barring check-sum issues), without issue.

If you find you dont like FLAC, convert to something else.
Posted on: 04 February 2011 by garyi
Wav is an interpretation, apple interprets the same file as AIFF.

I don't think wav is a means to anything, its just how a particular OS 'sees' cd files.
Posted on: 05 February 2011 by Simon-in-Suffolk
A few myths and sorcery creeping in.

The file name is a 'Wave File'. The term wav comes from the original limit that MSDOS had on 3 letter file extensions.

The Wave file format was developed by Microsoft and has become ubiquitous over the last 15 to 20 years since the time consumer digital media was in it's infancy. This has happened amost certainly because of the prevalence of Microsoft software and operating systems.

The Wave file has a distinct file structure called RIFF. It allows for chunks of data to be grouped together. This data can be multiple streams, audio format etc. This link has a good intro.

http://www.sonicspot.com/guide/wavefiles.html

However the key point wave files allow the loss less conveyance of encoded audio, just like FLAC, AIFF etc.

Also there is decoding required of the wave file, and there are variations possible depending om the alignment and structure of the chunks. The structure of the format for a given sampled audio data does not need to the same each time, that is the file structure is not deterministic, ie the wave file encoder can change it, without affecting the conveyed audio data. Interestingly wave files are also designed to allow the storing and encapsulating  mpeg and other lossy encoding formats as well as uncompressed PCM.


Simon
Posted on: 05 February 2011 by Simon-in-Suffolk
Further to my above post, not that I have noticed it specifically, there is a possibility that two PCM wave files ripped and encoded by different software *could* sound subtly different on playback simply because of a different RIFF wave file structure used by the two different devices/software and the differences required in decoding it. If there is a 'signature' of the decoder coupled into the analogue circuitry through noise or EM coupling then I could see how this accounts in perceived differences of rips into Wave files even though the PCM is identical. In my mind this is similar to perceived audible differences between FLAC optimisation.

So.... If FLAC is deterministic, that it's file structure is more rigid [ I don't know if this is the case ] compared to wave files, I could see the argument for the preference of FLAC over Wave files  for consistency reasons.



Simon