<?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 DK, Sample- &amp;amp; bitrate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93447/nrf5340-audio-dk-sample--bitrate</link><description>Hi, 
 I have 3 nRF5340 Audio DK&amp;#39;s and want to decrease the sample rate and the bit rate. By now, I have changed the rates in the .config and autoconf.h files (from 48kHz to 24kHz). 
 
 
 When compiling, the values are reset to 48kHz if I change the lines</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Nov 2022 07:40:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93447/nrf5340-audio-dk-sample--bitrate" /><item><title>RE: nRF5340 Audio DK, Sample- &amp; bitrate</title><link>https://devzone.nordicsemi.com/thread/395033?ContentTypeID=1</link><pubDate>Thu, 10 Nov 2022 07:40:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af8af19-ce7d-4df7-936b-d6b6c4b99ad6</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Other sample rates are not supported by NCS v2.1.1 You can see the configuration for AUDIO_SAMPLE_RATE_HZ on &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.1.1/applications/nrf5340_audio/src/audio/Kconfig#L33"&gt;lines 33-38 in src/audio/Kconfig&lt;/a&gt;. Changing this range will make it possible to choose other sample rates, though I have not tested if the application works after changing in v2.1.1. &lt;/p&gt;
&lt;p&gt;In the main branch of NCS the configuration for AUDIO_SAMPLE_RATE_HZ has been modified to enable a sample frequency choice between 16, 24 and 48kHz. The implementation is &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/src/audio/Kconfig#L33-L60"&gt;here&lt;/a&gt;. Note that the link is to the main branch, which is regularly updated.&lt;/p&gt;
&lt;p&gt;There are three ways you can update your application with the modified audio sample configurations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Switch to the main branch by entering&lt;br /&gt;&lt;code&gt;git fetch origin&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;git checkout origin/main&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;west update&lt;/code&gt;&lt;br /&gt;into the command line from &amp;lt;ncs-installation&amp;gt;/nrf.&lt;/li&gt;
&lt;li&gt;Checkout a specific commit by specifying the commit hash. To check out the latest commit which updated the nRF5340 Audio application you can replace&lt;code&gt; &lt;br /&gt;git checkout origin/main &lt;br /&gt;&lt;/code&gt;with&lt;code&gt; &lt;br /&gt;git checkout &lt;span&gt;&lt;span&gt;4840dd921f469db47b9cb835fd565b9039b36944&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;. &lt;br /&gt;This commit introduced the support for sampling frequencies other than 48kHz.&lt;/li&gt;
&lt;li&gt;If you can&amp;#39;t switch branches, replace the implementation for &lt;code&gt;config AUDIO_SAMPLE_RATE_HZ&lt;/code&gt; and with the lines 33-60 from the main branch version of &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/nrf5340_audio/src/audio/Kconfig#L33-L60"&gt;src/audio/Kconfi&lt;/a&gt;g. The code below is copied from there. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;choice AUDIO_SAMPLE_RATE
	prompt &amp;quot;Audio sample rate&amp;quot;
	default AUDIO_SAMPLE_RATE_48000_HZ if BT_AUDIO_BROADCAST_RECOMMENDED || BT_AUDIO_UNICAST_RECOMMENDED
	default AUDIO_SAMPLE_RATE_16000_HZ if BT_AUDIO_BROADCAST_16_2_1 || BT_AUDIO_BROADCAST_16_2_2 || BT_AUDIO_UNICAST_16_2_1
	default AUDIO_SAMPLE_RATE_24000_HZ if BT_AUDIO_BROADCAST_24_2_1 || BT_AUDIO_BROADCAST_24_2_2 || BT_AUDIO_UNICAST_24_2_1
	help
	  This will be selected based on the BAP settings.

config AUDIO_SAMPLE_RATE_16000_HZ
	bool &amp;quot;16 kHz&amp;quot;
	depends on AUDIO_SOURCE_I2S

config AUDIO_SAMPLE_RATE_24000_HZ
	bool &amp;quot;24 kHz&amp;quot;
	depends on AUDIO_SOURCE_I2S

config AUDIO_SAMPLE_RATE_48000_HZ
	bool &amp;quot;48 kHz&amp;quot;
endchoice

config AUDIO_SAMPLE_RATE_HZ
	int
	default 16000 if AUDIO_SAMPLE_RATE_16000_HZ
	default 24000 if AUDIO_SAMPLE_RATE_24000_HZ
	default 48000 if AUDIO_SAMPLE_RATE_48000_HZ
	help
	  I2S supports 16, 24, and 48 kHz sample rates for both input and output.
	  USB supports only 48 kHz for input.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;br /&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 Audio DK, Sample- &amp; bitrate</title><link>https://devzone.nordicsemi.com/thread/394994?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 18:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be3661cf-0d4f-4f39-a30d-748bc8a6b5d7</guid><dc:creator>Asbjorn Bjorkkjar</dc:creator><description>&lt;p&gt;I use the&amp;nbsp;v2.1.1 of nRF Connect SDK.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 Audio DK, Sample- &amp; bitrate</title><link>https://devzone.nordicsemi.com/thread/394923?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 13:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bd9e3af-c33b-41db-aa2b-94f4b0d270e3</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Asbjorn Bjorkkjar"]Hi,&amp;nbsp;and thanks for answering.&amp;nbsp;[/quote]
&lt;p&gt;Happy to help!&lt;/p&gt;
&lt;p&gt;Which version of nRF Connect SDK are you using? The nRF5340 Audio application changes from release to release, so my answer will depend on the version of NCS.&lt;/p&gt;
&lt;p&gt;What is going to be the same for all releases is that you need to build the application again for the new configs to be active.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;br /&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 Audio DK, Sample- &amp; bitrate</title><link>https://devzone.nordicsemi.com/thread/394638?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 10:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bb4356f-412d-4bcb-b56c-803c740f04d7</guid><dc:creator>Asbjorn Bjorkkjar</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;and thanks for answering.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems like the files in the autoconf.h does not change, even though we have the new functions in the prj.conf. Where are all the parameters in the autoconf.h coming from (i.e. 48kHz, 16 bitdepth etc.)? Is there any other way to make changes, or some other CONFIGs that should be included in prj?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 Audio DK, Sample- &amp; bitrate</title><link>https://devzone.nordicsemi.com/thread/393860?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 12:20:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a879154e-c362-405b-aefb-93d0ef0e5791</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello Asbjorn B.&lt;/p&gt;
&lt;p&gt;.config and autoconf.h are generated when building the application and changes made in them will not be saved across builds.&lt;/p&gt;
&lt;p&gt;To change the configurations, you need to add the CONFIGs you need into prj.conf if building with the default configuration file, or the .conf-file you are building with if you are specifying the configuration file you are using.&lt;/p&gt;
&lt;p&gt;Sample rates other than 48kHz are only supported when I2S is the audio source. You need to change the audio source to be I2S to be able to change the sample rate. To do this, include the line &lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;CONFIG_AUDIO_SOURCE_I2S&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;=y in your configuration file.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;CONFIG_LC3_BITRATE&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;=&amp;lt;value between max and min bitrate&amp;gt; should also be included in your configuration file to be included in the build.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;br /&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>