第一步:安装Fedora系统(略)
第二步:在Linux中安装必要的环境
(与项目无直接关系,可是必要的基础组件)linux
1.更新dnf源
# dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm
# dnf localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
# dnf clean all
# dnf makecache
# dnf update
2.创建程序存储路径和程序挂载目录
因为此用户名设为timely(能够自定义),因此用户根目录(~)为/home/timely/
(1)创建程序存储目录,之后用于存储程序文件:
$ mkdir /home/timely/DM8168 或 $ mkdir ~/DM8168
(2)创建程序nfs挂载目录,之后用于运行程序:
$ mkdir /home/timely/DM8168/nfs 或 $ mkdir ~/DM8168/nfs
3.安装nfs服务
(1)# dnf install nfs-utils rpcbind(也许系统自带,没必要安装)
(2)# vi /etc/exports
按i键,输入:
/home/timely/nfs *(rw,sync,no_root_squash)
按:wq,保存并退出vi编辑器。
(3)开启rpcbind服务
# systemctl start rpcbind
(4)开启nfs服务
# systemctl start nfs
(5)关闭防火墙
# systemctl stop firewalld
*说明:
如需重启nfs:# systemctl restart nfs
测试挂载本机目录:# mount -t nfs localhost:/home/timely/nfs/ /media/
测试挂载对方目录:# mount -t nfs [对方IP地址]:/[目标文件地址] [本机目标地址]
4.安装git工具
(1)# dnf install git(也许系统自带,没必要安装)
5.安装源程序目录
(1)解压缩DVR主程序压缩包
$ tar -zxvf DVRRDK_03.00.00.00.tar.gz -C ~/DM8168/
(2)下载其余四个目录
$ git clone https://github.com/willisyi/LiveServer ~/DM8168/LiveServer/
$ git clone https://github.com/willisyi/sys_server ~/DM8168/sys_server/
$ git clone https://github.com/willisyi/mycode ~/DM8168/mycode/
并将mycode文件夹中的8168_Boa和interface文件夹复制到DM8168目录。
$ cp -Rf ~/DM8168/mycode/8168_Boa/ ~/DM8168/
$ cp -Rf ~/DM8168/mycode/interface/ ~/DM8168/
$ rm -rf ~/DM8168/mycode/
最终,DM8168目录共有10个文件夹和4个pdf文件:git

第三步:编译程序
总程序共有5个文件夹须要编译:dvr_rdk,LiveServer,sys_server,interface,8168_Boa。下面依次说明编译方法,可执行文件目录和可能遇到的问题。
1.dvr_rdk编译
(1)必须在dvr_rdk目录下进行,使用./run_make.sh编译。
$ cd ~/DM8168/dvr_rdk/
$ ./run_make.sh ti816x-etvgithub

(2)当出现 #### [DM816X_ETV] platform build [] Done !!! 字样时,表明dvr_rdk编译完成。

(3)程序最终的输出可执行文件:vim
~/DM8168/dvr_rdk/bin/ti816x_etv/bin/dvr_rdk_demo_link_api.out
firmware输出的3个文件(可选):
~/DM8168/dvr_rdk/bin/ti816x_etv/firmware/dvr_rdk_fw_c6xdsp.xe674
~/DM8168/dvr_rdk/bin/ti816x_etv/firmware/dvr_rdk_fw_m3video.xem3
~/DM8168/dvr_rdk/bin/ti816x_etv/firmware/dvr_rdk_fw_m3vpss.xem3
(4)若是编译出错,多是软件版本问题,使用命令清除缓存,并从新编译:
$ ./run_make.sh ti816x-etv clean
$ ./run_make.sh ti816x-etv
*具体编译彻底方法能够参考<ETV-HDV8168软件使用指南.pdf>
2.配置交叉编译环境
(1)进入用户根目录打开环境变量文件:.bashrc
$ cd ~
$ vi ./.bashrc
在最后一行注释
# User specific aliases and functions
下面添加如下内容:
PATH="/home/timely/DM8168/ti_tools/cgt_a8/arm-2009q1/bin:$PATH"
export PATH
以下图所示:api

