Skip to main content
Associate III
April 16, 2024
Solved

Failed to execute multiple wave files

  • April 16, 2024
  • 2 replies
  • 2720 views

Hi Community ,

We are working on AVAS project Autodevkit AEK-AUD-C1D9031 and trying to execute two wave files for two different channels.

But only one wave file is getting executed which is getStartWavFile(0) when tried to give non zero parameter ,wave sound is not coming e.g. getStartWavFile(1).

Below is the snippet base code and modified code to access both wave files:

1.Two wave files added inside source -->audio files 

2. Two wave files location has been added inside sounddb.s 

 

Aishwaryaum_0-1713269566074.png

 

Best answer by Max VIZZINI

Hi,

In the previous post I have provided a complete code taken from AutoDevKit Studio sample library.

It has 2 tasks and delay. Try it first and then try to understand the difference with your code.

Best Regards,

AutoDevKit Team

2 replies

Tesla DeLorean
Guru
April 16, 2024

Check beginning and end off data the code uses.

Check data is valid

Perhaps make two instances of the data known to work.

Check it gets to your code and not blocked by the run once code.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Max VIZZINI
Technical Moderator
April 16, 2024

Hi,

You only have to channel in the solution (stereo) left and right.

The sample are sent in couple left,right therefore you do not need to load 2 files but to change the data file and encode the two channels: first sample goes left, second goes right, third goes left, forth goes right, etc.

Considering the limited internal flash space, you cannot load more than 1-2 sec wav file in total encoded on 32 bits.

Last thing to check is the volume you are using.

Best Regards,

AutoDevKit Team

 

 

Associate III
April 22, 2024

Hi Max VIZZINI,

Thank you for your prompt and informative response to my previous inquiries posted in the community. Now, the source code is working fine for two channels with two different wave files.

Now I am facing one more issue, I took FreeRtos example(as shown in the snippet) as the base source code and integrated AEK-AUD-D903V1 RLA component. After integration, "AEK_903D_Init(AEK_AUD_D903V1_DEV0)" API is not getting initialized. The execution is getting stucked inside this API.

Can you please help me to come out of this issue, so that I can integrate FreeRtos and amplifiers together.

Aishwaryaum_0-1713764287612.png

 

Max VIZZINI
Technical Moderator
April 22, 2024

Hi,

As I have already stated, the code has NOT be written from freeRTOS therefore it requires modification.

In particular all osalThreadDelay() are not working under freeRTOS. They have to be substituted with:

 

vTaskDelay () specifies a wake time relative to the time at which the function is called

OR

vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to unblock

 

Example code:

TickType_t xLastWakeTime = xTaskGetTickCount();

vTaskDelayUntil( &xLastWakeTime, 200 );

where 200 are in milliseconds.

 

Best Regards,

AutoDevKit Team