<?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>Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118551/output-of-my-audio-dk-is-noisy-clipping-when-coming-via-i2s</link><description>I am quite new to the nRF5340 Audio DK and used &amp;#39;s project on https://github.com/ace-johnny/nrfadk-hello_codec to get me started. 
 The overall project goal is to process audio data coming via line-in on the nRF5340 to add filters, effects, etc. and output</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Mar 2025 09:36:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118551/output-of-my-audio-dk-is-noisy-clipping-when-coming-via-i2s" /><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/526508?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 09:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:623b21f2-47bd-44dd-ba08-13d11c9bec9b</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;daubsi and jamesv1994,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am able to manually copy replies which are needed from our backup. If you remember part of the conversation that you need, please let me know and I can provide it for you.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/526312?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 09:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:541594a4-a943-4802-81ee-ec4f2543933c</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;We are still investigating reported DevZone problem. I hope to get some update about the issue during next week. I will get back to you by the end of next week.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/525225?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2025 09:29:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed90d5e3-d538-40d2-84c4-3e200af03004</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi daubsi and jamesv1994,&lt;br /&gt;&lt;br /&gt;I managed to reproduce what you see. We will look into this. I expect to get back to you by the end of next week.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/524900?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 16:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3542f517-3430-4d67-a47b-acad02707d75</guid><dc:creator>jamesv1994</dc:creator><description>&lt;p&gt;I also only see five replies in this whole thread. Even though the Counter on the top says 38.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/524877?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 15:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a40d4e76-2649-4866-943d-ff763ee54e91</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="daubsi"]How does it look for you?[/quote]
