<?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 / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106529/pdm-dmic-not-giving-any-sensible-output</link><description>I&amp;#39;m trying to capture audio data from a PDM microphone. Using the dmic sample I output the captured buffer via serial. Though the captured PCM data is 8x the same data. So each time the dmic sample captures one &amp;quot;block&amp;quot; is receives the same data though</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Dec 2023 16:05:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106529/pdm-dmic-not-giving-any-sensible-output" /><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/461323?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 16:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31733aae-599d-402b-89a8-d3d86bc6c397</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I&amp;#39;m not certain what the exact issue was but it seems it was a compounding issue of retrieving multiple blocks and calling config after each set of blocks again and then also likely interpreting the sample data with the wrong endianness.&lt;br /&gt;Also setting the queue depth deeper in the device tree helped remedy a crash I was exhibiting when asking for more sample reads than the dmic sample does by default.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/461181?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 00:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:800e27a5-2bc0-4cac-8fa1-678200467f75</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;Ah found it but it unfortunately suggest that the click is something that happens once when the interface is started, so if you don&amp;#39;t stop it again I would expect the pop to not re-appear :/&lt;br /&gt;&lt;a href="https://github.com/edgeimpulse/firmware-nordic-thingy53/blob/main/src/sensors/ei_microphone.cpp#L314-L331"&gt;github.com/.../ei_microphone.cpp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/461179?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 00:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73c7912d-8355-40db-87ff-7f9369d5886a</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;ah I just realize you are the same person with that other similar ticket &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;br /&gt;I&amp;#39;m actually using a modified version of the code you had posted, thanks for that, it helped me get a bit further with this.&lt;br /&gt;My pops are a bit more aggressive than the pcm sample you had posted so I figured that might be related to reading too much data maybe and getting a few random bytes in there.&lt;br /&gt;Thats unfortunate that you still get the pops if you don&amp;#39;t stop the stream at all. Altho I guess the memory slab could still contain some &amp;quot;off bytes&amp;quot; if the dmic driver isn&amp;#39;t completely filling it for some reason or notifies too early.&lt;br /&gt;I did see a notice about a workaround to get rid of click sounds in the Thingy:53 firmware. Let me see if I can find that again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/461176?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 00:27:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eed1b590-1f80-480d-bab1-8053009d1504</guid><dc:creator>poplitard</dc:creator><description>&lt;p&gt;I deleted my reply&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think you&amp;#39;d configure then trigger start and continuously do a dmic_read but when I tried that I got clicking noises like you so I&amp;#39;m still trying to figure that out&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/461175?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2023 00:22:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:404f5878-c555-442c-84a2-f149f74d8a1d</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/poplitard"&gt;poplitard&lt;/a&gt; not sure if the system is weird or if you deleted your reply. I&amp;#39;m currently doing a start, read and stop cycle in a loop. Mostly the dmic sample but moved the configuration out of the transfer function.&lt;br /&gt;I&amp;#39;m not quite sure what the proper way is to do a continues read stream. I&amp;#39;ve been going through the Thingy:53 firmware but its quite abstracted and verbose so hard to track down how exactly that is handled for audio streaming.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/460938?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 01:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:510b7c6d-354d-4c11-8176-77c0fd8eff6b</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I did make some progress though. Reconfiguring the pdm interface with every block read was partially an issue it seems.&lt;br /&gt;Still getting some periodic popping artifacts that I can&amp;#39;t really explain so far but behind the artifacts I can at at least hear the recorded audio now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/460937?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 01:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83b6eb8d-ae08-4adb-b754-75b52df59001</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;But that should raise an error for a read and not just continue to provide data while not receiving any data? That would make sense to me if the device disconnected during a read but that it configures and starts reading successfully without any hardware connected is odd.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/460936?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 01:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca005d21-f9af-4786-a1d8-000b4a985369</guid><dc:creator>poplitard</dc:creator><description>&lt;p&gt;That&amp;#39;s because dmic uses DMA, it allocates some memory to write microphone data&lt;/p&gt;
&lt;p&gt;dmic_read returns a buffer address and the size of that buffer&lt;/p&gt;
&lt;p&gt;It&amp;#39;s all good if the microphone returned any data and the buffer was updated, otherwise the buffer is going to have some garbage values&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/460922?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2023 21:02:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6805729-a876-4cb6-827f-f6cfd635fb2e</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/maria-gilje"&gt;Maria Gilje&lt;/a&gt; were you able to reproduce the problem? I saw that the Thingy:53 is also using a PDM microphone but the firmware is very complex and seems to be very specific for use with Edge Impulse.&lt;br /&gt;I&amp;#39;ve seen that they do not really make use of Zephyr&amp;#39;s DMIC subsystem but talk to the nordic pdm driver directly.&lt;br /&gt;Is this expected procedure? If so do you have any simpler samples that demonstrate basic use of the pdm driver?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/459994?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 17:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9642a683-6f4c-448c-a545-ff9ed719919f</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;I also just tested with NCS 2.4.2. I can do a cold boot of the devkit and it still reports successful reads with nothing attached to the devkit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/459986?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 16:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f05502c-68b5-40cd-a2ac-3f581c2cd238</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;Good to hear that its not just on my end, that limits the scope a bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/459985?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 16:22:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e31b818-0a9f-410f-a440-f47ebbe6c973</guid><dc:creator>timonsku</dc:creator><description>&lt;p&gt;Hi Maria,&lt;/p&gt;
&lt;p&gt;I remove the data and clock line from the development kit, then I press the reset button, the firmware reboots and still prints out sample data. This also happens with the unmodified dmic sample where it reports successful reads from the interface. E.g. this line is not triggered because dmic_read returned with 0 which it should not have with no physical device present to return audio data.&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/drivers/audio/dmic/src/main.c#L58C12-L58C12"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/drivers/audio/dmic/src/main.c#L58C12-L58C12&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It tried both nrf5340dk_nrf5340_cpuapp and nrf5340dk_nrf5340_cpuapp_ns build targets, same outcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/459984?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 16:16:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:822851fb-56c3-447e-8ab8-4c24ad61e89b</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have picked this up and will get back to you soon. But let&amp;#39;s start with some clarification questions:&lt;/p&gt;
[quote user=""]What is even more puzzling is that I keep getting successful data reads when I disconnect the microphone.[/quote]
&lt;p&gt;How to you disconnect the microphone?&lt;/p&gt;
&lt;p&gt;How do you define &amp;quot;successful data reads&amp;quot;?&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><item><title>RE: PDM / DMIC not giving any sensible output</title><link>https://devzone.nordicsemi.com/thread/459979?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 16:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b11279a5-9575-4673-a4fd-637a685fb7ee</guid><dc:creator>twberg</dc:creator><description>&lt;p&gt;Same problem for me. Would be interested in a solution as well&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>