WAV vs. FLAC transcoded to WAV - Network Trace

Posted by: DaveBk on 18 October 2012

One of the perennial debates often encountered here is whether WAV sounds better than FLAC on Naim streamers. The general consensus seems to be that any perceived differences are explained by the extra processing required to decode FLAC, and the resulting increase in digital noise which could be picked up by sensitive analogue components nearby.

 
A more contentious subset of this debate is whether FLAC transcoded on the fly to WAV on the uPnP server sounds different...?
 
Personally I can't tell them apart, but I was interested in whether there was any difference in the network traffic in these two scenarios so decided to do a little test.
 
I use a Shuttle bare bone PC, with an i5 processor and 4Gb RAM running Windows 7 and Asset as the Server.  This is connected via a Netgear GS116 switch to my NDS all using CAT6 cables. They are about 15m apart with 3 solid brick walls in between. The music files are on a QNAP 459 Pro NAS next to the server.
 
I picked relatively short 2 minute track, Intro off the XX album, and converted this from FLAC to WAV using dBpoweramp music converter. I put this and the original FLAC file into a new directory and edited the metadata to change the artist field to 'Test Material' so I could distinguish them from the original album. I forced a rescan on Asset, then checked I could see the new tracks on nStream. All as expected so far.
 
For the network capture I used WireShark running on the server and captured all the packets flowing between the server and the NDS while the 2 tracks were played.
 
For the sake of simplicity I ignored all the uPnP discovery, and the content look-up between nServe and the Server and only considered the actual delivery of the music stream. It starts with an HTTP Get from the NDS, specifying the uPnP URL of the required music file. For the FLAC file transcoded to WAV the URL format is a path with forced.wav at the end, for the native WAV the path ends with a unique file ID, also of type .wav. The URL path is not the path to the file on the NAS, it is a uPnP 'shorthand' using alphanumeric tokens to represent the required file.
 
The response from the server is an HTTP 206, followed by the required file which is streamed back to the NDS. I looked closely at the WAV headers and they are different, but closer inspection showed that this was due to the meta data tags being included in the direct WAV, but not on the transcoded WAV. The data chunk looks identical - exactly the same length, and at various offsets containing exactly the same bytes. I have not done an exhaustive comparison yet, but a close 'eyeball' inspection over 30 mins could not see any difference.
 
Looking at the network exchange it is almost identical as well - 
 
On the initial handshake the Max Segment Size is set to 1460 ( no jumbo frames ). The initial receive window from the NDS is 8192, which reduces to 6732 after 3 segments have been exchanged then remains constant. It's just textbook TCP, 1460 length segments, getting ACKed, final one has the FIN bit set. I can see absolutely no material differences, other than the presumably redundant transfer of a bunch of metadata at the end of the 'real' WAV which I guess the NDS just discards.
 
So, no further forward in working out why some people hear a difference....
Posted on: 18 October 2012 by Simon-in-Suffolk

Dave good work!!! Your findings are similar to mine (with respect to TCP). I also can hear no difference between transcoded mecia to WAV with Asset.  I did try and force some very large window sizes but I was not convinced I had improved anything.

bTW the 'shorthand' is the upnp index. If these change it can make stored playlists on Nstream unplayable I have found, 

Simon

Posted on: 18 October 2012 by Foxman50

Hi Dave

 

Im glad you have done this as i was asking this very question earlier this morning. I did some tests, with my ears only, and can hear no difference between the real wav file and transcoded flac file.

 

As i have said also i do find wav to be more natural although i have no idea why they should sound different if both are uncompressed. Surely whichever player you use has to decode the file to play it, be it wav or flac.

 

Like so many things i dont understand it just know which i prefer.

Posted on: 18 October 2012 by Simon-in-Suffolk

Foxman, there is a difference de pending on what decodes the FLAC. If the upnp does at transcode and converts to WAV it is benign as any extra noise created is completely isolated and seperated from the Naim equipment., if the  Naim receiver does then it can create more local noise on the streamer board, as FLAC requires more clock cycles to decode than WAV. As we see Naim are aware of this noise and try and reduce it, ie the NDS streamer boards are shielded and the powersupply to the DSP redesigned, despite this I still find differences between  WAV and FLAC decode on the NDS. WAV (and AIFF) are trivial to decode into PCM data.

