• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

4 channel DIY digital interface.... with an Amazon Basics HDMI extractor????

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Hello guys,

Wanted to share what it might become the initial steps of a cool and hopefully easy diy project. I am very noob in electronics in general, let alone digital audio, so bear with me :)
As i can already foresee the "why you don't just buy this and that", i wanted to say that i have absolutely no need for this, i own a very good 22 channel interface and i do this only as personal challenge and for fun and learning.
The reason i am interested in this project is that a couple of years ago, when i owned a very nice stereo DAC and bought my first subwoofer, I hit my head with the reality of multichannel electronics. From one day to the other, my stereo electronics were obsolete and i needed to get my hands dirty in the world of audio interfaces etc. (that was before the minidsp flex existed).
I could never understand why interfaces with multiple SPDIF outputs like the minidsp udio8, that would allow you to keep on using your stereo DAC and just buy a second one for the subs, were so rare and expensive (for what they do). Surprisingly, I could not find any diy project dealing with this.
Recently, a thread @jmf11 opened on his much more ambitious USB multichannel DSP interface project reactivated my interest on this, and motivated me to explore what could i do with what i already had at hand, that was.... a cheapo Amazon Basics HDMI extractor like the one Amir reviewed a few months ago.

The Amazon Basics extractor is based on a EP92A3E chip from Semiconn. This and others from the same family are common place in cheap HDMI extractors. This chip is very interesting because it can output 8 channel i2s audio via two common clock pins and 4 two channel data pins. In theory, you could get 4 different stereo spdif outputs from this, perfect!!
1687083270993.png

(Note that it also does DSD audio, i believe using the same pins, but i have no idea nor interest in DSD so i did not explore it and don't even know if it is of any interest to extract DSD from HDMI)
Unfortunately the datasheets of these chips are not readily available. A brief description of its sibling EP92A2E with its pinout is easy to find, but the pinout is completely different to the EP92A3E.
I could only find two sources of information regarding the pinout of the chip in the Amazon Basics extractor, and they seemed to match the PCB circuit:

One is this blurry pic from the website of a PCB printing company that seem to have copy/pasted whatever random project they had at hand in their marketing materail(?). Very professional:
1687077714401.png

that seems to indicate that spdif out and i2s out pins are pins 55 to 61.
And the second is the teardown of the SMSL HS-1 that uses the same chip and has pads for the spdif and the i2s pins with names on them, that confirms the blurry image above, great!. The SMSL PCB even has little marks every 10 pins that are of great help to count them, thanks SMSL.
1687077648517.png

And with this info, i could identify where the i2s pins for the 4 pairs of channels are:

1687078227257.png


As you can see, only the two clocks, and the channels 0,1 pins are connected to that 4 gang 330ohm resistor, and following the traces the three go straight to the DAC that feeds the analog line output of the extractor, so everything seems to fit.

But what happens with the other channels that are left unconnected, do they ever get a signal or the firmware just left them dead? how can i get to test this?
I could tap the clock and data signals and use a i2s dac or something to check each individually, but fortunatelly the PCB layout of the extractor offers a much easier solution:

To the back of the PCB, the trace of the i2s data for channels 0,1 goes straight to a 0 ohm SMD resistor(R150):

1687078691405.png


I could not believe my luck!. Only needed to take out the resistor, solder a cable with a 330 ohm resistor and start touching the other pins and see what comes out of the headphones, much easier than i thought!

1687078850933.png


To do my tests with the other channels i plug the extractor to my raspberry pi and set HDMI as a 8 channels card in camilladsp.
To make sure that what i am hearing is not just a stereo signal duplicated, i apply in camilladsp exagerated low pass filters or high pass filters or gain filters to each pair of channels, so i can identify them only listening to them.

1687079154140.png


with this setup, i start tapping pins manually, and to my surprise, this is the result:

- i2s channels 0,1 = channels 0,1 in camilladsp
- i2s channels 2,3 = no sound
- i2s channels 4,5 = channels 4,5 in camilladsp
- i2s channels 6,7 = no sound


Well, we don't have 8 channels, but hey, we do have 4, enough for a typical low cost mains + sub(s) setup! Why these four? No clue, maybe there is a reason, maybe the guys writing the firmware forgot them on, whatever. I am just curious if there are revisions of the extractor with different active channels... nobody knows

What i plan to do now is to get a couple of wm8804 i2s -> spdif codecs, that i am familiar with, and see if i manage to make them work in slave mode sharing the clock signals from the extractor and outputting 2 channels spdif each, wish me good luck :)

