Author Topic: Making a HDMI audio type detector  (Read 2030 times)

0 Members and 1 Guest are viewing this topic.

Offline teddyngTopic starter

  • Newbie
  • Posts: 5
  • Country: gb
Making a HDMI audio type detector
« on: November 12, 2019, 01:04:28 pm »
I want to make a device that goes inline on a HDMI to detech what type of audio it is (PCM, dolby digital, dolby digital+...) which I know is possible as you can normally see it on a tv or amplifier but not sure how to approach it? Can anyone help me out with some ideas?
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Making a HDMI audio type detector
« Reply #1 on: November 12, 2019, 04:29:18 pm »
I want to make a device that goes inline on a HDMI to detech what type of audio it is (PCM, dolby digital, dolby digital+...) which I know is possible as you can normally see it on a tv or amplifier but not sure how to approach it? Can anyone help me out with some ideas?

As all HDMI signals are digitally encoded I assume examining the contents of the digital streams will say somewhere what the frame or packet contains so it can be interpreted and decoded.

Also, different versions of HDMI have different capabilities so I suppose the version is also specified in the transmitted data.

In any case, you will need to analyze the data stream and interpret it using the HDMI standard.
« Last Edit: November 12, 2019, 04:38:31 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Making a HDMI audio type detector
« Reply #2 on: November 12, 2019, 04:38:45 pm »
HDMI sink signals it's supported formats to the HDMI source using the DDC/EDID, using SAD (short audio descriptors).

Can somebody fill in my gap in knowledge, how the HDMI sink then determines in what format is the audio data received?

(That will also probably be the partial answer for the OP how to grasp the problem)

Usually, HDMI receiver codec just provides a multichannel raw audio data (4x I2S or TDM), that then gets interpreted by the decoder. Question is, how the decoder decides, whether it is receiving raw LPCM, or compressed garbage?

Thx, Y.
« Last Edit: November 12, 2019, 04:40:27 pm by Yansi »
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Making a HDMI audio type detector
« Reply #3 on: November 12, 2019, 05:16:29 pm »
I see in Wikipedia that there are several audio formats which can be optionally supported. I am guessing there is a protocol between sender and receiver where the sender lists its capabilities and the receiver chooses what format it prefers.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Making a HDMI audio type detector
« Reply #4 on: November 12, 2019, 06:39:01 pm »
There is no bidirectional communication over HDMI, other the CEC. And I'm not sure if CEC can be used to negotiate the format. (Probably not?)

The I2C lines (Vesa DDC / EDID) is only unidirectional as far as I can tell. Signal source reads (read-only) content from the sink and opts to behave accordingly to the list of supported formats, as encoded in the DDC memory.

HDMI is unfortunately a lot of mystery, as it is a heavily commercialized pay-walled interface, just like MIPI. You're not simply gonna get any specs for it, sometimes you are not even gonna get full datasheets for ICs that interface either of those two. Doh!

 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Making a HDMI audio type detector
« Reply #5 on: November 12, 2019, 07:13:43 pm »
So a source which can send audio in a dozen different formats would send them all out simultaneously and let the receivers choose? That seems not very efficient to me, but, again, I know close to nothing about this topic and I am just speculating.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Making a HDMI audio type detector
« Reply #6 on: November 12, 2019, 07:38:40 pm »
I do not think there is a dozen formats. Barely half a dozen.

From a quick search about HDMI, I found that only 2 main encoding schemes are available, times 3 different sampling/bit-rates:

Either it is LPCM (linear non-compressed data) in 48, 192 or 384kHz sampling times two 32bit channels,
or it is some kind of Dolby compressed whatever, using the same audio data channel resulting in three different bitrates: either 1.5, 6 or 25mbps. [1]

I am no expert on HDMI, just investigated viability of HDMI for one of my projects (concluded it is not), so I have just a bare minimum knowledge of how it works. Inaccessible documentation was a showstopper. (I ended up with a DVI and some obscure encoder chip from Chrontel).

[1] https://developer.dolby.com/blog/dolby-audio-over-hdmi-part-2-signaling-and-carriage/
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Making a HDMI audio type detector
« Reply #7 on: November 12, 2019, 07:48:53 pm »
I cannot imagine sending all possible formats at once. It just makes no sense to me. And Wikipedia says the receiver can communicate "upstream".

Quote
https://en.wikipedia.org/wiki/HDMI#Audio/video

