Skip to content

Commit

Permalink
os/arch/arm/src/amebasmart: increase I2S dma page to 8 to increase to…
Browse files Browse the repository at this point in the history
…lerate of delays

1. there are delays between I2S DMA interrupt caused by other higher priority threads/flash operation, which if exceed the time taken to finish tx all data from dma pages will result in noise
2. with 4K size * 4 page, maximum delays it can tolerate will be ~85.33 ms, delays exceeding this will introduce noise.
3. this commit increases the page from 4 to 8, thus increases the maximum delays it can tolerate to ~170ms.
  • Loading branch information
zhongnuo-tang committed Jan 8, 2025
1 parent 374dfef commit 9847c79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion os/arch/arm/src/amebasmart/amebasmart_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#define OVER_SAMPLE_RATE (384U)

#define I2S_DMA_PAGE_SIZE 4096 /* 4 ~ 16384, set to a factor of APB size */
#define I2S_DMA_PAGE_NUM 4 /* Vaild number is 2~4 */
#define I2S_DMA_PAGE_NUM 8 /* Vaild number is 2~8 */

#ifdef CONFIG_PM
static volatile bool i2s_lock_state = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "ameba_audio_clock.h"
#include "amebasmart_i2s.h"

#define SP_MAX_DMA_PAGE_NUM 8
#define SP_MAX_DMA_PAGE_NUM 9

/** @addtogroup Ameba_Mbed_API
* @{
Expand Down

0 comments on commit 9847c79

Please sign in to comment.