Giter VIP home page Giter VIP logo

audiomark's People

Contributors

fabklein avatar joseph-yiu avatar kaipingli88 avatar llefaucheur avatar petertorelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

audiomark's Issues

Document memory allocation scheme

It appears there are four places the system integrator needs to be aware of when managing memory.

  1. The intermediate buffers declared at the start of ee_audiomark.c:35-42
  2. The Hanning and rotation arrays in ee_abf_f32.c:32-33
  3. The neural net scratch buffer and layer coefficients in th_api.c:210-239
  4. The requests made to th_malloc by the component's NODE_MEMREQ, indicated by an enumeration constant. See th_api.c:th_malloc.

I believe the intent is to use NODE_MEMREQ for fast working memory, and then allow the integrator to partition up the remaining as needed. Not quite clear on this myself, but it should be documented in the user guide.

Are the provided three input audio files sufficient?

The three input audio files contain a left, right, and noise. These files each contain 27008 int16_t samples.

Questions:

  1. Why 27008 samples and not 16000, one second?
  2. Do the audio samples contain one of the known keywords* in English? Laurent suggested in an email that they were french? :)
  3. Is there anything special that needs to be added? Laurent mentioned adding since wave noise?

* Keywords:
yes
no
up
down
left
right
on
off
stop
go

How do we properly use the NODE_MEMREQ interface?

All modules need some scratch memory, global (shared) memory. What is the "correct" way to create this memory (esp. if it shared). The memory may be moving through DMA or FIFO in an accelerator and not a slice of shared SRAM. Should there be a th_<NODE>_memreq function that the developer may edit in order to properly set their XDAIS pointers? How much flexibility is too much (is there even a thing as "too much").

Speexdsp component is set in fixed-point not agree with the top level API

The speexdsp component supports both floating-point and fixed-point implementations. It is set to fixed-point but the top level API is for floating-point (f32) implementation with fixed-point audio inputs. In the speexdsp component, change to floating-point by modify config.h file as shown below. It compiles but it does not run properly.
/* Compile as fixed-point */
//#define FIXED_POINT 1

/* Compile as floating-point */
#define FLOATING_POINT /**//

Why do we have so many FFT APIs?

Almost every block uses an FFT. The adaptive beamformer and KWS.mfcc use Arm CMSIS/DSP directly, and all of the libspeexdsp code uses the Xiph API. This means we are asking a developer to address two different port layers for the same code.

It would help the user and make the porting easier if there was just one API/port layer.

Move reference th_api.c to it's own area; change CMake files

Currently the Arm implementation code is mixed in with the benchmark source code.

Historically the porting layer is isolated from the main source and put in an explicit porting-layer directory, along with a "bare bones" file that contains the unimplemented function calls.

Move this code (and libs), create the barebones directory & files, and correct the cmake files to expect a PORT_DIR name, just like CoreMark.

Crash when run using MS Visual Studio

There is cmake file so I tried to build and run the project. To build on MS Visual Studio, I have to comment out line 13 and 14 in CMakeLists.txt file. When I run the test, it crashed. The error message is "File: minkernel\crts\ucrt\src\appcrt\stdio\fread.cpp Line:48 Expression: stream != nullptr"". I tried to insert screenshot of the crash below but not sure if it works.
image

Add valgrind/callgrind/(sp)lint static checking

I noticed a few cases with reused buffers (and found an out of bounds check) with valgrind. This is a reminder to perform static checking before releasing (esp. with strict typecasting, e.g. gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion). Also: is coverity free? (https://scan.coverity.com/)

Understand if we should be using `restricted` on our function calls

Synopsys asked to review if we are effectively using restricted, as their compiler makes good use of it. This has largely been ignored, other than to fix CMSIS compilation warnings. However, should we consider it four our custom nodes? And should it be a macro, like in CMSIS?

MISRA 2012 compliance

For fun I ran the code through a MISRA linter. How much do we care about being MISRA compliant?

Incorrect restrict qualifiers on th_memmove

th_memmove is used with overlapping source and destination, as you'd expect, but it has restrict qualifiers on its pointers, leading to undefined behaviour.

This prompts Arm Compiler 6 to use __aeabi_memcpy for the memmove inside the default implementation, rather than __aeabi_memmove.

No allocator present; assigns inaccessible memory

Out-of-the-box it forces memory pointers to spxGlobalHeapPtr, which is an arbitrary value in segfault range (45000).

Restoring os_support.h to the original Xiph library enables the speex_alloc to use library functions. However, the node _NODE_MEMREQ functions still force the pointers to inaccessible memory.

There is no facility to provide a local heap, as spxGlobalHeapPtr is constantly reassigned (at appears to be a "no-free" type allocation). So even if it is assigned by main.c via a calloc(), it is still overwritten.

What is the intention here?

What is the correct license header for the source files?

We have a mix of code from Laurent (arm), Kaiping (infineon), Arm repositories, CMSIS reference, etc. Most is Apache 2.0.

I think we can replace all the Apache 2.0 licenses with the EEMBC license as long as the copyright is preserved from the previous writers. E.g., the license changes, but the copyright must remain in the new header. Not sure how to do this correctly.

There are too many `#define` macros.

Almost every component has a set of #define macros that indicate the size of datatypes and arrays, many of which are fixed by the benchmark, and redundant.

These should be reduced and renamed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.