Hikey-960: Connect I2S2 output to external codec?

I understand that I2S2 in Hikey-960 is connected three way with Soc/BT/HDMI. Typically Soc works as master to send I2S to HDMI receiver. I believe BT is disabled in this case. But if I want to connect I2S2 lines to an external codec, one way is to use the I2S lines in BT part (WL1837MOD).

Is there a way where, when SoC is playing I2S2 to HDMI and we can still use I2S lines from BT? Can BT be put in some disabled/bypass mode where I2S2 played from Soc can be used at BT?

Or is the only way to get I2S output from BT is to make BT the master and play audio using it?

If there is a workaround to be able to tap I2S2 at BT, that would the great.

Thanks!

I think you misunderstand how the i2s on the bluetooth works… those pins are directly connected to the SoC and the HDMI. Any data that you transmit on the i2s line to the bluetooth will be sent out over the air, and data it receives over the air will be transmitted on the i2s lines to the SoC.

The i2s lines on the bluetooth chip are almost exclusively for the purpose of telephone calls in two scenarios;

  1. If the bluetooth chip is embedded in something like a CELL PHONE, then it will allow audio to be sent to a CAR.
  2. If the bluetooth chip is embedded in something like a CAR RADIO, then a cell phone that is paired with it can connect the audio to the CAR’s speakers and microphone.

There really isn’t any option to connect an external codec to the i2s2, since the only access to it is the tiny pins on the side of the bluetooth chip. Anything you solder onto there will be INCREDIBLY FRAGILE.

Why do you need to connect a codec to i2s2 rather than i2s0 which is available and you’ve been able to get working? Could you please describe what your end goal is, so that I can help you figure out what the best way to approach it is?

If you really insist on using i2s2 to hook up an external codec, your best option would probably involve something like a raspberry pi zero-W, transmit the audio over bluetooth and feed it through the pi’s i2s lines to an external codec.

Thanks for the responses!

I am working with an external DSP that has two I2S inputs. I have a requirement where I need two separate I2S lines to connect to this DSP. I am already using I2S0 in LS. I was hoping I can use I2S2 by either disabling HDMI or BT. Since there no connection at HDMI-receiver end, I am taking output from Wlink chip. I understand it is very fragile connection, but if there is no other way I am willing to take that risk.

Given this, my questions are:

  1. Since there is actually a I2S connection between Soc and BT, how do I disable HDMI path and enable BT path? Does this involve programming BT chip?

  2. Assuming we can do (1), is there anyway we can put BT in some special mode (disabled etc) where it just ignores the I2S input. This would be like a Dummy BT codec doing nothing. So from Soc I can write to I2S BT Codec and it would go to my external codec. Is this possible?

  3. If the above solution is not possible, could you elaborate on how we can setup audio over BT and use i2s lines in BT?

Thanks again for your help!

First; WHAT IS your DSP, and why do you need to use 2 i2s inputs on it?
Second, if you need to feed 2 i2s inputs to it, you can do so with a SINGLE SET of i2s lines. i.e I2S0_DO → DSP_DIN1, I2S0_DO → DSP_DIN2.

There are lots of DSP’s that have multiple inputs, you typically dont have to use them all.

So again, I am going to ask you to elaborate on your objective in this. What hardware are you using? And what are you trying to accomplish with it?

To answer your questions;

  1. This question doesnt make sense. Both paths are always enabled.
  2. That is already the default.

Hi doitright,

Sorry, the codec I am trying is a proprietary one and I can’t share too much details. But I do have a requirement to use both I2S lines independently.

When you say the I2S2 path from Soc->BT is always enabled, what do I need to do for I2S data show up at BT pins. Do I have to do any setup in BT? Any kernel device tree changes needed to route data from CPU dai to BT codec dai?

The reason I am asking is, when I play audio through HDMI, it works but I don’t see any I2S data at BT pins.

You don’t have to do anything except fix your logic analyzer.

I do see the I2S data on I2S2 in BT (WL1837MOD) pins. It was not the logic analyzer, but wrong pin connections. After fixing the connections based on the datasheet, it worked. Thanks for the help!