From 7534dda3b69026df6dc40b3d907b825a0078617b Mon Sep 17 00:00:00 2001
From: chenlh <2008get@163.com>
Date: 星期四, 21 八月 2025 20:14:01 +0800
Subject: [PATCH] Signed-off-by: chenlh <2008get@163.com>
---
src/f2f.c | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/src/f2f.c b/src/f2f.c
index 332b850..0dcba12 100644
--- a/src/f2f.c
+++ b/src/f2f.c
@@ -1,4 +1,5 @@
#include <string.h>
+#include <math.h>
#include "config.h"
#include "f2f.h"
#include "../drv/sport.h"
@@ -128,8 +129,38 @@
}
}
+
+void in2out_bypass(ufloat* out[], ufloat* in[], int ch, int len)
+{
+ int i, j;
+ for (i = 0; i < ch; i++)
+ for (j = 0; j < len; j++) {
+ out[i][j] = in[i][j];
+ }
+}
+void sin_gen(ufloat* dat, int len)
+{
+ static int sta = 0;
+ for (u32 i = 0; i < len; i++) {
+ dat[i] = 0.4f * sinf(2 * 3.1415926f * 675 * sta++ / SAMPLE_RATE);
+ }
+ if (sta == SAMPLE_RATE)
+ sta = 0;
+}
uvoid UpdateOutput(u32 iid ,u32 blockIndex)
{
+// in2out_bypass(mTxChannel[0], mRxChannel[0], 1, SAMPLE_NUM);
+// static ufloat data[64] = {0};
+// static int odd = 0;
+// if (0 == odd++ % 3) {
+// sin_gen(data, SAMPLE_NUM);
+// for (u32 i = 0; i < SAMPLE_NUM; i++) {
+// for (u32 j = 0; j < 8; j++) {
+// mTxChannel[0][j][i] = data[i];
+// }
+// }
+// }
+
for(s32 type =0 ; type < COUNT ;type ++) {
u16 channel = 0;
u16 output_num = mOutputNum[type];
@@ -138,6 +169,7 @@
for(u32 i =0 ;i < gCodecNum[type] ;i++) {
const AudioCodec* codec = &codec_arr[i];
+
if(codec->rx == utrue) continue;
ubool enable = (iid == codec->follow_intr_no);
@@ -145,8 +177,10 @@
if(codec->enable_sec){
for(u32 j = 0; channel < output_num && j < codec->channel_num*2 ;j ++,channel++) {
- if(enable && pTxChannel[channel] != NULL)
- fixData(dataPtr +OFFSET(j), pTxChannel[channel], codec->slot_num*2, SAMPLE_NUM);
+ if(enable && pTxChannel[channel] != NULL) {
+ s32 shift = OFFSET(j);
+ fixData(dataPtr + shift, pTxChannel[channel], codec->slot_num*2, SAMPLE_NUM);
+ }
}
}
else{
--
Gitblit v1.9.3