Using opus decoder with ESP-IDF 4.x

dave_see
Posts: 11
Joined: Wed Jan 08, 2020 6:02 pm

Using opus decoder with ESP-IDF 4.x

Postby dave_see » Fri Feb 21, 2020 4:42 pm

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:
https://github.com/espressif/esp-adf-li ... esp-opus.a

I also noticed that the ESP-IDF 4.x documents describe how to use a static library here:
https://docs.espressif.com/projects/esp ... components

I tried following the prebuilt example from here:
https://github.com/espressif/esp-idf/tr ... 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 https://github.com/xiph/opus

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,
Dave

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

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

Postby ESP_Dazz » Sun Feb 23, 2020 10:17 pm

Might be a stack overflow. See if increasing the stack size of moondog_rtp_mcast_task_function() resolves the issue.

dave_see
Posts: 11
Joined: Wed Jan 08, 2020 6:02 pm

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

Postby dave_see » Mon Feb 24, 2020 6:44 pm

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. https://github.com/espressif/esp-adf-li ... esp-opus.a
2. https://github.com/espressif/esp-adf-li ... 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!

User avatar
Jakobsen
Posts: 89
Joined: Mon Jan 16, 2017 8:12 am

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

Postby Jakobsen » Mon Feb 24, 2020 9:06 pm

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.
/J
Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then

ritsch@algo.mur.at
Posts: 9
Joined: Tue Feb 25, 2020 4:57 pm

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

Postby ritsch@algo.mur.at » 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

dave_see
Posts: 11
Joined: Wed Jan 08, 2020 6:02 pm

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

Postby dave_see » Sat Mar 14, 2020 11:37 am

Hi Jakobsen,

I would greatly appreciate you posting a link.

Many thanks,
Dave

nimbusgb
Posts: 9
Joined: Wed Dec 20, 2017 6:18 am

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

Postby nimbusgb » Tue Apr 21, 2020 7:19 pm

Hi

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.

User avatar
Jakobsen
Posts: 89
Joined: Mon Jan 16, 2017 8:12 am

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

Postby Jakobsen » Wed Apr 22, 2020 10:17 pm

Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then

Who is online

Users browsing this forum: Bing [Bot] and 120 guests