Simon

 

 

Posted on: 18 October 2012 by Foxman50

Hi Simon

 

It truly amazes me how, as i can only imagine the miniscule amounts of extra decoding it must take, but creates such a difference in sound between flac and wav.

 

Are you saying that on the NDS this difference is greatly reduced.

Posted on: 18 October 2012 by Bart

Dave, THANK YOU.  That was very interesting!

 

Cheers,

 

Bart

Posted on: 18 October 2012 by Jan-Erik Nordoen
Originally Posted by Simon-in-Suffolk:

Foxman, there is a difference de pending on what decodes the FLAC. If the upnp does at transcode and converts to WAV it is benign as any extra noise created is completely isolated and seperated from the Naim equipment., if the  Naim receiver does then it can create more local noise on the streamer board, as FLAC requires more clock cycles to decode than WAV. As we see Naim are aware of this noise and try and reduce it, ie the NDS streamer boards are shielded and the powersupply to the DSP redesigned, despite this I still find differences between  WAV and FLAC decode on the NDS. WAV (and AIFF) are trivial to decode into PCM data.

Simon

Hi Simon,

 

In reference to the portion I've highlighted in green, it's not clear to me whether Dave's test was of decoding at upnp or decoding at the Naim receiver.

 

Could you clarify,

 

many thanks,

 

Jan

Posted on: 18 October 2012 by Foxman50

Jan

 

Pretty sure the upnp did the transcoding or else there would be nothing to compare, just flac v wav

Posted on: 18 October 2012 by DaveBk

Thanks for the comments.

 

Simon,  re the uPnP index, yes, I guessed this was the issue from your earlier post. If nStream remembers this, any material changes to the content between scans could screw it up. I doubt if uPnP required this to be persistent as it assumes the directory will be searched each time.

 

Jan, in my test all the conversion is done on the server, Simon was responding to a question from Foxman. We can rationalise how FLAC might sound different if it is decoded in the streamer, but if this happens on a server 15m away it's hard to understand how this could impact the sound. I was just curious to see if the network traffic was different enough to put additional processing demands on the streamer.

Posted on: 18 October 2012 by Simon-in-Suffolk

Hi foxman, yes it is interesting how tiny interferences or perturbations are audible. Our brain is clearly an incredible thing. The differences in FLAC/WAV decode are relatively subtle, but say IME are as obvious as using a DR 555PS as opposed to a non DR 555PS. 

Hi Jan, as Dave said he was monitoring the network stack of his upnp server.

Simon

Posted on: 18 October 2012 by Jan-Erik Nordoen

OK, got it. Thanks Dave, Simon and Fox !

Posted on: 18 October 2012 by Hook

Nice job Dave!  This proves that that Asset transcoding works as advertised.

 

Like you said, if some folks are hearing differences, it can not have anything to do with the bitstreams Asset is delivering.  Perhaps other UPnP servers are not as transparent or reliable, or perhaps it comes down to mains fluctuations or some other temporal events effecting the comparisons...who knows.  

 

From my perspective, there is nothing left to investigate.  We know that Naim WAV rips and those produced by matching against the Accuraterip database are the same.  And now we know that on-the-fly transcoding is reliable, so no reason for FLAC users to fret over whether or not to convert files.  Job done, and topic closed IMO.  Hoorah!  

 

Thanks a lot for doing what you said you were going to do (an increasingly rare quality these days)!

 

ATB.

 

Hook

 

Posted on: 18 October 2012 by Bart
Originally Posted by Hook:
 From my perspective, there is nothing left to investigate.  We know that Naim WAV rips and those produced by matching against the Accuraterip database are the same.  And now we know that on-the-fly transcoding is reliable, so no reason for FLAC users to fret over whether or not to convert files.  Job done, and topic closed IMO.  Hoorah!  

 