Comments and suggestions are welcome!
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,565
Likes
3,448
Location
Detroit, MI
Very cool. You are probably already aware but there are some of the shelf products that can give you multichannel I2S.

USB to 8 channel I2S output

HDMI to 8 channel I2S output

8 channel I2S output DSP

For a while I was experimenting with the HDMI to I2S board in an attempt to capture the 8 channel I2S output with a USBstreamer but could never get it to work reliably. It seemed like a clocking issue.

A board that could take multichannel I2S and buffer the clock signals and give you 4x MCLK/BCLK/LRCLK would be really useful. This could easily interface with WM8804 boards as you mention to give SPDIF output or you could go directly in to stereo I2S DACs. IanCanada's McFIFO/McDualXO does this but it also acts as a reclocking FIFO which adds considerable delay. As it stands I've had difficult with using all of these multichannel I2S output devices with anything other than a 8 channel I2S DAC.

I'm excited to see where your project goes. I am not sure about hardware costs but it seems reasonable that you could recreate the output functionality of a U-DIO8 for about half the price.

Michael
 
Last edited:
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Hi Michael,
Yes i have seen those boards before. Actually i was about to order the Aliexpress one, that uses a Semiconn chip of the same family that the amazon basics extractor (maybe the same?), when i thought, why not checking before what i already have collecting dust in a drawer...

Agree, if you have a use for it and specially if you need 8 channels, go for one of those boards. I am still curious what the Aliexpress one can do.
For me, at this point, the objective is just to see what can be done with the extractor and two spdif transceivers. If the assembly works with no further issues, i believe it can be a very neat resource for someone that for whatever reason wants to build an ultra low cost 4 channel setup with stereo dacs. My BOM cost for the moment is 19 eur for the extractor + 4.44 eur for 2 wm8804 + 10 eur for the PCBs + 2-3 euros for two crystals that i don't have at the moment, still under the price of the Aliexpress board :D edit: will need a microcontroller as well, iirc the wm8804 hardware mode is spdif in -> spdif out only: + 4 eur for a ESP32. Just rechecked the datasheet, wm8804 can be set to do i2s->spdif in hardware mode, so no microcontroller needed, what to be honest, simplifies the project a lot.

I remember reading about your issues with the clock signals, later today i will try to post more details of what i plan to do with the wm8804s to get the spdif signals, i would appreciate your comments on the setup if you have any.
Thanks!
 
Last edited:
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
@mdsimon2
i have been reading a bit around trying to validate my plan of splitting the LRCLK and BCLK signals out of the extractor into 2 wm8804 chips. I will not need the MCLK because the wm8804 can generate its own master clock.
I came across this thread in diyaudio where they address the issue. Does it resonate with the issues you found?. According to the first guy answering, the most difficult to split would be the MCLK, that i don't need. Was this what you found difficult or was something totally unrelated? If you don't remember that's fine, no worries.


pasted here the relevant part:

1687113282307.png
 

ppataki

Major Contributor
Joined
Aug 7, 2019
Messages
1,291
Likes
1,483
Location
Budapest
I totally love this initiative @MarcosCh !
I hope you will succeed
I am using the RME Digiface USB to do USB to multi-SPDIF (wonder what board the Digiface must be using....) but a neat DIY design might be even better (and cheaper)

Also I am wondering why there is no such off-the-shelf product from manufacturers like SMSL, Topping, etc.... it would be a suppletory product for sure
 
  • Like
Reactions: MCH

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,565
Likes
3,448
Location
Detroit, MI
Yes, all of that matches my experience. I've split BCLK and LRCLK (from a 2x4HD) successfully in to two I2S input ESS DACs that do not require MCLK. When I was using WM8804 boards they were off the shelf and needed MCLK. As he mentioned termination resistors can help but I never got around to trying it. The other issue I ran in to is a lot of these boards aren't really well designed and do not have ground pins adjacent to each signal pin. In comparison the IanCanada stuff is well designed and outputs using U.FL connectors which seem to work well.

Michael
 
  • Like
Reactions: MCH
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
I totally love this initiative @MarcosCh !
I hope you will succeed
I am using the RME Digiface USB to do USB to multi-SPDIF (wonder what board the Digiface must be using....) but a neat DIY design might be even better (and cheaper)

Also I am wondering why there is no such off-the-shelf product from manufacturers like SMSL, Topping, etc.... it would be a suppletory product for sure
Thanks for your words :)
Well better... I have my doubts, but the extractor itself can do up to 192kHz and probably 24 bits over spdif, so if it could do the same via i2s, at least it will be a quite capable one. Let's see.
To build something similar to the RME, that is, via USB, there is the comtrue CT7601chip, that also exposes various i2s- channels in pairs with common clock signals. But for that one it is really difficult to find any info and anyways it would be way too complicated for me.
 
