Skip to main content
LR.2
Associate III
January 19, 2024
Solved

Opus codec with STM32WB5MMGHTR

  • January 19, 2024
  • 4 replies
  • 7221 views

Hi,
I have been trying to add opus codec in my project. But I cannot able to build after adding the opus file. If anyone successfully added opus with their project help me out. I mostly get errors on 'Neon' which is used for FFT. As I searched neon is for cortex A, but the STM32WB5MMGHTR is cortex M based. I'm also adding my config file code for opus here

 

#ifndef CONFIG_H
#define CONFIG_H

/* Variable leng arays */
#define VAR_ARRAYS

/* Comment out the next line for floating-point code */
#define FIXED_POINT 1 

#define OPUS_BUILD 1


#endif /* CONFIG_H */

 

Help me to add opus library with my project.

Best answer by LR.2

Hi,
I integrated opus in my project.
Things I did:
1. I opened example project which present inside the "X-CUBE-OPUS.zip" and explored what are the files included from the opus library. To check this I read ".cproject" and ".project" from the example file, then I added those files in my project.
2. After that I checked the compiler options from the project build settings and I made changes in my project compiler options with that.
3. Also, I checked build output for "fpu" based compiler options and set in my project. Opus needs "-mfpu=fpv4-sp-d16" "-mfloat-abi=hard" options to get compiled. (Before adding this option verify your controller has support for FPU).

After all the above changes in my code I got compiled successfully.

Thanks and regards,

Laksh

4 replies

Graduate
January 22, 2024

Hi,

I'm having the same problem. Did you find a solution?

LR.2
LR.2Author
Associate III
January 23, 2024

Hi Cavitcem,

No I couldn't find any solution. May I know what kind of error you are facing exactly. 

Thanks & regards

Graduate
January 23, 2024

Hi LR.2,

My error outputs are like this but I couldn't find a solution.

Thanks & Regards

 

error.PNG

Technical Moderator
January 23, 2024

Hello @Cavitcem @LR.2 

Thank you for having reported this.

I escalated this issue for fix in the internal ticket number 171448.

(PS: Internal ticket number 171448 is not accessible or usable by customers).

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Graduate
January 25, 2024

Hello @Imen.D 

Is there any progress on this issue?

Thanks & Regards

Technical Moderator
January 31, 2024

Hello All, 

It looks like there is a missing file (.pdsc file =Pack Description Format) in the he folder "X-CUBE-OPUS.zip.

Our team are working to resolve the issue.

Thank you for your feedback and sorry for the inconvenience.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
LR.2
LR.2Author
Associate III
February 1, 2024

Hi Imen.D,

Thanks for the update. If possible can you share the "X-CUBE-OPUS.zip" when the issue got resolved.

Thanks & Regards,
Laksh

LR.2
LR.2AuthorBest answer
Associate III
February 8, 2024

Hi,
I integrated opus in my project.
Things I did:
1. I opened example project which present inside the "X-CUBE-OPUS.zip" and explored what are the files included from the opus library. To check this I read ".cproject" and ".project" from the example file, then I added those files in my project.
2. After that I checked the compiler options from the project build settings and I made changes in my project compiler options with that.
3. Also, I checked build output for "fpu" based compiler options and set in my project. Opus needs "-mfpu=fpv4-sp-d16" "-mfloat-abi=hard" options to get compiled. (Before adding this option verify your controller has support for FPU).

After all the above changes in my code I got compiled successfully.

Thanks and regards,

Laksh

Graduate
February 9, 2024

Hi Laksh,

I am getting similar errors. Can you add the ".cproject" and ".project" files of your project here so I can compare?

Thanks & Regards

LR.2
LR.2Author
Associate III
February 12, 2024

Hi Cavitcem,

I'm not using "STM32CubeIDE" I'm using "Visual Studio Code" for my project and I'm using CMake to link the files and Ninja for build.  Anyway I'll share the example .cproject and .project from "X-CUBE-OPUS.zip".
Also, I have added the Opus folder structure and files that I have included in my project.

