HDMI->SPDIF extractor + WM8804 = Bad news?

I'm trying to use a Pi + a WM8804 addon board (Hifiberry Digi+ I/O) to do some realtime DSP. TOSLINK in, processing, TOSLINK straight back out again on the same clock. With the clean TOSLINK signal from my desktop motherboard, this works perfectly.

I bought a generic "HDMI->Optical" extractor device, hoping to be able to hook up my contraption to various devices that don't have SPDIF out. The TOSLINK signal from this device works fine when I feed it straight to my DAC, and it works mostly-fine when I feed it to a CM6206-based USB capture device.

But my WM8804 setup hates it. The signal errors out at least once a second, causing constant crackling which obviously isn't acceptable. Cables are known-good; tried multiple HDMI source devices.

I have the chip's "with flags" mode enabled (where various flags are appended to the audio sample itself) and the UNLOCK and/or TRANS_ERR bits are set for the affected samples. This makes me feel fairly safe in assuming the WM8804 itself is losing its grasp on the signal (as opposed to an error between the chip and Pi).

I've been looking through the driver with a fine toothed comb and haven't found anything wrong so far. It's still possible its timing is being set up incorrectly but it looks unlikely at this point (most timing configuration is ignored when the RX is active anyway, according to the datasheet).

The Hifiberry forum's guess was that the jitter/variance from the device was simply too high, perhaps as an inherent result of the audio signal being interleaved with video. However, google shows that the WM8804 has quite a good reputation for being tolerant of jittery signals.

Sadly I don't have an oscilloscope/logic analyser/etc so my ability to investigate much further is limited. Any suggestions would be much appreciated, as would recommendations for particularly tolerant SPDIF rx ICs!

(One obvious thing to do would be to try another extractor device, but aside from being a cheapskate, I'd prefer to be able to receive even questionable signals like this one- it's clearly possible since it works OK with the CM6206 and DAC)
 
I use the WM8804/5 SPDIF RX/TX in most of my designs and IMO its the best SDPIF interface IC with the lowest PLL Corner frequency resulting in highest jitter attenuation within the Audio B/W of all SPDIF interface IC's I know.

However with VERY poor SPDIF sources - its LF Jitter attenuation performance comes to hurt it as it will struggle to maintain lock with "Bang Bang" type clock synthesis (A Clock Gen circuit that hops between two discrete frequency offsets to achieve an integrated average frequency). Its the very fact that it has such good LF jitter attenuation that it struggles with such PIG frequency sources...

I have some experience with HDMI repeaters / extractors IC's from "Explore" - EP and there clock circuits are so poor my Wavecrest Jitter anaylser cannot "Determine the source center frequency"... this tells all you need to know!!!

Dont give up on the WM8804/5 as I say they have the highest audio B/W jitter attenuation of all bit perfect SPDIF interfaces - so with a well behaved source you will be good.

If you operate the WM8804/5 in software mode - then if memory serves me correct there are registers you can set to increase the DPLL BW (increase upwards the DPLL attenuation corner frequency) - if you moved to say 20KHz for the BAD source input then you should solve the lock issue with such horrendous SPDIF sources...

Its not the fault of the WM5504/5 but rather the "Illegal operation" Bang Bang type clock Gens used on these cheap HDMI bridges and other crude SoC's...

If you have no software control, then a CS8414 or some such with its PLL Jitter attenuation corner frequency typically set around 20KHz will work ok (atleast will not loose lock).. but conversely has zero jitter attenuation across the most significant portion of the audio B/W which very much has the potential to impact your audio performance IME...
 
Last edited:
Thank you John! That's very helpful. Is it safe to say then that a higher quality extractor device would work, if I were to give up on this one after all (i.e it's not an inherent issue with grabbing audio from HDMI)?

If you operate the WM8804/5 in software mode - then if memory serves me correct there are registers you can set to increase the DPLL BW (increase upwards the DPLL attenuation corner frequency) - if you moved to say 20KHz for the BAD source input then you should solve the lock issue with such horrendous SPDIF sources...
I do have software control, but my reading of the datasheet is that most of the PLL params are ignored when the receiver is active. Reasonable initial values have to be set according to the frequency of the crystal in use, but after that...
In S/PDIF receive mode, the PLL_N and PLL_K values are automatically modified by the S/PDIF receiver to allow the receiver to use the PLL to lock on to and track the incoming S/PDIF data stream.
[...]
Before the S/PDIF receiver is enabled, it is important that the PLL_N and PLL_K register values are manually configured in a specific default state so that the S/PDIF receiver can correctly modify the PLL_N and PLL_K values and hence establish correct PLL control.
If the values will immediately get changed then there doesn't seem to be any room to configure it unfortunately.
 
Thank you John! That's very helpful. Is it safe to say then that a higher quality extractor device would work, if I were to give up on this one after all (i.e it's not an inherent issue with grabbing audio from HDMI)?


I do have software control, but my reading of the datasheet is that most of the PLL params are ignored when the receiver is active. Reasonable initial values have to be set according to the frequency of the crystal in use, but after that...

If the values will immediately get changed then there doesn't seem to be any room to configure it unfortunately.

I've sent you a PM....
 
Just out of interest, what IC was used in your HDMI extractor (Explore) - EP94xx or some such?

The main IC is a Lontium lt8641sxe (intended as a 4x1 switcher, but there's only one input). There's also an STM8S005K6T6C MCU and a mystery unlabelled IC.
 

Attachments

  • IMG_20200419_090150.jpg
    IMG_20200419_090150.jpg
    398.3 KB · Views: 189
  • IMG_20200419_090227.jpg
    IMG_20200419_090227.jpg
    404 KB · Views: 185
I've never heard of Lontium lt8641sxe - I've worked with boards using the Explore IC's which I'd like to use for DSD extraction (from SACD).

Wounder if the unmarked IC is a DAC of some sort..

Typical cost cutting, the ESD protection IC's are not fitted to the HDMI lines...