<?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>Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102864/trouble-extracting-data-using-dmic</link><description>Hi there! 
 I am using the DMIC sample on a nrf5340dk. I have got it working, and now I want to develop it further. I want to record some sound and then transfer it to my PC. I have a lot of questions that I struggle with finding the answers to. 
 Now</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Jan 2024 17:26:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102864/trouble-extracting-data-using-dmic" /><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/464261?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 17:26:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18237704-ace6-4d78-8d0c-6eeb4f3dab3b</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I had build a simple example that sends data out via Serial as ASCI HEX strings.&lt;br /&gt;It&amp;#39;s not efficient but was an easy way for prototyping.&lt;br /&gt;You can find that project attached in this issue but I would recommend you use the fixed example Torbj&amp;oslash;rn posted in the accepted answer:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/106831/dmic-pop-click-sounds-between-each-memory-block/463741"&gt;RE: DMIC pop / click sounds between each memory block&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just capture the Serial output on your computer and use the included Python script to convert it into raw PCM data that you can then import into Audacity or Adobe Audition for playback.&lt;br /&gt;&lt;br /&gt;If you get repeated data or junk data then you likely have a hardware issue, the pdm driver returns data no matter if there is a microphone attached or not, so you might just be reading whatever happens to be in uninitialized memory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/464241?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 15:36:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e42b6378-bc02-4385-bd8a-c9d4ebba83f8</guid><dc:creator>twberg</dc:creator><description>&lt;p&gt;Is there already a&amp;nbsp;working solution for that issue? I am still struggling with the same problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/461556?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2023 11:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af314707-bb07-4b46-bcda-89e132922b3d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Timon&lt;/p&gt;
