<?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>nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127511/nrf5340_audio-example-sample-rate-issue-with-bidirectional-streaming</link><description>SDK version: 3.2.4 
 I am using two nRF5340 Audio DK boards configured as gateway and left headset. 
 I added &amp;quot; CONFIG_STREAM_BIDIRECTIONAL =y&amp;quot; to prj.conf and I built everything with: &amp;quot;python tools/buildprog/buildprog.py -c both -b debug -d both -t unicast</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Apr 2026 08:52:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127511/nrf5340_audio-example-sample-rate-issue-with-bidirectional-streaming" /><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564361?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2026 08:52:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eeeeac76-7c26-43c9-80ad-adb6e5d2c54f</guid><dc:creator>Odiug</dc:creator><description>&lt;p&gt;I used this in prj.conf:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER_USE_PRINTK&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_THREAD_ANALYZER_USE_LOG=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER_AUTO&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_THREAD_ANALYZER_AUTO_INTERVAL&lt;/span&gt;&lt;span&gt;=5&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;It outputs statistics on VCOM0 now. But only as long as I have not enabled any playback. Then output freezes and after stopping playback, I get a lot of:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;GW [00:19:01.010,559] &amp;lt;wrn&amp;gt; le_audio_rx: Out of RX buffers&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I guess the UART handling starves while playback is active.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Guido&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564294?ContentTypeID=1</link><pubDate>Tue, 31 Mar 2026 09:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af53896c-6565-4aa7-9495-e4c9fc68912c</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;If you happened to not use 48 in both directions, then that might have ironically inreased the CPU usage since the sample rate converter would need to be active. But I thought having a single stream in each direction would be okay.&lt;/p&gt;