And it makes me feel a lot better about all the music I have in .flac!

 

I'm looking forward to a home listening test myself, once my NDS arrives.  Will stream both .flac and flac transcoded to .wav and I will see if we hear a difference.

Posted on: 19 October 2012 by Jan-Erik Nordoen
Originally Posted by DaveBk:

Jan, in my test all the conversion is done on the server, Simon was responding to a question from Foxman. We can rationalise how FLAC might sound different if it is decoded in the streamer, but if this happens on a server 15m away it's hard to understand how this could impact the sound. I was just curious to see if the network traffic was different enough to put additional processing demands on the streamer.


Hi Dave,

 

Just to set my mind at rest, should I read this as meaning that you measured differences in network congestion ? (for example, queues of data packets building up quickly, persisting and slow in dissipating in one case, but not in the other).

 

Obviously, it's not my field, but I do want to understand it better,

 

Thanks,

 

Jan

 

Posted on: 19 October 2012 by Simon-in-Suffolk

Jan, no Dave, was looking at the windowing 'buckets' used in the network transport stack called TCP. The transport can optimise its window with its peer so there is a balance  between reliability and handshake efficiency. Each time a handskae or acknowledgement occurs the network stack in the network player has to work. The larger the window sizes the less handshaking and work, but the bigger impact if there is a loss in the network. Dave was seeing if there was a noticeable difference between windowing between FLAC and WAV transfer, and there wasn't.

Simon

Posted on: 19 October 2012 by Guido Fawkes

Interesting report .... 

 

The only way I can see the data would differ at receiving end is in the metadata, as the NDS mainly wants the PCM then if anything would it not sound better with the transcoded WAV where all the garbage, so to speak, had been removed before the data arrived. This saves it the job of discarding that which it does not need. 

 

I'm still surprised there is any difference between FLAC and WAV given the way the NDS appears to work, and if it is transcoded then surely it just sees it all as WAV. Does the NDS play PCM from its buffer, by which time the original format is long forgotten - dealt with in an optically isolated part of the design. 

 

Linn could not measure any difference between processing FLAC and WAV, but different machine so results may be different.  

 

Still good work Dave and interesting results ... conclusion I'd draw is if you can transcode then do, as it certainly will not sound worse if you do and may improve the performance of some players. So it seems a no lose strategy. 

Posted on: 19 October 2012 by Jan-Erik Nordoen
Originally Posted by Simon-in-Suffolk:

Jan, no Dave, was looking at the windowing 'buckets' used in the network transport stack called TCP. The transport can optimise its window with its peer so there is a balance  between reliability and handshake efficiency. Each time a handskae or acknowledgement occurs the network stack in the network player has to work. The larger the window sizes the less handshaking and work, but the bigger impact if there is a loss in the network. Dave was seeing if there was a noticeable difference between windowing between FLAC and WAV transfer, and there wasn't.

Simon

OK, thanks Simon... I think

So are you saying that Dave was not looking at congestion, or should I understand that looking at windowing amounts to the same thing ?

 

Jan

 

... trying to optimize my windowing buckets with bigger handshakes...

Posted on: 19 October 2012 by DaveBk

Jan, I was not looking at congestion; my network has loads of capacity for this type of application. The TCP window is there for flow control - in other words making sure the sender does not transmit data too fast for the receiver to cope with. I was looking for any difference between native WAV and transcoded FLAC to WAV and I could not find any.

Posted on: 19 October 2012 by Jan-Erik Nordoen

OK, now it's clear.

 

Thanks, and... no more questions!

 

Jan

Posted on: 21 October 2012 by Graham Russell

Just to throw another option into this discussion:

 

I totally agree that FLACs transcoded to WAV sound better than streaming FLAC. A while ago I read that uncompressed FLAC don't suffer the decoding noise/degradation issues of compressed FLACs. So I tested this. Indeed I found that uncompressed FLACs sound the same as WAVs or FLACs transcoded to WAVs. Has anyone else tested with uncompressed FLAC? dbPoweramp supports uncompressed FLAC.

 