&lt;p&gt;The case should be assigned shortly. If you are still struggling with this after new year I can take a look at it also. In the mean time happy holidays &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/461345?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 20:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:656b9949-8d7e-4538-885a-49b7b9a43fbf</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I made a separate ticket for the remaining pop/click issue&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/106831/dmic-pop-click-sounds-between-each-memory-block"&gt;devzone.nordicsemi.com/.../dmic-pop-click-sounds-between-each-memory-block&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/461180?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 00:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c8519ae-2ebc-4576-913a-8d98dbaea037</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;Hi Torbj&amp;oslash;rn, no worries!&lt;br /&gt;I opened a seperate issue here: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/106529/pdm-dmic-not-giving-any-sensible-output"&gt;PDM / DMIC not giving any sensible output&lt;/a&gt;&lt;br /&gt;That is good to know that there is no data detection being made, then I probably just get random memory without anything connected.&lt;br /&gt;I poked around a bit more and am able to extract actual audio data but am still experiencing weird popping artifacts that overlay the recording and shift my samples &amp;quot;up&amp;quot;.&lt;br /&gt;If you have seen that before any pointers would be useful, I&amp;#39;m pretty sure that its related to how I handle the buffer and the mic streaming.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/460990?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 09:15:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad995b6e-0cf8-4df5-a851-446b5c9b8254</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Timon&lt;/p&gt;
&lt;p&gt;Sorry for the slow response, I just got back from vacation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you still having issues with this?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does the data look the same whether or not the PDM mic is connected?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The PDM interface is not able to detect if anything is connected or not,&amp;nbsp;so the example should run just as well regardless, but the data should reflect the state of the pin (most likely permanently high or low, unless it is floating between the two states).&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/459580?ContentTypeID=1</link><pubDate>Sat, 09 Dec 2023 01:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:136511bc-01e4-4bc0-9b53-2dc22a02edd0</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I&amp;#39;m seeing a potentially similar issue. Using the default dmic sample I get 8 chunks of identical data with each run of the program.&lt;br /&gt;What is even more bizarre is that I get data no matter if the PDM mic is actually connected or not.&lt;br /&gt;Then I try to use a slightly different example meant for the 96_ArgonKey (&lt;a id="" href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/96b_argonkey/microphone"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/boards/96b_argonkey/microphone&lt;/a&gt;) which seems almost identical but there the driver throws an error with:&lt;br /&gt;dmic_nrfx_pdm: Failed to allocate buffer: -12&lt;br /&gt;&lt;br /&gt;had to add this in order for the sample to not return with a configuration error&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;cfg&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;channel&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;req_chan_map_lo&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;dmic_build_channel_map&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#4fc1ff;"&gt;PDM_CHAN_LEFT&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/442037?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 09:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b76d960a-398f-4e85-b90b-86aa6e73f145</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is your configuration sequence exactly the same as well?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only error I can spot in your screenshot is that you are trying to free the same buffer twice, but I don&amp;#39;t think that explains the problem you are seeing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you check with a debugger what the value of the buffer pointer is after the read, and try to inspect the data at that address directly?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/441702?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 17:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8195472-3b5e-4c96-9e98-baf8d387e5b9</guid><dc:creator>Espen</dc:creator><description>&lt;p&gt;Thanks you so much for the detailed answer!&lt;/p&gt;
&lt;p&gt;I am getting strange data when using the mic. I use basically the same code as the DMIC sample. When I print out the data, I get the exact same data each run. This is the code I use to read and print the data:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;void&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;*&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;buffer&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;uint32_t&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;size&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;int&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;ret&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;ret&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;dmic_read&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;dmic_dev&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;buffer&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;size&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;READ_TIMEOUT&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#c586c0;"&gt;if&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; (&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;ret&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt; LOG_ERR&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;%d&lt;/span&gt;&lt;span style="color:#ce9178;"&gt; - read failed: &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;%d&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;i&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;ret&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color:#c586c0;"&gt;return&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;ret&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;uint16_t&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;*&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;data_ptr &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; (&lt;/span&gt;&lt;span style="color:#569cd6;"&gt;int&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;*&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;)&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;buffer&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#c586c0;"&gt;for&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#569cd6;"&gt;int&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;j&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;j&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;size&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;/&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;2&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;j&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;++&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;printk&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;%x&lt;/span&gt;&lt;span style="color:#ce9178;"&gt; &amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;*&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;data_ptr);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data_ptr&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;++&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;printk&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;k_mem_slab_free&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;mem_slab, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;data_ptr);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;k_mem_slab_free&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;mem_slab, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;buffer&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The terminal outputs bellow are from different runs, but the output in data is exactly the same (not all data logged is included here for convenience sake)&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v3.3.99-ncs1 ***&lt;br /&gt;[00:00:00.453,460] &amp;lt;inf&amp;gt; dmic_sample: Size of sample: 2&lt;br /&gt;[00:00:00.453,460] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample&lt;br /&gt;[00:00:00.453,460] &amp;lt;inf&amp;gt; dmic_sample: PCM output rate: 16000, channels: 1&lt;br /&gt;[00:00:00.453,491] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1024000, actual PCM rate: 16000&lt;br /&gt;00 0 0 ffff fffe 31 2e 61 5d 90 8b f4 b9 125 b5 158 b0 1bd dd 223 a1 28d 65 32b 26 3ff ff7a 541&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v3.3.99-ncs1 ***&lt;br /&gt;[00:00:00.252,777] &amp;lt;inf&amp;gt; dmic_sample: Size of sample: 2&lt;br /&gt;[00:00:00.252,777] &amp;lt;inf&amp;gt; dmic_sample: DMIC sample&lt;br /&gt;[00:00:00.252,777] &amp;lt;inf&amp;gt; dmic_sample: PCM output rate: 16000, channels: 1&lt;br /&gt;[00:00:00.252,807] &amp;lt;inf&amp;gt; dmic_nrfx_pdm: PDM clock frequency: 1024000, actual PCM rate: 16000&lt;br /&gt;00 0 0 ffff fffe 31 2e 61 5d 90 8b f4 b9 125 b5 158 b0 1bd dd 223 a1 28d 65 32b 26 3ff ff7a 541&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/441573?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 11:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8969fdcb-decb-447f-8e34-d6d297b25eca</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is your UART baudrate?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;32kBytes/sec equals 256 kbps, which means you need to use a baudrate that is at a minimum 288 kbaud (to make room for the stop bit). Realistically though I would recommend at least 460800 baud, to have some overhead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Secondly, how do you output the data?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you use the LOG API and convert the raw audio data to ASCII then you are multiplying the amount of data significantly, since each raw byte becomes multiple bytes over the UART. Then you will surely not have enough bandwidth.&amp;nbsp;&lt;/p&gt;
[quote user=""]But this buffer get owerwritten with new data. How do I go about not overwriting the data and retrieving it later? (The recording does not need to be longer than a few seconds, maybe even shorter)[/quote]
&lt;p&gt;If you only need to store a couple of seconds of data you can copy it into a larger secondary buffer. If your math is correct then 3 seconds of data equals 96kB. The nRF5340 appcore has 512kB of RAM in total, so setting aside 96kB for data storage should be fine.&amp;nbsp;&lt;/p&gt;
[quote user=""]I also struggle with understanding the part the memory slab plays in the program. Defined as:[/quote]
&lt;p&gt;The DMIC driver will use the memory slab to allocate buffers for the PDM interface automatically in the PDM event handler, to ensure that the buffers are provided fast enough to avoid gaps in the data. All the application has to do is to free the buffers again after the data is processed, which you can see in the do_pdm_transfer(..) function in main.c.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The documentation for the driver is a bit slim, so in order to check out the details of the implementation you might want to just look at the source, zephyr/drivers/audio/dmic_nrfx_pdm.c. For instance to see how the buffers are allocated you can have a look &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/audio/dmic_nrfx_pdm.c#L56"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trouble extracting data using DMIC</title><link>https://devzone.nordicsemi.com/thread/441559?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 10:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e319949-6a68-4659-afe5-72691881e447</guid><dc:creator>Espen</dc:creator><description>&lt;p&gt;I have manged to access the data. What I really need is a way to quickly transfer the data to my PC, about 16000*2 = 32kbytes/sec (sampling frequency multiplied with bytes per sample). I was planning to log everything to a terminal window. But it seems like it can&amp;#39;t keep up. I got the error: &amp;nbsp;--- 3171 messages dropped ---.&lt;/p&gt;
&lt;p&gt;Might it be possible to use UART for this? Or is there something else?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>