# REW setup with audio through HDMI



## dondino (Feb 12, 2010)

Is it possible to use REW from a PC that passes audio through an HDMI to the receiver or do I have to use the line out of the sound card?

Thanks,
Don


----------



## laser188139 (Sep 19, 2009)

You have to use the line out. An essential step to setting up REW is to loopback the line out of the soundcard to the line in, so that it can subtract the line out and line in frequency responses of the soundcard from the later measurements. 

Bill


----------



## glaufman (Nov 25, 2007)

Technically, it can be done, but because you'll be missing the calibration Bill mentioned, it will be less accurate that way.


----------



## Moonfly (Aug 1, 2008)

I actually now use my HDMI out from my laptop to measure. 

I tested my sound card before and after calibration and found virtually no difference, so in my case using HDMI isnt an issue. I would do a similar check on your sound card, and if you find the calibration file isnt making a huge difference then I would say its fine to use HDMI, otherwise line out would be preferable, as already stated :T

As it happens it was a good job I had checked my cal, as someone broke my line out socket and I am now stuck with HDMI , it can work fine though.


----------



## glaufman (Nov 25, 2007)

In any case we're always using some connection or circuit (as near as I can tell) in the loopback that we don't use when actually measuring... I've been meaning to try something similar in my own setup, I'd be trading the insertion loss of my line in on the AVR for the loss of the preamp out on the AVR... not sure how big a difference this makes...
Moonfly, could you post your exact loopback configuration?


----------



## Moonfly (Aug 1, 2008)

glaufman said:


> Moonfly, could you post your exact loopback configuration?


As in how I calibrated the soundcard, or how I now have it setup when running sweeps?


----------



## glaufman (Nov 25, 2007)

Well, both really, but the calibration loop most importantly...


----------



## Moonfly (Aug 1, 2008)

When I ran the sound card cal, the cabling was as in the guide, with the right channel output looped back into the line in.

When running sweeps now, I have to connect the RS meter via line in (right channel only) and the output is via the HDMI out and into the HDMI input on the Onkyo. The SC cal. file is still loaded in, although I'm was actually under the impression it would still be valid even if outut is via HDMI, since the input is still via analogue line in.

As it happened, I only tried the HDMI to see if it would work, and to see what if any differences it might make. Like I say, for me it made virtually non.


----------



## glaufman (Nov 25, 2007)

Ah, so you're saying that comparing sweeps, switching from (soundcard line out to AVR line in) to (soundcard HDMI out to AVR HDMI in) made very little if any difference in the measured sweep...
Thereby, in your setup, the DAC in your soundcard would be similar to the DAC in your AVR.
What soundcard and what AVR are you using?


----------



## dondino (Feb 12, 2010)

Thanks for all the replies. I can go either way but was considering HDMI for the sake of convenience. I guess I'll measure both ways and if there's no discernable difference, I'll go with the HDMI.

I'm new to the Shack and appreciate the fast replies!

Don


----------



## Moonfly (Aug 1, 2008)

The AVR is the Onkyo 875, while my sound card is built into my (fairly budget) laptop, and is a Realtek HD Audio card. Its an in built generic card and Ive been pleasantly surprised at its performance if I'm honest. I would have thought the Onkyo DAC a little better, but you never know. When I noticed the similar results, I figured the cal is applied to the line in rather than line out, effectively taking it out of the equation what is used as output.


----------



## Moonfly (Aug 1, 2008)

dondino said:


> Thanks for all the replies. I can go either way but was considering HDMI for the sake of convenience. I guess I'll measure both ways and if there's no discernable difference, I'll go with the HDMI.
> 
> I'm new to the Shack and appreciate the fast replies!
> 
> Don


Welcome dondino :wave:

Be sure to let us know how you get on and how your results compare, especially if there is a difference :T


----------



## dondino (Feb 12, 2010)

Moonfly said:


> Welcome dondino :wave:
> 
> Be sure to let us know how you get on and how your results compare, especially if there is a difference :T


Thanks, will try for this weekend.


----------



## laser188139 (Sep 19, 2009)

Don, whether or not you will be satisfied using the analog loopback soundcard cal file with the digital output to the receiver will depend on how you intend to use the results. Most cards are flat over a middle range; the differences are at the ends and in your case these extremes may not interest you. The biggest problem I see with using digital audio to the receiver is that it is no longer easy to disconnect from one or the other of the front channels and measure the front speakers separately. 

Naturally this is a question that has been asked before. One of the most interesting notes I found is here, with graphs, where Sam measured more variation using the digital output than the analog. 

Bill


----------



## glaufman (Nov 25, 2007)

Moonfly said:


> The AVR is the Onkyo 875, while my sound card is built into my (fairly budget) laptop, and is a Realtek HD Audio card. Its an in built generic card and Ive been pleasantly surprised at its performance if I'm honest. I would have thought the Onkyo DAC a little better, but you never know. When I noticed the similar results, I figured the cal is applied to the line in rather than line out, effectively taking it out of the equation what is used as output.


Well, REW doesn't know input from output when it comes to the cal files... it measured a certain response across the loop, which included both the input and the output, and created a cal file to compensate for the combination. But I want to thank you, there's been a brain-worm in my head for a few years about this subject that I've been turning over and turning over, and you've inspired me to finally put pen to paper and work out the details... I'll share if/when I'm successful...


----------



## Moonfly (Aug 1, 2008)

glaufman said:


> Well, REW doesn't know input from output when it comes to the cal files... it measured a certain response across the loop, which included both the input and the output, and created a cal file to compensate for the combination. But I want to thank you, there's been a brain-worm in my head for a few years about this subject that I've been turning over and turning over, and you've inspired me to finally put pen to paper and work out the details... I'll share if/when I'm successful...


Excellent :T. I'd have a go at some tests myself, but I dont have the analogue option currently anyway . In the link above, one member did the loopback via the digital connection, and via his AVR. A comparison of a digital cal vs the analogue cal would be very interesting.


----------



## Moonfly (Aug 1, 2008)

laser188139 said:


> The biggest problem I see with using digital audio to the receiver is that it is no longer easy to disconnect from one or the other of the front channels and measure the front speakers separately.
> 
> 
> 
> Bill


The easiest way to do this really on the computer using the balance slider, otherwise, your hopefully using banana plugs.


----------



## laser188139 (Sep 19, 2009)

Greg, like you I found this problem interesting enough to put pen to paper last night and develop a simple mathematical model. It would be better if I tried this out on my system before writing it up.

Bill


----------



## glaufman (Nov 25, 2007)

Then maybe I'll wait for your results Bill... on the back of a napkin I got really close yesterday, but time escaped me before I completed what I was doing... today it's been fixing the washing machine etc...


----------



## laser188139 (Sep 19, 2009)

Moonfly said:


> The easiest way to do this really on the computer using the balance slider, otherwise, your hopefully using banana plugs.


Since I've never looked for it, I had not noticed the soundcard does have a balance control for the S/PDIF output. That should work in lieu of unplugging an RCA connector from one of the receiver's analog inputs. Thanks.


----------



## Moonfly (Aug 1, 2008)

Glad to be of help. If your SC has the ability to run in quad stereo mode or surround modes, then using a digital connection can also allow testing of the other speakers easily, and again, isolating speakers is usually a simple matter of adjusting the settings on the sound card. If nothing else, using a digital connection, assuming it works for you, does open you up to a fair few options.


----------



## laser188139 (Sep 19, 2009)

Greg, Dan, et.al., 

Let's start with the mathematical model I used to look at what happens when one drives the receiver for testing through a digital audio connection instead of the normal analog connection. 

Let i(f) be the input freq resp of the soundcard, 
o(f) be the output freq resp of the soundcard,
a(f) be the freq resp of the analog inputs to the receiver, 
and X(f) be the performance of the rest of the system under test. 
From here on out, I'll leave off the (f) notation, but remember these are all functions. 

Case 1 (Normal):
The soundcard calibration file represents (o + i).
Running the test signal through the analog inputs, REW sees (o + a + X + i). 
After subtracting the soundcard file, one measures (a + X), i.e., variation in the input ADC process is present, plus all the variation in the receiver's processing including its output DAC stage. 

Case 2 (SPDIF/HDMI):
Let's suppose we use the standard soundcard file with a digital connection. 
Running the test signal through the digital input, REW sees (X + i).
Subtracting the soundcard file, one measures (-o + X). Variation in the soundcard's output DAC process now appears in the measurement, in place of the analog input variation, even though the soundcard's DAC is not actually being used. 

Case 3 (modified soundcard calibration):
Suppose we build on the idea of comparing the full range measurement of the main preout with analog input to the measurement with digital input. 
If we drive the preout with analog input, we see (o + a + X + i). When we drive the preout with the digital input, we see (X + i). If one calculated the difference between the two curves, one has (o + a). If we apply this to the normal soundcard file (o + i), one could create a soundcard file representing (i - a). 

Now look what happens when we use this soundcard calibration file with a measurement through the digital input. REW sees (X + i), subtracts the soundcard (i - a), and the resulting measure should show (a + X). In other words, one should be able to construct a soundcard calibration file that would yield exactly identical measurements with the SPDIF/HDMI input as is measured using the analog input. Of course, this does not eliminate the receiver's analog input as an element in the measured results, but the digital input may be more convenient and may introduce less noise into the measurement process. 

So let's see what happens when one looks at this in the real world. 

The first issue I discovered is that, although the sampling rate may not matter much when using the analog inputs, it matters a lot when using a digital audio connection to drive the receiver. In the following graph, the red line is what happens when I run a sweep using the S/PDIF connection and measuring the output on the left front preout. The green, with all the oscillations, is the identical measure except running two sweeps instead of one. As multiplying the number of sweeps should just give us more measures to average to give a smoother line, this is really weird. The light blue line shows the same measurement using the analog RCA connection to the receiver, single sweep, no smoothing, to show that it is indeed noisier than digital. This problem goes away when I take the measurements using a 44kHz sampling rate instead of 48kHz. 








After changing the sampling rate to 44kHz, I thought I would see if I could eliminate some of the noise from the test by running my laptop off battery instead of line power. The unexpected result is that running off battery changes the measured response of the system, as if being on battery power changes the behavior of the soundcard. In the following graph, both measures use the digital audio connection to the receiver, measuring the output at the preout. Red is the result when the laptop is on battery, blue on the power line. 







The good news, in my case, is that the difference is only 2dB and only above 10kHz. 

Now let's compare the analog measurement to the digital measurement. In the following graph, the flat gray line is a sweep of a simple loopback not going through the receiver, the green line is the preout when the analog RCA input is driven, the red line shows the same measurement when digital audio is used to drive the receiver. 







This resembles Sam's measurement in the link I cited earlier. Using the normal soundcard cal file, while driving the receiver using digital audio, means the resulting measurement subtracts out the impact of the soundcard's DAC even when not going through the DAC. Note that the differences appear large because of the expanded vertical scale, 2dB per gridline. 

Finally, I tried my case 3 above. I generated a cal file looping through the receiver with the analog input, another cal file looping through the receiver with the digital audio input, took the difference of these and applied that to the normal loopback cal file. Using this new adjusted soundcard cal file, I again measured a sweep driving the receiver with its digital input. In the following graph, the gray and green lines are unchanged from above. The blue line is the new measured result with the adjusted cal file. 







As you can see, the measured blue graph using the digital input now matches the normal green curve using analog audio inputs. The noise comes from the process of looping back through the receiver to generate the intermediate soundcard data. I'm sure one could eliminate the noise from the data through smoothing before calculating the adjustments, ending up with a smooth soundcard cal file and smooth results, I just did not try to do this yet in Excel. 

For me, I think this is a lot of work to go through to use the digital audio connection, to get the same results available with the normal analog audio connection. But, if done right, it would reduce the analog noise from the test process. 

Bill


----------



## dondino (Feb 12, 2010)

My goodness. What have I started? :innocent:

Extremely informative however, thank you all.


----------



## glaufman (Nov 25, 2007)

Very interesting Bill, and thanks for that. It's possible that you may have achieved my goal, but I'm going to have to read that again when I have more time to digest it. Your basic premise isexactly what I've been toying with all along, I'm just a little concerned about the onise in your measurements. I'm not really surprised that running the laptpo off battery cleaned things up a bit... As a power supply Engineer, laptop power supplies are not exactly highly filtered devices.

I'm thinking real hard right now about redoing my kitchen... how long to I have to think about it before you come and just do it for me?


----------



## laser188139 (Sep 19, 2009)

That would be sometime after I redo the tiles in my kitchen, bathroom, and front entry way. Which I am not even thinking about starting.


----------

