<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to implement audio loopback (mic → headphone) on nRF5340 Audio DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124933/how-to-implement-audio-loopback-mic-headphone-on-nrf5340-audio-dk</link><description>Hello Nordic Team, 
 I am using the nRF5340 Audio DK and I want to implement a simple audio loopback — where the board captures voice from the on-board PDM microphone and simultaneously plays it back through the headphone output (I&amp;#178;S / PCM) in real time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Oct 2025 14:37:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124933/how-to-implement-audio-loopback-mic-headphone-on-nrf5340-audio-dk" /><item><title>RE: How to implement audio loopback (mic → headphone) on nRF5340 Audio DK</title><link>https://devzone.nordicsemi.com/thread/551463?ContentTypeID=1</link><pubDate>Tue, 14 Oct 2025 14:37:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b73545c5-cd32-453a-b092-c3d2009994bf</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hi Nishant,&lt;/p&gt;
[quote user=""]Which &lt;strong&gt;nRF Connect SDK (NCS) example&lt;/strong&gt; I can base this on (e.g., &lt;code&gt;nrf5340_audio&lt;/code&gt;, &lt;code&gt;nrf5340_audio_dk_app&lt;/code&gt;, or a simpler PDM/I2S sample)?[/quote]
&lt;p&gt;This depends on how much you want to implement yourself and how much you want to use existing implementations for. PDM input and I2S output are already implemented in the nRF5340 Audio application. I don&amp;#39;t know what you mean with&amp;nbsp;nrf5340_audio_dk_app here, please clarify which sample/application you mean. If you want to implement your loopback appliation from scratch, using an I2S sample as a basis and expanding it to use PDM as input is an option. Still much from the nRF5340 Audio application should be of help when implementing your application (i.e.&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/modules/hw_codec.c"&gt;hw_codec.c&lt;/a&gt;,&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/drivers/cs47l63_reg_conf.h"&gt;cs47l63_reg_conf.h&lt;/a&gt;,&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/modules/audio_i2s.c"&gt;audio_i2s.c&lt;/a&gt;, and&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/audio/audio_datapath.c"&gt;audio_datapath.c&lt;/a&gt;).&lt;/p&gt;
[quote user=""]How to &lt;strong&gt;enable both PDM input and I2S output&lt;/strong&gt; simultaneously on the nRF5340 Audio DK.[/quote]
&lt;p&gt;This is implemented for the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/applications/nrf5340_audio/doc/configuration.html#enabling_the_walkie-talkie_demo"&gt;walkie-talkie demo&lt;/a&gt; configuration of the nRF5340 Audio application.&amp;nbsp;&lt;/p&gt;
[quote user=""]Any configuration needed in &lt;code&gt;overlay.conf&lt;/code&gt;, &lt;code&gt;dts&lt;/code&gt;, or &lt;code&gt;audio_system.c&lt;/code&gt; for loopback operation.[/quote]
&lt;p&gt;Since the nRF5340 Audio application already supports I2S output and PDM input, I am fairly certain that you don&amp;#39;t need to change .dts, but you will need to change the data flow in the application source code.&lt;/p&gt;
[quote user=""]Whether this can be done in &lt;strong&gt;Zephyr directly&lt;/strong&gt; (e.g., using the &lt;code&gt;drivers/audio&lt;/code&gt; or &lt;code&gt;i2s&lt;/code&gt; APIs).[/quote]
&lt;p&gt;The PDM microphone is configured through the CS47L63, so you would need to use the &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.8.0/applications/nrf5340_audio/src/drivers"&gt;CS47L63 driver&lt;/a&gt; from the application nRF5340 Audio application. Other than that you can use Zephyr drivers and APIs to implement your application according to your needs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>