Skip to content

Commit

Permalink
Fixed audio on hisi-gen2 as well, user frame depth needed to be confi…
Browse files Browse the repository at this point in the history
…gured
  • Loading branch information
wberube committed Aug 18, 2024
1 parent e0f4aff commit 029c200
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ In spite of these design choices, Divinus boasts numerous features that cater to
|-------------------------|:------------:|:-------------:|:-----------:|:-----------:|:------------------:|
| CV181x[^1] ||||||
| GM813x[^2] | ✔️ | ✔️ | ✔️ | ✔️ ||
| Hi3516AV100[^3] | | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516AV100[^3] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV100[^4] ||||||
| Hi3516CV200[^5] | | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV200[^5] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV300[^6] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV500[^7] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516EV200[^8] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Expand Down
9 changes: 9 additions & 0 deletions src/hal/hisi/v2_aud.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ typedef struct {
char isSysBound;
} v2_aud_efrm;

typedef struct {
unsigned int userFrmDepth;
} v2_aud_para;

typedef struct {
void *handle;

Expand All @@ -61,6 +65,7 @@ typedef struct {

int (*fnDisableChannel)(int device, int channel);
int (*fnEnableChannel)(int device, int channel);
int (*fnSetChannelParam)(int device, int channel, v2_aud_para *param);

int (*fnFreeFrame)(int device, int channel, v2_aud_frm *frame, v2_aud_efrm *encFrame);
int (*fnGetFrame)(int device, int channel, v2_aud_frm *frame, v2_aud_efrm *encFrame, int millis);
Expand Down Expand Up @@ -90,6 +95,10 @@ static int v2_aud_load(v2_aud_impl *aud_lib) {
hal_symbol_load("v2_aud", aud_lib->handle, "HI_MPI_AI_EnableChn")))
return EXIT_FAILURE;

if (!(aud_lib->fnSetChannelParam = (int(*)(int device, int channel, v2_aud_para *param))
hal_symbol_load("v2_aud", aud_lib->handle, "HI_MPI_AI_SetChnParam")))
return EXIT_FAILURE;

if (!(aud_lib->fnFreeFrame = (int(*)(int device, int channel, v2_aud_frm *frame, v2_aud_efrm *encFrame))
hal_symbol_load("v2_aud", aud_lib->handle, "HI_MPI_AI_ReleaseFrame")))
return EXIT_FAILURE;
Expand Down
6 changes: 6 additions & 0 deletions src/hal/hisi/v2_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ int v2_audio_init(int samplerate)
if (ret = v2_aud.fnEnableDevice(_v2_aud_dev))
return ret;

{
v2_aud_para para;
para.userFrmDepth = 30;
if (ret = v2_aud.fnSetChannelParam(_v2_aud_dev, _v2_aud_chn, &para))
return ret;
}
if (ret = v2_aud.fnEnableChannel(_v2_aud_dev, _v2_aud_chn))
return ret;

Expand Down

0 comments on commit 029c200

Please sign in to comment.