2022 UPDATE
Since writing this blog post I have created the AV Latency.com Toolkit, which is designed to accurately measure S/PDIF Audio Latency using the technique that is described in this blog post. I recommend this new toolkit instead.
Original Blog Post
In a previous post, I described a method of measuring HDMI audio DAC latency using a computer’s sound card and a Wii U. This post describes a similar method for measuring optical S/PDIF audio DAC latency using a cheap and widely available USB audio DAC as a signal generator. I strongly recommend you give my previous post a read before reading this one to give some context for this approach.
Finding a Signal Generator
Because my Wii U test method resulted in such consistent results, I hypothesized that there might be an integrated circuit out there that would output optical S/PDIF and analog audio at the exact same time. If this was the case, it could act as a signal generator for measuring optical audio DAC latency in the same as the Wii U can be used for HDMI audio.
After some quick shopping, I decided to settle on the LiNKFOR USB DAC Audio Converter which can be purchased for only $22 USD. I found it was available on Amazon (as well as Amazon.ca), AliExpress, and various marketplace sellers.
This USB audio DAC uses the Cmedia CM108B, which is able to output synchronized audio to analog RCA, analog headphone, RCA S/PDIF, and optical S/PDIF at the same time.
Verifying Output Synchronization
I wanted to be sure that this audio DAC did, in fact, output audio at exactly the same time through the analog outputs and the optical S/PDIF output. To test this, converted the digital optical signal into a digital voltage signal that I could compare more easily with the analog voltage signal of the RCA/headphone output.
I found the EAPLRAA4 Fiber Optic Receiver, which would make this conversion from optical to voltage with a delay of only 120 nanoseconds in a worst case. The datasheet for this receiver came with a “General application circuit”, which made wiring it up extremely easy:
Now that I can represent the optical signal as voltage, I was able to simply wire it up to my 192 kHz sound card to use as a sort of makeshift oscilloscope. 192 kHz is not a high enough frequency to capture the digital S/PDIF signal in detail, but enough to get a gist of when a change has happened. In the future, I may repeat this test with a proper mixed signal oscilloscope or logic analyzer, but for now I feel these tests clearly show the accuracy of this test method.
Here’s what it looked like at different zoom levels when I played a 4800 Hz tone that turned on and off through foobar2000 in WASAPI exclusive mode:
Although I don’t have enough detail to decode the S/PDIF signal, there seems to be enough detail to show clearly that the different outputs are very closely synchronized by this Cmedia chip, making it ideal for this latency measurement method.
Testing Optical S/PDIF DAC Latency
The test process and hardware for measuring optical S/PDIF DAC latency is virtually identical to the process used for measuring HDMI audio DAC latency with a Wii U, so I will not reiterate any of those details in this post. The only differences are:
- The optical output of the LiNKFOR USB DAC is used instead of the HDMI output of the Wii U
- The RCA or headphone output of the LiNKFOR USB DAC is used instead of the analog RCA output of the Wii U
- The LiNKFOR USB DAC must be connected to a computer. Simply play any audio file you want with the LiNKFOR USB DAC as your output device. (Note: On Windows, it seems like the USB audio device, called “Speakers”, is disabled by default when you plug it in. Simply enable it in your sound settings to use this as your output device.)
During these tests I discovered that there was one quirk with the LiNKFOR USB DAC: the analog audio output seems to be inverted compared to the source and optical audio output. This is not a problem, but is something to be aware of if you are using this method for measuring latency.
Results
I only tested a couple of receivers that I have on hand and included existing latency measurements using my Wii U method:
Device | Signal | Setting | Audio Latency |
---|---|---|---|
Marantz NR1711 | 1080p 60Hz 2.0 Stereo | Direct | 6.0ms |
Marantz NR1711 | 1080p 60Hz 2.0 Stereo | Stereo | 6.0ms |
Marantz NR1711 | 1080p 60Hz 5.1 Surround | Direct | 6.2ms |
Marantz NR1711 | 1080p 60Hz 5.1 Surround | Multi Ch | 6.2ms |
Marantz NR1711 | Analog RCA Stereo | Direct | 0.0ms |
Marantz NR1711 | Analog RCA Stereo | Stereo | 0.0ms |
Marantz NR1711 | Optical S/PDIF | Direct | 4.9ms |
Marantz NR1711 | Optical S/PDIF | Stereo | 7.9ms |
Sony STR-DH540 | 1080p 60Hz 2.0 Stereo | Pure Direct | 56.5ms |
Sony STR-DH540 | 1080p 60Hz 5.1 Surround | Pure Direct | 13.1ms |
Sony STR-DH540 | Analog RCA Stereo | Pure Direct | 13.0ms |
Sony STR-DH540 | Optical S/PDIF | Pure Direct | 55.8ms |
Limitations
The Cmedia CM108B is only capable of outputting 44.1 kHz and 48 kHz 16-bit PCM audio over optical S/PDIF. Although many other formats may be transmitted over an optical cable, this format is common and valuable to test. Please let me know if you have any recommendations for other widely available optical audio DACs that would be better suited as a signal generator!