Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build the audio_network example? #918

Closed
andresovela opened this issue Jul 24, 2024 · 10 comments
Closed

How to build the audio_network example? #918

andresovela opened this issue Jul 24, 2024 · 10 comments

Comments

@andresovela
Copy link
Contributor

I guess this question is more about how to use the build system.

I ran xmake inside examples/audio_network. I already have the required libs but the build system warns about version mismatches. What's the intended way to manage dependencies using xmake? If I delete all my libs and download the required versions for this example somehow, I'll break other applications that depend on the versions I currently have.

This is the output I get:

Checking build modules
Checking https://www.xmos.com for required libraries
Found version 1.0.0 of lib_src. Download [y/n]? y
Unzip to: /home/andy/dev/projects/xmos/ai_tools/examples/audio_network/./../../.. [y/n]? y
WARNING: Required version of lib_logging is >=2.1.0 and actual version has greater major version: 3.2.0. There could be API incompatibilities.
WARNING: Required version of lib_logging is >=2.0.0 and actual version has greater major version: 3.2.0. There could be API incompatibilities.
WARNING: Required version of lib_mic_array is >=4.6.0 and actual version has greater major version: 5.2.0. There could be API incompatibilities.
WARNING: Required version of lib_xassert is >=3.0.0 and actual version has greater major version: 4.2.0. There could be API incompatibilities.
WARNING: Required version of lib_xassert is >=2.0.0 and actual version has greater major version: 4.2.0. There could be API incompatibilities.
Using build modules: lib_xua(4.1.0) lib_i2c(5.0.0) lib_src(1.0.0) lib_xcore_math(2.2.0) lib_adat(1.2.0) lib_locks(2.2.0) lib_logging(3.2.0) lib_mic_array(5.2.0) lib_spdif(6.1.0) lib_sw_pll(2.2.0) lib_xassert(4.2.0) lib_xud(2.3.2)
Rebuild .build/_iflag.rsp
Analyzing model_audioi16.tflite.cpp
../src/model_audioi16.tflite.cpp:13714:31: warning: Dereferencing a function pointer whose declaration has no fptrgroup. The stack size will not be calculable. [-Wxcore-fptrgroup]
      tflNodes[i].user_data = registrations[used_ops[i]].init(&ctx, (const char*)tflNodes[i].builtin_data, tflNodes[i].custom_initial_data_size);
                              ^
../src/model_audioi16.tflite.cpp:13753:29: warning: Dereferencing a function pointer whose declaration has no fptrgroup. The stack size will not be calculable. [-Wxcore-fptrgroup]
      TfLiteStatus status = registrations[used_ops[i]].prepare(&ctx, &tflNodes[i]);
                            ^
../src/model_audioi16.tflite.cpp:13579:27: warning: Dereferencing a function pointer whose declaration has no fptrgroup. The stack size will not be calculable. [-Wxcore-fptrgroup]
    TfLiteStatus status = registrations[used_ops[i]].invoke(&ctx, &tflNodes[i]);
                          ^
3 warnings generated.
Analyzing support.cpp
Analyzing Util.cpp
Analyzing data_path.c
Analyzing dsp.c
../src/dsp.c:8:10: fatal error: 'src_ff3_fir_coefs.h' file not found
#include "src_ff3_fir_coefs.h"
         ^
1 error generated.
xmake[1]: *** [.build/src/dsp.c.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2

I'll appreciate any guidance here :)

@henkmuller
Copy link
Contributor

Hi Andres,

The version mismatches should mostly be ok; the one exception is the file it downloaded.
We're in the process of making the download grab the latest version of GitHub, instead xmake found a really old version on-line!

Remove lib_src and clone GitHub.com/xmos/lib_src in its place.

xmake clean && xmake

and it ought to compile.

The xmake clean is normally not necessary, but replacing a whole library underneath it may confuse the dependencies slightly.

@andresovela
Copy link
Contributor Author

Thanks, that did get me farther but it failed with this:

Creating audio_network.xe
model_audioi16.tflite.cpp: Warning: Undefined reference to '_ZN6tflite3ops5micro5xcore18Register_XC_pad_v2Ev'
model_audioi16.tflite.cpp: Error: Undefined reference to '_ZN6tflite3ops5micro5xcore18Register_XC_pad_v2Ev'
xmake[1]: *** [bin//audio_network.xe] Error 1
xmake: *** [bin//audio_network.xe] Error 2

@henkmuller
Copy link
Contributor

model_audioi16.tflite.cpp is probably generated with an old version of xcore-opt than the latest; I probably shouldn't have checked it in

@andresovela
Copy link
Contributor Author

I tried to regenerate the cpp with xcore-opt v1.2.0 (latest?), and it fails with this error:

xcore-opt model_audioi16.tflite -o model_audioi16.tflite
model_audioi16.tflite:0:0: warning: loc("4X"("model_audioi16.tflite":0:0)) : Quadratic approximation error of 17 larger than set threshold of 1, therefore reverting to reference op!
Inspect the output, and if suitable, set a higher threshold with --xcore-quadratic-lookup-error.

Failed to get registration from op code CUSTOM

AllocateTensors() failed
<unknown>:0: error: Could not set up compile

@panickal-xmos
Copy link
Collaborator

Hi @andresovela, that's the optimized model. That is probably out-of-date now. denoise_16x8.tflite is the source model. Could you please try with that one?

@andresovela
Copy link
Contributor Author

Ah I see. I was able to build the example but now I don't really know what it's supposed to do. I ran xrun --xscope bin/audio_network.xe and don't see any output (not sure if there should be or not). I also don't see the evk as an available sound card on my PC.

@panickal-xmos
Copy link
Collaborator

This model was prepared to be used in an example app as a CES demo. Let me try to find more information.

@henkmuller
Copy link
Contributor

I think you may have the evaluation kit https://www.xmos.com/xk-evk-xu316 ? The software is designed to run on the multi-channel audio board; the same chip but different audio hardware https://www.xmos.com/xk-audio-316-mc-ab

@andresovela
Copy link
Contributor Author

Ah okay, yes, I have the XK-EVK-XU316

@andresovela
Copy link
Contributor Author

I'll close this issue since I don't have the right EVK to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants