完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,前辈们好
我遇到了些问题。我正从事于创建一个在DSP端运行的集成了G723和G729编解码的服务器。 当codec server只有G723编解码器时,运行的很好。同样地,codec server只有G729编解码器运行时,也是工作的很好。但是当我把两者集成到一起时,问题就出现了。 当只有G723编解码器,并且正常工作时,我发现我应用程序里的SPHENC1_create()函数会调用一个sphenc1.c文件里面的SPHENC1_create()源码实现函数,在该sphenc1.c文件中,宏“MODNAME”被定义为“ti.sdo.ce.speech1.SPHENC1”,然后在对应的sphenc1.h文件中,宏“SPHENC1_VISATYPE”被定义为“ti.sdo.ce.speech1.ISPHENC1”。 同样地,当server只有G729编解码器,并且正常工作时,它调用的是另外一个sphenc1.c文件,在该文件中,宏“MODNAME”被定义为“ti.sdo.ce.examples.extensions.speech1.SPHENC1”,然后在对应的sphenc1.h文件中,宏“SPHENC1_VISATYPE”被定义为“ti.sdo.ce.examples.extensions.speech1.ISPHENC1”。 当我把它们集成到一起时,问题来了。 下面是我的codec server的配置文件 *.cfg ******************************************************************************************************************* var platformName = Program.platformName; var platform = Program.platform; var heapConfig = xdc.loadCapsule('ti/sdo/ce/examples/buildutils/heap_config.cfg'); var internalMemoryName = heapConfig.getInternalHeapName(); var internalHeapSize = 0xc000; var externalMemoryName = heapConfig.getExternalHeapName(); var externalHeapSize = 0x20000; Program.global.EXT_HEAP = heapConfig.createHeapMem(externalHeapSize, ".EXT_HEAP", "DDR3_DSP"); Program.global.INT_HEAP = heapConfig.createHeapMem(internalHeapSize, ".INT_HEAP", "IRAM"); var DDRALGMemoryName = "DDRALGHEAP"; var DDRALGHeapSize = platform.externalMemoryMap[DDRALGMemoryName].len; Program.global.EXTALG_HEAP = heapConfig.createHeapMem(DDRALGHeapSize, ".EXTALG_HEAP", DDRALGMemoryName); Program.sectMap[".text"] = externalMemoryName; var Memory = xdc.useModule('xdc.runtime.Memory'); Memory.defaultHeapInstance = Program.global.EXTALG_HEAP; xdc.useModule('ti.sy***ios.xdcruntime.Settings'); var BIOS = xdc.useModule("ti.sy***ios.BIOS"); BIOS.libType = BIOS.LibType_Custom; BIOS.logsEnabled = false; BIOS.assertsEnabled = false; var Diags = xdc.useModule("xdc.runtime.Diags"); var Load = xdc.useModule("ti.sy***ios.utils.Load"); Load.hwiEnabled = true; Load.swiEnabled = true; Load.taskEnabled = true; Load.common$.diags_USER4 = Diags.ALWAYS_OFF; var Cache = xdc.useModule('ti.sy***ios.family.c64p.Cache'); Cache.MAR0_31 = 0xffffffff; Cache.MAR32_63 = 0xffffffff; Cache.MAR64_95 = 0xffffffff; Cache.MAR96_127 = 0xffffffff; Cache.MAR128_159 = 0xffffffff; Cache.MAR160_191 = 0xffffffff; Cache.MAR192_223 = 0xffffffff; Cache.MAR224_255 = 0xffffffff; Cache.initSize.l1pSize = Cache.L1Size_32K; Cache.initSize.l1dSize = Cache.L1Size_32K; Cache.initSize.l2Size = Cache.L2Size_256K; var platformName = Program.platformName; var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global'); osalGlobal.runtimeEnv = osalGlobal.DSPLINK_BIOS; var myName = "DSP"; var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); var settings = xdc.useModule('ti.sdo.ipc.family.Settings'); var procNames = settings.getDeviceProcNames(); MultiProc.setConfig(myName, procNames); var platformBaseName = platformName.replace(/(w+):.*$/, "$1").replace(/./g, "_"); try [ xdc.loadCapsule(platformBaseName + ".cfg"); ] catch(e) [ throw "Error: cannot load example's platform capsule '" + platformBaseName + ".cfg' (either it doesn't exist or there's an error inside it)"; ] var G729ABDEC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abdec.G729ABDEC'); var G729ABENC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abenc.G729ABENC'); var G7231ADEC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231adec.G7231ADEC'); var G7231AENC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231aenc.G7231AENC'); var Server = xdc.useModule('ti.sdo.ce.Server'); Server.threadAttrs.stackSize = 2048; Server.threadAttrs.priority = Server.MINPRI; Server.stackSizePad = 9000; Server.algs = [ [name: "g729abdec", mod: G729ABDEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g729abenc", mod: G729ABENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g7231adec", mod: G7231ADEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g7231aenc", mod: G7231AENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], ]; var DSKT2 = xdc.useModule('ti.sdo.fc.dskt2.DSKT2'); DSKT2.DARAM0 = "EXTALG_HEAP"; DSKT2.DARAM1 = "EXTALG_HEAP"; DSKT2.DARAM2 = "EXTALG_HEAP"; DSKT2.SARAM0 = "EXTALG_HEAP"; DSKT2.SARAM1 = "EXTALG_HEAP"; DSKT2.SARAM2 = "EXTALG_HEAP"; DSKT2.ESDATA = "EXTALG_HEAP"; DSKT2.EPROG = "EXTALG_HEAP"; DSKT2.IPROG = "EXTALG_HEAP"; DSKT2.DSKT2_HEAP = "EXT_HEAP"; DSKT2.ALLOW_EXTERNAL_SCRATCH = true; DSKT2.SARAM_SCRATCH_SIZES[0] = 32 * 1024; var RMAN = xdc.useModule('ti.sdo.fc.rman.RMAN'); RMAN.useDSKT2 = true; RMAN.tableSize = 10; xdc.loadCapsule('ti/sdo/ce/examples/buildutils/server_log.cfg'); ******************************************************************************************************************* 如上文配置顺序那样,集成了两者以后,只有G723编解码器能正确工作,G729编解码器则不行,经过追踪,我发现了两者集成到一起后,G729编解码器没有调用自己应该调用的sphenc1.c文件里面的SPHENC1_create()函数,而是调用了属于G723的,两个sphenc1.c文件的区别就是上面说的两个宏定义差别。这样错误的调用,导致G729后面引用了错误的宏定义,即G729需要的是以下两个宏: #define MODNAME "ti.sdo.ce.examples.extensions.speech1.SPHENC1" #define SPHENC1_VISATYPE “ti.sdo.ce.examples.extensions.speech1.ISPHENC1” 却错误进入了G723的sphenc1.c和sphenc1.h两个文件,进而引用了错误的宏,进而导致编解码失败。 然后当我把配置文件作如下顺序调整时,导致了另一种结果: ******************************************************************************************************************* ... var G7231ADEC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231adec.G7231ADEC'); var G7231AENC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231aenc.G7231AENC'); var G729ABDEC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abdec.G729ABDEC'); var G729ABENC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abenc.G729ABENC'); ... Server.algs = [ [name: "g7231adec", mod: G7231ADEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g7231aenc", mod: G7231AENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g729abdec", mod: G729ABDEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g729abenc", mod: G729ABENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], ]; ... ******************************************************************************************************************* 这时G729正常工作了,G723却出错了,追踪结果跟上面一样,G723引用了G729的sphenc1.c和sphenc1.h,进而引用了错误的宏,进而出错。 接下来我又修改了一下: ******************************************************************************************************************* ... var G729ABDEC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abdec.G729ABDEC'); var G729ABENC = xdc.useModule('ti.sdo.ce.examples.codecs.g729abenc.G729ABENC'); var G7231ADEC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231adec.G7231ADEC'); var G7231AENC = xdc.useModule('ti.sdo.ce.examples.codecs.g7231aenc.G7231AENC'); ... Server.algs = [ [name: "g7231adec", mod: G7231ADEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g7231aenc", mod: G7231AENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g729abdec", mod: G729ABDEC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], [name: "g729abenc", mod: G729ABENC, groupId: 0, threadAttrs: [ stackSize: 4096, stackMemId: 0, priority: Server.MAXPRI] ], ]; ... ******************************************************************************************************************* 这时候凌乱了,分属两个sphenc1.c的调试打印信息,揉到一起了,然后两个编解码都不行工作了。 然后我就不知道是这个配置文件出问题了,还是分配的内存不够大,还是初始化出问题了。 请前辈们赐教! |
|
相关推荐
1 个讨论
|
|
终于搞明白了,原来ti.sdo.ce.examples.extensions.speech1.ISPHxxx1是修改后的接口,然后ti.sdo.ce.speech1.ISPHxxx1则是标准接口,两者本质上是一样的,不是截然不同的接口。然后工程编译时,每次只会加载其中一个接口,这样就导致每次都有一个接口能工作。两者的区别在于,后者每次处理一帧数据,然后等待下一帧数据到来,而前者则是连续处理两帧数据,从而加快了处理效率。将两者都改为ti.sdo.ce.examples.extensions.speech1.ISPHxxx1或是ti.sdo.ce.speech1.ISPHxxx1,其余作相应修改就可以了,呵呵
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
514 浏览 1 评论
386 浏览 1 评论
583 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
831 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
688 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
128浏览 29评论
707浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
294浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
248浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
100浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-11 14:38 , Processed in 0.907208 second(s), Total 51, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号