按:wq退出vi编辑器。
(2)$ source ~/.bashrc
(3)可经过以下方式测试 arm2009q1编译器是否能够使用,在Linux服务器控制台输入以下命令:
$ arm-none-linux-gnueabi-gcc
显示以下便可:缓存

3.LiveServer编译
(1)进入/LiveServer目录,使用Makefile编译
$ cd ~/DM8168/LiveServer/
$ make

(2)当出现 make[1]: Leaving directory `/home/timely/DM8168/LiveServer/mediaServer' 字样时,编译完成。bash

(3)程序最终可执行文件为:服务器
~/DM8168/LiveServer/wis-streamer/wis-streamer
4.sys_server编译
(1)进入/sys_server/src/目录,使用Makefile编译。
$ cd ~/DM8168/sys_server/src/
$ make编辑器

(2)当出现make[1]: Leaving directory `/home/timely/DM8168/sys_server/src' 字样时,编译完成。

(3)程序最终可执行输出文件为:ide
~/DM8168/sys_server/src/release/system_server
(4)可能会存在编译出错[1]:
/home/timely/DM8168/ti_tools/cgt_a8/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../
../arm-none-linux-gnueabi/bin/ld: cannot find - lfreetype
错误缘由:这是缺乏libfreetype库形成的。
解决方案:在~/DM8168/8168_Boa/中有freetype-2.4.0.tar.gz压缩包,安装libfreetype。
$ cd ~/DM8168/8168_Boa/
$ tar -zxvf freetype-2.4.0.tar.gz
$ cd freetype-2.4.0
$ ./configure CC=arm-none-linux-gnueabi-gcc --host=arm-linux --prefix=$PWD/install
$ make && make install
生成的文件在~DM8168/8168_Boa/freetype-2.4.0/install中。
将生成的库拷贝的交叉编译工具的库目录下:
i:将生成的install/lib 下的libfreetype.so libfreetype.so.6 libfreetype.so.6.5.0 拷贝至
~/DM8168/ti_tools/cgt_a8/arm-2009q1/arm-none-linux-gnueabi/libc/lib/
ii:将生成的install/lib下的libfreetype.a libfreetype.la libfreetype.so libfreetype.so.6 libfreetype.so.6.5.0 拷贝至
~/DM8168/ti_tools/cgt_a8/arm-2009q1/arm-none-linux-gnueabi/libc/usr/lib
iii:将生成的目录/install/include目录下的全部文件 拷贝至
~/DM8168/ti_tools/cgt_a8/arm-2009q1/arm-none-linux-gnueabi/libc/usr/include
而后从新编译。
(5)可能在./configure会存在出错[2]:
configure: error: cannot find native C compiler
错误缘由:找不到本地C编译器,缺乏gcc
解决方案:在root下安装gcc
# yum install gcc
(6)可能会存在编译出错[3]:
ln: creating symbolic link `../../target/rfs_816x/usr/share/zoneinfo/localtime': No such file or directory

错误缘由:缺乏路径目录
解决方案:添加缺失路径
$ cd ~/DM8168/target/rfs_816x/usr/share/
$ mkdir zoneinfo
$ cd zoneinfo
$ mkdir localtime
而后从新编译。
5.interface编译
(1)进入/interface/src 目录,使用Makefile进行编译。
$ cd ~/DM8168/interface/src
$ make
以下图:

(2)当出现如下make[1]: Leaving directory '/home/timely/DM8168/interface/src'字样时,编译完成。

(3)程序没有最终可执行输出文件。
(4)可能会存在的编译错误[1]:
make: *** No rule to make target `/opt/interface/include/semaphore.h', needed by `semaphore.o'. Stop.
错误缘由:Makefile文件内的路径有问题
解决方案:修改Makefile文件内容:
$ vi Makefile
能够见到Makefile前三行:
INTERFACE_DIR=../
PUBLIC_INCLUDE_DIR=/opt/interface/include
APP_LIB_DIR=/opt/interface/lib
将它改成:
INTERFACE_DIR=../
PUBLIC_INCLUDE_DIR=./include
APP_LIB_DIR=./lib
如图:

从新编译程序便可。
(5)可能会存在的编译错误[2]:
error: asm/bitsperlong.h: No such file or directory

进入int-ll64.h文件
$ cd ~/DM8168/ti_tools/linux_lsp/linux-psp-dvr-04.04.00.01/src/linux-04.04.00.01/include/asm-generic/
$ vim int-ll64.h

头文件改成#inlcude <asm-generic/bitsperlong.h>,从新编译。
6.8168_Boa编译
(1)进入/8168_Boa/boa-0.94.13/src/ 目录,使用Makefile进行编译。
$ cd ~/DM8168/8168_Boa/boa-0.94.13/src/
$ make

(2)当出现make[1]: Leaving directory `/home/timely/DM8168/8168_Boa/boa-0.94.13/src'字样时,编译完成。

(3)程序最终可执行输出文件为:
~/DM8168/8168_Boa/boa-0.94.13/src/boa
(4)可能遇到的问题[1]:(Fedora下不会出现此问题)
make[1]: bison: Command not found
错误缘由:缺乏bison命令
解决方案:安装bison
# yum install bison
并从新编译。
(5)可能遇到的问题[2]:(Fedora下不会出现此问题)
make[1]: flex: Command not found
错误缘由:缺乏flex命令
解决方案:安装flex
# yum install flex
并从新编译。
第四步、准备程序运行文件
程序有两种运行方案,一种是基本运行方案,一种是基于ipc核间通讯的运行方案。
1.基本运行方案
(1)在用户根目录下创建nfs文件夹(若是已经有了,不须要再创建)
$ mkdir ~/nfs
(2)构建如下7个文件。

[1]四个可执行文件:
dvr_rdk_demo_link_api.out :
~/DM8168/dvr_rdk/bin/ti816x_etv/bin/dvr_rdk_demo_link_api.out
wis-streamer :
~/DM8168/LiveServer/wis-streamer/wis-streamer
system_server :
~/DM8168/sys_server/src/release/system_server
boa :
~/DM8168/8168_Boa/boa-0.94.13/src/boa
[2]两个辅助文件:
logo.yuyv : logo图案,yuyv格式
HZK16 : 字符库
[3]一个脚本文件
chain.sh : 程序入口
2.基于ipc核间通讯的运行方案
(1)在用户根目录下创建nfs文件夹(若是已经有了,不须要再创建)
$ mkdir ~/nfs
(2)构建如下个文件。
能够解压缩prebuild_ipc.tar.gz文件到此目录。

其中惟一不一样的是,目录下面的firmware文件夹存储的是DM8168的2个Cortex-M3核和DSP核代码执行文件:
dvr_rdk_fw_c6xdsp.xe674
dvr_rdk_fw_m3video.xem3
dvr_rdk_fw_m3vpss.xem3
这三个文件均在~/DM8168/dvr_rdk/bin/ti816x_etv/firmware/目录下,复制过来便可。

第五步 运行程序
不管是基本运行方案仍是基于ipc核间通讯的方案,在运行程序步骤(方法和命令)都是同样的。
1.硬件部分:
(1)开启视频源电源;
(2)开启DM8168-ETV板电源
(3)将电脑与DM8168-ETV板子连接到一个路由器上
2.软件部分:
(4)查看本身链接在路由器上的IP地址
$ ifconfig

此次链接上面显示IP 地址为192.168.1.100
(5)链接到开发板:
$ telnet 192.168.1.8
(开发板默认IP地址为192.168.1.8)
在login:中填写root<回车>
从而进入dm816x开发板中的linux系统:

(6)挂载可执行文件目录到开发板
在root@dm816x:~#后面输入命令:
root@dm816x:~# busybox mount -t nfs 192.168.1.100:/home/timely/DM8168/nfs /mnt -o nolock
(7)执行脚本文件,运行程序
root@dm816x:~# cd /mnt
root@dm816x:/mnt# ./chain.sh

Enjoy! Written by Timely Wang ~