Last edited:
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Yes, all of that matches my experience. I've split BCLK and LRCLK (from a 2x4HD) successfully in to two I2S input ESS DACs that do not require MCLK. When I was using WM8804 boards they were off the shelf and needed MCLK. As he mentioned termination resistors can help but I never got around to trying it. The other issue I ran in to is a lot of these boards aren't really well designed and do not have ground pins adjacent to each signal pin. In comparison the IanCanada stuff is well designed and outputs using U.FL connectors which seem to work well.

Michael
Thanks Michael, that makes me more confident.
I don't plan to use any off the shelf wm8804 i2s->spdif board but i am going to make my own. I already made one (stereo, with one ic) that works fine. It is quite easy and very well documented, actually.
My own board will allow me to keep the traces symmetrical and short, in case it is important. Also, the extractor PCB has a 3.3volts pad that will come handy to power the two wm8804. I just hope it provides enough power, as i believe it comes from an internal voltage converter that the chip has. But i am not 100% certain, cannot tell just looking at the extractor board.
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Short question,

I am finishing to draft the PCB for the soundcard. I decided to add footprints for 8 channels (4 x wm8804) in case I manage to make the 8 channels work somehow in the future. Will leave the extra circuitry them unpopulated in case I don’t.

I have absolutely no clue why the extractor outputs 4 channels instead of 8. It seems reasonable to think it could be the way they program the chip. Nevertheless I want to explore the possibility that it could depend on what we send through the HDMI input.

The way I did my tests in post #1 was using the BCM2835 driver that i guess is default for ubuntu server 22.04 HDMI. Alsa calls the HDMI card “b1”, and i had it working with up to 8 channels, 48KHz and 16 bits. Nothing higher than that works.

I know the extractor can do 192KHz 24 bits, for instance when i connect it to an amazon fire stick, but i have no idea how to achieve that with the raspberry pi.
I thought i could try the KMS driver (vc4-kms-v3d) and see what happens. My objective is not so much getting higher sample rates and bit depths to work, but to see if i can get the other 4 channels as well.

I added dtoverlay=vc4-kms-v3d to my config text and indeed i got a new alsa card called vc4hdmi0 (and vc4hdmi1). To my surprise, instead of improving things, this card is only capable of 2 channels and the audio format is IEC958_SUBFRAME_LE (???). I could not manage to make camilladsp work with this card no matter what, i suspect the issue is that format instead of S16LE but to be honest, i have no idea what that means.

All this is completely unknown territory for me and the few sources of information (links at the end) I could find are a bit over my head…

My question to you guys before giving up this route is:

Does anyone know of any tutorial or source of information about the KMS driver for audio?

Thanks a lot for any indication.

links:


https://manuals.plus/raspberrypi/kms-hdmi-output-graphics-driver-manual#axzz85FdCvc1W
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Short question,

I am finishing to draft the PCB for the soundcard. I decided to add footprints for 8 channels (4 x wm8804) in case I manage to make the 8 channels work somehow in the future. Will leave the extra circuitry them unpopulated in case I don’t.

I have absolutely no clue why the extractor outputs 4 channels instead of 8. It seems reasonable to think it could be the way they program the chip. Nevertheless I want to explore the possibility that it could depend on what we send through the HDMI input.

The way I did my tests in post #1 was using the BCM2835 driver that i guess is default for ubuntu server 22.04 HDMI. Alsa calls the HDMI card “b1”, and i had it working with up to 8 channels, 48KHz and 16 bits. Nothing higher than that works.

I know the extractor can do 192KHz 24 bits, for instance when i connect it to an amazon fire stick, but i have no idea how to achieve that with the raspberry pi.
I thought i could try the KMS driver (vc4-kms-v3d) and see what happens. My objective is not so much getting higher sample rates and bit depths to work, but to see if i can get the other 4 channels as well.

I added dtoverlay=vc4-kms-v3d to my config text and indeed i got a new alsa card called vc4hdmi0 (and vc4hdmi1). To my surprise, instead of improving things, this card is only capable of 2 channels and the audio format is IEC958_SUBFRAME_LE (???). I could not manage to make camilladsp work with this card no matter what, i suspect the issue is that format instead of S16LE but to be honest, i have no idea what that means.

All this is completely unknown territory for me and the few sources of information (links at the end) I could find are a bit over my head…

My question to you guys before giving up this route is:

Does anyone know of any tutorial or source of information about the KMS driver for audio?

Thanks a lot for any indication.

links:


https://manuals.plus/raspberrypi/kms-hdmi-output-graphics-driver-manual#axzz85FdCvc1W