&lt;p&gt;Could you check the&amp;nbsp;CPU numbers using &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/debugging/thread-analyzer.html"&gt;this &lt;/a&gt;or &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/debug/cpu_load.html"&gt;this&lt;/a&gt;? The thread analyzer might be the easiest.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564155?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 09:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1da542f-540f-4e8a-a469-6800e032b041</guid><dc:creator>Odiug</dc:creator><description>&lt;p&gt;Yes, indeed.&lt;/p&gt;
&lt;p&gt;The simplest reproduceable setup would be compiling nrf5340_audio with&amp;nbsp;CONFIG_STREAM_BIDIRECTIONAL=y added in prj.conf. Then I used Audacity (under Windows) with a 48kHz audio file. Only playing works, and only recording works, but not playing and recording at the same time, which leads to stuttering and slow playback (set Audacity-&amp;gt;Recording-&amp;gt;Record on a new track, then Record).&lt;/p&gt;
&lt;p&gt;But I understand that this might be a resource limitation of the nRF5340.&lt;/p&gt;
&lt;p&gt;Guido&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564153?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 09:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e90f121a-2024-4d83-96af-9e12ab90ed3e</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;I think 48 would be good. Was 48 used in both directions?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564093?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 12:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71314119-39ca-490f-abf7-8017caeac6a2</guid><dc:creator>Odiug</dc:creator><description>&lt;p&gt;I stated &amp;quot;&lt;span&gt;16000kHz sample rate would be sufficient&amp;quot;, well, I meant &amp;quot;16 kHz is sufficient&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I was actually using 48 kHz. But if anything else would be better suited...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Guido&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564092?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 11:51:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6e5b753-7f50-4a00-b385-1b3eaaee5fc4</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This does sound like something that should be supported, yet also might be on the verge of being a&amp;nbsp;&lt;span&gt;resource issue.&lt;/span&gt;&lt;/p&gt;
[quote user="Odiug"]Both signals are mono and 16000kHz sample rate[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Is that also what you ran your original test with?&lt;/p&gt;
&lt;p&gt;Btw, I&amp;#39;ve reached out to the relevant R&amp;amp;D team about this, but I am afraid that several are away on vacation at the moment, so there might be some delays in getting you an accurate answer here.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564069?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2026 06:56:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e30c137-6c98-4d0a-bdb3-2f59d6b3f86e</guid><dc:creator>Odiug</dc:creator><description>&lt;p&gt;Hi Elfving,&lt;/p&gt;
&lt;p&gt;What I actually wanted to do is having a look at how audio synchronization performs in general.&lt;/p&gt;
&lt;p&gt;We wanted to investigate the following scenario: A device (gateway) connected via USB to a PC, playing audio to a speaker (headphone out) and at the same time capturing microphone audio from a remote BLE audio device (headset). We wanted to see how well the captured microphone audio data is synchronized to the played audio on the speaker. Both signals are mono and 16000kHz sample rate would be sufficient.&lt;/p&gt;
&lt;p&gt;I thought the easiest example to start from would have been the bidirectional gateway + (single) headset setup (nrf5340_audio with -t unicast). It would provide synchronization between both devices and a microphone path from headset to gateway. The only thing to add would have been an additional audio output to the headphone jack on the gateway. But then I realized, I can either play OR record from the PC host, but not both at the same time.&lt;/p&gt;
&lt;p&gt;Would it be possible to not send audio data to the remote device (headset) and only stream the microphone data to the gateway, but still play the audio data on gateway to the headphone?&lt;/p&gt;
&lt;p&gt;So, I need the following functionalities&lt;/p&gt;
&lt;p&gt;Gateway:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;USB (from host) -&amp;gt; headphone jack (I2S)&lt;/li&gt;
&lt;li&gt;USB (to host) &amp;lt;- BLE audio (from headset)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Headset:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;BLE audio (to gateway) &amp;lt;- microphone (I2S)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would assume that on the gateway side the I2S clock and the BLE frame clock are synchronized to the USB clock. On the headset the I2S clock should be synchronized to the BLE frame clock.&lt;/p&gt;
&lt;p&gt;But this kind of synchronization might be different from how it is done normally in the unicast case.&lt;/p&gt;
&lt;p&gt;Can you give some feedback on how to achieve our plans?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Guido&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/564006?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2026 09:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f39e722-111e-48df-805a-d246b3a22fb5</guid><dc:creator>Odiug</dc:creator><description>&lt;p&gt;Hi Elfving,&lt;/p&gt;
&lt;p&gt;I was referring to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88122/nrf5340-audio-dk---bidirectional-communication"&gt;nRF5340 Audio DK - Bidirectional communication&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/125748/question-about-bidirectional-audio-with-nrf5340-audio"&gt;Question About Bidirectional Audio With nRF5340 Audio&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is also OCT-3560 under Known Issues (&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/known_issues.html#nrf5340_audio):"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/known_issues.html#nrf5340_audio):&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;OCT-3560: The audio application might be resource intensive, using significant amount of CPU for encoding, decoding, sample rate conversion, and USB&lt;/p&gt;
&lt;p&gt;This is apparent when running bidirectional audio on the unicast gateway or client on the nRF5340. This might push the load over 100 % and result in poor audio, and lower priority threads such as logging. This is a known limitation.&amp;quot;&lt;/p&gt;
&lt;p&gt;So, I guess bidirectional and USB is not possible.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Guido&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340_audio example sample rate issue with bidirectional streaming</title><link>https://devzone.nordicsemi.com/thread/563781?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2026 15:08:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b7560b8-16a9-4a7a-baf6-bfc59f97877c</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi Guido,&lt;/p&gt;
&lt;p&gt;But besides these basic changes you haven&amp;#39;t done anything else to the sample?&lt;/p&gt;
&lt;p&gt;The issue here remings me a bit of the rule of thumb that for high quality audio, encoding a single channel takes about 30 % of the APP core CPU, and decoding takes 15 %. The USB takes ~20 % for receiving audio from a PC/host and another 10 % for sending. Although this&amp;nbsp;shouldn&amp;#39;t be a problem in the scenario you describe.&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;span&gt;I saw an old issue posted here stating that bidirectional audio was not possible, but as this option is now available, I assume it should work by now?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Could you link me to this?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>