I2S DMA status

chadpham75
Posts: 24
Joined: Thu Sep 12, 2019 11:39 am

I2S DMA status

Postby chadpham75 » Thu Oct 31, 2019 5:38 am

Hi guys,
Is there any register or any api function call or any call back function I can use to query for the status of the data transfer out from I2S DMA?
I am currently using I2S DMA for the built-in DAC, I have the problem of cutting short the sound playing by stop too early. The problem will go away if I provide enough value for vTaskDelay() function.
I looked into the document but there is no information about the status of the I2S DMA activities during the data transferring.
Please give me some advice/pointers/page number/sections of the related to I2S DMA's statuses.
Thank you for your helps

chadpham75
Posts: 24
Joined: Thu Sep 12, 2019 11:39 am

Re: I2S DMA status

Postby chadpham75 » Mon Nov 11, 2019 12:50 am

Any suggestions? ESP?

chadpham75
Posts: 24
Joined: Thu Sep 12, 2019 11:39 am

Re: I2S DMA status

Postby chadpham75 » Tue Nov 12, 2019 6:34 am

Since noone has any suggestion, I am continuing to dig in the source code. My goal is trying to find a way that either query status register method, or call back function is the refer method, to find out when each of the buffer is successfully DMA out, and when the entire data is DMA out.
Below is my set up

Code: Select all

	int i2s_num               = I2S_NUM;
	 i2s_config_t i2s_config  = {
		.mode                      = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN,
		.sample_rate            = 16000,
		.bits_per_sample      = 16,
		.communication_format = I2S_COMM_FORMAT_I2S_MSB,
		.channel_format            = I2S_FORMAT,
		.intr_alloc_flags             = 0,
		.dma_buf_count             = 4,
		.dma_buf_len                 = 1024,
		.use_apll                        = 1,
	 };
When I called

Code: Select all

 i2s_driver_install(0, &i2s_config, 0, NULL);
Since I didn't pass any queue in the i2s_driver_install, there will be no p_i2s_obj[i2s_num]->i2s_queue to be created. However, when the sub function inside i2s_driver_install was called, it then calls the i2s_set_clk function, and in this sub function, there will be the call for i2s_create_dma_queue, which will use our dma_buf_count and dma_buf_len because my setting was using I2S_MODE_TX.

One important point is inside the i2s_driver_install, there is a function i2s_isr_register function that initialized the interrupt, and there is a call back function i2s_intr_handler_default that seems to be used for the tx/rx interrupt, but when I tried to create event message to float the even_id to application layer, I never got any events trigger.
I have tried
(i2s_reg->int_st.out_eof && p_i2s->tx)
(i2s_reg->int_st.out_done && p_i2s->tx)
(i2s_reg->int_st.out_total_eof && p_i2s->tx)

But non of these bits will be set.

Does anyone know if the dma queues are created from i2s_create_dma_queue be able to generate any event or any interrupt status at all?
Thank you for you helps

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 18 guests