• 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!

The 1 euro HDMI input solution for your next DIY DAC

I am afraid I got lost in your commands.

Ad sox: the -n parameter is used when either input source (device or file)or output sink (device or file) is missing, like when generating a signal (-n instead of input) or when generating spectrum/stats of the signal (-n instead of the output specs). Your commands seem to mix -n into existing input/output chain.

If you play a pre-generated wav, there is no need to put trim 0.0 100.0 dcshift 0.0. I used that for generating the dc-shifted constants which produce a constant pattern of bits in every sample in the I2S data stream.
 
  • Like
Reactions: MCH
I am afraid I got lost in your commands.

Ad sox: the -n parameter is used when either input source (device or file)or output sink (device or file) is missing, like when generating a signal (-n instead of input) or when generating spectrum/stats of the signal (-n instead of the output specs). Your commands seem to mix -n into existing input/output chain.

If you play a pre-generated wav, there is no need to put trim 0.0 100.0 dcshift 0.0. I used that for generating the dc-shifted constants which produce a constant pattern of bits in every sample in the I2S data stream.
thanks for the indications. Was my first time using sox, just copied your example and adapted it to my needs. I repeated the captures changing what was wrong. The captures of the i2s signal are identical when playing the tones (indicating 24 bits i guess). The outcome of sox now is the following:

marcosch@raspcamilla2:~$ sox ~/1kHz192kHz32bstereo.wav -V -r 192000 -c 2 -b 32 -t alsa hdmi:vc4hdmi0 gain -160
sox: SoX v14.4.2
sox INFO formats: detected file format type `wav'

Input File : '/home/marcosch/1kHz192kHz32bstereo.wav'
Channels : 2
Sample Rate : 192000
Precision : 32-bit
Duration : 00:01:00.00 = 11520000 samples ~ 4500 CDDA sectors
File Size : 92.2M
Bit Rate : 12.3M
Sample Encoding: 32-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no


Output File : 'hdmi:vc4hdmi0' (alsa)
Channels : 2
Sample Rate : 192000
Precision : 32-bit
Duration : 00:01:00.00 = 11520000 samples ~ 4500 CDDA sectors
Sample Encoding: 32-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no

sox INFO sox: effects chain: input 192000Hz 2 channels
sox INFO sox: effects chain: gain 192000Hz 2 channels
sox INFO sox: effects chain: output 192000Hz 2 channels
In:100% 00:01:00.00 [00:00:00.00] Out:11.5M [ | ] Clip:0
Done.
 
Just reading the thread, it seems possible that it's not actually I2S data - perhaps a different format or something else entirely. I would recommend using a chip with a datasheet...
 
@MCH :

You command "sox ~/1kHz192kHz32bstereo.wav -V -r 192000 -c 2 -b 32 -t alsa hdmi:vc4hdmi0 gain -160" means some wav gets attenuated by 160dB. But I do not know what that wav actually contains.

IMO better way would be generating the signal directly, having equal value in each sample so that you can see params of your transmission channel right away in your scope/analyzer

Like:
sox -V -r 192000 -c 1 -n -c 2 -b 32 -t alsa hdmi:vc4hdmi0 trim 0 1000 dcshift 1 gain -186

This makes sox generate from start 1000 seconds of zeros (trim 0 1000), dcshifted to 1 (i.e. all samples ffff), then attenuated down to the 32nd bit. Your scope/analyzer would show one bit every sample, if your transmission is 32-bit wide.

For checking the bits limit just leave out the gain and check how many ones are there in each sample (should be 24 instead of 32). Or change the dcshift to generate only the 24th LSB (it's easier to calculate the dcshift value (1/ 2^23) than the required gain dbs which have some imprecision caused by the logs calculation):

sox -V -r 192000 -c 1 -n -c 2 -b 32 -t alsa hdmi:vc4hdmi0 trim 0 1000 dcshift 0.0000001192


1704715369079.png


In all cases you should get stable I2S data values, every sample in both channels identical.
 
@MCH :

You command "sox ~/1kHz192kHz32bstereo.wav -V -r 192000 -c 2 -b 32 -t alsa hdmi:vc4hdmi0 gain -160" means some wav gets attenuated by 160dB. But I do not know what that wav actually contains.

IMO better way would be generating the signal directly, having equal value in each sample so that you can see params of your transmission channel right away in your scope/analyzer

Like:
sox -V -r 192000 -c 1 -n -c 2 -b 32 -t alsa hdmi:vc4hdmi0 trim 0 1000 dcshift 1 gain -186

This makes sox generate from start 1000 seconds of zeros (trim 0 1000), dcshifted to 1 (i.e. all samples ffff), then attenuated down to the 32nd bit. Your scope/analyzer would show one bit every sample, if your transmission is 32-bit wide.

For checking the bits limit just leave out the gain and check how many ones are there in each sample (should be 24 instead of 32). Or change the dcshift to generate only the 24th LSB (it's easier to calculate the dcshift value (1/ 2^23) than the required gain dbs which have some imprecision caused by the logs calculation):

sox -V -r 192000 -c 1 -n -c 2 -b 32 -t alsa hdmi:vc4hdmi0 trim 0 1000 dcshift 0.0000001192
Ok all good, i will try to do that when i have some time. Fyi, the wav i was using contain tones (1 kHz and the last one 3 kHz) generated in Audacity

In all cases you should get stable I2S data values, every sample in both channels identical.
This has been the case so far in the tests i have done (see for instance the first capture in post #19).

Additionally, now that i already soldered two cables to the pins, i plan to solder the remaining two and the spdif out and try to capture with a soundcard and check in REW if it provides a clean signal. It will take me some time now the holidays are over.

thanks a lot for all the help.
 
I'm sorry if I'm sneaking here coming from a different place, which is how to get to a satisfying way to convert HDMI digital audio signals into coax digital output, by RCA or BNC, to inject into an external DAC though coaxial input.

I don't manage or have the knowledge to get to say anything about the parts involved, and an explanation of what involves what I want to accomplish would be a good starting points. So what are the stages and blocks that I need to go from HDMI to coax? That should be my first question.

Let's leave it clear that I do want a DAC. I want to go from an HDMI output that has digital audio and then stream that to the coax output with a signal that has the level, sampling and bitrate the DAC will accept, and if possible with nothing "added" to it in any kind of distortion, interference, noise, etc.

For instance, I did buy a Chinese box that accomplished that conversion function, but added "sibilance" and probably distortion of many kinds to the analog signal coming out the DAC. But some good things, like instruments presence or "life" was also injected in the presentation, though in an exaggerate way. The DVD player which HDMI output was used also has a DAC, and its audio sounded much more muted and soft that through the adapter + DAC.

Then I tried a third way: plugging the HDMI output into a line level HDMI input on the same receiver I was using. This time the "exaggeration", particularly sibilance, muted down, but keeping its vitality and a closer to life presentation. The question is always which was the original objective of team that originally made the disc or discs.

So I centered my attention on the converter. Amirn had tested one of these some time ago


Pity the unit you tested was a digital to analog conversion, but from what I can guess from your tests and discussion, it seems the important thing is to program correctly the chip that comes after the HDMI input, which programs what the signal will go and do.

Has anyone played measurements and settings in an unit similar to that amirn did test? Or any other that converts HDMI to coaxial digital?
 
Pity the unit you tested was a digital to analog conversion, but from what I can guess from your tests and discussion, it seems the important thing is to program correctly the chip that comes after the HDMI input, which programs what the signal will go and do.

Has anyone played measurements and settings in an unit similar to that amirn did test? Or any other that converts HDMI to coaxial digital?
Carlmat, Amir also measured the COAX output of the Amazon basics extractor, at the end of the review, and the measurements show it is perfectly transparent. He also explicitly mentions that in the text. I am not sure how hdmi audio to SPDIF conversion works, but it seems that nothing is added or changed, at least in this case.
I think you are going to be fine using the Amazon basics extractor coax output connected to your DAC.
Screenshot_20240611-145007.png
 
Carlmat, Amir also measured the COAX output of the Amazon basics extractor, at the end of the review, and the measurements show it is perfectly transparent. He also explicitly mentions that in the text. I am not sure how hdmi audio to SPDIF conversion works, but it seems that nothing is added or changed, at least in this case.
I think you are going to be fine using the Amazon basics extractor coax output connected to your DAC.
View attachment 374559
Thanks, MCH. Did miss that comment and that's all I need.
 
My problem is I that buying this box from Amazon and ship to Brazil would be a lot of money in import taxes and shipping.

Does somebody have the Aliexpress URL for the similar model converter they sell? I can't seem to find it myself.
 
OK, I am still trying to find on Aliexpress a similar unit that Amir tested, similar to Amazon's, or something that might work slightly better than the one I had bought.

So I bought this one:


The problem is that the HDMI input is an ARC type, and it doesn't work with common HDMI outputs. I wonder if there's a way to solve that.

Now I'm considering this one:


There's no ARC marking anywhere, so it should work.
 
OK, I am still trying to find on Aliexpress a similar unit that Amir tested, similar to Amazon's, or something that might work slightly better than the one I had bought.

So I bought this one:


The problem is that the HDMI input is an ARC type, and it doesn't work with common HDMI outputs. I wonder if there's a way to solve that.

Now I'm considering this one:


There's no ARC marking anywhere, so it should work.
I remember your requirement of a coax output. I had a look and the truth is that most of very cheap AliExpress options have only toslink, never realised this.
The ones like the first one you linked, with only one hdmi connector, are often ARC only, no pass through. Sometimes these "only ARC" ones, they just take the ARC signal and change it electrically to be SPDIF compatible, that's why they are so cheap.
The second one, with two HDMI connectors is more likely to work pass through, that is, like regular audio extractor passing the video. But I don't own one like that, so I cannot tell for sure what it does.
 
Last edited:
Well, I already have one that plays HDMI to coax, but some recordings sound too sibilant with it. That's why I bought another converter: to see if it was the problem.

Yes, the second converter has a good price and should be low bet, compared to others on AE. Since last year we pay a very high tax to buy things from China, so the expensive would cost double the price.
 
Back
Top Bottom