LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Reading I2S0 DMA data directly bypassing ALSA (https://www.linuxquestions.org/questions/linux-kernel-70/reading-i2s0-dma-data-directly-bypassing-alsa-4175734298/)

dhanraj_kmr 02-27-2024 12:02 AM

Reading I2S0 DMA data directly bypassing ALSA
 
I am exploring options to bypass the ALSA and directly read the I2S0 data in kernel space. I2S0 is connected to an external ADC. I want to read the I2S bus every 64 bytes and I don't want to miss any samples between reads. Something similar to I2C read, SPI read.

I see ALSA using this function to trigger DMA and callback. I'm not sure how to duplicate the necessary details for this function call if I want to hack these ALSA calls.

Code:

sound/core/pcm_dmaengine.c

desc = dmaengine_prep_dma_cyclic(chan,
                substream->runtime->dma_addr,
                snd_pcm_lib_buffer_bytes(substream),
                snd_pcm_lib_period_bytes(substream), direction, flags);

desc->callback = dmaengine_pcm_dma_complete;
        desc->callback_param = substream;



All times are GMT -5. The time now is 06:03 AM.