| | |
| | | <inputType id="assembler.input.1304626576" name="Assembler Source" superClass="assembler.input"/> |
| | | </tool> |
| | | <tool id="sharc.toolchain.compiler.913943905" name="CrossCore SHARC C/C++ Compiler" superClass="sharc.toolchain.compiler"> |
| | | <option id="compiler.option.optimization.556394403" name="Enable optimization (-O)" superClass="compiler.option.optimization" useByScannerDiscovery="false"/> |
| | | <option id="compiler.option.debugcode.900335004" name="Generate debug information (-g)" superClass="compiler.option.debugcode" useByScannerDiscovery="false"/> |
| | | <option id="compiler.option.optimization.556394403" name="Enable optimization (-O)" superClass="compiler.option.optimization" useByScannerDiscovery="false" value="false" valueType="boolean"/> |
| | | <option id="compiler.option.debugcode.900335004" name="Generate debug information (-g)" superClass="compiler.option.debugcode" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <option id="compiler.option.proc.775463007" name="-proc" superClass="compiler.option.proc" useByScannerDiscovery="false" value=" ADSP-21569" valueType="string"/> |
| | | <option id="compiler.option.sirevision.375383135" name="-si-revision" superClass="compiler.option.sirevision" useByScannerDiscovery="false" value=" 0.0" valueType="string"/> |
| | | <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="compiler.option.preprocessdefs.200157960" name="Preprocessor definitions (-D):" superClass="compiler.option.preprocessdefs" useByScannerDiscovery="false" valueType="definedSymbols"> |
| | |
| | | </option> |
| | | <option id="compiler.option.compilerswitch.182237227" name="Compiler Switch" superClass="compiler.option.compilerswitch" useByScannerDiscovery="false" value="false" valueType="boolean"/> |
| | | <option id="compiler.option.cpp11.976576354" name="Compile C++ source files with C++11 feature extensions (-c++11)" superClass="compiler.option.cpp11" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <option id="compiler.option.interprocdoptim.1504058608" name="Interprocedural optimization (-ipa)" superClass="compiler.option.interprocdoptim" useByScannerDiscovery="false" value="false" valueType="boolean"/> |
| | | <inputType id="compiler.inputType.1651873364" name="C/C++ Source" superClass="compiler.inputType"/> |
| | | </tool> |
| | | <tool id="sharc.toolchain.linker.1433934460" name="CrossCore SHARC Linker" superClass="sharc.toolchain.linker"> |
| | |
| | | <tool id="sharc.toolchain.loader.1387296196" name="CrossCore SHARC Loader" superClass="sharc.toolchain.loader"> |
| | | <option id="loader.option.proc.1054273039" name="-proc" superClass="loader.option.proc" useByScannerDiscovery="false" value=" ADSP-21569" valueType="string"/> |
| | | <option id="loader.option.sirevision.439317339" name="-si-revision" superClass="loader.option.sirevision" useByScannerDiscovery="false" value=" 0.0" valueType="string"/> |
| | | <option id="sharc.loader.option.kernelfile.696987039" name="Kernel file (-l)" superClass="sharc.loader.option.kernelfile" useByScannerDiscovery="false" value="C:\Analog Devices\CrossCore Embedded Studio 2.11.0\SHARC\ldr\null.dxe" valueType="string"/> |
| | | <option id="sharc.loader.option.enumerated.bootmode.568320891" superClass="sharc.loader.option.enumerated.bootmode" useByScannerDiscovery="false" value="sharc.loader.option.boot.enumerated.spislave" valueType="enumerated"/> |
| | | <option id="sharc.loader.option.enumerated.bootformat.1189547824" superClass="sharc.loader.option.enumerated.bootformat" useByScannerDiscovery="false" value="sharc.loader.option.format.enumerated.binary" valueType="enumerated"/> |
| | | <option id="sharc.loader.option.initfile.1249896984" superClass="sharc.loader.option.initfile" useByScannerDiscovery="false" value="C:\Analog Devices\CrossCore Embedded Studio 2.11.0\SHARC\ldr\ezkit21569_initcode.dxe" valueType="string"/> |
| | | <option id="sharc.loader.option.kernelfile.696987039" name="Kernel file (-l)" superClass="sharc.loader.option.kernelfile" useByScannerDiscovery="false" value="D:\Program Files\Analog Devices\CrossCore Embedded Studio 2.12.1\SHARC\ldr\null.dxe" valueType="string"/> |
| | | <option id="sharc.loader.option.enumerated.bootmode.568320891" name="Boot mode (-b)" superClass="sharc.loader.option.enumerated.bootmode" useByScannerDiscovery="false" value="sharc.loader.option.boot.enumerated.spislave" valueType="enumerated"/> |
| | | <option id="sharc.loader.option.enumerated.bootformat.1189547824" name="Boot format (-f)" superClass="sharc.loader.option.enumerated.bootformat" useByScannerDiscovery="false" value="sharc.loader.option.format.enumerated.binary" valueType="enumerated"/> |
| | | <option id="sharc.loader.option.initfile.1249896984" name="Initialization file (-init)" superClass="sharc.loader.option.initfile" useByScannerDiscovery="false" value="D:\Program Files\Analog Devices\CrossCore Embedded Studio 2.12.1\SHARC\ldr\ezkit21569_initcode.dxe" valueType="string"/> |
| | | </tool> |
| | | <tool id="sharc.toolchain.deviceprogrammer.185366862" name="CrossCore SHARC Device Programmer" superClass="sharc.toolchain.deviceprogrammer"> |
| | | <option id="deviceprogrammer.option.proc.1944618241" name="-proc" superClass="deviceprogrammer.option.proc" useByScannerDiscovery="false" value=" ADSP-21569" valueType="string"/> |
| | | <option id="deviceprogrammer.option.enumerated.fileformat.170825008" superClass="deviceprogrammer.option.enumerated.fileformat" useByScannerDiscovery="false" value="deviceprogrammer.option.format.enumerated.binary" valueType="enumerated"/> |
| | | <option id="deviceprogrammer.option.enumerated.fileformat.170825008" name="File format" superClass="deviceprogrammer.option.enumerated.fileformat" useByScannerDiscovery="false" value="deviceprogrammer.option.format.enumerated.binary" valueType="enumerated"/> |
| | | </tool> |
| | | </toolChain> |
| | | </folderInfo> |
| | |
| | | <tool id="sharc.toolchain.deviceprogrammer.630556623" name="CrossCore SHARC Device Programmer" superClass="sharc.toolchain.deviceprogrammer.185366862"/> |
| | | </toolChain> |
| | | </folderInfo> |
| | | <fileInfo id="sharc.toolchain.configuration.debug.986561216.776821550" name="tob.cpp" rcbsApplicability="disable" resourcePath="src/tob.cpp" toolsToInvoke="sharc.toolchain.compiler.913943905.1208184272"> |
| | | <tool id="sharc.toolchain.compiler.913943905.1208184272" name="CrossCore SHARC C/C++ Compiler" superClass="sharc.toolchain.compiler.913943905"> |
| | | <option id="compiler.option.debugcode.1852700867" name="Generate debug information (-g)" superClass="compiler.option.debugcode" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <option id="compiler.option.optimization.1367621719" name="Enable optimization (-O)" superClass="compiler.option.optimization" useByScannerDiscovery="false" value="false" valueType="boolean"/> |
| | | <option id="compiler.option.interprocdoptim.1519443625" name="Interprocedural optimization (-ipa)" superClass="compiler.option.interprocdoptim" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <inputType id="compiler.inputType.1256387287" name="C/C++ Source" superClass="compiler.inputType"/> |
| | | </tool> |
| | | </fileInfo> |
| | | <fileInfo id="sharc.toolchain.configuration.debug.986561216.961651879" name="f2f.c" rcbsApplicability="disable" resourcePath="src/f2f.c" toolsToInvoke="sharc.toolchain.compiler.913943905.255253029"> |
| | | <tool id="sharc.toolchain.compiler.913943905.255253029" name="CrossCore SHARC C/C++ Compiler" superClass="sharc.toolchain.compiler.913943905"> |
| | | <option id="compiler.option.debugcode.640011568" name="Generate debug information (-g)" superClass="compiler.option.debugcode" useByScannerDiscovery="false" value="false" valueType="boolean"/> |
| | | <option id="compiler.option.optimization.1494843332" name="Enable optimization (-O)" superClass="compiler.option.optimization" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <option id="compiler.option.interprocdoptim.1022671789" name="Interprocedural optimization (-ipa)" superClass="compiler.option.interprocdoptim" useByScannerDiscovery="false" value="true" valueType="boolean"/> |
| | | <inputType id="compiler.inputType.142353510" name="C/C++ Source" superClass="compiler.inputType"/> |
| | | </tool> |
| | | </fileInfo> |
| | | <sourceEntries> |
| | | <entry excluding="system|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> |
| | | <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> |
| | |
| | | <tool id="sharc.toolchain.loader.1360261758" name="CrossCore SHARC Loader" superClass="sharc.toolchain.loader"> |
| | | <option id="loader.option.proc.1450984201" name="-proc" superClass="loader.option.proc" value=" ADSP-21569" valueType="string"/> |
| | | <option id="loader.option.sirevision.838668312" name="-si-revision" superClass="loader.option.sirevision" value=" 0.0" valueType="string"/> |
| | | <option id="sharc.loader.option.kernelfile.307294945" name="Kernel file (-l)" superClass="sharc.loader.option.kernelfile" value="C:\Analog Devices\CrossCore Embedded Studio 2.11.0\SHARC\ldr\_prom.dxe" valueType="string"/> |
| | | <option id="sharc.loader.option.kernelfile.307294945" name="Kernel file (-l)" superClass="sharc.loader.option.kernelfile" value="D:\Program Files\Analog Devices\CrossCore Embedded Studio 2.12.1\SHARC\ldr\_prom.dxe" valueType="string"/> |
| | | </tool> |
| | | <tool id="sharc.toolchain.deviceprogrammer.707828906" name="CrossCore SHARC Device Programmer" superClass="sharc.toolchain.deviceprogrammer"> |
| | | <option id="deviceprogrammer.option.proc.686495168" name="-proc" superClass="deviceprogrammer.option.proc" value=" ADSP-21569" valueType="string"/> |
| | |
| | | eclipse.preferences.version=1 |
| | | version=2.11.0.0 |
| | | version=2.12.1.0 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | eclipse.preferences.version=1 |
| | | encoding//src/messageproc.cpp=UTF-8 |
| | | encoding//src/tg/tg_scene.cpp=UTF-8 |
| | |
| | | *pREG_FIR0_CHNPTR = (uint32_t)(saddr(firHead.first->tcb+12)); |
| | | firHead.clock_start = clock(); |
| | | //Initializing the chain pointer register |
| | | *pREG_FIR0_CTL1 = BITM_FIR_CTL1_EN|BITM_FIR_CTL1_DMAEN|(firHead.num -1)<<BITP_FIR_CTL1_CH|BITM_FIR_CTL1_BURSTEN; |
| | | //*pREG_FIR0_CTL1 = BITM_FIR_CTL1_EN|BITM_FIR_CTL1_DMAEN|(firHead.num -1)<<BITP_FIR_CTL1_CH|BITM_FIR_CTL1_BURSTEN; |
| | | *pREG_FIR0_CTL1 = BITM_FIR_CTL1_EN|BITM_FIR_CTL1_DMAEN|((firHead.num -1)<<BITP_FIR_CTL1_CH); |
| | | |
| | | firHead.status = acc_processing; |
| | | } |
| | |
| | | ModuleProcessLibInit(); |
| | | |
| | | if (modules.empty()) { |
| | | <<<<<<< HEAD |
| | | modules.push_back(ModuleEntry("Input", ModuleType::PROC_INPUT, SignalSourceCreate, ufalse)); //SignalSource |
| | | ======= |
| | | modules.push_back(ModuleEntry("SignalSource", ModuleType::PROC_INPUT, SignalSourceCreate, ufalse)); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | // modules.push_back(ModuleEntry("Input",ModuleType::PROC_INPUT, InputCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Output",ModuleType::PROC_OUTPUT, OutputCreate, ufalse)); |
| | | |
| | | modules.push_back(ModuleEntry("Meter",ModuleType::PROC_METER, MeterCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Meter",ModuleType::PROC_METER, MeterCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Expander",ModuleType::PROC_EXPANDER, ExpanderCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Compress",ModuleType::PROC_COMPRESS, CompressorCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Limiter",ModuleType::PROC_LIMIT, LimiterCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Mixer",ModuleType::PROC_MIXER, MixerCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Delay",ModuleType::PROC_DELAY, DelayCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Gain",ModuleType::PROC_GAIN, GainCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Gain",ModuleType::PROC_GAIN, GainCreate, utrue)); |
| | | modules.push_back(ModuleEntry("GainSharingmixer",ModuleType::PROC_AUTOMIXER, GSAMCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("GatingMixer",ModuleType::PROC_GATING_AUTOMIXER, GatingAMCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("SPL",ModuleType::PROC_CONTINUNOUS_SPL, ContinuousSPLCreate, utrue)); |
| | |
| | | modules.push_back(ModuleEntry("Ducker",ModuleType::PROC_DUCKER, DuckerCreate, utrue)); |
| | | modules.push_back(ModuleEntry("AGC",ModuleType::PROC_AGC, AGCCreate, utrue)); |
| | | modules.push_back(ModuleEntry("SELECTOR",ModuleType::PROC_SELECTOR, MixerCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("SignalGenerator",ModuleType::PROC_SIGNALGEN, SignalGeneraterCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("SignalGenerator",ModuleType::PROC_SIGNALGEN, SignalGeneraterCreate, utrue)); |
| | | modules.push_back(ModuleEntry("GATING",ModuleType::PROC_GATING, NoiseGateCreate,utrue)); |
| | | modules.push_back(ModuleEntry("ROUTE",ModuleType::PROC_ROUTE, RouteCreate,ufalse)); |
| | | modules.push_back(ModuleEntry("EQ",ModuleType::PROC_EQ, EQsCreate, utrue)); |
| | | modules.push_back(ModuleEntry("GEQ",ModuleType::PROC_GEQ, GEQCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Crossover",ModuleType::PROC_CROSSOVER, CrossOverCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Crossover",ModuleType::PROC_CROSSOVER, CrossOverCreate, utrue)); |
| | | modules.push_back(ModuleEntry("nhs",ModuleType::PROC_FEEDBACK, NHSCreate, utrue)); |
| | | modules.push_back(ModuleEntry("aec",ModuleType::PROC_AEC, SQECreate, utrue)); |
| | | modules.push_back(ModuleEntry("aec",ModuleType::PROC_AEC, SQECreate, ufalse)); |
| | | modules.push_back(ModuleEntry("ans",ModuleType::PROC_ANS, ANSCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Sysctrl",ModuleType::PROC_SYSCTL, SysctlCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("FIR",ModuleType::PROC_FIR, FIRCreate,utrue)); |
| | | //modules.push_back(ModuleEntry("AFC",ModuleType::PROC_AFC, AFCCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Pitch",ModuleType::PROC_PITCH, PitchCreate, ufalse)); |
| | | modules.push_back(ModuleEntry("Pitch",ModuleType::PROC_PITCH, PitchCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Reverb",ModuleType::PROC_REVERB, ReverbCreate, utrue)); |
| | | modules.push_back(ModuleEntry("Echo",ModuleType::PROC_ECHO, EchoCreate, utrue)); |
| | | modules.push_back(ModuleEntry("DummyInput",ModuleType::DUMMY_INPUT, DummyCreate, ufalse)); |
| | |
| | | PROC_SHELF, // é«ä½æ¶ |
| | | PROC_SELECTOR, //æ··é³å¨ |
| | | PROC_GATING_AUTOMIXER, //é¨éèªå¨æ··é³ 20 |
| | | <<<<<<< HEAD |
| | | PROC_CONTINUNOUS_SPL, //è¿ç»åSPL(åªå£°å¢çè¡¥å¿) |
| | | ======= |
| | | PROC_CONTINUNOUS_SPL, //è¿ç»åSPL |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | PROC_GATING, //åªå£°é¨ |
| | | PROC_DUCKER, //éªé¿å¨ |
| | | PROC_REVERB, //æ··å |
| | |
| | | public: |
| | | //s8 name[16]; |
| | | u16 module_type; |
| | | ubool link_enable; |
| | | ubool link_enable; //åæ°å¤ééå
±äº«æ¯æï¼ |
| | | ubool pad =0; |
| | | |
| | | Create module_create; |
| | |
| | | |
| | | Frames::Frames(int num) |
| | | { |
| | | frameList = (Frame*)sram_malloc(SRAM_AUTO,mem_any, num*sizeof(Frame)); |
| | | frameList = (Frame*)sram_malloc(SRAM_AUTO, mem_any, num*sizeof(Frame)); |
| | | //åé
è¿ç»å
å. |
| | | dataPtr = (ufloat*)sram_malloc(SRAM_AUTO,mem_any ,num*SAMPLE_NUM*sizeof(float)); |
| | | dataPtr = (ufloat*)sram_malloc(SRAM_AUTO, mem_any, num*SAMPLE_NUM*sizeof(float)); |
| | | |
| | | assert(dataPtr != NULL); |
| | | for (int i = 0; i < num; i++) { |
| | |
| | | s8 usb_output_num; |
| | | s8 dante_input_num ; |
| | | s8 dante_output_num ; |
| | | s8 local_input_num; |
| | | s8 local_output_num; |
| | | public: |
| | | virtual ~hw_adapter_t(){} |
| | | hw_adapter_t(s8 dual_dsp,s8 dsp_index,s8 ana_input_num,s8 ana_output_num,s8 dante_input_num,s8 dante_output_num) |
| | | hw_adapter_t(s8 dual_dsp, s8 dsp_index, s8 local_input_num, s8 local_output_num, s8 dante_input_num, s8 dante_output_num) |
| | | { |
| | | this->dual_dsp = dual_dsp; |
| | | this->dsp_index = dsp_index ; |
| | | this->ana_input_num = ana_input_num; |
| | | this->ana_output_num = ana_output_num; |
| | | this->local_input_num = local_input_num; |
| | | this->local_output_num = local_output_num; |
| | | this->dante_input_num = dante_input_num; |
| | | this->dante_output_num = dante_output_num; |
| | | this->usb_input_num = 2; |
| | | this->usb_output_num = 2; |
| | | <<<<<<< HEAD |
| | | this->ana_input_num = local_input_num - usb_input_num; |
| | | this->ana_output_num = local_output_num - usb_output_num; |
| | | ======= |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | uvoid get_channel_num(s8* ana_rx_num,s8* ana_tx_num,s8* dante_rx_num,s8* dante_tx_num) |
| | | uvoid get_channel_num(s8* loc_rx_num,s8* loc_tx_num,s8* dante_rx_num,s8* dante_tx_num,s8* usb_rx_num,s8* usb_tx_num) |
| | | { |
| | | *ana_rx_num = ana_input_num; |
| | | *ana_tx_num = ana_output_num; |
| | | *loc_rx_num = local_input_num; |
| | | *loc_tx_num = local_output_num; |
| | | *dante_rx_num = dante_input_num; |
| | | *dante_tx_num = dante_output_num; |
| | | *usb_rx_num = usb_input_num; |
| | | *usb_tx_num = usb_output_num; |
| | | } |
| | | |
| | | uvoid get_channel_num(u16* input_num ,u16* output_num) |
| | | { |
| | | *input_num = ana_input_num+dante_input_num; |
| | | *output_num = ana_output_num+dante_output_num; |
| | | *input_num = local_input_num+dante_input_num; |
| | | *output_num = local_output_num+dante_output_num; |
| | | } |
| | | |
| | | s32 get_dsp_index() {return dsp_index ;} |
| | |
| | | tob->toProc(); |
| | | |
| | | UpdateOutput(iid, DMACount[iid]&0x1); |
| | | <<<<<<< HEAD |
| | | // LP_transmit(); |
| | | ModulesAsynSetInterval(proc_secs); |
| | | fir_acc_startup(); |
| | | ======= |
| | | //LP_transmit(); |
| | | // ModulesAsynSetInterval(proc_secs); |
| | | // fir_acc_startup(); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | clock_stop = clock(); |
| | | proc_secs = ((ufloat) (clock_stop - clock_start))/ CLOCKS_PER_SEC; |
| | | } |
| | |
| | | UpdateOutput(iid, DMACount[iid]&0x1); |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | ++DMACount[iid]; |
| | | ======= |
| | | DMACount[iid]++; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | int main(int argc, char *argv[]) |
| | |
| | | memset(DMACount, 0, sizeof(DMACount)); |
| | | |
| | | Message* spiMsg = new Message(8); |
| | | //ç¬¬ä¸æ¬¡å¯å¨ä¸æ¥ç¹å«æ¯ä»¿ççæ¶åéè¦arm'éæ°åéæ¶æ¯. |
| | | spiMsg->DspStatusPush(DSP_EMULATE_DEBUG, 0, 0); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | |
| | | SPI2_Init(); |
| | | |
| | |
| | | GPIO_SetOutPut(GPIOA, GPIO_Pin12, GPIO_HIGH); |
| | | GPIO_SetOutPut(GPIOB, GPIO_Pin5, GPIO_HIGH); |
| | | |
| | | <<<<<<< HEAD |
| | | //ç¬¬ä¸æ¬¡å¯å¨ä¸æ¥ç¹å«æ¯ä»¿ççæ¶åéè¦arm'éæ°åæ¡æ. |
| | | spiMsg->DspStatusPush(DSP_EMULATE_DEBUG, 0, 0); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | |
| | | printf("free sram %d, L2 %d\n", sram_free_space(SRAM_DDR, mem_any), sram_free_space(SRAM_L2, mem_any)); |
| | | ======= |
| | | // u32 ddrspace = sram_free_space(SRAM_DDR, mem_any); |
| | | // printf("ddrspace:%d\n", ddrspace); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | while(1) { |
| | | asyn_proc_secs = ModulesAsynProcess(); |
| | |
| | | |
| | | //clock state will change after running,it need check always. |
| | | //about 1s |
| | | if(++loop_cnt > 100000000){ |
| | | if(clock_check_count == DMACount[var.master_intr]) { |
| | | if(++loop_cnt > 5e+6){ |
| | | if (var.clock_ok && clock_check_count == DMACount[var.master_intr]) { |
| | | var.dsp_status = dsp_no_clock; |
| | | <<<<<<< HEAD |
| | | spiMsg->DspStatusPush(DSP_RUNNING_STATUS, &var.dsp_status ,1); |
| | | ======= |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, &var.dsp_status ,1); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | spiMsg->ReportDspStatus(&msg); |
| | | printf("clk0 ok\n"); |
| | | } |
| | | loop_cnt =0; |
| | | clock_check_count = DMACount[var.master_intr]; |
| | | // printf("clk1 ok\n"); |
| | | } |
| | | |
| | | |
| | | if(!var.clock_ok && var.dsp_status == DSPStatus::dsp_running_ok && var.HandShakeSuccesful) { |
| | | //notify arm to work normaly. |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, 0, 0); |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, &var.dsp_status, 1); |
| | | request_topo_count = DMACount[var.master_intr] ; |
| | | var.clock_ok = utrue; |
| | | <<<<<<< HEAD |
| | | spiMsg->ReportDspStatus(&msg); |
| | | printf("clk2 ok\n"); |
| | | ======= |
| | | // printf("clk2 ok\n"); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | uvoid Message::ReportDspStatus(MSG* pmsg) |
| | | { |
| | | s32 size = dsp_status_q.get_device_status_ptr(pmsg->data,MSG_DATA_LEN); |
| | | s32 size = dsp_status_q.get_device_status_ptr(pmsg->data, MSG_DATA_LEN); |
| | | if(size > 0) { |
| | | pmsg->Enc(MsgType::MSG_DSP_STATUS_REPORT, 0, size); |
| | | txQueue->Push(*pmsg); |
| | |
| | | int data_len; |
| | | |
| | | ToB* tob = ToB::GetInstance(); |
| | | <<<<<<< HEAD |
| | | u16 LevelCnt = tob->GetLevels(Levels); //918 levels |
| | | ======= |
| | | u16 LevelCnt = tob->GetLevels(Levels); //864 levels |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | u32 msgLen = LevelCnt * sizeof(*Levels); |
| | | int Packegs = (msgLen+MSG_DATA_LEN-1)/MSG_DATA_LEN; |
| | | |
| | |
| | | |
| | | if(tob != NULL && pmsg->pktNo == pmsg->totalPkts - 1) { |
| | | VarState& var = VarState::GetInstance(); |
| | | u32 type = tob->GetModuleType(ptr->mid); |
| | | // u32 type = tob->GetModuleType(ptr->mid); |
| | | s32 data_num = (pmsg->totalPkts-1)*MSG_DATA_LEN+pmsg->dataLen; |
| | | |
| | | s16* data = (s16*)(ptr + 1); |
| | | |
| | | data_num = (data_num - sizeof(struct ParamCtrl))/sizeof(s16); |
| | | // ptr->mid = var.pscene->get_module_id(ptr->mid, type, ptr->cmd) ; |
| | | <<<<<<< HEAD |
| | | // printf("mID:%d pID:%d val[0]:%d val[1]:%d\n",ptr->mid, ptr->cmd, data[0], data[1]); |
| | | ======= |
| | | |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | tob->toCtrl(ptr->mid, ptr->cmd, data, data_num); |
| | | } |
| | | |
| | |
| | | var.TopoStatus = PRESET_STA::PRESET_ERR; |
| | | } |
| | | else if(tob){ |
| | | <<<<<<< HEAD |
| | | int preset_size = sizeof(tag_parameters); // 45128 + sizeof(tag_fir) * MAX_OUTPUT_NUM; // size + FIR |
| | | u8* content = (u8*)sram_malloc(SRAM_DDR, mem_any, preset_size); |
| | | ======= |
| | | u8* content = (u8*)sram_malloc(SRAM_DDR, mem_any, 45128);//45*1024); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | s32 size ; |
| | | |
| | | tob->toClear(); |
| | | |
| | | var.pscene->update_module(); |
| | | size = var.pscene->convert_to_bin(content); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | tob->toClear(); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | tob->toAnalysis(content, size); |
| | | |
| | | sram_free(SRAM_DDR, content); |
| | |
| | | |
| | | s32 Message::HandshakeMessageProcess(MSG* pmsg) |
| | | { |
| | | // s8 usb_rx_ch=2, usb_tx_ch=2; |
| | | VarState& var = VarState::GetInstance(); |
| | | |
| | | ptag_device_config device_config = (ptag_device_config)pmsg->data; |
| | |
| | | } |
| | | |
| | | // param_init(device_config); |
| | | <<<<<<< HEAD |
| | | hw_adapter_t* _adapter = new tg_hw_adapter_t(device_config->dual_dsp, device_config->dsp_index |
| | | ,device_config->local_rx_num, device_config->local_tx_num |
| | | ,device_config->dante_rx_num, device_config->dante_tx_num); |
| | | ======= |
| | | hw_adapter_t* _adapter = new tg_hw_adapter_t(device_config->dual_dsp,device_config->dsp_index |
| | | ,device_config->local_rx_num,device_config->local_tx_num |
| | | ,device_config->dante_rx_num,device_config->dante_tx_num); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | var.pscene = new(SRAM_DDR) tgScene(_adapter); |
| | | |
| | | _adapter->config_board(&dspconfig); |
| | |
| | | //Config(conf); |
| | | RouteConfig(dspconfig.routes, dspconfig.mRouteNum); |
| | | SRCsConfig(0 , &dspconfig.srcs[0]); |
| | | SRCsConfig(1 , &dspconfig.srcs[4]); |
| | | SRCsConfig(1 , &dspconfig.srcs[1]); |
| | | PCGsConfig(dspconfig.pcgs); |
| | | SportsConfig(dspconfig.sports); |
| | | //LinportConfig(dspconfig.linkport); |
| | |
| | | } |
| | | |
| | | Send(MsgType::MSG_ACK_REQ, 0 , 0); |
| | | |
| | | printf("HandShake OK\n"); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | Message(u32 num) |
| | | { |
| | | txQueue = new Queue<MSG>(num); |
| | | <<<<<<< HEAD |
| | | Levels = new s16[1000]; |
| | | ======= |
| | | Levels = new s16[868]; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | ~Message() |
| | | { |
| | |
| | | //é¢è®¾åæ°è§£æç¨ |
| | | typedef u32 (*ParamCtrl_fn)(IModule* m, void* handle, int &plen); |
| | | //åæ°æ§å¶ç¨ |
| | | typedef u32 (*Ctrl_fn)(IModule* m, u32 pID, s16* val_c); |
| | | typedef u32 (*Ctrl_fn)(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | |
| | | class ParamEntry { |
| | | private: |
| | |
| | | Ctrl_fn ctrl; |
| | | |
| | | public: |
| | | ParamCtrl_fn GetParamEntry(){ |
| | | ParamCtrl_fn GetParamEntry() const { |
| | | return param; |
| | | } |
| | | |
| | | Ctrl_fn GetCtrlEntry(){ |
| | | Ctrl_fn GetCtrlEntry() const { |
| | | return ctrl; |
| | | } |
| | | ParamEntry() : param(nullptr), ctrl(nullptr) {} |
| | |
| | | }; |
| | | |
| | | class param_ctrl_t{ |
| | | protected: |
| | | std::map<u32, ParamEntry> mctrl_list; |
| | | |
| | | public: |
| | | // è¿åpairé¿å
é夿¥æ¾ |
| | | std::pair<ParamCtrl_fn, Ctrl_fn> GetEntries(u32 mtype) const |
| | | { |
| | | auto it = mctrl_list.find(mtype); |
| | | if(it != mctrl_list.end()) { |
| | | return {it->second.GetParamEntry(), it->second.GetCtrlEntry()}; |
| | | } |
| | | return {nullptr, nullptr}; |
| | | } |
| | | |
| | | ParamCtrl_fn GetParamEntry(u32 mtype) const |
| | | { |
| | | auto it = mctrl_list.find(mtype); |
| | | return (it != mctrl_list.end()) ? it->second.GetParamEntry() : nullptr; |
| | | } |
| | | |
| | | Ctrl_fn GetCtrlEntry(u32 mtype) const |
| | | { |
| | | auto it = mctrl_list.find(mtype); |
| | | return (it != mctrl_list.end()) ? it->second.GetCtrlEntry() : nullptr; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦åå¨ |
| | | bool HasEntry(u32 mtype) const |
| | | { |
| | | return mctrl_list.find(mtype) != mctrl_list.end(); |
| | | } |
| | | }; |
| | | /*class param_ctrl_t{ |
| | | protected: |
| | | std::map<u32, ParamEntry> mctrl_list; |
| | | public: |
| | |
| | | else |
| | | return NULL; |
| | | } |
| | | }; |
| | | };*/ |
| | | |
| | | |
| | | |
| | |
| | | typedef struct{ |
| | | short dual_dsp; |
| | | short dsp_index; |
| | | short local_rx_num; |
| | | short local_rx_num; // include analog + usb channel |
| | | short local_tx_num; |
| | | short dante_rx_num; |
| | | short dante_tx_num; |
| | |
| | | #include "protocol_internal.h" |
| | | #include "moduleexport.h" |
| | | #include "crc.h" |
| | | #include "../drv/memory.h" |
| | | |
| | | s32 Scene::str_delim(const s8* str, u16 logic_channel[]) |
| | | { |
| | |
| | | mixer->mType = ModuleType::PROC_MIXER; |
| | | mixer->mTag = 0; |
| | | mixer->mPhyModule = 0; |
| | | mixer->mParamaddr = (s32)get_module_param_ptr(p->parameters,p->fixed); |
| | | mixer->mParamaddr = (s32)get_module_param_ptr(mixer->mType, p->parameters, p->fixed); |
| | | |
| | | size += sizeof(struct Module); |
| | | |
| | |
| | | m->mType = p->proc_type; |
| | | m->mTag = p->tag; |
| | | m->mPhyModule = p->physic_type; |
| | | m->mParamaddr = (s32)get_module_param_ptr(p->parameters,p->fixed); |
| | | m->mParamaddr = (s32)get_module_param_ptr(m->mType, p->parameters, p->fixed); |
| | | |
| | | size += sizeof(struct Module); |
| | | m->mRxNum = ninports; |
| | |
| | | for(j = 0 ; j< ninports ;j ++, phy_id++) { |
| | | phy_id->mIntType = 0; |
| | | phy_id->mPhyID = hw_adapter->get_physical_channel(1, rxBufID[j]-1); |
| | | <<<<<<< HEAD |
| | | // printf("PhyID:%d\n", phy_id->mPhyID); |
| | | ======= |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | size += ninports*sizeof(PhyPort); |
| | | } |
| | |
| | | //åç¬¦ä¸²è½¬æ¢æé»è¾ç«¯å£å·,è¿åè¾å
¥è¾åºç«¯å£æ°é. |
| | | s32 str_delim(const s8* str, u16 logic_channel[]) ; |
| | | |
| | | virtual uvoid* get_module_param_ptr(uvoid *param, s32 fixed) =0; |
| | | virtual uvoid* get_module_param_ptr(s32 mtype, uvoid *param, s32 fixed) =0; |
| | | //æ ¹æ®æ¨¡åç±»åæ´æ°æ¨¡åä¿¡æ¯. |
| | | virtual s32 update_module() =0; |
| | | //æåè¿å0ï¼å¤±è´¥è¿å-1(å
容é误ã大å°ä¸å¹é
ç). |
| | | virtual s32 set_parameters_content(uvoid* param, s32 size) =0; |
| | | |
| | | virtual u32 get_module_id(u32 mid, s32 mtype ,u32 pid) =0; |
| | | // virtual u32 get_module_id(u32 mid, s32 mtype ,u32 pid) =0; |
| | | |
| | | s32 convert_to_bin(u8* bin); |
| | | }; |
| | |
| | | }tag_echo,*ptag_echo; |
| | | |
| | | typedef struct{ |
| | | short bypass; |
| | | short name[8]; |
| | | short taps; |
| | | int coeffs[MAX_FIR_TAPS]; |
| | | }tag_fir, *ptag_fir; |
| | | |
| | | typedef struct{ |
| | |
| | | char proc_ins[sizeof(tag_eq)]; |
| | | }tag_module ,*ptag_module; |
| | | |
| | | typedef struct{ |
| | | short proc_type; |
| | | short pad; |
| | | char proc_ins[sizeof(tag_fir)]; |
| | | }tag_module_fir, *ptag_module_fir; |
| | | |
| | | typedef struct{ |
| | | short input_group[MAX_INPUT_NUM]; |
| | | short output_group[MAX_OUTPUT_NUM]; |
| | | int input_group[MAX_INPUT_NUM]; |
| | | int output_group[MAX_OUTPUT_NUM]; |
| | | }tag_group,*ptag_group ; |
| | | |
| | | |
| | | // ENUM |
| | | typedef enum{ |
| | | INPUT_GAIN = 0x1, |
| | | INPUT_MUTE, |
| | |
| | | //åæ°logic_channelé»è¾ééä»0å¼å§. |
| | | s32 tg_hw_adapter_t::get_physical_channel(s32 input , s32 logic_channel) |
| | | { |
| | | <<<<<<< HEAD |
| | | if(input) { |
| | | s32 input_num = ana_input_num + dante_input_num ; |
| | | if(logic_channel < ana_input_num) { |
| | | //analog |
| | | return logic_channel + 1; |
| | | } |
| | | else if(logic_channel < input_num) { |
| | | //dante |
| | | return 19 + (logic_channel - ana_input_num); |
| | | } |
| | | else { |
| | | //usb |
| | | // return 17 + (logic_channel - input_num); |
| | | return (logic_channel > input_num) ? 17 : 18; |
| | | } |
| | | } |
| | | else { //output |
| | | s32 output_num = ana_output_num + dante_output_num ; |
| | | //analog |
| | | if(logic_channel < ana_output_num) { |
| | | return logic_channel + 1; |
| | | } |
| | | else if(logic_channel < output_num) { |
| | | //dante |
| | | return 19 + (logic_channel - ana_output_num); |
| | | } |
| | | else { |
| | | //usb |
| | | // return 17 + (logic_channel - output_num); |
| | | return (logic_channel > output_num) ? 17 : 18; |
| | | } |
| | | } |
| | | ======= |
| | | //s32 phy_channel[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19}; |
| | | if(input) { |
| | | s32 input_num = ana_input_num + dante_input_num ; |
| | |
| | | return 17 + (logic_channel - output_num); |
| | | } |
| | | } |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | //ç©çbufferå®ä¹é¡ºåºæ¯16é鿍¡æ+2ééUSB+32ééDante. |
| | |
| | | conf->sports[i].clke = utrue; |
| | | conf->sports[i].enable = utrue; |
| | | conf->sports[i].enable_sec = ufalse; |
| | | <<<<<<< HEAD |
| | | conf->sports[i].lfs = ufalse; // The USB left and right channels can be swapped. |
| | | conf->sports[i].mfd = 0; |
| | | ======= |
| | | conf->sports[i].lfs = ufalse; |
| | | conf->sports[i].mfd = 1; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | conf->sports[i].opmode = 1 ; //i2s |
| | | conf->sports[i].rx = ufalse; |
| | | conf->sports[i].slots = 2; |
| | |
| | | conf->sports[4].rx = utrue; |
| | | |
| | | //USB pcg. |
| | | <<<<<<< HEAD |
| | | conf->pcgs[1].enable = utrue; |
| | | conf->pcgs[1].opmode = 0; |
| | | conf->pcgs[1].fs_div = mclk / conf->mSampleRate ; |
| | | conf->pcgs[1].sclk_div = mclk / (conf->mSampleRate * 2 * 32); |
| | | AddRoute(SourceSignal::DAI0_PB02_O, DestSignal::PCG_EXTB_I); |
| | | // route |
| | | AddRoute(SourceSignal::PCG_FSB_O, DestSignal::SPT2_AFS_I); |
| | | AddRoute(SourceSignal::PCG_FSB_O, DestSignal::SPT2_BFS_I); |
| | | AddRoute(SourceSignal::PCG_CLKB_O, DestSignal::SPT2_ACLK_I); |
| | | AddRoute(SourceSignal::PCG_CLKB_O, DestSignal::SPT2_BCLK_I); |
| | | ======= |
| | | // conf->pcgs[1].enable = utrue; |
| | | // conf->pcgs[1].opmode = 0; |
| | | // conf->pcgs[1].fs_div = mclk / conf->mSampleRate ; |
| | | // conf->pcgs[1].sclk_div = mclk / (conf->mSampleRate * 2 * 32); |
| | | // AddRoute(SourceSignal::DAI0_PB02_O, DestSignal::PCG_EXTB_I); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | // AddRoute(SourceSignal::LOGIC_HIGH, DestSignal::DAI0_PBEN09_I);//fs |
| | | // AddRoute(SourceSignal::LOGIC_HIGH, DestSignal::DAI0_PBEN08_I);//sclk |
| | | // AddRoute(SourceSignal::PCG_FSB_O, DestSignal::DAI0_PB09_I); |
| | | // AddRoute(SourceSignal::PCG_CLKB_O, DestSignal::DAI0_PB08_I); |
| | | |
| | | AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SPT2_ACLK_I); |
| | | AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SPT2_AFS_I); |
| | | AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SPT2_BCLK_I); |
| | | AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SPT2_BFS_I); |
| | | // AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SPT2_ACLK_I); |
| | | // AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SPT2_AFS_I); |
| | | // AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SPT2_BCLK_I); |
| | | // AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SPT2_BFS_I); |
| | | |
| | | AddRoute(SourceSignal::DAI0_PB07_O, DestSignal::SPT2_AD0_I); |
| | | // AddRoute(SourceSignal::DAI0_PB07_O, DestSignal::SPT2_AD0_I); // usb output |
| | | // AddRoute(SourceSignal::LOGIC_HIGH, DestSignal::DAI0_PBEN10_I); |
| | | // AddRoute(SourceSignal::SPT2_BD0_O, DestSignal::DAI0_PB10_I); // usb input |
| | | |
| | | // usb asrc |
| | | conf->srcs[0].enable = utrue; |
| | | conf->srcs[0].format = 1; |
| | | conf->srcs[0].wordLen = 0; |
| | | conf->srcs[0].ratio = 1; // usb input |
| | | |
| | | conf->srcs[1].enable = utrue; |
| | | conf->srcs[1].format = 1; |
| | | conf->srcs[1].wordLen = 0; |
| | | conf->srcs[1].ratio = 0; // usb output |
| | | |
| | | // usb input / asrc input |
| | | AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SRC0_FS_IP_I); |
| | | AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SRC0_CLK_IP_I); |
| | | AddRoute(SourceSignal::DAI0_PB07_O, DestSignal::SRC0_DAT_IP_I); |
| | | // usb input / asrc output |
| | | AddRoute(SourceSignal::PCG_FSB_O, DestSignal::SRC0_FS_OP_I); |
| | | AddRoute(SourceSignal::PCG_CLKB_O, DestSignal::SRC0_CLK_OP_I); |
| | | AddRoute(SourceSignal::SRC0_DAT_OP_O, DestSignal::SPT2_AD0_I); |
| | | // usb output / asrc input |
| | | AddRoute(SourceSignal::PCG_FSB_O, DestSignal::SRC1_FS_IP_I); |
| | | AddRoute(SourceSignal::PCG_CLKB_O, DestSignal::SRC1_CLK_IP_I); |
| | | AddRoute(SourceSignal::SPT2_BD0_O, DestSignal::SRC1_DAT_IP_I); |
| | | // usb output / asrc output |
| | | AddRoute(SourceSignal::DAI0_PB09_O, DestSignal::SRC1_FS_OP_I); |
| | | AddRoute(SourceSignal::DAI0_PB08_O, DestSignal::SRC1_CLK_OP_I); |
| | | AddRoute(SourceSignal::LOGIC_HIGH, DestSignal::DAI0_PBEN10_I); |
| | | AddRoute(SourceSignal::SPT2_BD0_O, DestSignal::DAI0_PB10_I); |
| | | AddRoute(SourceSignal::SRC1_DAT_OP_O, DestSignal::DAI0_PB10_I); |
| | | |
| | | //Dante Slave |
| | | //MCLK(DAI1_2),LRCLK(DAI1_20),SCLK(DAI1_19) |
| | |
| | | conf->sports[i].mfd = 1; |
| | | conf->sports[i].opmode = 0 ; //tdm |
| | | conf->sports[i].rx = ufalse; |
| | | <<<<<<< HEAD |
| | | conf->sports[i].slots = 8; |
| | | conf->sports[i].vld = 8; |
| | | ======= |
| | | conf->sports[i].slots = 16; |
| | | conf->sports[i].vld = 16; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | conf->sports[i].follow_intr_no = intr_sport_no(8); |
| | | } |
| | | conf->sports[8].interrupt = utrue; |
| | |
| | | #include "config.h" |
| | | |
| | | //项ç®å®å¶åå®å®ä¹. |
| | | <<<<<<< HEAD |
| | | #define MAX_INPUT_NUM 34 // ana:16, dante:16, usb:2 |
| | | ======= |
| | | #define MAX_INPUT_NUM 34 |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | #define MAX_OUTPUT_NUM 34 |
| | | |
| | | #define FEEDBACK_FILTERS_NUM 16 //NHS滤波å¨ç»æ°ç® |
| | | #define FEEDBACK_FILTERS_NUM 16 //NHS滤波å¨ç»æ°ç® |
| | | |
| | | #define MAX_MIXER_INPUT 37 |
| | | #define MAX_MIXER_OUTPUT 34 |
| | | |
| | | #define MAX_EQ_SECTION 12 |
| | | #define AUTOMIXER_CHANNEL_NUM 32 |
| | | #define AUTOMIXER_CHANNEL_NUM 34 |
| | | #define MAX_DELAY_MSEC 1200 |
| | | |
| | | #define MAX_DELIM_LEN 32 |
| | | |
| | | #define MAX_FIR_TAPS 1024 |
| | | |
| | | #ifdef __ADSP21489__ |
| | | #define RESSIGNBIT(X) (((X)&0x8000)?(-((~(X))&0xffff)-1):(X)) //è¿å符å·ä½ |
| | | #elif defined(__ADSP21569__) |
| | |
| | | |
| | | u32 tg_param_convert::InputParamCtrl(IModule* m, void* handle, int &plen) |
| | | { |
| | | enum GainID { |
| | | enum Input_ID{ |
| | | GAIN = 0x1, |
| | | MUTE, |
| | | SENSI, |
| | | PHANTOM, |
| | | |
| | | PHASE = 9, |
| | | STEP,//-500~+500 |
| | | }; |
| | | TYPE, |
| | | FREQ, |
| | | LEVEL, |
| | | NAME, |
| | | PHASE, |
| | | STEP, |
| | | LINK, |
| | | CHANNEL_LEVEL, |
| | | |
| | | enum PitchID { |
| | | PITCH_BYPASS = 0x1,// |
| | | PITCH_SEMITONES,// |
| | | INPUT_MIN, |
| | | INPUT_MAX, |
| | | }; |
| | | |
| | | if(handle == NULL) return 1; |
| | |
| | | |
| | | val[1] = RESSIGNBIT(pInput->input[i].gain); m->Ctrl(GAIN, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].mute); m->Ctrl(MUTE, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].level); m->Ctrl(LEVEL, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].sensitivity); m->Ctrl(SENSI, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].phant); m->Ctrl(PHANTOM, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].phase); m->Ctrl(PHASE, val, 2); |
| | | |
| | | val[1] = RESSIGNBIT(pInput->input[i].type); m->Ctrl(TYPE, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].freq); m->Ctrl(FREQ, val, 2); |
| | | val[1] = RESSIGNBIT(pInput->input[i].level); m->Ctrl(LEVEL, val, 2); |
| | | } |
| | | |
| | | return 0; |
| | |
| | | |
| | | for(i=0 ;i < pmixer->output_num ;i ++) { |
| | | for(j =0 ;j < pmixer->input_num ;j++) { |
| | | val[0] = j; val[1] = i ; val[2] = (pmixer->input_mask[i][j/15]>>(j&15))&0x1; m->Ctrl(MIXER_SWITCH, val, 3); |
| | | val[0] = j; val[1] = i ; val[2] = RESSIGNBIT(pmixer->input_gain[i][j]); m->Ctrl(MIXER_GAIN, val, 3); |
| | | val[0] = j; val[1] = i; val[2] = (pmixer->input_mask[i][j/15]>>(j&15))&0x1; m->Ctrl(MIXER_SWITCH, val, 3); |
| | | // printf("oich %d %d= %x %x %x\n", i,j, val[0],val[1],val[2]); |
| | | val[0] = j; val[1] = i; val[2] = RESSIGNBIT(pmixer->input_gain[i][j]); m->Ctrl(MIXER_GAIN, val, 3); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | u32 tg_param_convert::FeedbackParamCtrl(IModule* m, void* handle, int &plen) |
| | | { |
| | | // enum NHSID{ |
| | | // FB_BYPASS = 0x1, |
| | | // FB_PANIC, |
| | | // FB_THRS, |
| | | // FB_FLT_DEPTH, |
| | | // FB_STEP, |
| | | // FB_FLT_Q, |
| | | // FB_RECYCLETIME, |
| | | // |
| | | // FB_FLT_FREQ, |
| | | // FB_FLT_GAIN, |
| | | // FB_FLT_TYPE, |
| | | // |
| | | // FB_CLEAR, // |
| | | // FB_CLEAR_DYNAMIC,// |
| | | // }; |
| | | |
| | | enum NHSID{ |
| | | FB_BYPASS= 0x1, |
| | | FB_FLT_FREQ, |
| | |
| | | |
| | | if(handle == NULL) return 1; |
| | | |
| | | short val[4]; |
| | | short val[4] = {0,0,0,0}; |
| | | ptag_aec paec = (ptag_aec)handle; |
| | | plen = sizeof(tag_aec); |
| | | |
| | | val[0] = paec->bypass; m->Ctrl(BYPASS, val, 1); |
| | | val[0] = paec->mode; m->Ctrl(NLPLEVEL, val, 1); |
| | | val[1] = paec->bypass; m->Ctrl(BYPASS, val, 2); |
| | | val[1] = paec->mode; m->Ctrl(NLPLEVEL, val, 2); |
| | | val[1] = 2; m->Ctrl(NSMODE, val, 2); |
| | | |
| | | return 0; |
| | | } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_convert::FirParamCtrl(IModule* m, void* handle, int &plen) |
| | | { |
| | | enum FIRID { |
| | | FIR_BYPASS = 0x1, ////val[0]: 0-åæ¶bypass, 1- 使è½bypass |
| | | FIR_NAME, //æ ç¨ |
| | | FIR_TAPS, //æ ç¨ |
| | | FIR_COEFFS, //val: åå
ï¼æå¤§é¿åº¦1024 float. æ 转æ¢ç´æ¥æ·è´float. |
| | | }; |
| | | if(NULL == handle) return 1; |
| | | |
| | | ptag_fir pfir = (ptag_fir)handle; |
| | | |
| | | plen = sizeof(tag_fir); |
| | | short val[4] = {0}; |
| | | val[0] = pfir->bypass; |
| | | int taps = pfir->taps; |
| | | const short *pcoeffs = (const short *)pfir->coeffs; |
| | | |
| | | m->Ctrl(FIR_BYPASS, val, 1); |
| | | m->Ctrl(FIR_COEFFS, pcoeffs, taps * 2); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_convert::EmptyParamCtrl(IModule* m, void* handle, int &plen) |
| | | { |
| | | if(handle == NULL) return 1; |
| | |
| | | static u32 GeqParamCtrl(IModule* m, void* handle, int &plen); |
| | | static u32 ReverbParamCtrl(IModule* m, void* handle, int &plen); |
| | | static u32 EchoParamCtrl(IModule* m, void* handle, int &plen); |
| | | static u32 FirParamCtrl(IModule* m, void* handle, int &plen); |
| | | static u32 EmptyParamCtrl(IModule* m, void* handle, int &plen); |
| | | }; |
| | | |
| | |
| | | mctrl_list.insert(std::pair<u32, ParamEntry>((u32)PROC_AFC, ParamEntry(tg_param_convert::EmptyParamCtrl, tg_param_ctrl::General_Ctrl))); |
| | | mctrl_list.insert(std::pair<u32, ParamEntry>((u32)DUMMY_INPUT, ParamEntry(tg_param_convert::EmptyParamCtrl, tg_param_ctrl::General_Ctrl))); |
| | | mctrl_list.insert(std::pair<u32, ParamEntry>((u32)DUMMY_OUTPUT, ParamEntry(tg_param_convert::EmptyParamCtrl, tg_param_ctrl::General_Ctrl))); |
| | | mctrl_list.insert(std::pair<u32, ParamEntry>((u32)PROC_FIR, ParamEntry(tg_param_convert::FirParamCtrl, tg_param_ctrl::Fir_Ctrl))); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | /* |
| | | * scene.c |
| | | * |
| | | * Created on: 2025å¹´7æ18æ¥ |
| | | * Created on: 2025å¹´7æ18æ¥ |
| | | * Author: 86189 |
| | | */ |
| | | #include <string.h> |
| | |
| | | tgScene::tgScene(hw_adapter_t* adapter):Scene(adapter) |
| | | { |
| | | s8 inport_str[16],outport_str[16]; |
| | | <<<<<<< HEAD |
| | | s8 ana_input_num, ana_output_num, loc_input_num, loc_output_num, dante_input_num, dante_output_num ; |
| | | s8 usb_input_num, usb_output_num; |
| | | s16 input_num, output_num ; |
| | | s32 n, new_idx = 300; //ID of the USB channel starts from 300. |
| | | ======= |
| | | s8 ana_input_num, ana_output_num,dante_input_num,dante_output_num ; |
| | | s8 usb_input_num = 2, usb_output_num = 2; |
| | | s16 input_num, output_num ; |
| | | s32 n, new_idx = 300; //usb æ°å¢æ¨¡åIDä»300å¼å§(ä¸arm/pcååä¸è´)ï¼ä½¿ç¨new_idxéå¢. |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | s16 dual_dsp = adapter->get_system_is_dual_dsp(); |
| | | s16 dsp_index = adapter->get_dsp_index(); |
| | | |
| | | <<<<<<< HEAD |
| | | adapter->get_channel_num(&loc_input_num, &loc_output_num, &dante_input_num, &dante_output_num, &usb_input_num, &usb_output_num); |
| | | ana_input_num = loc_input_num - usb_input_num; |
| | | ana_output_num = loc_output_num - usb_output_num; |
| | | |
| | | //ç©çè¾å
¥å
±16+16+2 |
| | | ======= |
| | | adapter->get_channel_num(&ana_input_num, &ana_output_num, &dante_input_num, &dante_output_num); |
| | | |
| | | //æ°å¢å ç2x2 usbæ¯å¸¦å¤ççåè¾å
¥ï¼è¾åºå¹³çº§ |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | input_num = ana_input_num + dante_input_num + usb_input_num; //2 USB |
| | | output_num = ana_output_num + dante_output_num + usb_output_num; |
| | | |
| | | tgScene_param_default(¶meters); |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | //åªæphysic_type 为PHY_INPUTåPHY_OUTPUTç æä¼è°ç¨XX_adapter.cppä¸çget_physical_channel彿°. |
| | | //æä»¥è¿2两个模åç±»å port_str 对åºçæ¯é»è¾ééåºè¯¥è¦çå°ææç©çééå
æ¬æ¨¡æãdanteãusb. |
| | | //é»è¾ééä¹å°±æ¯PC软件çå°çéé顺åºï¼ana+dante+usbL+usbR+am+aec+ansï¼. |
| | | //ç©çé鿝DMAé
ç½®ç顺åºï¼get_physical_channelå°±æ¯åé»è¾ééå°ç©çééçæ å°. |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | sprintf(inport_str, "1-%d", input_num); |
| | | __MADD(299,PROC_INPUT,inport_str,inport_str,0, 1 ,¶meters.input, 0, ModuleInterfaceType::PHY_INPUT); |
| | | |
| | |
| | | //The number of DSPs is 1, but the number of input and output channels is greater than 16. |
| | | //It only processes analog input and output. |
| | | //However, for the channels that do not need to be processed, the level offset needs to be calculated. |
| | | if(!dual_dsp && input_num >16) { |
| | | n = ana_input_num; |
| | | } |
| | | else { |
| | | n= input_num; |
| | | } |
| | | // if(!dual_dsp && input_num >16) { |
| | | // n = ana_input_num; |
| | | // } |
| | | // else { |
| | | // n= input_num; |
| | | // } |
| | | |
| | | //expander |
| | | for(s32 i =0 ;i < input_num ; i++) { |
| | |
| | | //am |
| | | sprintf(inport_str, "1-%d", input_num); |
| | | sprintf(outport_str, "1-%d", input_num+1); |
| | | <<<<<<< HEAD |
| | | __MADD(161,PROC_AUTOMIXER,inport_str, outport_str, 0, 0, ¶meters.automixer, 0, ModuleInterfaceType::SOFT_MODULE); //¿ÃÃæ»» |
| | | ======= |
| | | __MADD(161,PROC_AUTOMIXER,inport_str, outport_str, 0, 0, ¶meters.automixer, 0, ModuleInterfaceType::SOFT_MODULE); //坿¿æ¢ |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | //aec selector |
| | | sprintf(inport_str, "1-%d", input_num+ 1); |
| | |
| | | //mixer |
| | | sprintf(inport_str, "1-%d", input_num+ 3); |
| | | sprintf(outport_str, "%d-%d",input_num+4, input_num+output_num+4); |
| | | <<<<<<< HEAD |
| | | __MADD(166,PROC_MIXER,inport_str,outport_str,1, 1 ,¶meters.mixer, 0, ModuleInterfaceType::SOFT_MODULE); // .begin()+48 |
| | | ======= |
| | | __MADD(166,PROC_MIXER,inport_str,outport_str,1, 1 ,¶meters.mixer, 0, ModuleInterfaceType::SOFT_MODULE); // .begin()+48 |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | //crossover |
| | | for(s32 i =0 ;i < output_num ; i++) { |
| | |
| | | |
| | | //eq |
| | | for(s32 i =0 ;i < output_num ; i++) { |
| | | <<<<<<< HEAD |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(199+i,PROC_EQ,outport_str, outport_str,1, 0, ¶meters.out2[i], 8, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx++,PROC_EQ,outport_str, outport_str,1, 0, ¶meters.out2[i], 8, ModuleInterfaceType::SOFT_MODULE); |
| | | ======= |
| | | sprintf(inport_str, "%d|", i+input_num+4); |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(199+i,PROC_EQ,inport_str, outport_str,1, 0, ¶meters.out2[i], 8, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx++,PROC_EQ,inport_str, outport_str,1, 0, ¶meters.out2[i], 8, ModuleInterfaceType::SOFT_MODULE); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | //delay |
| | | for(s32 i =0 ;i < output_num ; i++) { |
| | | <<<<<<< HEAD |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(231+i,PROC_DELAY,outport_str, outport_str,1, 0, ¶meters.out3[i], 1200, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx++,PROC_DELAY,outport_str, outport_str,1, 0, ¶meters.out3[i], 1200, ModuleInterfaceType::SOFT_MODULE); |
| | | ======= |
| | | sprintf(inport_str, "%d|", i+input_num+4); |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(231+i,PROC_DELAY,inport_str, outport_str,1, 0, ¶meters.out3[i], 1200, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx++,PROC_DELAY,inport_str, outport_str,1, 0, ¶meters.out3[i], 1200, ModuleInterfaceType::SOFT_MODULE); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | //limit |
| | | for(s32 i =0 ;i < output_num ; i++) { |
| | | <<<<<<< HEAD |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(263+i,PROC_LIMIT,outport_str, outport_str,1, 0, ¶meters.out4[i],0, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx++,PROC_LIMIT,outport_str, outport_str,1, 0, ¶meters.out4[i],0, ModuleInterfaceType::SOFT_MODULE); |
| | | ======= |
| | | sprintf(inport_str, "%d|", i+input_num+4); |
| | | sprintf(outport_str, "%d|", i+1); |
| | | if(i < output_num - usb_output_num) |
| | | __MADD(263+i,PROC_LIMIT,inport_str, outport_str,1, 0, ¶meters.out4[i],0, ModuleInterfaceType::SOFT_MODULE); |
| | | else |
| | | __MADD(new_idx,PROC_LIMIT,inport_str, outport_str,1, 0, ¶meters.out4[i],0, ModuleInterfaceType::SOFT_MODULE); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | //output |
| | |
| | | __MADD(296,PROC_SYSCTL,outport_str,outport_str,1, 1, ¶meters.sysctl,0, ModuleInterfaceType::PHY_OUTPUT); |
| | | //meter |
| | | __MADD(297,PROC_METER,outport_str,"",1, 1, NULL, 0, ModuleInterfaceType::SOFT_MODULE); |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | |
| | | break; |
| | | |
| | | case PROC_FIR: |
| | | <<<<<<< HEAD |
| | | ptag_fir pfir = (ptag_fir)param_ptr; |
| | | pfir->bypass = allbypass; |
| | | pfir->taps = 1024; |
| | | memset((void*)pfir->coeffs, 0, sizeof(pfir->coeffs)); |
| | | pfir->coeffs[0] = 1; |
| | | ======= |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | break; |
| | | |
| | | default: |
| | |
| | | s32 tgScene::set_parameters_content(uvoid* param, s32 size) |
| | | { |
| | | tag_parameters* pp = (tag_parameters*)param; |
| | | <<<<<<< HEAD |
| | | int L[24] = {0}; |
| | | if(pp->magic != 0xbcba || size != sizeof(tag_parameters)) { |
| | | printf("preset param error!\n"); |
| | | /*printf("tag_head:%d,%d,%d,%d,%d\n", L[0]=sizeof(parameters.magic), L[1]=sizeof(parameters.nmds)+L[0], L[2]=sizeof(parameters.pad1)+L[1], L[3]=sizeof(parameters.pad2)+L[2], L[4]=sizeof(parameters.crc)+L[3]); |
| | | printf("tag_input:%d, %d\n", sizeof(tag_input), L[5]=sizeof(tag_input)+L[4]); |
| | | printf("tag_module_in:%d, %d\n", sizeof(tag_module), L[6]=sizeof(tag_module) * MAX_INPUT_NUM * 5 + L[5]); |
| | | |
| | | printf("tag_automixer:%d, %d\n", sizeof(tag_automixer), L[7]=sizeof(tag_automixer)+L[6]); |
| | | printf("tag_select1:%d, %d\n", sizeof(tag_selector), L[8]=sizeof(tag_selector)+L[7]); |
| | | printf("tag_aec:%d, %d\n", sizeof(tag_aec), L[9]=sizeof(tag_aec)+L[8]); |
| | | printf("tag_selector:%d, %d\n", sizeof(tag_selector), L[10]=sizeof(tag_selector) + L[9]); |
| | | printf("tag_3a:%d, %d, %d\n", sizeof(tag_3a), L[11]=sizeof(tag_3a)+L[10]); |
| | | printf("tag_mixer:%d, %d\n", sizeof(tag_mixer), L[12]=sizeof(tag_mixer)+L[11]); |
| | | |
| | | printf("tag_module_o1:%d, %d\n", sizeof(tag_module), L[13]=sizeof(tag_module) * MAX_INPUT_NUM + L[12]); |
| | | printf("tag_module_fir:%d\n", sizeof(tag_module_fir), L[14]=sizeof(tag_module_fir) * MAX_OUTPUT_NUM + L[13]); |
| | | printf("tag_module_out:%d\n", sizeof(tag_module), L[15]=sizeof(tag_module) * MAX_OUTPUT_NUM * 2 + L[14]); |
| | | printf("tag_output:%d, %d\n", sizeof(tag_output), L[16]=sizeof(tag_output)+L[15]); |
| | | printf("tag_sysctl:%d, %d\n", sizeof(tag_sysctl), L[17]=sizeof(tag_sysctl)+L[16]); |
| | | printf("tag_group:%d, %d\n", sizeof(tag_group), L[18]=sizeof(tag_group)+L[17]);*/ |
| | | |
| | | printf("Len parameters:%d, Len recv:%d\n", L[19]=sizeof(tag_parameters), size); |
| | | ======= |
| | | if(pp->magic != 0xbcba || size != sizeof(tag_parameters)) { |
| | | printf("preset param error!\n"); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | return -1; |
| | | } |
| | | memcpy(¶meters, param, sizeof(tag_parameters)); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | s32 tgScene::update_dynmodule_tag(s32 proc_type,struct proc_field* proc) |
| | | s32 tgScene::update_dynmodule_tag(s32 proc_type, struct proc_field* proc) |
| | | { |
| | | switch(proc_type) { |
| | | case ModuleType::PROC_GEQ:{ |
| | |
| | | |
| | | s32 tgScene::update_module() |
| | | { |
| | | <<<<<<< HEAD |
| | | s8 ana_input_num, ana_output_num,dante_input_num,dante_output_num, usb_input_num, usb_output_num ; |
| | | ======= |
| | | s8 ana_input_num, ana_output_num,dante_input_num,dante_output_num ; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | s16 input_num, output_num ; |
| | | s16 dual_dsp = hw_adapter->get_system_is_dual_dsp(); |
| | | s16 dsp_index = hw_adapter->get_dsp_index(); |
| | | |
| | | hw_adapter->get_channel_num(&ana_input_num, &ana_output_num, &dante_input_num, &dante_output_num); |
| | | hw_adapter->get_channel_num(&ana_input_num, &ana_output_num, &dante_input_num, &dante_output_num, &usb_input_num, &usb_output_num); |
| | | input_num = ana_input_num + dante_input_num; |
| | | output_num = ana_output_num + dante_output_num; |
| | | |
| | |
| | | if(pmodule->proc_type >= ModuleType::PROC_COUNT || pmodule->proc_type < ModuleType::PROC_NONE) { |
| | | pmodule->proc_type = ModuleType::PROC_NONE; |
| | | } |
| | | update_dynmodule_tag(pmodule->proc_type, &iter); |
| | | |
| | | // if(iter.dsp_index == 0) { |
| | | // s32 n = input_num; |
| | | // s32 ninports = str_delim((const s8*)iter.inportstr, port_number); |
| | | // |
| | | // //Consider PCM model&& PCM channel don't process. |
| | | // if(dual_dsp == 0 && input_num >16){ |
| | | // n = ana_input_num; |
| | | // } |
| | | // |
| | | // if(ninports == 1 && port_number[0] >= n){ |
| | | // iter.proc_type = ModuleType::PROC_NONE;//便äºè§£æåºæ¯è¿æ»¤ |
| | | // //even though module not to process, but the pc has level offset. |
| | | // if(port_number[0] >= input_num) { |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | // else { |
| | | // s32 n = output_num; |
| | | // s32 ninports = str_delim(iter.inportstr, port_number); |
| | | // |
| | | // if(dual_dsp == 0 && output_num >16){ |
| | | // n = ana_output_num; |
| | | // } |
| | | // |
| | | // if(ninports==1 && port_number[0] >= n){ |
| | | // iter.proc_type = ModuleType::PROC_NONE; //便äºè§£æåºæ¯è¿æ»¤ |
| | | // //even though module not to process, but the pc has level offset. |
| | | // if(port_number[0] >= output_num) { |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | update_dynmodule_tag(pmodule->proc_type, &iter); |
| | | } |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | uvoid* tgScene::get_module_param_ptr(uvoid *param, s32 fixed) |
| | | uvoid* tgScene::get_module_param_ptr(s32 mType, uvoid *param, s32 fixed) |
| | | { |
| | | uvoid *ptr = param; |
| | | |
| | | if(fixed == 0){ |
| | | ptag_module pmod = (ptag_module)param; |
| | | ptr = (void*)pmod->proc_ins; |
| | | if (PROC_FIR == mType) { |
| | | ptag_module_fir pmod = (ptag_module_fir)param; |
| | | ptr = (void*)pmod->proc_ins; |
| | | } |
| | | else { |
| | | ptag_module pmod = (ptag_module)param; |
| | | ptr = (void*)pmod->proc_ins; |
| | | } |
| | | } |
| | | return ptr; |
| | | } |
| | | |
| | | |
| | | u32 tgScene::get_module_id(u32 mid, s32 mtype , u32 pid) |
| | | { |
| | | if(mtype == PROC_INPUT && (pid == INPUT_TYPE || pid == INPUT_FREQ || pid == INPUT_LEVEL)){ |
| | | mid = 300; |
| | | } |
| | | else if(mtype == PROC_DUCKER && pid == DUCKER_MIX){ |
| | | mid = mid + 320; |
| | | } |
| | | |
| | | return mid; |
| | | } |
| | | //u32 tgScene::get_module_id(u32 mid, s32 mtype , u32 pid) |
| | | //{ |
| | | // if(mtype == PROC_INPUT && (pid == INPUT_TYPE || pid == INPUT_FREQ || pid == INPUT_LEVEL)){ |
| | | // mid = 300; |
| | | // } |
| | | // else if(mtype == PROC_DUCKER && pid == DUCKER_MIX){ |
| | | // mid = mid + 320; |
| | | // } |
| | | // |
| | | // return mid; |
| | | //} |
| | |
| | | #include "../protocol.h" |
| | | #include "module_def.h" |
| | | |
| | | <<<<<<< HEAD |
| | | #pragma pack (1) |
| | | ======= |
| | | |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | typedef struct { |
| | | unsigned short magic; |
| | | unsigned short nmds; |
| | | |
| | | unsigned short pad1; |
| | | unsigned short pad2; |
| | | |
| | | unsigned short crc[2]; |
| | | |
| | | tag_input input; //1362 |
| | | |
| | | <<<<<<< HEAD |
| | | tag_module in1[MAX_INPUT_NUM]; //4352 |
| | | ======= |
| | | tag_input input;//1282 |
| | | |
| | | tag_module in1[MAX_INPUT_NUM]; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | tag_module in2[MAX_INPUT_NUM]; |
| | | tag_module in3[MAX_INPUT_NUM]; |
| | | tag_module in4[MAX_INPUT_NUM]; |
| | | tag_module in5[MAX_INPUT_NUM]; |
| | | |
| | | tag_automixer automixer;//138 |
| | | tag_selector aec_selector; //68 |
| | | tag_aec aec; //4 |
| | | tag_selector ans_selector; //68 |
| | | tag_3a afc_ns;//4 |
| | | tag_mixer mixer; //728 -4 |
| | | tag_automixer automixer; //366 |
| | | tag_selector aec_selector; //208 |
| | | tag_aec aec; //4 |
| | | tag_selector ans_selector; //208 |
| | | tag_3a afc_ns; //36 |
| | | tag_mixer mixer; //5242 |
| | | |
| | | tag_module out1[MAX_OUTPUT_NUM]; |
| | | tag_module out2[MAX_OUTPUT_NUM]; |
| | | tag_module out3[MAX_OUTPUT_NUM]; |
| | | tag_module out4[MAX_OUTPUT_NUM]; |
| | | tag_output output; |
| | | tag_sysctl sysctl; |
| | | tag_group group; |
| | | tag_module out1[MAX_OUTPUT_NUM]; //4352 |
| | | // tag_module out2[MAX_OUTPUT_NUM]; |
| | | tag_module_fir out2[MAX_OUTPUT_NUM]; //140080 |
| | | tag_module out3[MAX_OUTPUT_NUM]; |
| | | tag_module out4[MAX_OUTPUT_NUM]; |
| | | tag_output output; //1158 |
| | | tag_sysctl sysctl; //6 |
| | | tag_group group; //272 |
| | | } tag_parameters, *ptag_parameters; |
| | | |
| | | #pragma pack () |
| | | |
| | | class tgScene: public Scene |
| | | { |
| | |
| | | |
| | | virtual s32 set_parameters_content(uvoid* param, s32 size) override; |
| | | |
| | | virtual uvoid* get_module_param_ptr(uvoid *param, s32 fixed) override; |
| | | virtual uvoid* get_module_param_ptr(s32 mType, uvoid *param, s32 fixed) override; |
| | | |
| | | virtual u32 get_module_id(u32 mid, s32 mtype ,u32 pid) override; |
| | | // virtual u32 get_module_id(u32 mid, s32 mtype ,u32 pid) override; |
| | | }; |
| | | |
| | | |
| | |
| | | * Created on: 2025å¹´7æ24æ¥ |
| | | * Author: 86189 |
| | | */ |
| | | #include <stdio.h> |
| | | #include "IModule.h" |
| | | #include "module_def.h" |
| | | #include "tg_user_ctrl.h" |
| | | |
| | | |
| | | u32 tg_param_ctrl::Signalgen_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Signalgen_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum SGItemType{ |
| | | SG_MUTE = 0x1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Input_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Input_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum GainID { |
| | | enum Input_ID{ |
| | | GAIN = 0x1, |
| | | MUTE, |
| | | SENSI, |
| | | PHANTOM, |
| | | |
| | | PHASE = 9, |
| | | STEP,//-500~+500 |
| | | TYPE, |
| | | FREQ, |
| | | LEVEL, |
| | | NAME, |
| | | PHASE, |
| | | STEP, |
| | | LINK, |
| | | CHANNEL_LEVEL, |
| | | |
| | | INPUT_MIN, |
| | | INPUT_MAX, |
| | | }; |
| | | |
| | | |
| | | enum PitchID { |
| | | PITCH_BYPASS = 0x1,// |
| | | PITCH_SEMITONES,// |
| | | }; |
| | | |
| | | |
| | | short val[4]; |
| | | int channel = val_c[0]&(MAX_INPUT_NUM-1); |
| | | int channel = val_c[0];//&(MAX_INPUT_NUM-1); |
| | | |
| | | if(pID == INPUT_STEP) { |
| | | val[0] = channel; val[1] = RESSIGNBIT(val_c[1]); |
| | | m->Ctrl(STEP, val, 2); |
| | | } |
| | | else { |
| | | val[0] = channel; val[1] = RESSIGNBIT(val_c[1]); |
| | | m->Ctrl(pID, val, 2); |
| | | } |
| | | val[0] = channel; val[1] = RESSIGNBIT(val_c[1]); |
| | | m->Ctrl(pID, val, 2); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Gain_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Gain_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum GainID { |
| | | GAIN = 0x1, |
| | |
| | | }; |
| | | |
| | | short val[4]; |
| | | int channel = val_c[0]&(MAX_INPUT_NUM-1); |
| | | int channel = val_c[0];//&(MAX_INPUT_NUM-1); |
| | | |
| | | if(pID == 0x20) { |
| | | val[0] = channel; val[1] = RESSIGNBIT(val_c[1]); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Output_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Output_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum GainID { |
| | | GAIN = 0x1, |
| | |
| | | }; |
| | | |
| | | short val[4]; |
| | | int channel = val_c[0]&(MAX_OUTPUT_NUM-1); |
| | | int channel = val_c[0];//&(MAX_OUTPUT_NUM-1); |
| | | |
| | | short cmd[16] = {GAIN, MUTE, 0, PHASE, SENSI, STEP, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 }; |
| | | val[0] = channel; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Mixer_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Mixer_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | short val[4]; |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Crossover_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Crossover_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum CFilterID { |
| | | _BYPASS = 0x1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Feedback_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Feedback_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | // enum NHSID{ |
| | | // FB_BYPASS = 0x1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Automixer_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Automixer_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum GainSharingAMID { |
| | | AM_BYPASS =0x1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Aec_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Aec_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum AECID{ |
| | | BYPASS = 0X1, |
| | |
| | | AGC_GAIN, |
| | | }; |
| | | |
| | | short val[4] = {0,0,0,0}; |
| | | short cmd[3] = {0, BYPASS, NLPLEVEL}; |
| | | |
| | | short val[4]; |
| | | short cmd[12] = {0, BYPASS, NLPLEVEL, 0, 0,0}; |
| | | |
| | | val[0] = RESSIGNBIT(val_c[0]); |
| | | val[1] = RESSIGNBIT(val_c[1]); |
| | | m->Ctrl(cmd[pID], val, 1); |
| | | val[1] = RESSIGNBIT(val_c[0]); |
| | | m->Ctrl(cmd[pID], val, 2); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Sysctl_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Sysctl_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum SYSCTRLID{ |
| | | SYSCTL_MUTE = 0x1, //val[0]:0-unmute,1-mute |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Geq_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Geq_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum EQID{ |
| | | EQ_BYPASS_ALL = 0x1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Reverb_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Reverb_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | short val[4]; |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Echo_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::Echo_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum EchoID{ |
| | | ECHO_BYPASS = 1, |
| | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::General_Ctrl(IModule* m, u32 pID, s16* val_c) |
| | | u32 tg_param_ctrl::General_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | short val[4]; |
| | | |
| | |
| | | val[1] = RESSIGNBIT(val_c[1]); |
| | | |
| | | m->Ctrl(pID, val, 2); |
| | | // printf("pID:%d v[0]:%d v[1]:%d\n", pID, val[0], val[1]); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | u32 tg_param_ctrl::Fir_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num) |
| | | { |
| | | enum FIRID { |
| | | FIR_BYPASS = 0x1, ////val[0]: 0-åæ¶bypass, 1- 使è½bypass |
| | | FIR_NAME, //æ ç¨ |
| | | FIR_TAPS, //æ ç¨ |
| | | FIR_COEFFS, //val: åå
ï¼æå¤§é¿åº¦1024 float. æ 转æ¢ç´æ¥æ·è´float. |
| | | }; |
| | | s16 val[4]; |
| | | val[0] = RESSIGNBIT(val_c[0]); |
| | | |
| | | if(FIR_BYPASS == pID){ |
| | | m->Ctrl(pID, val, 1); // val[0] is bypass or nobypass |
| | | } |
| | | else if (FIR_COEFFS == pID){ |
| | | m->Ctrl(pID, val_c, num); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | class tg_param_ctrl { |
| | | public: |
| | | static u32 Signalgen_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Input_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Gain_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Output_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Mixer_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Crossover_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Feedback_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Automixer_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Aec_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Sysctl_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Geq_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Reverb_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Echo_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 General_Ctrl(IModule* m, u32 pID, s16* val_c); |
| | | static u32 Signalgen_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Input_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Gain_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Output_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Mixer_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Crossover_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Feedback_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Automixer_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Aec_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Sysctl_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Geq_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Reverb_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Echo_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 General_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | static u32 Fir_Ctrl(IModule* m, u32 pID, s16* val_c, u32 num); |
| | | }; |
| | | |
| | | |
| | |
| | | #define dbg_printf |
| | | #endif |
| | | |
| | | static ToB* tob = NULL; |
| | | //static ToB* tob = NULL; |
| | | |
| | | ToB* ToB::GetInstance() |
| | | { |
| | | return tob; |
| | | } |
| | | //ToB* ToB::GetInstance() |
| | | //{ |
| | | // return tob; |
| | | //} |
| | | |
| | | ToB::ToB(ubool dualDsp, u32 dspIndex ) |
| | | : dual_dsp(dualDsp), dsp_index(dspIndex),mList(32) |
| | | : dual_dsp(dualDsp), dsp_index(dspIndex) |
| | | { |
| | | if(tob != NULL) { |
| | | delete tob; |
| | | } |
| | | tob = this; |
| | | frames = NULL; |
| | | // if(tob != NULL) { |
| | | // delete tob; |
| | | // } |
| | | // tob = this; |
| | | frames = nullptr; |
| | | processed = ufalse; |
| | | mModuleNum =0; |
| | | mModuleIndex.resize(0); |
| | |
| | | ToB::~ToB() |
| | | { |
| | | toClear(); |
| | | <<<<<<< HEAD |
| | | // tob = NULL; |
| | | ======= |
| | | tob = NULL; |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | delete paramset; |
| | | } |
| | | |
| | |
| | | ErrStatus ToB::toClear() |
| | | { |
| | | processed = ufalse; |
| | | int i = 0; |
| | | |
| | | for (std::vector<IModule*>::iterator iter = mList.begin(); |
| | | iter != mList.end() ;iter++) { |
| | | delete *iter; |
| | | // for (std::vector<IModule*>::iterator iter = mList.begin(); iter != mList.end(); iter++, ++i) { |
| | | // delete *iter; |
| | | // *iter = nullptr; |
| | | // } |
| | | for (auto iter : mList) { |
| | | delete iter; |
| | | iter = nullptr; |
| | | } |
| | | |
| | | mList.clear(); |
| | | mModuleIndex.clear(); |
| | | |
| | | if(frames != NULL) { |
| | | delete frames; |
| | | frames = nullptr; |
| | | } |
| | | mModuleNum = 0; |
| | | |
| | |
| | | |
| | | return ErrStatus::SUCCESS; |
| | | } |
| | | <<<<<<< HEAD |
| | | #define DEBUG 0 |
| | | ======= |
| | | |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | #if 1//DEBUG |
| | | const s8* type_string[ModuleType::PROC_COUNT] = { |
| | | "none" |
| | |
| | | const Module* pmod = (Module*)(bin+ size); size += sizeof(Module); |
| | | const u16* mRxbufID = (u16*)(bin + size); size += pmod->mRxNum * sizeof(u16); |
| | | const u16* mTxbufID = (u16*)(bin + size); size += pmod->mTxNum * sizeof(u16); |
| | | PhyPort* mPhyID ; |
| | | PhyPort* mPhyID; |
| | | ubool bInput=ufalse,bOutput=ufalse; |
| | | u16 mRxNum = pmod->mRxNum, mTxNum = pmod->mTxNum; |
| | | |
| | |
| | | |
| | | if (pmod->mDsp != dsp_index) continue; |
| | | |
| | | <<<<<<< HEAD |
| | | #if DEBUG |
| | | //if (PROC_FIR == pmod->mType) |
| | | printf("Module ID %d type %d %s rxnum %d txnum %d tag %d. \n",pmod->mID ,pmod->mType, type_string[pmod->mType], pmod->mRxNum,pmod->mTxNum,pmod->mTag); |
| | | ======= |
| | | #ifdef DEBUG |
| | | printf("Module ID %d type %d %s rxnum %d txnum %d tag %d. \n",pmod->mID ,pmod->mType, type_string[pmod->mType], pmod->mRxNum,pmod->mTxNum,pmod->mTag); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | #endif |
| | | |
| | | IModule* m = CreateBaseModule(pmod->mType, pmod->mTag, mRxNum, mTxNum); |
| | |
| | | continue; |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | // int ddr = sram_free_space(SRAM_DDR,mem_any); |
| | | // int ccm = sram_free_space(SRAM_L2,mem_any); |
| | | // int l1 = sram_free_space(SRAM_L1,mem_heap); |
| | | // printf("ddr %d ccm %d l1 %d.\n",ddr, ccm ,l1); |
| | | |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | m->SetModuleInfo(pmod->mID ,pmod->mType, pmod->mTag); |
| | | mList.push_back(m); |
| | | |
| | |
| | | |
| | | // printf("Module id:%d, Tx buffer id:", pmod->mID); |
| | | for (size_t i = 0; i < mTxNum && !bOutput; i++){ |
| | | <<<<<<< HEAD |
| | | // printf("bid %d, ", mTxbufID[i]); |
| | | ======= |
| | | printf("bid %d, ", mTxbufID[i]); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | if (mTxbufID[i] > 0) { |
| | | Frame* pcm = frames->GetFrame(mTxbufID[i]-1); |
| | | m->SetOutputChannelDataPtr(i, pcm); |
| | |
| | | nPhyInput[mPhyID[i].mIntType] = mPhyID[i].mPhyID; |
| | | m->SetInputChannelDataPtr(i, pcm); |
| | | SetRxChannelPtr(static_cast<IntDataType>(mPhyID[i].mIntType), mPhyID[i].mPhyID-1, pcm->Data()); |
| | | <<<<<<< HEAD |
| | | // printf("phy_id %d\n", mPhyID[i].mPhyID); |
| | | ======= |
| | | printf("phy_id %d\n", mPhyID[i].mPhyID); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | } |
| | | else { |
| | |
| | | } |
| | | // printf(";Rx buffer id:"); |
| | | for (size_t i = 0; i < mRxNum && !bInput; i++) { |
| | | <<<<<<< HEAD |
| | | // printf("mID %d,bid %d\n", pmod->mID, mRxbufID[i]); |
| | | ======= |
| | | // printf("bid %d", mRxbufID[i]); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | if (mRxbufID[i] > 0) { |
| | | Frame* pcm = frames->GetFrame(mRxbufID[i]-1 ); |
| | | m->SetInputChannelDataPtr(i, pcm); |
| | |
| | | if(nPhyOutput[mPhyID[i].mIntType] < mPhyID[i].mPhyID) |
| | | nPhyOutput[mPhyID[i].mIntType] = mPhyID[i].mPhyID; |
| | | |
| | | pcm = frames->AllocFrame(); |
| | | //pcm = frames->AllocFrame(); // It is not necessary to be compatible with the AXE1208 series here, because the TOP architecture is different. |
| | | m->SetOutputChannelDataPtr(i, pcm); |
| | | SetTxChannelPtr(static_cast<IntDataType>(mPhyID[i].mIntType), mPhyID[i].mPhyID-1, pcm->Data()); |
| | | <<<<<<< HEAD |
| | | // printf("mID %d,bid %d\n", pmod->mID, mPhyID[i].mPhyID-1); |
| | | // printf("phy_type %d, _id %d\n", mPhyID[i].mIntType, mPhyID[i].mPhyID); |
| | | ======= |
| | | // printf("phy_id %d", mPhyID[i].mPhyID); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | } |
| | | else { |
| | |
| | | // printf("\n"); |
| | | |
| | | m->Init(); |
| | | <<<<<<< HEAD |
| | | |
| | | // ä» paramset ä¸è·å对åºçåæ°æ§å¶å½æ°æé |
| | | ParamCtrl_fn paramEntry = paramset->GetParamEntry( m->GetModuleType()); |
| | | if(paramEntry == NULL) { |
| | | printf("paramEntry is NULL!\n"); |
| | | } |
| | | // è°ç¨åæ°æ§å¶å½æ° |
| | | u32 result = paramEntry(m, (uvoid*)pmod->mParamaddr, len); |
| | | ======= |
| | | // paramset->GetParamEntry(m->GetModuleType())(m, (uvoid*)pmod->mParamaddr, len); |
| | | // è·å模åç±»å |
| | | u32 moduleType = m->GetModuleType(); |
| | |
| | | void* paramAddr = (uvoid*)pmod->mParamaddr; |
| | | // è°ç¨åæ°æ§å¶å½æ° |
| | | u32 result = paramEntry(m, paramAddr, len); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | |
| | | } while (size < nbytes); |
| | | |
| | | // int ddr = sram_free_space(SRAM_DDR,mem_any); |
| | | // int ccm = sram_free_space(SRAM_L2,mem_any); |
| | | // int l1 = sram_free_space(SRAM_L1,mem_heap); |
| | | // printf("mListAdd:0x%x, ddr %d ccm %d l1 %d.\n", &mList, ddr, ccm ,l1); |
| | | |
| | | //for (auto pl : mList) { |
| | | // delete pl; |
| | | // int l2mem = sram_free_space(SRAM_L2, mem_any); |
| | | // printf("L2mem %d\n", l2mem); |
| | | //} |
| | | |
| | | if (size != nbytes) { |
| | | dbg_printf("check flowchart some error!\n"); |
| | |
| | | { |
| | | if(processed) { |
| | | for (auto iter = mList.begin(); iter < mList.end(); iter++) { |
| | | <<<<<<< HEAD |
| | | // if(((*iter)->GetModuleType() >= 6) && ((*iter)->GetModuleType() <= 6)) { |
| | | ======= |
| | | // if(((*iter)->GetModuleType() >= 9) && ((*iter)->GetModuleType() <= 9)) { |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | // printf("%d ", (*iter)->GetModuleID()); |
| | | (*iter)->Proc(); |
| | | // } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | /*ErrStatus ToB::toCtrl(u32 mID, u32 pID, const s16* val, u32 num) |
| | | { |
| | | if(mID >= mModuleIndex.size() || mModuleIndex[mID] == 0) { |
| | | printf("ToB::toCtrl mID Error!\n"); |
| | | return ErrStatus::ERR_PARAM; |
| | | } |
| | | |
| | | IModule* m = mList[mModuleIndex[mID]-1]; |
| | | if(!m) { |
| | | printf("ToB::toCtrl m Error!\n"); |
| | | return ErrStatus::ERR_PARAM; |
| | | } |
| | | |
| | | auto entries = paramset->GetEntries(m->GetModuleType()); |
| | | if(!entries.second) { |
| | | printf("ToB::toCtrl entries Error!\n"); |
| | | return ErrStatus::ERR_METHOD; |
| | | } |
| | | |
| | | entries.second(m, pID, const_cast<s16*>(val), num); |
| | | return ErrStatus::SUCCESS; |
| | | }*/ |
| | | ErrStatus ToB::toCtrl(u32 mID, u32 pID, const s16* val, u32 num) |
| | | { |
| | | if(mID >= mModuleIndex.size() || mModuleIndex[mID] == 0) { |
| | |
| | | |
| | | IModule* m = mList[mModuleIndex[mID]-1]; |
| | | if( m != NULL) { |
| | | <<<<<<< HEAD |
| | | // m->Ctrl(pID, val, num); |
| | | paramset->GetCtrlEntry(m->GetModuleType())(m, pID, (s16*)val, num); |
| | | ======= |
| | | //m->Ctrl(pID, val, num); |
| | | paramset->GetCtrlEntry(m->GetModuleType())(m, pID, (s16*)val); |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | } |
| | | |
| | | // printf("mID:%d pID:%d val[0]:%d val[1]:%d\n",mID, pID, val[0], val[1]); |
| | | return ErrStatus::SUCCESS; |
| | | } |
| | | |
| | |
| | | public: |
| | | ToB(ubool dualDsp, u32 dspIndex); |
| | | ~ToB(); |
| | | static ToB* GetInstance(); |
| | | // static ToB* GetInstance(); |
| | | ToB(const ToB&) = delete; |
| | | ToB& operator=(const ToB&) = delete; |
| | | static ToB* GetInstance(ubool dualDsp = true, u32 dspIndex = 0) { |
| | | static ToB instance(dualDsp, dspIndex); |
| | | return &instance; |
| | | } |
| | | uvoid SetMute(ubool mute); |
| | | ErrStatus toClear(); |
| | | ErrStatus toProc(); |
| | |
| | | /* |
| | | <<<<<<< HEAD |
| | | ** ADSP-21569 linker description file generated on Sep 05, 2025 at 15:48:19. |
| | | ======= |
| | | ** ADSP-21569 linker description file generated on Jul 24, 2025 at 14:17:30. |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | */ |
| | | /* |
| | | ** Copyright (C) 2000-2022 Analog Devices Inc., All Rights Reserved. |
| | | ** Copyright (C) 2000-2023 Analog Devices Inc., All Rights Reserved. |
| | | ** |
| | | ** This file is generated automatically based upon the options selected |
| | | ** in the System Configuration utility. Changes to the LDF configuration |
| | |
| | | ** placed within these sections are preserved when this file is re-generated. |
| | | ** |
| | | ** Product : CrossCore Embedded Studio |
| | | ** Tool Version : 6.2.3.3 |
| | | ** Tool Version : 6.2.5.2 |
| | | */ |
| | | |
| | | ARCHITECTURE(ADSP-21569) |
| | |
| | | // Stack and heap initial memory reserve. |
| | | dxe_block0_stack_and_heap_reserve NO_INIT BW |
| | | { |
| | | RESERVE(heaps_and_system_stack_in_L1, heaps_and_system_stack_in_L1_length = 32768, 8) |
| | | RESERVE(heaps_and_system_stack_in_L1, heaps_and_system_stack_in_L1_length = 189440, 8) |
| | | } > mem_block0_bw |
| | | |
| | | // Highest priority (prio0) data and code. |
| | |
| | | INPUT_SECTION_ALIGN(4) |
| | | RESERVE_EXPAND(heaps_and_system_stack_in_L1, heaps_and_system_stack_in_L1_length, 0, 8) |
| | | ldf_stack_space = heaps_and_system_stack_in_L1; |
| | | ldf_stack_end = (ldf_stack_space + (heaps_and_system_stack_in_L1_length - 8)); |
| | | ldf_stack_end = (ldf_stack_space + (((heaps_and_system_stack_in_L1_length * 57344) / 189440) - 8)); |
| | | ldf_stack_length = ldf_stack_end - ldf_stack_space; |
| | | L1mem_space = ldf_stack_end + 8; |
| | | L1mem_end = (L1mem_space + (((heaps_and_system_stack_in_L1_length * 132096) / 189440) - 8)); |
| | | L1mem_length = L1mem_end - L1mem_space; |
| | | } > mem_block0_bw |
| | | |
| | | dxe_l2_stack_and_heap_expand NO_INIT BW |
| | |
| | | /*$VDSG<insert-input-sections-at-the-start-of-dxe_sdram_stack_and_heap> */ |
| | | |
| | | RESERVE_EXPAND(heaps_and_system_stack_in_L3, heaps_and_system_stack_in_L3_length, 0, 8) |
| | | DDRHeap_space = heaps_and_system_stack_in_L3; |
| | | DDRHeap_space = heaps_and_system_stack_in_L3 + 8; |
| | | DDRHeap_end = (DDRHeap_space + (heaps_and_system_stack_in_L3_length - 8)); |
| | | DDRHeap_length = DDRHeap_end - DDRHeap_space; |
| | | } > SDRAM_STACK_HEAP_BLOCK |
| | |
| | | /* |
| | | <<<<<<< HEAD |
| | | ** ADSP-21569 app_IVT.s generated on Sep 05, 2025 at 15:48:19 |
| | | ======= |
| | | ** ADSP-21569 app_IVT.s generated on Jul 24, 2025 at 14:17:29 |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | */ |
| | | /* |
| | | ** Copyright (C) 2000-2022 Analog Devices Inc., All Rights Reserved. |
| | | ** Copyright (C) 2000-2023 Analog Devices Inc., All Rights Reserved. |
| | | ** |
| | | ** This file is generated automatically based upon the options selected |
| | | ** in the System Configuration utility. Changes to the Startup Code configuration |
| | |
| | | /* |
| | | <<<<<<< HEAD |
| | | ** ADSP-21569 user heap source file generated on Sep 05, 2025 at 15:48:19. |
| | | ======= |
| | | ** ADSP-21569 user heap source file generated on Jul 24, 2025 at 14:17:30. |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | */ |
| | | /* |
| | | ** Copyright (C) 2000-2022 Analog Devices Inc., All Rights Reserved. |
| | | ** Copyright (C) 2000-2023 Analog Devices Inc., All Rights Reserved. |
| | | ** |
| | | ** This file is generated automatically based upon the options selected |
| | | ** in the System Configuration utility. Changes to the Heap configuration |
| | |
| | | ** placed within these sections are preserved when this file is re-generated. |
| | | ** |
| | | ** Product : CrossCore Embedded Studio |
| | | ** Tool Version : 6.2.3.3 |
| | | ** Tool Version : 6.2.5.2 |
| | | */ |
| | | |
| | | #ifdef _MISRA_RULES |
| | |
| | | |
| | | extern "asm" unsigned long ldf_heap_space; |
| | | extern "asm" unsigned long ldf_heap_length; |
| | | extern "asm" int L1mem_space; |
| | | extern "asm" int L1mem_length; |
| | | extern "asm" int DDRHeap_space; |
| | | extern "asm" int DDRHeap_length; |
| | | |
| | | const __heap_desc_t heap_table[3] = |
| | | const __heap_desc_t heap_table[4] = |
| | | { |
| | | |
| | | { &ldf_heap_space, (unsigned long) &ldf_heap_length, 0 }, |
| | | { &DDRHeap_space, (unsigned long) &DDRHeap_length, 1 }, |
| | | { &L1mem_space, (unsigned long) &L1mem_length, 1 }, |
| | | { &DDRHeap_space, (unsigned long) &DDRHeap_length, 2 }, |
| | | |
| | | { (void *)0, (size_t)0, 0 } /* This terminates the table. */ |
| | | }; |
| | |
| | | /* |
| | | <<<<<<< HEAD |
| | | ** ADSP-21569 startup code generated on Sep 05, 2025 at 15:48:19. |
| | | ======= |
| | | ** ADSP-21569 startup code generated on Jul 24, 2025 at 14:17:29. |
| | | >>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430 |
| | | */ |
| | | /* |
| | | ** Copyright (C) 2000-2022 Analog Devices Inc., All Rights Reserved. |
| | | ** Copyright (C) 2000-2023 Analog Devices Inc., All Rights Reserved. |
| | | ** |
| | | ** This file is generated automatically based upon the options selected |
| | | ** in the System Configuration utility. Changes to the Startup Code configuration |
| | |
| | | ** placed within these sections are preserved when this file is re-generated. |
| | | ** |
| | | ** Product : CrossCore Embedded Studio |
| | | ** Tool Version : 6.2.3.3 |
| | | ** Tool Version : 6.2.5.2 |
| | | */ |
| | | |
| | | .FILE_ATTR libGroup="startup"; |