Skip to content

Commit

Permalink
(Continued)
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Jun 19, 2024
1 parent 06ac514 commit 09e765e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
9 changes: 4 additions & 5 deletions src/hal/hisi/v3_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ int v3_audio_init(void)
config.intf = V3_AUD_INTF_I2S_SLAVE;
config.stereoOn = 0;
config.expandOn = 0;
config.frmNum = 40;
config.packNumPerFrm = 640;
config.frmNum = 0;
config.packNumPerFrm = config.rate / 16;
config.chnNum = 1;
config.syncRxClkOn = 0;
if (ret = v3_aud.fnSetDeviceConfig(_v3_aud_dev, &config))
Expand All @@ -105,11 +105,10 @@ void *v3_audio_thread(void)

v3_aud_frm frame;
v3_aud_efrm echoFrame;
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

while (keepRunning) {
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

if (ret = v3_aud.fnGetFrame(_v3_aud_dev, _v3_aud_chn,
&frame, &echoFrame, 100)) {
fprintf(stderr, "[v3_aud] Getting the frame failed "
Expand Down
9 changes: 4 additions & 5 deletions src/hal/hisi/v4_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ int v4_audio_init(void)
config.intf = V4_AUD_INTF_I2S_SLAVE;
config.stereoOn = 0;
config.expandOn = 0;
config.frmNum = 40;
config.packNumPerFrm = 640;
config.frmNum = 0;
config.packNumPerFrm = config.rate / 16;
config.chnNum = 1;
config.syncRxClkOn = 0;
if (ret = v4_aud.fnSetDeviceConfig(_v4_aud_dev, &config))
Expand All @@ -106,11 +106,10 @@ void *v4_audio_thread(void)

v4_aud_frm frame;
v4_aud_efrm echoFrame;
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

while (keepRunning) {
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

if (ret = v4_aud.fnGetFrame(_v4_aud_dev, _v4_aud_chn,
&frame, &echoFrame, 100)) {
fprintf(stderr, "[v4_aud] Getting the frame failed "
Expand Down
13 changes: 6 additions & 7 deletions src/hal/star/i6_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ int i6_audio_init(void)
config.bit24On = 0;
config.intf = I6_AUD_INTF_I2S_SLAVE;
config.sound = I6_AUD_SND_MONO;
config.frmNum = 40;
config.packNumPerFrm = 640;
config.codecChnNum = 1;
config.frmNum = 0;
config.packNumPerFrm = config.rate / 16;
config.codecChnNum = 0;
config.chnNum = 1;
config.i2s.leftJustOn = 0;
config.i2s.clock = I6_AUD_CLK_OFF;
config.i2s.syncRxClkOn = 1;
config.i2s.tdmSlotNum = 1;
config.i2s.tdmSlotNum = 0;
config.i2s.bit24On = 0;
if (ret = i6_aud.fnSetDeviceConfig(_i6_aud_dev, &config))
return ret;
Expand All @@ -110,11 +110,10 @@ void *i6_audio_thread(void)

i6_aud_frm frame;
i6_aud_efrm echoFrame;
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

while (keepRunning) {
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

if (ret = i6_aud.fnGetFrame(_i6_aud_dev, _i6_aud_chn,
&frame, &echoFrame, 100)) {
fprintf(stderr, "[i6_aud] Getting the frame failed "
Expand Down
7 changes: 3 additions & 4 deletions src/hal/star/i6c_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int i6c_audio_init(void)
config.rate = 48000;
config.clock = I6C_AUD_CLK_OFF;
config.syncRxClkOn = 1;
config.tdmSlotNum = 1;
config.tdmSlotNum = 0;
if (ret = i6c_aud.fnSetI2SConfig(input[0], &config))
return ret;
if (ret = i6c_aud.fnAttachToDevice(_i6c_aud_dev, input, 1))
Expand All @@ -121,11 +121,10 @@ void *i6c_audio_thread(void)
int ret;

i6c_aud_frm frame, echoFrame;
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

while (keepRunning) {
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

if (ret = i6c_aud.fnGetFrame(_i6c_aud_dev, _i6c_aud_chn,
&frame, &echoFrame, 100)) {
fprintf(stderr, "[i6c_aud] Getting the frame failed "
Expand Down
13 changes: 6 additions & 7 deletions src/hal/star/i6f_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ int i6f_audio_init(void)
config.bit = I6F_AUD_BIT_16;
config.intf = I6F_AUD_INTF_I2S_SLAVE;
config.sound = I6F_AUD_SND_MONO;
config.frmNum = 40;
config.packNumPerFrm = 640;
config.codecChnNum = 1;
config.frmNum = 0;
config.packNumPerFrm = config.rate / 16;
config.codecChnNum = 0;
config.chnNum = 1;
config.i2s.clock = I6F_AUD_CLK_OFF;
config.i2s.leftJustOn = 0;
config.i2s.syncRxClkOn = 1;
config.i2s.tdmSlotNum = 1;
config.i2s.tdmSlotNum = 0;
config.i2s.bit = I6F_AUD_BIT_32;
if (ret = i6f_aud.fnSetDeviceConfig(_i6f_aud_dev, &config))
return ret;
Expand All @@ -113,11 +113,10 @@ void *i6f_audio_thread(void)

i6f_aud_frm frame;
i6f_aud_efrm echoFrame;
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

while (keepRunning) {
memset(&frame, 0, sizeof(frame));
memset(&echoFrame, 0, sizeof(echoFrame));

if (ret = i6f_aud.fnGetFrame(_i6f_aud_dev, _i6f_aud_chn,
&frame, &echoFrame, 100)) {
fprintf(stderr, "[i6f_aud] Getting the frame failed "
Expand Down

0 comments on commit 09e765e

Please sign in to comment.