Page 1 of 1

Using opus decoder with ESP-IDF 4.x

Posted: Fri Feb 21, 2020 4:42 pm
by dave_see
I have a project that's currently using ESP-IDF 4.x

I'm interested in using opus-decoder in my ESP-IDF 4.x project. Currently, ESP-ADF is only supported on a specific version of ESP-IDF 3.x where the build system is different.

I noticed that a static library of the the opus library exists here: ... esp-opus.a

I also noticed that the ESP-IDF 4.x documents describe how to use a static library here: ... components

I tried following the prebuilt example from here: ... t_prebuilt

It builds! But I get a runtime error:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x4000c46c  PS      : 0x00060530  A0      : 0x8013c4c7  A1      : 0x3ffd8420  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00006780  A5      : 0x00000000  
A6      : 0x00000003  A7      : 0x00000678  A8      : 0x00006780  A9      : 0x3ffd83e0  
A10     : 0x000045c8  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x3ffd9ef4  
A14     : 0x0000002e  A15     : 0x00000006  SAR     : 0x00000020  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000677  

ELF file SHA256: 93e3c61071c572a1b5de0e95a1c939fe2f3d1f551c1a59ec0e1518509581cc21

Backtrace: 0x4000c469:0x3ffd8420 0x4013c4c4:0x3ffd8430 0x400d610b:0x3ffd8460 0x400936d9:0x3ffd9810
0x4013c4c4: opus_decoder_init at /Users/maojianxin/duros/esp-adf-libs-source/esp_codec/esp-opus/src/opus_decoder.c:106

0x400d610b: moondog_rtp_mcast_task_function at /Users/dsee/Documents/esp_opus_test/build/../main/esp_opus_test_main.c:50

0x400936d9: vPortTaskWrapper at /Users/dsee/esp/esp-idf/components/freertos/xtensa/port.c:143[Codebox=bash file=Untitled.bsh]
That error references opus_decoder.c from some developer's machine. I'm unsure if I can work around this.

I'm in the process of making a suitable source-code component from

I have two questions:
1. Is there any advice for using the opus encoder/decoder with ESP-IDF 4.x ?
2. Maybe this question should be posted in ADF - are there optimizations built in to the libesp-opus.a static library in esp-adf-libs ?

Many thanks,

Re: Using opus decoder with ESP-IDF 4.x

Posted: Sun Feb 23, 2020 10:17 pm
by ESP_Dazz
Might be a stack overflow. See if increasing the stack size of moondog_rtp_mcast_task_function() resolves the issue.

Re: Using opus decoder with ESP-IDF 4.x

Posted: Mon Feb 24, 2020 6:44 pm
by dave_see
Thank you ESP_Dazz for your reply. I was calling the wrong function.

For testing, the first step should be calling opus_decoder_create which allocates memory. I have a new linking issue where I have one static library (.a file) that needs another.

I need to build with two libraries :
1. ... esp-opus.a
2. ... ec-utils.a

1. relies on 2. and I'm currently figuring out how to satisfy that with the ESP-IDF build system.

I'll report back if I can get that working.

Many thanks!

Re: Using opus decoder with ESP-IDF 4.x

Posted: Mon Feb 24, 2020 9:06 pm
by Jakobsen
Hi Dave
I have a working libopus component that I am using in a PoE streaming project running on the WESP32 PoE board.
Let me know if you want a link.

Re: Using opus decoder with ESP-IDF 4.x

Posted: Wed Feb 26, 2020 6:33 am
A link to the project would be fine,
also trying a streaming with the ESP32-POE-ISO (Olimex).

mfg winfried

Re: Using opus decoder with ESP-IDF 4.x

Posted: Sat Mar 14, 2020 11:37 am
by dave_see
Hi Jakobsen,

I would greatly appreciate you posting a link.

Many thanks,

Re: Using opus decoder with ESP-IDF 4.x

Posted: Tue Apr 21, 2020 7:19 pm
by nimbusgb

Is there any follow up on this thread? A link to the project?

I am trying to compile opus onto an ESP32 Wrover but I'm having a rather torrid time.

Having single stepped through most of the encoder I am throwing an exception on a call to a simple routine ( APPLY_Sine_Window_Fix deep within the Silk encoder )

VS_GDB offers no help.

Although I see a few threads on what appear to be succesfull opus implementations I cant get past this weird error.

Re: Using opus decoder with ESP-IDF 4.x

Posted: Wed Apr 22, 2020 10:17 pm
by Jakobsen