//Opus Folder
.
├── celt
│ ├── arch.h
│ ├── arm
│ │ ├── armcpu.h
│ │ ├── armopts.s.in
│ │ ├── fft_arm.h
│ │ ├── fixed_arm64.h
│ │ ├── fixed_armv4.h
│ │ ├── fixed_armv5e.h
│ │ ├── kiss_fft_armv4.h
│ │ ├── kiss_fft_armv5e.h
│ │ ├── mdct_arm.h
│ │ └── pitch_arm.h
│ ├── bands.c
│ ├── bands.h
│ ├── celt.c
│ ├── celt_decoder.c
│ ├── celt_encoder.c
│ ├── celt.h
│ ├── celt_lpc.c
│ ├── celt_lpc.h
│ ├── cpu_support.h
│ ├── cwrs.c
│ ├── cwrs.h
│ ├── ecintrin.h
│ ├── entcode.c
│ ├── entcode.h
│ ├── entdec.c
│ ├── entdec.h
│ ├── entenc.c
│ ├── entenc.h
│ ├── fixed_debug.h
│ ├── fixed_generic.h
│ ├── float_cast.h
│ ├── kiss_fft.c
│ ├── _kiss_fft_guts.h
│ ├── kiss_fft.h
│ ├── laplace.c
│ ├── laplace.h
│ ├── mathops.c
│ ├── mathops.h
│ ├── mdct.c
│ ├── mdct.h
│ ├── mfrngcod.h
│ ├── modes.c
│ ├── modes.h
│ ├── os_support.h
│ ├── pitch.c
│ ├── pitch.h
│ ├── quant_bands.c
│ ├── quant_bands.h
│ ├── rate.c
│ ├── rate.h
│ ├── stack_alloc.h
│ ├── static_modes_fixed_arm_ne10.h
│ ├── static_modes_fixed.h
│ ├── static_modes_float_arm_ne10.h
│ ├── static_modes_float.h
│ ├── vq.c
│ └── vq.h
├── CMakeLists.txt
├── Inc
│ ├── opus_custom.h
│ ├── opus_defines.h
│ ├── opus.h
│ ├── opus_multistream.h
│ ├── opus_projection.h
│ └── opus_types.h
├── silk
│ ├── A2NLSF.c
│ ├── ana_filt_bank_1.c
│ ├── API.h
│ ├── arm
│ │ ├── biquad_alt_arm.h
│ │ ├── LPC_inv_pred_gain_arm.h
│ │ ├── macros_arm64.h
│ │ ├── macros_armv4.h
│ │ ├── macros_armv5e.h
│ │ ├── NSQ_del_dec_arm.h
│ │ ├── NSQ_neon.h
│ │ ├── SigProc_FIX_armv4.h
│ │ └── SigProc_FIX_armv5e.h
│ ├── biquad_alt.c
│ ├── bwexpander_32.c
│ ├── bwexpander.c
│ ├── check_control_input.c
│ ├── CNG.c
│ ├── code_signs.c
│ ├── control_audio_bandwidth.c
│ ├── control_codec.c
│ ├── control.h
│ ├── control_SNR.c
│ ├── debug.c
│ ├── debug.h
│ ├── dec_API.c
│ ├── decode_core.c
│ ├── decode_frame.c
│ ├── decode_indices.c
│ ├── decode_parameters.c
│ ├── decode_pitch.c
│ ├── decode_pulses.c
│ ├── decoder_set_fs.c
│ ├── define.h
│ ├── enc_API.c
│ ├── encode_indices.c
│ ├── encode_pulses.c
│ ├── errors.h
│ ├── fixed
│ │ ├── apply_sine_window_FIX.c
│ │ ├── arm
│ │ │ └── warped_autocorrelation_FIX_arm.h
│ │ ├── autocorr_FIX.c
│ │ ├── burg_modified_FIX.c
│ │ ├── corrMatrix_FIX.c
│ │ ├── encode_frame_FIX.c
│ │ ├── find_LPC_FIX.c
│ │ ├── find_LTP_FIX.c
│ │ ├── find_pitch_lags_FIX.c
│ │ ├── find_pred_coefs_FIX.c
│ │ ├── k2a_FIX.c
│ │ ├── k2a_Q16_FIX.c
│ │ ├── LTP_analysis_filter_FIX.c
│ │ ├── LTP_scale_ctrl_FIX.c
│ │ ├── main_FIX.h
│ │ ├── noise_shape_analysis_FIX.c
│ │ ├── pitch_analysis_core_FIX.c
│ │ ├── process_gains_FIX.c
│ │ ├── regularize_correlations_FIX.c
│ │ ├── residual_energy16_FIX.c
│ │ ├── residual_energy_FIX.c
│ │ ├── schur64_FIX.c
│ │ ├── schur_FIX.c
│ │ ├── structs_FIX.h
│ │ ├── vector_ops_FIX.c
│ │ └── warped_autocorrelation_FIX.c
│ ├── gain_quant.c
│ ├── HP_variable_cutoff.c
│ ├── init_decoder.c
│ ├── init_encoder.c
│ ├── Inlines.h
│ ├── inner_prod_aligned.c
│ ├── interpolate.c
│ ├── lin2log.c
│ ├── log2lin.c
│ ├── LPC_analysis_filter.c
│ ├── LPC_fit.c
│ ├── LPC_inv_pred_gain.c
│ ├── LP_variable_cutoff.c
│ ├── MacroCount.h
│ ├── MacroDebug.h
│ ├── macros.h
│ ├── main.h
│ ├── NLSF2A.c
│ ├── NLSF_decode.c
│ ├── NLSF_del_dec_quant.c
│ ├── NLSF_encode.c
│ ├── NLSF_stabilize.c
│ ├── NLSF_unpack.c
│ ├── NLSF_VQ.c
│ ├── NLSF_VQ_weights_laroia.c
│ ├── NSQ.c
│ ├── NSQ_del_dec.c
│ ├── NSQ.h
│ ├── pitch_est_defines.h
│ ├── pitch_est_tables.c
│ ├── PLC.c
│ ├── PLC.h
│ ├── process_NLSFs.c
│ ├── quant_LTP_gains.c
│ ├── resampler.c
│ ├── resampler_down2_3.c
│ ├── resampler_down2.c
│ ├── resampler_private_AR2.c
│ ├── resampler_private_down_FIR.c
│ ├── resampler_private.h
│ ├── resampler_private_IIR_FIR.c
│ ├── resampler_private_up2_HQ.c
│ ├── resampler_rom.c
│ ├── resampler_rom.h
│ ├── resampler_structs.h
│ ├── shell_coder.c
│ ├── sigm_Q15.c
│ ├── SigProc_FIX.h
│ ├── sort.c
│ ├── stereo_decode_pred.c
│ ├── stereo_encode_pred.c
│ ├── stereo_find_predictor.c
│ ├── stereo_LR_to_MS.c
│ ├── stereo_MS_to_LR.c
│ ├── stereo_quant_pred.c
│ ├── structs.h
│ ├── sum_sqr_shift.c
│ ├── table_LSF_cos.c
│ ├── tables_gain.c
│ ├── tables.h
│ ├── tables_LTP.c
│ ├── tables_NLSF_CB_NB_MB.c
│ ├── tables_NLSF_CB_WB.c
│ ├── tables_other.c
│ ├── tables_pitch_lag.c
│ ├── tables_pulses_per_block.c
│ ├── tuning_parameters.h
│ ├── typedef.h
│ ├── VAD.c
│ └── VQ_WMat_EC.c
└── src
 ├── analysis.c
 ├── analysis.h
 ├── mapping_matrix.h
 ├── mlp.c
 ├── mlp_data.c
 ├── mlp.h
 ├── opus.c
 ├── opus_decoder.c
 ├── opus_encoder.c
 ├── opus_multistream.c
 ├── opus_multistream_decoder.c
 ├── opus_multistream_encoder.c
 ├── opus_private.h
 ├── repacketizer.c
 └── tansig_table.h

8 directories, 213 files

Thanks and Regards,
Laksh