How to send continous audio data in I2S using Flexio in NXP S32K142/144.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to send continous audio data in I2S using Flexio in NXP S32K142/144.

Jump to solution
824 Views
Prerna_Nibe
Contributor I

Hello,

For my application, I want continous audio data transmitted to my amplifier to get continous sound. I am using S32K142/144 board. I am using Flexio for I2S communication. Please suggest which method should I follow to transfer data i.e., Polling, DMA or Interrupts. 

Currently I am using DMA method, data is getting transmitted but after each iteration of data transmission again clocks are reinitialize, due to this my amplifier is taking time to generate PWM signals. Please suggest proper method so that I can transfer continous data without any reinitialization.

0 Kudos
Reply
1 Solution
794 Views
IsaulO
NXP Employee
NXP Employee

Hi @Prerna_Nibe ,


These methods are used for data transfer depending on the application, and each has its advantages and limitations.


For example:
• DMA is highly efficient for large data transfers, significantly reducing CPU workload, data transfer is constant and faster but setting up and debugging can be complex.
• Polling is simple to implement, but it is inefficient for high-speed tasks. It consumes more CPU time and power resources because the CPU must repeatedly check the status of the data transfer, even when no data is ready.
• Interrupts are great for time-sensitive tasks, they allows the CPU to perform other task between interruptions, but they add complexity and require careful handling to avoid overhead.

For continuous audio data transmission, DMA is typically the most suitable option it is scalable to high frequencies and large buffers and ensure that data transfer is constant and without interruption.


It is helpful to examine the data frame and clock signals to check for any gaps or timing inconsistencies during the process. If you can share the data frame or clock signals, I can help visualize and analyze any potential issues in the transfer process.


BR,
IsaulO. 

 

View solution in original post

0 Kudos
Reply
2 Replies
795 Views
IsaulO
NXP Employee
NXP Employee

Hi @Prerna_Nibe ,


These methods are used for data transfer depending on the application, and each has its advantages and limitations.


For example:
• DMA is highly efficient for large data transfers, significantly reducing CPU workload, data transfer is constant and faster but setting up and debugging can be complex.
• Polling is simple to implement, but it is inefficient for high-speed tasks. It consumes more CPU time and power resources because the CPU must repeatedly check the status of the data transfer, even when no data is ready.
• Interrupts are great for time-sensitive tasks, they allows the CPU to perform other task between interruptions, but they add complexity and require careful handling to avoid overhead.

For continuous audio data transmission, DMA is typically the most suitable option it is scalable to high frequencies and large buffers and ensure that data transfer is constant and without interruption.


It is helpful to examine the data frame and clock signals to check for any gaps or timing inconsistencies during the process. If you can share the data frame or clock signals, I can help visualize and analyze any potential issues in the transfer process.


BR,
IsaulO. 

 

0 Kudos
Reply
647 Views
Prerna_Nibe
Contributor I

Thank you for your response.

Please find the attached image of time difference of gap.

 

In below image A and E are clock initialization gaps and B, C, D are call back gaps.

Time gap.png

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2012048%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20send%20continous%20audio%20data%20in%20I2S%20using%20Flexio%20in%20NXP%20S32K142%2F144.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2012048%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EFor%20my%20application%2C%20I%20want%20continous%20audio%20data%20transmitted%20to%20my%20amplifier%20to%20get%20continous%20sound.%20I%20am%20using%20S32K142%2F144%20board.%20I%20am%20using%20Flexio%20for%20I2S%20communication.%20Please%20suggest%20which%20method%20should%20I%20follow%20to%20transfer%20data%20i.e.%2C%20Polling%2C%20DMA%20or%20Interrupts.%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20I%20am%20using%20DMA%20method%2C%20data%20is%20getting%20transmitted%20but%20after%20each%20iteration%20of%20data%20transmission%20again%20clocks%20are%20reinitialize%2C%20due%20to%20this%20my%20amplifier%20is%20taking%20time%20to%20generate%20PWM%20signals.%20Please%20suggest%20proper%20method%20so%20that%20I%20can%20transfer%20continous%20data%20without%20any%20reinitialization.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2054756%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20send%20continous%20audio%20data%20in%20I2S%20using%20Flexio%20in%20NXP%20S32K142%2F144.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2054756%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20your%20response.%3C%2FP%3E%3CP%3EPlease%20find%20the%20attached%20image%20of%20time%20difference%20of%20gap.%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EIn%20below%20image%20A%20and%20E%20are%20clock%20initialization%20gaps%20and%20B%2C%20C%2C%20D%20are%20call%20back%20gaps.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Time%20gap.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Time%20gap.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F326496i88F3864967C86832%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Time%20gap.png%22%20alt%3D%22Time%20gap.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2013083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20send%20continous%20audio%20data%20in%20I2S%20using%20Flexio%20in%20NXP%20S32K142%2F144.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2013083%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242194%22%20target%3D%22_blank%22%3E%40Prerna_Nibe%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EThese%20methods%20are%20used%20for%20data%20transfer%20depending%20on%20the%20application%2C%20and%20each%20has%20its%20advantages%20and%20limitations.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EFor%20example%3A%3CBR%20%2F%3E%E2%80%A2%20DMA%20is%20highly%20efficient%20for%20large%20data%20transfers%2C%20significantly%20reducing%20CPU%20workload%2C%20data%20transfer%20is%20constant%20and%20faster%20but%20setting%20up%20and%20debugging%20can%20be%20complex.%3CBR%20%2F%3E%E2%80%A2%20Polling%20is%20simple%20to%20implement%2C%20but%20it%20is%20inefficient%20for%20high-speed%20tasks.%20It%20consumes%20more%20CPU%20time%20and%20power%20resources%20because%20the%20CPU%20must%20repeatedly%20check%20the%20status%20of%20the%20data%20transfer%2C%20even%20when%20no%20data%20is%20ready.%3CBR%20%2F%3E%E2%80%A2%20Interrupts%20are%20great%20for%20time-sensitive%20tasks%2C%20they%20allows%20the%20CPU%20to%20perform%20other%20task%20between%20interruptions%2C%20but%20they%20add%20complexity%20and%20require%20careful%20handling%20to%20avoid%20overhead.%3C%2FP%3E%0A%3CP%3EFor%20continuous%20audio%20data%20transmission%2C%20DMA%20is%20typically%20the%20most%20suitable%20option%20it%20is%20scalable%20to%20high%20frequencies%20and%20large%20buffers%20and%20ensure%20that%20data%20transfer%20is%20constant%20and%20without%20interruption.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIt%20is%20helpful%20to%20examine%20the%20data%20frame%20and%20clock%20signals%20to%20check%20for%20any%20gaps%20or%20timing%20inconsistencies%20during%20the%20process.%20If%20you%20can%20share%20the%20data%20frame%20or%20clock%20signals%2C%20I%20can%20help%20visualize%20and%20analyze%20any%20potential%20issues%20in%20the%20transfer%20process.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBR%2C%3CBR%20%2F%3EIsaulO.%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E