&lt;p&gt;It looks as usual. I can see all replies. I will look for potential cause internally and get back to you tomorrow.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/524869?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 15:16:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63fad592-bfb5-477f-9bc8-aaa5f1e6dfcc</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Output-of-my-Audio-DK-is-noisy_5F00_clipping-when-coming-via-i2s-_2D00_-Nordic-Q_2600_A-_2D00_-Nordic-DevZone-_2D00_-Nordic-DevZone.pdf"&gt;devzone.nordicsemi.com/.../Output-of-my-Audio-DK-is-noisy_5F00_clipping-when-coming-via-i2s-_2D00_-Nordic-Q_2600_A-_2D00_-Nordic-DevZone-_2D00_-Nordic-DevZone.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hi Dejans, this is all I see from this huge thread now. It seems all discussions involving &lt;a href="https://devzone.nordicsemi.com/members/ace.johnny"&gt;ace.johnny&lt;/a&gt;&amp;nbsp; and me has vanished? There should be 37 posts in this thread and I only see 3 now. I was always able to see all the posts in this thread during the last weeks, now they are all gone? How does it look for you? Tried with Chrome and FF and with logging in and out...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/524864?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 14:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60e41352-bc39-4ba0-9ed1-12ac107df2f6</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="daubsi"]&lt;p&gt;Hello Nordic, where have all those replies in this chat gone to? It correctly reads 23 replies, but all I can see are 2?&lt;/p&gt;
&lt;p&gt;All the interaction with the other forum members like @ace.johnny seems to be invisible all of a sudden?&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;I do not think that anything changed on our side. I can see all previous replies. Which browser application do you use? Have you tried using different browser?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/524731?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 07:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edb395cd-7e6d-460d-bb82-fbbad0a93677</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Hello Nordic, where have all those replies in this chat gone to? It correctly reads 23 replies, but all I can see are 2?&lt;/p&gt;
&lt;p&gt;All the interaction with the other forum members like @ace.johnny seems to be invisible all of a sudden?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/523246?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2025 12:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c29eb0b0-c04e-4519-8530-8f8a8e43b7ae</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;There are several additional general notes from developers. Callback is called every time when I2S needs more data. This is done inside ISR hence any kind of time-consuming operation should not be done inside ISR. A PDM can be stereo, but it is mono on the DK. Regarding buffers, it is important that nothing is written to the Tx buffer while it is used.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522741?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 21:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2928c7b1-7bab-4b80-a1e8-1711c6465c94</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Today was a very successful day. With the support from&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/ace.johnny"&gt;ace.johnny&lt;/a&gt;&amp;nbsp;I finally got my example project reworked to use the NRFX i2s module, with multiple buffers AND achieved an echo filter to be applied to the received audio stream. As always, things seemed to be quite simple in retrospect once you understand more about the basic mechanics which&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/ace.johnny"&gt;ace.johnny&lt;/a&gt;&amp;nbsp;did a great job in explaining to me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However the audio is still quite choppy and I am unsure why that is. The same buffer sizes which worked reasonably fine in the base example now no longer seem to make the audio smooth.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve upload my latest version to&amp;nbsp;&lt;a id="" href="https://github.com/OevreFlataeker/nrf5340_ak_fx/commit/4e5e664099a83cad6020e3cc506aaf57fa8f61ba" rel="noopener noreferrer" target="_blank"&gt;https://github.com/OevreFlataeker/nrf5340_ak_fx/commit/4e5e664099a83cad6020e3cc506aaf57fa8f61ba&lt;/a&gt;&amp;nbsp;if someone wants to have a look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/dejans"&gt;dejans&lt;/a&gt;&amp;nbsp;, if it&amp;#39;s possible, I&amp;#39;d appreciate you taking a look, i.e. running the code on your DK and maybe you can advise where the choppy audio might be coming from. Could it be a mismatch in the sample rate maybe? Or am I doing the i2s &amp;quot;wrong&amp;quot;?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522505?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 15:59:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2667d505-fafe-4511-8936-ad56c47f870e</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Hi Dejans, thanks for the feedback. While I&amp;#39;m happy to hear those suggestions I am not sure how to best apply them:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;ad 1) And this callback is called how please? And how do i make use of it?&lt;/p&gt;
&lt;p&gt;ad 2) Yes, but mono from the PDM, right?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ad 3) Which means what exactly? Which kind of higher-level APIs? Any examples?&lt;/p&gt;
&lt;p&gt;ad 4) OK&lt;/p&gt;
&lt;p&gt;ad 5) I don&amp;#39;t get this point. Actually this is probably my main problem right now: I don&amp;#39;t understand how the whole system is working internally. I understood that once my process_audio() function is called, I have a filled(?) RX buffer from the coded where I can work on and populate the TX buffer as I like (in my simple example just copy 1:1 from RX buffer). But this fails when I want to do something more elaborate, like an echo/delay/... WHY? Because TX is already sendin while I am still manipulating the buffer? &lt;br /&gt;&lt;br /&gt;Where can I read how the whole concept works internally? I&amp;#39;ve spent the last hour looking through docs.nordicsemi.com reading about the NRFX driver but this is merely some API documentation but without some kind of glue how it all works together?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If your inquiry to the devs was about my initial question regarding the clipping/noise - what is the underlying reason then? That the way I handle the data is inefficient? Or where is this crackling coming from?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522477?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 14:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49cdf0af-739e-4aeb-bb7d-2c0d4a8d076c</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I have discussed your approach with developers. There are several things you should consider:&lt;br /&gt;1. no polling is needed when you work with I2S because there is a callback which is automatically triggered when there is more I2S data for sending&lt;br /&gt;2. there is stereo input from the line-in jack&lt;br /&gt;3. the use of higher-level API is recommended&lt;br /&gt;4. consider using LOG_ instead of printk&lt;br /&gt;5. when you work with tx and rx buffers, there needs to be intermediate buffer as I2S works on tx and rx buffers at the same time&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522467?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 14:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7311f84d-e827-4fb4-bbcd-12cc6444e98d</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;While looking for a potential solution I stumbled over&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/107248/i2s-configuring-clock-details-with-zephyr"&gt;I2S: configuring clock details with Zephyr&lt;/a&gt;&amp;nbsp;and am confused. Does this mean I cannot use a Zephyr only approach to talk to the codec on the Audio DK but need to use the nrfx_i2s driver variant?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522462?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 14:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91c19bb9-938d-48d0-9c3c-5a9ee0340203</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Having another weird issue, that I cannot really explain.&lt;br /&gt;&lt;br /&gt;Basically, the Zephyr example&amp;nbsp;&lt;a id="" href="https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/i2s/echo"&gt;https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/i2s/echo&lt;/a&gt;&amp;nbsp;should be more or less what I want to achieve. Unfortunately it&amp;#39;s build for the&amp;nbsp;&lt;span&gt;WM8731.&lt;br /&gt;&lt;br /&gt;But basically the code is pretty much independant from the actual codec. So I thought about merging the relevant parts of that example into my existing bare bone example.&lt;br /&gt;&lt;br /&gt;This required me to change things like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;/span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if DT_NODE_EXISTS(DT_NODELABEL(i2s_rxtx))&lt;/pre&gt;&lt;br /&gt;to&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;/span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if DT_NODE_EXISTS(DT_NODELABEL(i2s0))&lt;/pre&gt;&lt;br /&gt;as the i2s_rxtx was not present for the nrf5340_adk - or at least that&amp;#39;s what I figured out.&lt;br /&gt;&lt;br /&gt;The strange thing is now that as soon as I remove the initialization of the i2s component via &lt;a href="https://devzone.nordicsemi.com/members/ace.johnny"&gt;ace.johnny&lt;/a&gt;&amp;nbsp;&amp;#39;s func&amp;nbsp;&lt;/span&gt;nrfadk_i2s_reg_init() with the one from the example the subsequenct call to&amp;nbsp;nrfadk_hwcodec_init() will fail and thus the whole code.&amp;nbsp;Making my own init_i2s() function from what&amp;#39;s in the main of&amp;nbsp;&lt;a id="" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/i2s/echo/src/main.c"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/i2s/echo/src/main.c&lt;/a&gt;&amp;nbsp;will let the call to nrfadk_hwcodec_init() fail. More precisely: As long as in nrfadk_i2s_reg_init() does not call&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;NRF_I2S0-&amp;gt;TASKS_START = I2S_TASKS_START_TASKS_START_Trigger;&lt;/pre&gt;
&lt;div&gt;it will fail (I commented that particular line to verify the effect).&lt;/div&gt;
&lt;div&gt;I&amp;#39;m not yet talking about making use of the new i2s initialization like it&amp;#39;s done in the Zephyr example. It&amp;#39;s just that if I don&amp;#39;t to the i2s initialization like @ace.johnny did, the HW Codec init fails.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I am not sure but is &lt;a href="https://devzone.nordicsemi.com/members/ace.johnny"&gt;ace.johnny&lt;/a&gt;&amp;nbsp;&amp;#39;s variant maybe not using Zephyr functions at all by using those &amp;quot;NRF_I2S0-&amp;gt;XYZ &amp;quot; style of configuring?&amp;nbsp;&lt;br /&gt;I can only assume that maybe this initialization does something to the clocking configuration (I can configure the CLK in the NRF_I2S0 approach but not via the example from the Zephyr project), which then is a problem for the subsequent call to nrfadk_hwcodec_init()?&lt;br /&gt;&lt;br /&gt;Any idea?&lt;br /&gt;&lt;br /&gt;I&amp;#39;ll attach the current version of the code below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/53804.main.c"&gt;devzone.nordicsemi.com/.../53804.main.c&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522300?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 19:38:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21eeff05-9c7c-4c53-90d4-77b7cf78b0d1</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Hi dejans,&lt;/p&gt;
&lt;p&gt;thanks for asking.&lt;/p&gt;
&lt;p&gt;My &amp;quot;solution&amp;quot; was buried somewhere in this thread between multiple posts. I noticed that once I increase the buffer size from 256 bytes like in ace.johnny&amp;#39;s barebone example to e.g. 8192 the clipping/noise basically is non-existent anymore. As for the reason, I can only suspect it has to do, that the read/write cycle via i2s happens much less frequently than before. I still haven&amp;acute;t looked fully into optimizing this part, as I am still struggeling with some simple audio processing like the echo/delay mentioned above. Also I haven&amp;acute;t yet found a suitable example in the nRF Connect SDK to show how the whole receive/send chain is realized via interrupt driven/DMA. If you could point me to the right direction, this would be much appreciated. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/522288?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 17:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cd5d3d3-dc24-48b2-ba16-08cdb6653d9d</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/daubsi"&gt;daubsi&lt;/a&gt;&amp;nbsp;,&lt;br /&gt;&lt;br /&gt;Can you provide status update on the noise/clipping issue?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521691?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2025 11:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0630bf41-c5d9-4048-bca6-a2be4de9fa12</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;You&amp;#39;re right, sorry.&amp;nbsp;&lt;br /&gt;I&amp;#39;ve pushed my current working state to&amp;nbsp;&lt;a id="" href="https://github.com/OevreFlataeker/nrf5340_ak_fx"&gt;https://github.com/OevreFlataeker/nrf5340_ak_fx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s actually still pretty much your code 1:1, I just added the PMIC enable and removed noise and test tone stuff and all my 100s comments and defines, etc. ;-)&lt;/p&gt;
&lt;p&gt;If you, in process_audio() just revert to the plain:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;for (size_t i = 0; i &amp;lt; size; i++) {
		tx[i] = rx[i];  // Simple passthrough (modify as needed)
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in there you should hear the input taken from the PDM 1:1 in the headphone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;quot;ve cleaned up quite a bit now without begin able to live test ist. If it fails kindly try also a commit from last evening, e.g&amp;nbsp;c10b0aba3c9289a2692bcc42ef18992a89caaeeb&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521634?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 21:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ff19d48-71be-4163-bdaa-bbcac92cea02</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;I&amp;#39;ve now added successfully the PDM to the input chain by adding the relevant config bits and pieces. No idea why it didn&amp;acute;t work before but now it seemed like the simplest thing to do.&lt;/p&gt;
&lt;p&gt;Next I tried to add a simple echo effect, i.e adding a delayed by D samples and weakened RX sample to our current RX sample and copying it to our TX buffer.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What should work in theory just doesn&amp;acute;t work out in code. I don&amp;acute;t hear any echo at all, no matter how I play with the DELAY constant. size is at 8192 which is what I defined as a suitable buffer size by experimenting. The audio is clear like in the original tx[i] = rx[i] version, I just don&amp;acute;t hear any echo.&lt;/p&gt;
&lt;p&gt;My calculation was that at 48k samples * 2 channels per 1000ms with a delay of&amp;nbsp;2000&amp;nbsp;samples I would get an echo of approx 20ms?&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any idea what might be wrong?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define DELAY 2048

void process_audio(int16_t *rx, int16_t *tx, size_t size)
{
	static int16_t delay_buffer[DELAY];
	static int delay_index = 0;

	for (int i=0; i&amp;lt;size; ++i) {
		int16_t delayed_sample = delay_buffer[delay_index];
		tx[i] = rx[i] + delayed_sample * 0.5;
		delay_buffer[delay_index] = rx[i];
		delay_index = (delay_index + 1) % DELAY;
	}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521477?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 09:04:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6f49647-793c-44fc-bfe1-5e5cbeb00362</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;So basically if I have my PDM I just need to set this input as EQ1_SRC1 and enable the EQ in order to integrate it&amp;#39;s filtering in the chain? (Fig 4.16 in the datasheet). Ofc one would have to visually define the filter curve using WISCE and then configure the retrieved constants beforehand to configure the EQ accordingly.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521470?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 09:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e18e61e2-4fae-4c27-8436-d3ff6e844637</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Thank you this makes it clear now. I have to admit I didn&amp;#39;t even look at the datasheet of the VM3011 yet at all. Your explanation was very helpful!&lt;br /&gt;Regarding the misconfiguration, I understand in order to reconfigure the VM3011, if one wants to do so, the C47L63 also would need to be configured via i2c and not SPI? (which is not possible right now, due to the fact that Nordic configures it as SPI in the first connection)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521416?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2025 21:24:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cc8fcfc-7e94-4145-bfce-d849b77f24dc</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Could you kindly reiterate the following statement:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;code&gt;IN1(LR)&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is dedicated exclusively to the onboard digital&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;PDM1&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;mic, however its second channel&lt;code&gt;(R)&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;remains unused, so is essentially a mono signal. This is important to remember when routing signals inside the codec.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;code&gt;IN2(LR)&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is shared between analog stereo&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;LINE-IN&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and an auxiliary digital stereo&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;PDM2&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;mic input on connector P15, and only one of these can be selected at a time.&lt;/p&gt;
&lt;p&gt;Where do you see this?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1738704344006v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;In the datasheet on p25 it appears to&amp;nbsp;me the digital mic&amp;#39;s data at&amp;nbsp;IN1_PDMCLK and&amp;nbsp;IN1_PDMDATA gets to IN1L and IN1R likewise? Or is it something you see on&amp;nbsp;&lt;a id="" href="https://docs-be.nordicsemi.com/bundle/ug_nrf5340_audio/page/UG/nrf5340_audio/images/audio_codec.svg"&gt;https://docs-be.nordicsemi.com/bundle/ug_nrf5340_audio/page/UG/nrf5340_audio/images/audio_codec.svg&lt;/a&gt;&amp;nbsp;? If so, where please? I fully agree to the 2nd statement about IN2 (LR) from what I see on page 25, but I don&amp;acute;t see what you&amp;nbsp; mentioned in the first statement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Also, did you try turning on ANC (p36, 4.2.9) or the equalizer (p41, 4.3.4). It is not clear to me how to connect the EQ into the signalchain. I understand it has to happen somewhere in the digital core and associated with one of the channels of e.g. the ASPx or the line-in interface, but it don&amp;acute;t understand right away how. Any opinion on this?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521273?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2025 10:40:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:218dc888-ff89-4a88-b5f8-df7495742a48</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Oh wow... you seem to be right:&amp;nbsp;&lt;a id="" href="https://stackoverflow.com/questions/47695912/cant-connect-to-airpods-via-ble"&gt;https://stackoverflow.com/questions/47695912/cant-connect-to-airpods-via-ble&lt;/a&gt;&lt;br /&gt;I was super sure it would be BLE :-O Meh...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521229?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2025 08:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5472cab9-53d5-4451-a851-3eb9ea441114</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Thanks, I actually had a look at that file/schematic when I was trying to understand your point in another discussion with the ASP2 setup (&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/111066/error-in-nrf5340-audio-dk-sample-application"&gt;Error in nRF5340 Audio DK sample application&lt;/a&gt;&amp;nbsp;), and to verify/understand where the but I didn&amp;#39;t bother to look again for the PDM. Thanks for your insights about how it is all wired internally.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;The&amp;nbsp;&lt;/span&gt;&lt;code&gt;MICBIAS&lt;/code&gt;&lt;span&gt;&amp;nbsp;generator has 3 outputs ABC, and only 2 are used: B drives the onboard mic, and C drives the aux PDM input. A is not used, but could conceivably drive an analog mic if one were wired to the &lt;/span&gt;&lt;span&gt;available analog&amp;nbsp;&lt;/span&gt;&lt;code&gt;IN1(LR)&lt;/code&gt;&lt;span&gt;&amp;nbsp;test points.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So that means in the excerpt from the original Nordic code I annotated above, if I ONLY want the onboard digital microphone I would only need MICBIAS3 and I actually would only need IN1L as the IN1R is not used anyway? Same for IN2* as it&amp;#39;s not related to the PDM?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;{ CS47L63_LDO2_CTRL1, 0x0005 }, // p165, 0b00000101 -&amp;gt; Bit 0, LDO2_EN=1, Bit 2, LDO2_DISCH=1, Voltage = 0x0 (default) 2.4V
{ CS47L63_MICBIAS_CTRL1, 0x00EC }, // p166, 0b11101100 -&amp;gt; Bit 2, MICB1_DISCH=1, discharge when disable, (default = 1)
// Bit 3, MICB1_RATE=1, 1 = Pop-free start-up/shutdown (default = 0)
// Bit 5-7 = 0x7 = 2.2V (default)
{ CS47L63_MICBIAS_CTRL5, 0x0272 }, // p166, 0b0010 0111 0010 -&amp;gt; Bit 1 MICB1A_DISCH=1, discharge when disable (default)
// -&amp;gt; Bit 4 MICB1B_EN=1
// -&amp;gt; Bit 5 MICB1B_DISCH=1, discharge when disable (default)
// -&amp;gt; Bit 6 MICB1B_SRC=1 = VDD_A (default 0, MICBIAS regulator)
// -&amp;gt; Bit 9 MICB1C_DISCH=1, discharge when disable (default)

/* Enable IN1L */
{ CS47L63_INPUT_CONTROL, 0x000F }, // p29, 0b00001111 -&amp;gt; Bit 0, IN1R_EN,
// Bit 1, IN1L_EN,
// Bit 2, IN2R_EN,
// Bit 3, IN2L_EN&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Actually I was only able to make sense out of the various control registers by looking a the long explicit listing of all the registers at the end of the datasheet where each and every bit is shown at the same place and not scattered through various pages.&lt;/p&gt;
&lt;p&gt;What I don&amp;#39;t get for example is:&lt;/p&gt;
&lt;p&gt;CS47L63_INPUT1_CONTROL1 also configures the oversampling rate. Is this something which only is applicable to a microphone? Don&amp;#39;t we have/need this for line-in?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I fully agree it would be very nice to have like 3,4,5 minimalistic samples from Nordic how to use the codec on THEIR board with THEIR defined setup (what is wired where), like &amp;quot;route line-in via i2s to MCU&amp;quot;, &amp;quot;send i2s to codec for output&amp;quot;, etc. etc. That would really speed up the learning with this board.&lt;/p&gt;
&lt;p&gt;Another question you might have an answer for:&lt;/p&gt;
&lt;p&gt;Currently I use the codec to output to headphones, but is it also possible to connect to Apple AirPods via BLE from the MCU? My stretch goal is to write a simple Guitar FX processor by doing the FXs (chorus, echo, reverb, ...) on the ARM core and then connect to my AirPods for audio output. I know the compatibility of the BLE audio was something which was intensively discussed during the Nordic Techtour 2 years ago with Apple being proprietary but I can easily connect the pods to my Linux and Windows PC like-wise without problems so it probably is not very special? Or is it then standard Bluetooth and not BLE? Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521189?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2025 20:34:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39da995d-54b6-49ef-82f1-223c340dd6ce</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;Thanks for those additional details. I&amp;#39;ll have a look at those next. Today I added the annotations for the constants for setting up the PDM (the digital microphone) but I have to say that those are the most esoteric so far, because the whole concept of the LDO and MICBIAS is a foreign to me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef ENABLE_MIC
	// Enable digital MIC
	/* Set MICBIASes */
	{ CS47L63_LDO2_CTRL1, 0x0005 },     // p165, 0b00000101 -&amp;gt; Bit 0, LDO2_EN=1, Bit 2, LDO2_DISCH=1, Voltage = 0x0 (default) 2.4V
	{ CS47L63_MICBIAS_CTRL1, 0x00EC },  // p166, 0b11101100 -&amp;gt; Bit 2, MICB1_DISCH=1, discharge when disable, (default = 1)
	                                    //                     Bit 3, MICB1_RATE=1, 1 = Pop-free start-up/shutdown (default = 0)
										//                     Bit 5-7 = 0x7 = 2.2V (default)
	{ CS47L63_MICBIAS_CTRL5, 0x0272 },  // p166, 0b0010 0111 0010 -&amp;gt; Bit 1 MICB1A_DISCH=1, discharge when disable (default)
	                                    //                        -&amp;gt; Bit 4 MICB1B_EN=1
										//                        -&amp;gt; Bit 5 MICB1B_DISCH=1, discharge when disable (default)
										//                        -&amp;gt; Bit 6 MICB1B_SRC=1 = VDD_A (default 0, MICBIAS regulator)
										//                        -&amp;gt; Bit 9 MICB1C_DISCH=1, discharge when disable (default)  

	/* Enable IN1L */
	{ CS47L63_INPUT_CONTROL, 0x000F },  // p29, 0b00001111 -&amp;gt; Bit 0, IN1R_EN, 
										//                    Bit 1, IN1L_EN, 
										//                    Bit 2, IN2R_EN, 
										//                    Bit 3, IN2L_EN

	/* Enable PDM mic as digital input */
	{ CS47L63_INPUT1_CONTROL1, 0x50021 }, // p31, 0b0101 00000000 0010 0001 -&amp;gt; Bit 0, Input Path 1 Mode=Digital input
	                                      //                                -&amp;gt; Bit 5, fixed at according to p181? (see also p30 &amp;quot;Note&amp;quot;)
										  //                                -&amp;gt; Bit 16-18 Input Path 1 Oversample control, p27
										  //                                   = 0b101 = 3.072 MHz, controls IN1_PDMCLK freq

	/* Un-mute and set gain to 0dB */
	{ CS47L63_IN1L_CONTROL2, 0x800080 },  // p31 &amp;amp; p34, p181 0b1000 0000 0000 0000 1000 0000
	  									  // Bit 1-7 = 0x40 = 0dB Input Path 1L PGA Volume (analog only)
	                                      // Bit 16-23 = 0x80 = default 0dB Input Path 1L Digial volume
										  // Bit 28 = 0 (default 1), unmute

	{ CS47L63_IN1R_CONTROL2, 0x800080 },  // p31 &amp;amp; p34, p181 0b1000 0000 0000 0000 1000 0000
										  // Bit 1-7 = 0x40 = 0dB Input Path 1R PGA Volume (analog only)
	                                      // Bit 16-23 = 0x80 = default 0dB Input Path 1R Digial volume
										  // Bit 28 = 0 (default 1), unmute

	/* Volume Update */
	{ CS47L63_INPUT_CONTROL3, 0x20000000 }, // p181, set IN_VU to 1

	/* Send PDM MIC to I2S Tx */
	//{ CS47L63_ASP1TX1_INPUT1, 0x800010 },
	//{ CS47L63_ASP1TX2_INPUT1, 0x800011 },
#endif

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For example I dont understand why there are MICB1A,1B,1C involved. Does a single microphone need 3 biases (== power supply?). Or is this overly generic?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With C&lt;span&gt;S47L63_INPUT_CONTROL&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x000F, we also enable IN1L, IN1R, IN2L, IN2R although we only configure IN1L and IN1R if I am not mistaken. (&lt;/span&gt;&lt;span&gt;&lt;span&gt;CS47L63_IN1L_CONTROL2,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;CS47L63_IN1R_CONTROL2)&lt;/p&gt;
&lt;p&gt;I couldn&amp;acute;t test the code yet. My goal right now would be to get the PDM also up and running just for completeness sake and then turn to the interrupt driven handling of the I2S. I just have to assume that the&amp;nbsp;&lt;span&gt;&lt;span&gt;CS47L63_LDO2_CTRL1,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;CS47L63_MICBIAS_CTRL1,&amp;nbsp;&lt;/span&gt;CS47L63_MICBIAS_CTRL5 settings are generic and do not require a special clock setup which isn&amp;acute;t present in your base bone example.&lt;/p&gt;
&lt;p&gt;Progress will be slower through the week and I will probably not be able to work on a daily basis on this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Output of my Audio DK is noisy/clipping when coming via i2s</title><link>https://devzone.nordicsemi.com/thread/521003?ContentTypeID=1</link><pubDate>Sun, 02 Feb 2025 17:09:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30f9d278-0eb7-4cbf-8f4d-79e2ebff702f</guid><dc:creator>daubsi</dc:creator><description>&lt;p&gt;It seems that just increasing the value of&amp;nbsp;I2S_BUFF_SIZE from 256 to e.g. 4096 makes the result already much less noisy! Not sure why that is... Maybe the constant switching between RX/TX of such a small buffer and the minimal delays for this actually cause the noise...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>