<?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>Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2</link><description>Hi, 
 I&amp;#39;m currently working on an application that collects audio data and sends it to a central device via BLE. Since audio compression has great potential to reduce power consumption, I would like to implement opus (libopus 1.2.1) on the nRF DK 52 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Mar 2018 11:13:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2" /><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/123635?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 11:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0f1220a-6efb-45e8-bcce-5e3d3dde00a4</guid><dc:creator>Pawel Dunaj</dc:creator><description>&lt;p&gt;Hi Nick,&lt;/p&gt;
&lt;p&gt;Smart Remote 3 application fits into nRF52832 FLASH (512 KiB) together with S132 SoftDevice and DFU bootloader. Application has&amp;nbsp;multiple features - Opus codec being one of them. Codec is definitely not the largest component.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/123504?ContentTypeID=1</link><pubDate>Thu, 08 Mar 2018 17:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:911ba3ab-2ebe-43d9-9abf-a1b5d6a0d8fc</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Hi Pawel,&lt;/p&gt;
&lt;p&gt;After some more trying, I decided to switch to linux and setup up eclipse with gcc (GNU ARM Embedded tool chain). It took some time but I think I learned some important stuff while setting up the tool chain.&lt;/p&gt;
&lt;p&gt;By now I managed to build the opus library using the arm gcc compiler. Unfortunately, the library is around 750kB in size. I will see if I can reduced the size using additional configure commands and I will see how much space it takes in an actual nRF application. &lt;/p&gt;
&lt;p&gt;Could you maybe give me some information on how Nordic implemented the opus codec and what size range I could expect?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m assuming that I would probably get better results if I manually included the source files and just use the absolute necessary code. Unfortunately, the opus codec is very complicated and opus support extremely limited.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122877?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 15:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3bf2c46-029d-440e-8203-ae3aef88ee9a</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Hi Nick,&lt;/p&gt;
&lt;p&gt;A library is essentially a group of functions &amp;amp; definitions that another program has access to &amp;amp; can use (&lt;a href="https://en.wikibooks.org/wiki/C_Programming/Libraries" rel="noopener noreferrer" target="_blank"&gt;see link&lt;/a&gt;). If you take a look at the Blinky example from SDK14.2, you can see the nRF_Libraries folder with contains the app_button.c file. Along with the c file, there is also the app_button.h header file. These two files are part of the button handling library, which allows users to use the buttons to enable some kind of functionality. The .c file contains the function implementation, while the .h file enables an interface (a way for other files to use the functions inside the .c file). By&amp;nbsp;including&amp;nbsp;#include &amp;quot;app_button.h&amp;quot; inside the main.c file, it is possible for the main file to call functions inside the button library.&lt;/p&gt;
&lt;p&gt;So I would consider making a new folder in SES for example&amp;amp; placing all of the OPUS files in there. You can then use the functions inside the OPUS files by for example having a header file for each function &amp;amp; including the header files in the main.c file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122568?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 09:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb31a3a5-66cd-4793-85c4-c8803617a260</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;You can &lt;a href="https://response.nordicsemi.com/subscribe-to-our-newsletters" rel="noopener noreferrer" target="_blank"&gt;subscribe to the product update notifications&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122512?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 18:27:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7c56343-4ffa-4142-8a34-41f492b8bc7e</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Hi Bjorn&lt;/p&gt;
&lt;p&gt;Thanks for your answer.&lt;/p&gt;
[quote userid="25682" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2/122392"] but I would add the necessary files to the Segger IDE &amp;amp; compile from there.[/quote]
&lt;p&gt;What exactly do you mean by that? Maybe I&amp;#39;m still not clear on the definition of a library. Do I not need to make opus into a library before using it? How else is opus going to know on which platform it is running? &lt;/p&gt;
&lt;p&gt;Sorry for all the questions, by now I&amp;#39;m just very confused on the relation between operating systems, compilers and makefiles.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122507?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 17:57:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:714bb4e7-507c-45c0-bb45-dd9b2b9177db</guid><dc:creator>Heinous Harald</dc:creator><description>&lt;p&gt;That&amp;#39;s good news. Is there any way I can be notified when that goes live?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122443?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 11:50:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbe835e4-b718-488f-88cc-fc29177d56f7</guid><dc:creator>Pawel Dunaj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not familiar with Segger but most such tools use their proprietary project files. I expect it should be possible to import Makefile based project.&amp;nbsp;I don&amp;#39;t know if it is automated though.&lt;/p&gt;
&lt;p&gt;In general as long as toolchains are compatible (use the same ABI and the same format for object files) you should be able to compile library with one tool and link it later&amp;nbsp;with the other.&lt;/p&gt;
&lt;p&gt;If, as you say, SES is using GCC than you can use make pointing to the same&amp;nbsp;GCC that SES uses. Usually this is done by specifying CROSS_COMPILE env variable but it really depends on how Makefile was written (please refer to OPUS documentation where I&amp;nbsp;expect it is explained).&lt;/p&gt;
&lt;p&gt;There are Windows ports of GNU tools and you can install one of them if you want to obtain make and build library directly from Makefile.&lt;/p&gt;
&lt;p&gt;My personal suggestion is to use Linux when you create your projects using GNU tools (make, GCC, etc). It is much easier this way and build is done faster too.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122437?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 11:27:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1496e1d5-06ee-4235-a8bc-16ce3a1a449b</guid><dc:creator>Pawel Dunaj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I actually agree with you - it is not trivial to update. Still it depends much on which components you do use.&lt;/p&gt;
&lt;p&gt;I suggest waiting for the next version of the Smart Remote which will be released in couple of weeks. It is based on SDK 14.2.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122392?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 08:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70d34885-f0d8-4ebf-9fed-55d99032884f</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) Unfortunately, you would need to buy a smart remote to be able to download the source code. Other than the smart remote, I have not found any other example code for Opus on a Nordic chip.&lt;/p&gt;
&lt;p&gt;2) I am slightly unsure about this.&amp;nbsp;My guess is that both would work, but I would add the necessary files to the Segger IDE &amp;amp; compile from there.&lt;/p&gt;
&lt;p&gt;3) From my understanding, the whole idea of make files is to keep the source file(s) up to date.&amp;nbsp;It seems it is good practice to have one makefile in each directory that keeps the components inside that directory up to date. So in your case, if you have multiple directories, you might want to have one makefile per directory &amp;amp; have a top level make file (&lt;a href="https://www.safaribooksonline.com/library/view/managing-projects-with/0596006101/ch06.html" rel="noopener noreferrer" target="_blank"&gt;see link&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;4) I have explained briefly what the makefile does in 3. See &lt;a href="http://www.sis.pitt.edu/mbsclass/tutorial/advanced/makefile/whatis.htm" rel="noopener noreferrer" target="_blank"&gt;this link&lt;/a&gt; for more details. The sdk_config file essentially changes the static settings of an application built on top of the nrf5 sdk (&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.1.0/sdk_config.html?cp=4_0_1_1_6" rel="noopener noreferrer" target="_blank"&gt;see link&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If I were you, I would take a look at the Thingy FW, as the Thingy:52 device does audio streaming from a smartphone to the Thingy:52 device &amp;amp; vice versa. It uses different audio codecs than OPUS.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Bjørn Kvaale&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122373?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 01:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9f203b7-dde6-4b80-bec4-547bdee11dce</guid><dc:creator>Heinous Harald</dc:creator><description>&lt;p&gt;I would say pay the money nick7, it&amp;#39;s well worth the time and effort saved! That said, the reference design code is built on SDK 12.2. So Pawel, how does one get a reference design built on the latest SDK... and before you say it, I disagree, it is NOT trivial to update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122356?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 17:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eef64897-0d7a-4399-98b0-0e16943a40ea</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Building externally seems to be the more straightforward solution for me.&lt;/p&gt;
[quote userid="68956" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2/122345"](e.g. with make provided with OPUS)[/quote]
&lt;p&gt;Can you clarify on that? do I try to build this library in Segger ES inside a new project with the provided make files?&lt;/p&gt;
&lt;p&gt;Or outside Segger ES? in that case which tools do I need to build an application externally for an nRF 52832? (On Windows 10, Segger using gcc compiler, language standard gnu99)&lt;/p&gt;
&lt;p&gt;I assume I need to compile it with gcc somehow.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122345?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 16:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0925462-24d6-4100-98d9-4ed939b3f735</guid><dc:creator>Pawel Dunaj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, firmware and source code is available after purchase of the reference design.&lt;/p&gt;
&lt;p&gt;Going back to your question. That is a question on how you would like to have you project organized.&lt;/p&gt;
&lt;p&gt;Assuming that you have everything except the OPUS library, you will have to either:&lt;br /&gt;- modify the project files to tell tool to build OPUS sources together with your project, or&lt;br /&gt;- build the library out of your project tree (e.g. with make provided with OPUS) and later link your project against this library (again you will have to change project files to tell linker where the library is located).&lt;/p&gt;
&lt;p&gt;Changing project files depends on what tool you do use.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122342?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 16:17:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6263297d-009a-49ff-ae2d-eab55d796be4</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Thanks for the reply Pawel.&lt;/p&gt;
&lt;p&gt;Did I read correctly that I would have to purchase the nRF ready Smart Remote 3 (300$) in order to obtain the reference design? &lt;/p&gt;
&lt;p&gt;Unfortunately that would be a bit too much for my project budget.&lt;/p&gt;
&lt;p&gt;So to rephrase my questions:&lt;/p&gt;
&lt;p&gt;1. How do I get from the folder structure above to a project with BLE capabilities? Or asked differently: How do I integrate the opus codec in an existing BLE SDK project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Opus implementation with BLE (SDK 14.2)</title><link>https://devzone.nordicsemi.com/thread/122334?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 15:34:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d03266e-b63e-4176-a298-4adfb2a80d97</guid><dc:creator>Pawel Dunaj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is great to hear that you are interested in Nordic&amp;#39;s Smart Remote reference design. Please find the answers to your questions below.&lt;/p&gt;
[quote userid="55972" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2"]1. Is there example code available for an implementation of Opus on a Nordic chip (using both BLE and opus)? (Smart Remote apparently, but I cannot find any example code)[/quote]
&lt;p&gt;Smart remote can be configured to use OPUS as an audio codec and it sends audio over BLE. Note that&amp;nbsp;nRFready Smart Remote 3 for nRF52 Series is a reference design and its code is not available within the SDK package. You can find more information on how to obtain the source code on the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRFready-Smart-Remote-3-for-nRF52-Series"&gt;Smart Remote product page&lt;/a&gt;.&lt;/p&gt;
[quote userid="55972" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2"]2. What is a normal way to go about such an implementation? Should I precompile the library and then add it to the Nordic libraries? or can I add the whole folder structure to the Segger IDE and compile it in there?[/quote]
&lt;p&gt;OPUS library is compiled within the Smart Remote project. You don&amp;#39;t need to copy any OPUS related files as Smart Remote sources come with them included.&lt;/p&gt;
&lt;p&gt;If you are working on your own project, you will have to create your own design (i.e. which components are used and how they are integrated together).&lt;/p&gt;
[quote userid="55972" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2"]3. If I&amp;#39;m not mistaken I have a separate makefile for Opus either way. Do I need to merge the makefiles from the BLE Nordic example and Opus or how can I go about this?[/quote]
&lt;p&gt;Smart Remote sources have project files prepared&amp;nbsp;to be used with Keil and GCC. You don&amp;#39;t need to compile OPUS out of Smart Remote tree as OPUS files will be compiled along with other sources. To have all Smart Remote features build in you will however have to obtain the AirMotion library (please refer to product documentation). This library is not needed for OPUS nor BLE so if you are interested in audio transmission only you will not need it.&lt;/p&gt;
[quote userid="55972" url="~/f/nordic-q-a/30881/opus-implementation-with-ble-sdk-14-2"]4. Very general question, what&amp;#39;s the relation between the sdk_config file and the makefile?[/quote]
&lt;p&gt;The sdk_config header file contains project configuration (i.e. set of options that define how project sources&amp;nbsp;are built and which features&amp;nbsp;are compiled in and with what properties). Makefile is a file that tells make (a tool) how to convert source code into binaries. The same sdk_config header file can be used for different project construction environments (e.g. GCC, Keil, IAR, SES, etc). Makefile is specific for make and describe dependencies between different files within a project.&lt;/p&gt;
&lt;p&gt;I hope this will help you to get started.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Pawel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>