Routings or register settings for modem i2s in the hikey

Thank you for the diagram leo yan :slight_smile:.

It may sound stupid but can I get something little clear. Its hard for me to look at those :neutral_face:.

Hi Praveen,

Yeah. From the diagram, we can see Audio downlink uses two FIFOs and this two FIFOs are output for “Audio DL” and “Audio DR” respectively. But for modem voice, it only has one FIFO and output.

Hi @leo-yan ,

Thank you for supporting me in figuring out the solutions for the modem i2s.

Basically, I have a codec which needs stereo data.

I tried to use the modem i2s because that is exposed on the low-speed expansion header. But now it is only working with mono.

Are there any other i2s lines that I can use which are exposed?

Just making sure not to miss anything related to the i2s.
I studied the hikey user guide but did not find anything related to the other exposed i2s lines. Maybe you may have something useful information.

Thank you,
-VVN

Hi Leo Yan,

While I am trying capture from the modem i2s, I found that I am not getting LRCLK.
Do I need to do any other configurations settings to get that?

Can you share me the uplink diagram or some kind of information related to it?

When I started capture I am setting the registers fine for the LRCLK too.

#define HII2S_THIRDMD_PCM_PGA_CFG		0x6c
#define HII2S_S3_IF_RX_ENA					BIT(14)
hi6210_bits(i2s, HII2S_THIRDMD_PCM_PGA_CFG, 0, HII2S_S3_IF_RX_ENA);

Dont know why it is not generating any lrclk.

Hi Praveen,

I discussed with Hisilicon, they confirmed that modem I2S can be used for stereo mode and also mentioned that modem I2S can ONLY work as slave mode.

Discussed with Hisilicon, the feasible method is if you can dump all registers related with DMA controller [1] and I2S port registers [2] so they can help review related register setting.

[1] k3dma.c « dma « drivers - john.stultz/android-dev.git - Android Development/Trivial Tree. WARNING: Branches may be rebased.
[2] hi6210-i2s.h « hisilicon « soc « sound - john.stultz/android-dev.git - Android Development/Trivial Tree. WARNING: Branches may be rebased.

Hi Leo Yan,

That’s really a good news that it can be used for stereo.

I will get the register dump and will let you know soon.

And one more thing currently I am using the modem i2s as master and it is working fine though.
But when capturing it is not generating the LRCLK.

I will be back with the register dump as soon as possible.

Thank you,
VVN

Hi @leo-yan,

I shared the dump of the registers here .

Currently, I was able to get the register dumps of the i2s ( i2s->base ).

I will update the remaining DMA control registers in the same link.
I am figuring out the end and start of the DMA registers. Once it is done I will update.

Currently, shared 4 files with various configurations for reference.

i2s_slave_48k_1ch_16bit_play  : i2s is the slave and played 48k sample rate 1 channel 16bit file
i2s_slave_48k_2ch_16bit_play  : i2s is the slave and played 48k sample rate 2 channel 16bit file 
i2s_master_48k_1ch_16bit_play : i2s is the master and played 48k sample rate 1 channel 16bit file
i2s_master_48k_2ch_16bit_play : i2s is the master and played 48k sample rate 2 channel 16bit file

Those dumps are while playing audio.

UPDATE: Updated the link with the DMA registers too.
Soon there will be a readme explaining about the files in that link.

Hi Praveen,

Have shared the dumping files with Hisilicon. According to previous discussion, I suggested Hisilicon to review below combinations firstly:

DMA_i2s_slave_48k_2ch_16bit_play.txt + i2s_slave_48k_2ch_16bit_play.txt

DMA_i2s_master_48k_2ch_16bit_play.txt + i2s_master_48k_2ch_16bit_play.txt

Hi Leo Yan,

I forgot to mention that when the i2s is working as slave it is playing mono very slow for the streams which are greater than 8k sample rate and stereo is always playing as silence.

Is there any register for configuring the fs of the modem fifo?
I found nothing related to it but I can see the fs related stuff for other fifos.
It seems I was missing something related to the sample rate because 8k mono playback is fine whereas other sample rates are not fine.

Just an update:

Only 8k Playing fine while the other stuff playing fast when the i2s is the slave

Stereo is not at all working when the i2s is the slave. Getting 0s from the expansion header.

Only mono and that too 8k is working properly now when i2s is the slave.

Hi @leo-yan,

Any update?

Hi @vvn2023,

I have not received response and sent email to inquiry for this. Sorry for long delay.

Thanks,
Leo Yan

Hi Leo Yan,

Thank you for the reply. Ok, Let us wait for their reply.
Hope they will reply soon.

Thank you,
VVN

Any updates?

Are my register dumps for DMA not good?

I updated the DMA control registers.

The new files starts with UPDATED_ in the link that I provided previously.

Dumped few more registers from 0x690 to 0x820