How to - Distortion Measurements with REW

I do not think the problem RickRay and kozard face is related to averaging. IMO the cause is stream discontinuity in the buffer over which FFT is calculated. Even a single sample missing/skipped will ruing the FFT results, and the averaging will make recovery longer.

This is my experience in linux (I have not tested in windows, yet).

First the sound layer must provide a stable stream. While it may seem an obvious requirement these days, dropouts do happen sometimes, especially on USB hardware with improperly small buffers. Some USB-audio devices (increasingly recently) use implicit feedback which has not been supported out of the box in linux usb-audio driver, quirks for a specific device had to be added. Stock Win10 USB-audio driver does not support implicit feedback at all. Incorrect feedback handling causes small dropout tens of seconds or minutes apart. They may not be noticeable by listening, but the very sensitive longer FFT in REW is unforgiving.

Then the java audio layer must process the samples without any dropouts. Java itself is not particularly real-time friendly, with its garbage collector. Newer java versions have made a big progress with low-latency garbage collection, but REW still uses Java 8 by default. On the other hand I tested REW with Java 14 with the ZGC garbage collector and still the dropouts occured from time to time. We have discussed the issue with John, it is not easy to troubleshoot.

What improved the situation in linux for me was the relatively new option for OpenGL processing, and using longer FFTs. It kind of hints at the GUI layer, as if redrawing the chart could stall for a bit, delaying the audio-layer threads. OpenGL - faster redrawing, longer FFT - less frequent redrawing. Eventhough each task is performed by a different thread in REW, there can be some hidden synchronization issue (likely in the lower-level java libraries, not in REW code).

Also what helped me was generating the source signal outside of REW, using sox in my case. As if it was the generator part which was affected by the perhaps slower UI. Sounds weird, I know.

In windows the driver issue could be ruled out by testing Arta, Visual Analyzer, etc.
 
Thanks Jan. On the issue of dropouts, LatencyMon is a good tool to identify problematic drivers or processes that may be causing audio issues. I've seen reports of issues with the Win 10 20H2 update for some users with USB interfaces, driver updates may help in those cases.

Would ASIO possibly be better than java?

My much more ancient Vista machine is using ASIO with the EMU 1820m and no issues. The Windows 10 machine is using Java with the SB0490 and does have the issue.


Of course the 1820m doesn't use USB.
 
I was able to measure my Hafler DH110 preamplifier. I'm having issues with stability of the measurement. It goes along and updates moving around a little and improving with more averages and then it jumps, distortion goes way up, everything climbs and then it starts averaging again and getting back to normal. I have attached a picture of the error screen.

View attachment 904265

View attachment 904266

I have noticed the same thing on MacOS with my EMU 0404. It only happens occasionally. If I reset the EMU and restart REWS, it goes away. I always assumed it was the EMU (and I use an unofficial driver) but maybe it is a REWS issue. In any event, it is not so frequent as to be an issue for me, just annoying.
 
Thanks Jan. On the issue of dropouts, LatencyMon is a good tool to identify problematic drivers or processes that may be causing audio issues. I've seen reports of issues with the Win 10 20H2 update for some users with USB interfaces, driver updates may help in those cases.

Trying to get rid of the glitches on my Windows 10 Laptop with SB0490 USB interface I tried the ASIO (ASIO4ALL) and I was able to exchange one problem for another problem... :(

With JAVA I don't have any LF (20-100 Hz) false distortion problem. (See attached screen capture.) But I do have a weird spike at ~4 kHz that should not be there. And I am limited to 16 bits on this 24 bit interface, of course.

With ASIO (ASIO4ALL) I don't have the weird spike at ~4 kHz. But unfortunately there is a terrible LF (20-100 Hz) false distortion problem. (See attached screen capture.) So I can use 24 bits but it is ruined by the LF problem.

Running on battery power doesn't make any difference. So far (about one hour) no glitches today (the original issue)... The glitches were frequent yesterday. I have nothing running in the background (except Windows 10 64 Bit...).

I am running REW 5.20RC4.

I would love to resolve this since I would like to do my measurements in 24 bits and without the false distortion readings.
 

Attachments

  • JAVA No LF Problem But Weird 4 kHz Spike.png
    JAVA No LF Problem But Weird 4 kHz Spike.png
    577.1 KB · Views: 286
  • ASIO False LF Distortion Problem But No Weird 4 kHz Spike.png
    ASIO False LF Distortion Problem But No Weird 4 kHz Spike.png
    661.5 KB · Views: 298
Making some progress. With the ASIO drivers there seems to be a digital/software feedback loop from Line Outputs 1/2 to Inputs 1/2 with SB0490 and REW. This does not occur with JAVA.

Now I am trying to route the outputs to Line Outputs 3/4 and loop back to Line Inputs 1/2.

I had this problem before with the SPDIF Out 1/2 being looped back (internally or in software, not sure) to Line Inputs 1/2 so when I measured a DAC (using the SPDIF out) I had to route the output to the left channel and bring the input into the right channel.
 
RickRay said:
My glitch happens with Java and ASIO, with all the bandwidth settings and all the averaging settings. I agree with phofman, it seems to be the buffer getting overran and it is very random. Sometimes happens in waves, sometimes doesn't.

That agrees with what I am seeing. I had hoped ASIO would fix it on my Windows 10 laptop since I had never seen it with my ancient Vista machine which was using ASIO with the EMU 1820.

However switching from JAVA to ASIO on the Windows 10 machine did not fix it today.

It must be due to another difference. Such as Windows 10 versus Windows Vista. Or the SB0490 being USB on the Windows 10 machine versus the EMU 1820 being a PCI card (and external dock) on the Windows Vista machine.
 
I was able to measure my Hafler DH110 preamplifier. I'm having issues with stability of the measurement. It goes along and updates moving around a little and improving with more averages and then it jumps, distortion goes way up, everything climbs and then it starts averaging again and getting back to normal. I have attached a picture of the error screen.

View attachment 904265

View attachment 904266

I also had this problem. (Win7/10 REW/ARTA ASIO/WDM)
I solved it by switching to linux+rew+java.
 
ASIO is generally more reliable since the ASIO driver runs at a higher priority than is allowed for Java processes. Problems with ASIO are more likely to be caused by other high priority processes taking too long to complete, which is what LatencyMon measures.

Ok. Next experiment will be to try LatencyMon. [Or for those with a sense of humor maybe I get the parts out of the box from the Windows XP machine and put that back together and see if that fixes the Windows 10 audio problems...]
 
Last edited:
I also had this problem. (Win7/10 REW/ARTA ASIO/WDM)
I solved it by switching to linux+rew+java.

I had not considered doing that. I do have Linux Mint on an older dual core laptop. I could look into installing REW there and see if the SB0490 (24 Bit External USB Sound Blaster Live!) plays nicely with Linux Mint...

What variety and version of Linux is recommended/best for REW?