The benefit is slightly smaller files than WAV with the benefits of fully supprted tagging and meta data.

Posted on: 21 October 2012 by Hook

Hi Graham -

 

I agree that uncompressed FLAC offers the best of both worlds -- the sound quality of WAV, and the portability and ease of tagging of FLAC.  If I were starting from scratch today, I would either use dbpoweramp and rip to uncompressed FLAC, or I would get a UnitiServe and let Naim manage the WAV ripping.

 

I started ripping to FLAC level 0 (minimal compression) several years back, and had recently been considering a batch conversion to either WAV, AIFF or uncompressed FLAC.  But now that Dave has proven that Asset's on-the-fly transcoding is transparent, I no longer see the need.  

 

And now that Mr. Spoon has finished porting Asset to MacOS, I hope he will turn his attentiom to Linux. Would be nice to be able to install Asset directly on my QNAP NAS.

 

ATB.

 

Hook

Posted on: 21 October 2012 by AMA

Thanks Dave, your efforts are highly appreciated. 

 

I also don't hear any difference between WAV and FLAC, transcoded on the fly by Asset uPnP.

 

You clearly prove that both WAV and transcoded FLAC result in the same data transmission through the network so that data content and traffic load could not be a source of sonic variation.

 

I still can leave a room for explanation on why some people may hear a difference.

It quite may be that decompressing the FLAC on PC may increase the mains contamination due to heavily increased CPU load.

 

If audio system is not properly isolated from the PC mains line (which could be the case even if the system and PC stay in different rooms) than it may cause a negative feedback and people start hearing the difference. 

 

In this case I do advise those who hear a difference to experiment with following: let them play WAV from PC and at the same time run any decompression on the background (unrelated to the WAV in play). If they hear a deterioration -- this is it. There is a good point to reconsider the audio system mains wiring.

Posted on: 22 October 2012 by Foxman50

Hi Graham

 

All my music is ripped to uncompressed FLAC via dbpoweramp. But i can hear a difference on my ND5 between these and either native WAV or transcoded WAV. Maybe the ND5 hasn't got the processing power to convert FLAC efficiently enough, total guess. I do not have any compressed FAC to compare.

 

I cannot hear a difference between native WAV and transcoded WAV.

Posted on: 22 October 2012 by DaveBk

AMA,

 

My server is on a separate ring powered via a 1kVA UPS. The NDS is on a dedicated radial on a different consumer unit, so they are about as separate as possible for a domestic installation. Perhaps this is why I can't hear any difference?

 

There are so many variables that in theory could change the outcome, so my tests are only really valid under similar conditions. I'm lucky in that I can keep the computing side physically and electrically separated, other folk have different circumstances and may have different results.

 

I still want to find a way of exhaustively comparing the 2 data chunks 'on the wire' to make sure Asset is bit perfect, and network independent. My tests so far indicate this is the case, but I'd like to be absolutely sure.

 

Dave.

Posted on: 22 October 2012 by Guido Fawkes
Originally Posted by Foxman50:

Hi Graham

 

All my music is ripped to uncompressed FLAC via dbpoweramp. But i can hear a difference on my ND5 between these and either native WAV or transcoded WAV. Maybe the ND5 hasn't got the processing power to convert FLAC efficiently enough, total guess. I do not have any compressed FAC to compare.

 

I cannot hear a difference between native WAV and transcoded WAV.

 

My Mac Mini sends PCM from all lossless formats up the S/PDIF in to the Naim DAC/555PS and I cannot hear any difference between any of the formats. It takes a bit more CPU to process FLAC and ALAC than AIFF or WAV. I'm happy this is the way it is. When is Naim bringing out the reference DAC, I know it is intended for the digital out on the NDS, but I'm hoping it sounds good with my Mac Mini. 

Posted on: 22 October 2012 by Simon-in-Suffolk

Guy, not that I know anything, but I wonder if a DAC2 might appear next spring. It might have suspension and two power circuits to be fed by a 555PS... We shall see. It might contain innovation that might be trickled into the potential reference ND555.