<?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>PDM data to speaker</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127561/pdm-data-to-speaker</link><description>Hi,I am working with pdm mic to read data .I can able to get the audio data using dmic_read api in pcm format.I got clock of 1280000 and sampling rate of 16000 of each 16 bit sample.Now I want to play that data in tas2562 speaker amplifier.I configured</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Mar 2026 09:32:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127561/pdm-data-to-speaker" /><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564163?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 09:32:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d1e69dd-fd91-4a70-ac12-04a3c03e0c2c</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;That questions itself is as clear as mud. Don&amp;#39;t expect an answer unless you completely re-write that so other people have a chance to understand it.&lt;/p&gt;
&lt;p&gt;As a general hint: Mess with&amp;nbsp;&lt;em&gt;both&lt;/em&gt; PDM and I&amp;sup2;S settings until sampling frequencies match&amp;nbsp;&lt;em&gt;exactly&lt;/em&gt; and use these settings going forward.&lt;/p&gt;
&lt;p&gt;Re-sampling (the other way to handle the difference) is non-trivial in both code and CPU cycle usage especially if both frequencies are close to each other.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564151?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 08:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2b065dc-ba6a-4a42-8230-e085d114b43c</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;Hi Edvin,thanks for that response.I understood how its working.&lt;/p&gt;
[quote userid="134881" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564140"]And in final I want to know reading data from PDM Mic and getting PCM data will cause more processing in time in compare with using I2S MIC&amp;nbsp; with i2s_read?.I want to confirm what mic should I use as I will be doing more processing before sending to speaker.Will both the processes will require same processing or different[/quote]
&lt;p&gt;Can you clarify me this thing ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564143?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 08:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89e32943-5076-44c3-ba6f-c2e9210ff81f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The reason for all this is that the pdm is sampling a bit faster than the I2S is outputting. This means (as an example, not actual numbers) that if the mic records for 1 second, that results in the speaker playing 1.1 seconds (a bit of slow motion). The difference is listed in the table that you pasted earlier:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1774597648623v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The reason the nRF54L15 is not capable to do Audio over Bluetooth LE (like the nRF5340 is) is because it lacks a HW component, the Audio PLL, which is responsible for adjusting the clock speed to avoid these mismatches.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There may be better ways to do this than what I suggested. It was just an attempt to make the error that you saw go away. Perhaps you can make it work with just 2 buffers, if you handle the logic yourself. Just make sure that wherever you are trying to store your dmic buffers to are free/available.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564141?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 07:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90662eee-9d9a-46ed-8d51-309c1383cecd</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;And also to mention I can see noticeable delay in the output while listening audio in speaker.Why we are getting delay ? we are doing using threads and process is straight we read and just send in speaker.I kept &lt;span&gt;AUDIO_Q_LEN + 12 memory.&amp;nbsp;&lt;/span&gt;And if I do processing in between will delay will be increased?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564140?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 05:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ae6afb3-89cc-4505-85f5-cc2ddd428d7c</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;Yes,when I follow this buffers I am just loosing one block of audio per second but audio flow is working fine.But when I used I2S_RX and TX there it worked even for 4 blocks in mem_slab without issue .Is it because here&amp;nbsp; PDM to I2s it&amp;#39;s taking many blocks in recent approach(threads).&lt;br /&gt;And in final I want to know reading data from PDM Mic and getting PCM data will cause more processing in time in compare with using I2S MIC&amp;nbsp; with i2s_read?.I want to confirm what mic should I use as I will be doing more processing before sending to speaker.Will both the processes will require same processing or different?&lt;br /&gt;&lt;br /&gt;With Regards,&lt;/p&gt;
&lt;p&gt;Kashyap&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564088?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 09:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3adc298b-2745-4b5b-8fd6-49c760316c6a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I think the BLOCK_COUNT needs to be at least AUDIO_Q_LEN + 10. The AUDIO_Q_LEN uses blocks from the mem_slab (size = BLOCK_COUNT), and then you need some more for the dmic. I think the limit is AUDIO_Q_LEN + 2 for DMIC DMA + 4 for I2S tx queue and 2 for I2S HW. In addition, you need 2 for handover. Perhaps use AUDIO_Q_LEN + 12 to be sure.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564079?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 08:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8632e91e-ec77-492b-aaa7-dc08ddf8846b</guid><dc:creator>Kashyap23</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564075"]What exactly did you try in this case? What changes did you do?[/quote]
&lt;p&gt;I tried to reduced block count to 16 and also&amp;nbsp;&lt;span&gt;AUDIO_Q_LEN to 16 and 8 but after few seconds I got same issue even if Iused thread method also&lt;br /&gt;00&amp;gt; *** Using Zephyr OS v4.1.99-ff8f0c579eeb ***&lt;br /&gt;00&amp;gt; [00:00:00.002,148] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample&lt;br /&gt;00&amp;gt; [00:00:00.002,162] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000&lt;br /&gt;00&amp;gt; [00:00:00.002,187] &amp;lt;inf&amp;gt; i2s_nrfx: I2S MCK frequency: 507936, actual PCM rate: 15873&lt;br /&gt;00&amp;gt; Configure Stream Successful.&lt;br /&gt;00&amp;gt; Trigger Command Successful.&lt;br /&gt;00&amp;gt; [00:00:14.990,039] &amp;lt;err&amp;gt; dmic_nrfx_pdm: Failed to allocate buffer: -12&lt;br /&gt;00&amp;gt; [00:00:15.129,861] &amp;lt;err&amp;gt; i2s_nrfx: Next buffers not supplied on time&lt;br /&gt;00&amp;gt; [00:00:15.990,132] &amp;lt;wrn&amp;gt; dmic_sample: dmic_read backpressure/retry: 1&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564075"]Keep track of how many of the buffers that are filled. If no buffers are ready, wait for the DMIC to finish another sampling before you try to queue up the buffer in the speaker.&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;Here can we send buffer of data to speaker or we&amp;#39;re waiting all the data i getting qued then we sending to speaker?And I want to do some processing before data is sending to speaker.I want to do filtering and also ANC in that case i need to use 2 channel data.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564075?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 07:48:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15e2d485-607f-4299-9ed4-d3dae883b122</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Kashyap,&lt;/p&gt;
&lt;p&gt;It is correct that you probably don&amp;#39;t need that many buffers. I just experimented with your sample to see why it was failing (and forgot to turn the buffer count back down after it didn&amp;#39;t seem to affect much to increase it).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Having too many buffers will increase the time it takes before the first buffer is dropped, but it also introduces a delay (don&amp;#39;t know whether that is an issue in your case).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So you should be able to turn these down a bit.&lt;/p&gt;
[quote user="Kashyap23"]When I tried I got following[/quote]
&lt;p&gt;What exactly did you try in this case? What changes did you do?&lt;/p&gt;
[quote user="Kashyap23"]As I checked Nrf54 datasheet it says the following sampling rates will occur in I2S configuration with some error.I am not sure how I can tune samples .And also make me sure is this correct process for reading pdm data and send to speaker?&lt;br /&gt;[/quote]
&lt;p&gt;I assume this comes from this table:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf9151/page/i2s.html#ariaid-title6"&gt;https://docs.nordicsemi.com/bundle/ps_nrf9151/page/i2s.html#ariaid-title6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see, it is not possible to make it exactly 16 000 Hz. You will have some error. So you need to pick a sample rate for the I2S that is either a bit too fast or a bit too slow. Perhaps, in your case, you can pick one that is a bit too fast. This means that you will still get some cracks in the sound, but it will not loose any data. You can experiment and see what works best in your case. I still recommend that you do this in two separate threads. Keep track of how many of the buffers that are filled. If no buffers are ready, wait for the DMIC to finish another sampling before you try to queue up the buffer in the speaker.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564072?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 07:28:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3565761-8e9b-4eee-a663-be5754365df4</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564036"]Assuming this is what you see as well:[/quote]
&lt;p&gt;Yes,I am seeing same what you have mentioned&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564036"]One way to work around this is to split this up into two threads. One constantly reading the mic, storing the data in buffers, and another one emptying it, outputting to the speaker.&amp;nbsp;[/quote]
&lt;p&gt;I checked with the code you shared where it skips the block of data ,it worked.But I didn&amp;#39;t understand why we have used mem_slab of 64 blocks and&amp;nbsp;&amp;nbsp;&lt;span&gt;#&lt;/span&gt;&lt;span&gt;AUDIO_Q_LEN&lt;/span&gt;&lt;span&gt;&amp;nbsp; of&amp;nbsp;&lt;/span&gt;&lt;span&gt;32,as we&amp;#39;re doing in real time it will automatically clear buffer when we sent to speaker then why can&amp;#39;t we use limited buffers of 16 and make it work.Why data is getting hold in that many buffers.When I tried I got following&lt;br /&gt;&lt;br /&gt;00&amp;gt; [00:00:00.002,148] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample&lt;br /&gt;00&amp;gt; [00:00:00.002,162] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000&lt;br /&gt;00&amp;gt; [00:00:00.002,187] &amp;lt;inf&amp;gt; i2s_nrfx: I2S MCK frequency: 507936, actual PCM rate: 15873&lt;br /&gt;00&amp;gt; Configure Stream Successful.&lt;br /&gt;00&amp;gt; Trigger Command Successful.&lt;br /&gt;00&amp;gt; [00:00:14.976,144] &amp;lt;err&amp;gt; dmic_nrfx_pdm: Failed to allocate buffer: -12&lt;br /&gt;00&amp;gt; [00:00:15.115,783] &amp;lt;err&amp;gt; i2s_nrfx: Next buffers not supplied on time&lt;br /&gt;00&amp;gt; [00:00:15.976,247] &amp;lt;wrn&amp;gt; dmic_sample: dmic_read backpressure/retry: 1&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/127561/pdm-data-to-speaker/564036"]Since there is a difference in sample rate, there will still be some data that can&amp;#39;t be output to the speaker, but you will be able to detect it, and skip one block.[/quote]
&lt;p&gt;&lt;span&gt;As I checked Nrf54 datasheet it says the following sampling rates will occur in I2S configuration with some error.I am not sure how I can tune samples .And also make me sure is this correct process for reading pdm data and send to speaker?&lt;br /&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/Screenshot-from-2026_2D00_03_2D00_26-12_2D00_55_2D00_34.png" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kashyap&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/564036?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2026 12:57:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d78facb3-39bc-4daa-a262-1d699e392f87</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You cut away parts of the log here, right?&lt;/p&gt;
&lt;p&gt;When I run your application, there are a lot of logs saying &amp;quot;got buffer of 320 bytes&amp;quot; for about 10 seconds before I see the error messages. Do you see the same?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, it ends with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
00&amp;gt; [00:00:00.001,184] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample
00&amp;gt; [00:00:00.001,197] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000
00&amp;gt; [00:00:00.001,222] &amp;lt;inf&amp;gt; i2s_nrfx: I2S MCK frequency: 507936, actual PCM rate: 15873
00&amp;gt; Configure Stream Successful.
00&amp;gt; Trigger Command Successful.
00&amp;gt; [00:00:10.911,696] &amp;lt;err&amp;gt; dmic_nrfx_pdm: No room in RX queue
00&amp;gt; [00:00:11.012,482] &amp;lt;err&amp;gt; i2s_nrfx: Next buffers not supplied on time
00&amp;gt; [00:00:11.952,065] &amp;lt;err&amp;gt; dmic_sample: read failed: -11&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Assuming this is what you see as well:&lt;/p&gt;
&lt;p&gt;The main issue is that the mic and speaker are working at two slightly different speeds (16000 in via mic and 15873 out via speaker). What happens is that the DMIC&amp;#39;s internal queue is slowly filling up, and after about 10 seconds, the buffers are full, and it is stuck trying to read more, while the buffer is full. However, the buffers will never be freed, because the I2S is being prevented from executing (it is still waiting for the DMIC trying to read).&lt;/p&gt;
&lt;p&gt;One way to work around this is to split this up into two threads. One constantly reading the mic, storing the data in buffers, and another one emptying it, outputting to the speaker.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Since there is a difference in sample rate, there will still be some data that can&amp;#39;t be output to the speaker, but you will be able to detect it, and skip one block.&lt;/p&gt;
&lt;p&gt;Alternatively, you need to look at your sample rates, and try to find something that is a better match, if the resulting outcome is not sufficient.&lt;/p&gt;
&lt;p&gt;Attached is a simple application showing how it can be done.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/43325.dmic.zip"&gt;devzone.nordicsemi.com/.../43325.dmic.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/563992?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2026 05:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bacd9a45-526a-4f06-a8ad-9412266019ce</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;I tried with the changes you mentioned but the errors its throwing ,I am attaching logs and zip file .00&amp;gt; [00:00:00.001,184] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample&lt;br /&gt;00&amp;gt; [00:00:00.001,197] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000&lt;br /&gt;00&amp;gt; [00:00:00.001,222] &amp;lt;inf&amp;gt; i2s_nrfx: I2S MCK frequency: 507936, actual PCM rate: 15873&lt;br /&gt;00&amp;gt; Configure Stream Successful.&lt;br /&gt;00&amp;gt; Trigger Command Successful.&lt;br /&gt;00&amp;gt; [00:00:10.911,696] &amp;lt;err&amp;gt; dmic_nrfx_pdm: No room in RX queue&lt;br /&gt;00&amp;gt; [00:00:11.012,482] &amp;lt;err&amp;gt; i2s_nrfx: Next buffers not supplied on time&lt;br /&gt;00&amp;gt; [00:00:11.952,065] &amp;lt;err&amp;gt; dmic_sample: read failed: -11&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8358.dmic.zip"&gt;devzone.nordicsemi.com/.../8358.dmic.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/563957?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2026 13:59:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcbea007-5e2c-4903-8f46-0f789ae4ac34</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is difficult to say exact without seeing the entire application, and being able to reproduce, but you should try replacing i2s_buf_write() with i2s_write(). The issue is that i2s_buf_write() is blocking waiting for a free buffer, but this is not being provided. Also, you should only free the mem_slab if there is an error (because i2s_write() frees it upon success).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret = i2s_write(i2s_dev_tx, buffer, size);
if (ret) {
    LOG_ERR(&amp;quot;Failed to write I2S buffer: %d&amp;quot;, ret);
    k_mem_slab_free(&amp;amp;mem_slab, buffer);  // only free on error
    return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try increasing the block count from 8 to e.g. 16.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLOCK_COUNT 16&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try moving dmic_trigger() to after the I2S has been configured:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
	config.word_size = 16;
	config.channels = NUMBER_OF_CHANNELS;
	config.format = I2S_FMT_DATA_FORMAT_I2S;
	config.options = I2S_OPT_BIT_CLK_MASTER | I2S_OPT_FRAME_CLK_MASTER;
	config.frame_clk_freq = MAX_SAMPLE_RATE;
	config.mem_slab = &amp;amp;mem_slab;
	config.block_size = BLOCK_SIZE;
	config.timeout = READ_TIMEOUT;
	if (!configure_streams(i2s_dev_tx, &amp;amp;config))
	{
		return 0;
	}
	
	ret = dmic_trigger(dmic_dev, DMIC_TRIGGER_START);
	if (ret &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;START trigger failed: %d&amp;quot;, ret);
		return ret;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if that changes anything. If not, it would be helpful if you could zip and post the application that you are using to replicate this, so that I can try to do it on a DK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/563928?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2026 08:54:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b8c52a0-4a1d-435d-9e5c-63346139bc5d</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/audio/dmic.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2s.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;quot;tas.h&amp;quot;

#define MAX_SAMPLE_RATE 16000
#define SAMPLE_BIT_WIDTH 16
#define BYTES_PER_SAMPLE sizeof(int16_t)
#define READ_TIMEOUT 1000
#define SAMPLES_PER_BLOCK 160 
#define NUMBER_OF_CHANNELS 1
#define I2S_TX_NODE DT_NODELABEL(i2s_tx)
#define I2C1_NODE DT_NODELABEL(tas2563)

#define BLOCK_SIZE (BYTES_PER_SAMPLE * SAMPLES_PER_BLOCK)
#define MAX_BLOCK_SIZE BLOCK_SIZE
#define BLOCK_COUNT 8

LOG_MODULE_REGISTER(dmic_sample);
K_MEM_SLAB_DEFINE_STATIC(mem_slab, MAX_BLOCK_SIZE, BLOCK_COUNT, 4);
static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C1_NODE);

static bool configure_streams(const struct device *i2s_dev_tx, const struct i2s_config *config)
{
	int ret = i2s_configure(i2s_dev_tx, I2S_DIR_TX, config);
	if (ret == 0)
	{
		printk(&amp;quot;Configure Stream Successful.\n&amp;quot;);
		return true;
	}
	printk(&amp;quot;Failed to configure streams: %d\n&amp;quot;, ret);
	return false;
}
static bool prepare_transfer(const struct device *i2s_dev_tx)
{
	int ret;

	for (int i = 0; i &amp;lt; 2; ++i)
	{
		void *mem_block;

		ret = k_mem_slab_alloc(&amp;amp;mem_slab, &amp;amp;mem_block, K_NO_WAIT);
		if (ret &amp;lt; 0)
		{
			printk(&amp;quot;Failed to allocate TX block %d: %d\n&amp;quot;, i, ret);
			return false;
		}
		memset(mem_block, 0, BLOCK_SIZE);

		ret = i2s_write(i2s_dev_tx, mem_block, BLOCK_SIZE);
		if (ret &amp;lt; 0)
		{
			printk(&amp;quot;Failed to write block %d: %d\n&amp;quot;, i, ret);
			return false;
		}
	}

	return true;
}
static bool trigger_command(const struct device *i2s_dev_tx, enum i2s_trigger_cmd cmd)
{
	int ret = i2s_trigger(i2s_dev_tx, I2S_DIR_TX, cmd);
	if (ret == 0)
	{
		printk(&amp;quot;Trigger Command Successful.\n&amp;quot;);
		return true;
	}
	printk(&amp;quot;Failed to trigger command %d: %d\n&amp;quot;, cmd, ret);
	return false;
}
int main(void)
{
	const struct device *const dmic_dev = DEVICE_DT_GET(DT_NODELABEL(dmic_dev));
	const struct device *const i2s_dev_tx = DEVICE_DT_GET(I2S_TX_NODE);
	struct i2s_config config;
	int ret;

	LOG_INF(&amp;quot;DMIC sample&amp;quot;);

	if (!device_is_ready(dmic_dev))
	{
		LOG_ERR(&amp;quot;%s is not ready&amp;quot;, dmic_dev-&amp;gt;name);
		return 0;
	}

	if (!device_is_ready(i2s_dev_tx))
	{
		printk(&amp;quot;%s is not ready\n&amp;quot;, i2s_dev_tx-&amp;gt;name);
		return 0;
	}


	struct pcm_stream_cfg stream = {
		.pcm_width = SAMPLE_BIT_WIDTH,
		.mem_slab = &amp;amp;mem_slab,
	};
	struct dmic_cfg cfg = {
		.io = {
			.min_pdm_clk_freq = 1000000,
			.max_pdm_clk_freq = 3500000,
			.min_pdm_clk_dc = 40,
			.max_pdm_clk_dc = 60,
		},
		.streams = &amp;amp;stream,
		.channel = {
			.req_num_streams = 1,
		},
	};

	cfg.channel.req_num_chan = 1;
	cfg.channel.req_chan_map_lo =dmic_build_channel_map(0, 0, PDM_CHAN_LEFT);
	cfg.streams[0].pcm_rate = MAX_SAMPLE_RATE;
	cfg.streams[0].block_size = BLOCK_SIZE;

	ret = dmic_configure(dmic_dev, &amp;amp;cfg);
	if (ret &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;Failed to configure the driver: %d&amp;quot;, ret);
		return ret;
	}

	ret = dmic_trigger(dmic_dev, DMIC_TRIGGER_START);
	if (ret &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;START trigger failed: %d&amp;quot;, ret);
		return ret;
	}
	config.word_size = 16;
	config.channels = NUMBER_OF_CHANNELS;
	config.format = I2S_FMT_DATA_FORMAT_I2S;
	config.options = I2S_OPT_BIT_CLK_MASTER | I2S_OPT_FRAME_CLK_MASTER;
	config.frame_clk_freq = MAX_SAMPLE_RATE;
	config.mem_slab = &amp;amp;mem_slab;
	config.block_size = BLOCK_SIZE;
	config.timeout = READ_TIMEOUT;
	if (!configure_streams(i2s_dev_tx, &amp;amp;config))
	{
		return 0;
	}
	if (!prepare_transfer(i2s_dev_tx))
	{
		return 0;
	}
	if (!trigger_command(i2s_dev_tx, I2S_TRIGGER_START))
	{
		return 0;
	}

	while (1)
	{
		void *buffer;
		uint32_t size;
		ret = dmic_read(dmic_dev, 0, &amp;amp;buffer, &amp;amp;size, READ_TIMEOUT);
		if (ret &amp;lt; 0)
		{
			LOG_ERR(&amp;quot;read failed: %d&amp;quot;, ret);
			return ret;
		}

		ret = i2s_buf_write(i2s_dev_tx, buffer, size);
		if (ret)
		{
			printk(&amp;quot;Failed to write I2S buffer: %d\n&amp;quot;, ret);
			return;
		}

		k_mem_slab_free(&amp;amp;mem_slab, buffer);
	}
	ret = dmic_trigger(dmic_dev, DMIC_TRIGGER_STOP);
	if (ret &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;STOP trigger failed: %d&amp;quot;, ret);
		return ret;
	}

	LOG_INF(&amp;quot;Exiting&amp;quot;);
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Can you please check the implementation of reading data from pdm mic and sending to speaker.I have included source code for same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM data to speaker</title><link>https://devzone.nordicsemi.com/thread/563923?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2026 07:28:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:072c6ad2-0d79-43d3-a780-c809f9016909</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Error in line 42: Source code not found.&lt;/p&gt;
&lt;p&gt;Looks to me like you tried to start the I2S output before you have enough data from the DMIC in order to be able to feed it. Order of operation matters here a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>