For digital audio, if an HDMI device has audio, it is required to implement the baseline format: stereo (uncompressed) PCM. Other formats are optional, with HDMI allowing up to 8 channels of uncompressed audio at sample sizes of 16-bit, 20-bit and 24-bit, with sample rates of 32 kHz, 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz, 176.4 kHz and 192 kHz. HDMI also carries any IEC 61937-compliant compressed audio stream, such as Dolby Digital and DTS, and up to 8 channels of one-bit DSD audio (used on Super Audio CDs) at rates up to four times that of Super Audio CD. With version 1.3, HDMI allows lossless compressed audio streams Dolby TrueHD and DTS-HD Master Audio.[6](§7) As with the Y′CBCR video, audio capability is optional. Audio return channel (ARC) is a feature introduced in the HDMI 1.4 standard. "Return" refers to the case where the audio comes from the TV and can be sent "upstream" to the AV receiver using the HDMI cable connected to the AV receiver. An example given on the HDMI website is that a TV that directly receives a terrestrial/satellite broadcast, or has a video source built in, sends the audio "upstream" to the AV receiver.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Making a HDMI audio type detector
« Reply #8 on: November 12, 2019, 07:59:50 pm »
Hard to argue, hopefully someone with more info (and proper documentation) can enlighten us.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Making a HDMI audio type detector
« Reply #9 on: November 12, 2019, 08:51:12 pm »
I guess it could be that the user would select manually from a menu the audio format. That seems pretty easy to do.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1195
  • Country: ca
    • VE7XEN Blog
Re: Making a HDMI audio type detector
« Reply #10 on: November 12, 2019, 09:47:28 pm »
I believe it's just re-framed S/PDIF packed into the data islands, so format detection would happen more or less the same as it does with an S/PDIF receiver. Which is to say "not in a very well defined manner".
73 de VE7XEN
He/Him
 
The following users thanked this post: Yansi

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9321
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Making a HDMI audio type detector
« Reply #11 on: November 13, 2019, 01:45:27 am »
I believe it's just re-framed S/PDIF packed into the data islands, so format detection would happen more or less the same as it does with an S/PDIF receiver. Which is to say "not in a very well defined manner".
Except HDMI supports a bunch of audio formats S/PDIF does not.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: Making a HDMI audio type detector
« Reply #12 on: November 13, 2019, 03:33:16 am »
Looking through the HDMI Standard 1.4 (search for "hdmi 1.4 standard filetype:pdf") it looks like there are two ways to transmit audio.

- A packet that contains audio samples, and metadata bits out of the S/PDIF stream.

- A one-bit audio packet. That I assume moves raw bits from source to sink.

Looking at the S/PDIF info at http://www.hardwarebook.info/S/PDIF, I would guess that the coding is transmitted in the "Channel status and subcode information".

I assume that the source asked over E-DID what formats are supported, then sends a standard S/PDIF stream with the correct metadata for the desired audio format.

If the stream is not compatible for with SPDIF framing/packets I assume the raw stream of bits is transmitted over a one-bit audio packet...
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline cvanc

  • Frequent Contributor
  • **
  • Posts: 675
  • Country: us
Re: Making a HDMI audio type detector
« Reply #13 on: November 13, 2019, 03:57:37 am »
Wouldn't the easiest answer be to just use a surround sound receiver and observe what format it detects?

Or am I misunderstanding your goal here?
 

Offline teddyngTopic starter

  • Newbie
  • Posts: 5
  • Country: gb
Re: Making a HDMI audio type detector
« Reply #14 on: November 13, 2019, 10:38:10 am »
Wouldn't the easiest answer be to just use a surround sound receiver and observe what format it detects?

Or am I misunderstanding your goal here?

That's what I am doing at the moment with a receiver, but I am trying to build a portable one.
 

Offline teddyngTopic starter

  • Newbie
  • Posts: 5
  • Country: gb
Re: Making a HDMI audio type detector
« Reply #15 on: November 13, 2019, 10:55:44 am »
HDMI sink signals it's supported formats to the HDMI source using the DDC/EDID, using SAD (short audio descriptors).

Can somebody fill in my gap in knowledge, how the HDMI sink then determines in what format is the audio data received?

(That will also probably be the partial answer for the OP how to grasp the problem)

Usually, HDMI receiver codec just provides a multichannel raw audio data (4x I2S or TDM), that then gets interpreted by the decoder. Question is, how the decoder decides, whether it is receiving raw LPCM, or compressed garbage?

Thx, Y.

I will probably do some sink simulation to find out the handshake process if any.

Thanks for all the info so far, I will do a bit more research and I also have access to a few quantumdata analysers so I can double check where the audio signal is being send and look at the EDID and infoframes, I will keep you guys updated. The main problem might be building a circuit with their proprietary chipset as Yansi mentioned which the datasheet or where I can get hold of them. I might buy a "HDMI Audio Extractor" from Amazon which might have a "smart" decoder chipset that also process the EDID/infoframes, but it might have a "dumb" chip/chipset that just pull the audio out without the handshake.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9321
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Making a HDMI audio type detector
« Reply #16 on: November 13, 2019, 01:23:18 pm »
That's what I am doing at the moment with a receiver, but I am trying to build a portable one.
Find a used receiver with a blown PSU or output stage, then scavenge the HDMI board and display?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf