今天终于知道了测试帧率的过程。在平台上可以进行minicom之后,挂载需要的程序,包括dspm,x64.bin,davinci_dsp.ko,ceapp.c。
假设在kevin目录下,在minicom中挂载到板子的mnt/kevin下:mount -o nolock 192.1.12.2:/home/kevin /mnt/kevin。
挂载之后,在arm上建立dsp通信用的节点mdsp(名字是程序中使用的):mknod mdsp c 254 0。
该节点是dsp为arm做事的接口,可以看见是挂载在dev下的,这与linux将设备看作文件的处理方式是一致的。现在跑在arm上的linux也将dsp看作一个设备(文件),现在建立一个这样的节点来使得dsp做的事情就像是arm的linux的一个文件做了一些改动一样。
接下来就是在操作系统中加载一个模块:davinci_dsp.ko。这个内核的补丁作用直白的讲就是让设备文件mdsp和dsp打交道成为可能,就是一个设备驱动程序:insmod davinci_dsp.ko
信息:davinci_dsp: no version for "struct_module" found: kernel tainted.
DSP Manager initiated!
,Major:254,Minor:0
Power control I2C chip:182
request irq returned:0,probe=0
这样arm和dsp通过一个设备文件mdsp就联系起来了,当arm要进行需要dsp的过程时,就操作mdsp,这时davinci_dsp.ko就驱动了dsp,然后到作完事再让arm来干预。当然,如何调用系统调用来驱动dsp设备就是应用程序的事情了,而在操作系统一层,它已经做好了这方面的准备了。
执行./dspm:read file ok,1501set boot to 82100000
8008 bytes
PTSAT 0System is not in transition state, begin operation.
set DSP Domin Next to 1.
set DSP Domin Next state to enable.
begin transition.
ok to power on.
power ready.
PTSAT 0transition complete.
Write 100000 end at 200000! Complete
Write 100000 end at 300000! Complete
Write 100000 end at 400000! Complete
Write 100000 end at 500000! Complete
Write 100000 end at 600000! Complete
Write 100000 end at 700000! Complete
Write 100000 end at 800000! Complete
Write 100000 end at 900000! Complete
Write 100000 end at a00000! Complete
Write 100000 end at b00000! Complete
Write 100000 end at c00000! Complete
Write 100000 end at d00000! Complete
Write 100000 end at e00000! Complete
Write 100000 end at f00000! Complete
Write 52818 end at f52818! Complete
Load File Ok.
Load File Ok.
Reset DSP.
该程序将编码器加载到dsp的内存中,这样就可以使得dsp为arm工作了。之后运行./ceapp
the size of 86 frames is 2466:
lala
the size of 87 frames is 1161:
lala
the size of 88 frames is 1704:
lala
the size of 89 frames is 1038:
total 90 frames, total second: 37, total usecond: 125455
the bitRate is 178.133333
完成。当然这只是一个过程,具体的程序才是关键。