ok, i think i got the kms driver and card working and with good results.

What i was doing wrong is to set the alsa output device in camilladsp as a hardware device, instead, it must be set as iec958:vc4hdmi0

With the kms driver, the capabilities of the HDMI device increase to 8 channels 24 bits 192 kHz, but only if the "5.1 channels" button in the extractor is activated:

1687556328391.png


And indeed it can be set to up to 192/24 in camilladsp:

1687556457798.png


Unfortunately we still get 4 channels of real output, but i will keep on trying...
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
When I used it with my fire stick, the Amazon Basics HDMI extractor was resampling everything to 48kHz except for Amazon Music, which resamples to 192kHz no matter what. The device is notorious for that, I don't know if other extractors do the same. (note: well, actually i don't know if it is the stick or the extractor that does the resampling)

I wanted to confirm that when used as an output card with the KMS driver it was not doing the same thing, so i prepared my pico oscilloscope (what an amazing tool for the casual tinkerer) and taped the LRCLK signal from pin 57 of the extractor's chip. The LRCLK signal should give directly the sample rate with a 50% duty cycle:

Camilladsp set to 44.1 kHz:
Screenshot_2023-06-24-09-52-37-60_98dfc6e29a57ac5a053b31bb1348cfeb.jpg


Camilladsp set to 48kHz:
Screenshot_2023-06-24-09-53-05-12_98dfc6e29a57ac5a053b31bb1348cfeb.jpg


Camilladsp set to 96kHz:
Screenshot_2023-06-24-09-58-18-13_98dfc6e29a57ac5a053b31bb1348cfeb.jpg


and finally camilladsp set to 192kHz:
Screenshot_2023-06-24-10-01-00-50_98dfc6e29a57ac5a053b31bb1348cfeb.jpg


cool, it outputs the correct sample rate up to 192kHz with a voltage in the range of the wm8804. The KMS driver is the way to go!

I don't know if there is a way to measure bit depth as well. I read that the pico oscilloscope can be used as well as logic analyzer but i need to figure out what to look for.

In the meantime, the PCB drafting is almost finished:
1687595175915.png
 
Last edited:
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
If someone can explain how this is even possible, i would be curious to know (JLCPCB)

1687713941267.png
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Unfortunately i don't have a dedicated space nor i do these sort of things that often, so mostly i hand solder them with the soldering iron, specially small double sided pcbs like this one. For more complex projects i have also used the assembly service in JLCPCB, that can will be cheaper than ordering the parts.

I learned not that long ago and i definitely embrace the principle "you never have enough flux".
The smallest i managed to do so far are precisely the 20 and 28 pin ssop wm8804/5. Here one of my attempts. After adding some solder to the pads and final result:

1687723836976.png
1687723947449.png

It won't win a beauty price but it works...
(the other smd parts in this picture are not hand soldered, i never did 0603 like those capacitors there)

Actually, the most challenging part of this project will be to solder a cable to a pin of the 128-pin LQFP package, that is waaay smaller than the ssop. The lense of my third hand is not going to be enough, but precisely this morning i borrowed the microscope of my kid and i "modded it" to accommodate the audio extractor board. I still need to figure out how to do the soldering, but i guess i will apply some solder to the tip of a thin cable, fix the cable somehow on top of the pin and approach the iron.... let's see how it works...
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,565
Likes
3,448
Location
Detroit, MI
  • Like
Reactions: MCH
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
I definitely have no space for a real oven, but have considered building this one Great Scott reviews here. His concern is that the the heating part does not last long, but well, you will need to print 5 boards anyways so for casual use and small pcbs, it might be worth it.


 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
Thank you, will need it!
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,712
Likes
2,350
two channels (the ones picked directly from the chip).... WORKING!

1691768517866.png


I used very long cables without any ground signal in parallel on purpose to check how robust the signal is. Additionally the filtering of the power supply is not soldered yet, so this is like a worst case scenario test.
It goes to 96kHz without problem but not beyond that. Should be capable of 192kHz but truth is that i've never played with wm8804 in hardware mode before so it could be that it does not switch automatically to 176/192kHz mode. Will try to find out.

What i am noticing is two very strange behaviors:
- the inputs in camilladsp (i.e. mute one channel) don't always apply immediately, and this is the first time this ever happens to me
- sometimes the output changes from one channel to another on without any reason, even to channels that should not be accessible. This never happened during my previous tests.
I suspect that both things could be related to the KMS driver, not the hardware, but i have no idea, as it is the first time i use this driver, but it is something i must fix to make it usable....
 
Last edited:
Top Bottom