导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页
    1. 主页
    2. BSPlayer
    B
    • 资料
    • 关注 0
    • 粉丝 0
    • 我的积分 390
    • 主题 4
    • 帖子 7
    • 最佳 4
    • 群组 0

    BSPlayerLV 3

    @BSPlayer

    390
    积分
    15
    声望
    21
    资料浏览
    7
    帖子
    0
    粉丝
    0
    关注
    注册时间 最后登录

    BSPlayer 取消关注 关注

    BSPlayer 发布的最佳帖子

    • OK113i-S开发板-2适配10寸LCD显示

      前言

      本文介绍如何在OK113i-S开发板上适配一个自己的10寸LCD。

      OK113i-S 是一个优秀的开发板,支持lvds 单8,双8显示,最大分辨率1280x800

      也支持RG666显示,由于我手头只有lvds 单8,40pin的显示器,今天我就适配一下这个LCD的显示。

      显示效果

      GUI.jpg

      设备接线

      我这个转接板是两部分,左边的是触摸线,右边的是屏幕接线,触摸的调试见另一篇文章。这里只说屏幕的适配;从图上可以看到,液晶屏的排线40pin经过转接板转为20pin接入主板。

      LCD-Cable.jpg

      首先根据主板使用说明,LVDS接口信息,主板是LVDS双8信号,我这里只有LVDS接口的屏幕,其他工程剩余的,是LVDS单8信号,需要做一些修改。屏幕是10寸的40pinLVDS 单8接口。40pinLVDS 接口经过转接板只有20接口线。下面是关键信息。

      主板的LCD接口信息
      2-主板接口LVDS-双8.png

      LCD的LVDS 40PIN接口信息
      1-LVDS-40PIN-单8-LCD接口.png

      接口板接口信息定义
      30-40-pin-接口.png

      我们要做的就是把主板的接口与20pin的转接板连接起来,调整排线的线序,具体做法如下

      conn.png

      屏幕接口说明书

      代码适配修改

      首先找到内核的设备树文件OK113i-C-Linux.dts和 OK113i-C-Common.dtsi

      Device/config/chips/t113_i/config/ok113i/目录下有同名的链接文件,都指向同一个文件
      link.png

      根据屏幕说明书,找到屏幕的关键参数,如下图
      LCD-10--1.png

      Default 注释的是原来的内容,1024x600是我的屏幕分辨率,这里面有许多参数,具体的说明如下:我们这里只关心几个即可
      lcd注释.png

      lcd-10.png
      ////////////////////////////////////
      Lcd_if: HV模式,见lcd屏幕说明
      lcd_lvds_if: 0:single link; 1:dual link
      lcd_lvds_mode: 0:NS mode; 1:JEIDA mode;这里是JEIDA显示序列

      Lcd_x 分辨率x
      Lcd_y 分辨率y
      Lcd_width 物理尺寸
      Lcd_height 物理尺寸

      lcd_hbp: hsync back porch(pixel) + hsync plus width(pixel);
      lcd_ht: hsync total cycle(pixel)
      lcd_vbp: vsync back porch(line) + vysnc plus width(line)
      lcd_vt: vysnc total cycle(line)
      lcd_hspw: hsync plus width(pixel)
      lcd_vspw: vysnc plus width(pixel)
      ////////////////////////////////////////

      UBOOT的配置文件在这里:
      kernel/linux-5.4/arch/arm/boot/dts/uboot-board-lvds.dts

      这里看到有看到其他的不同屏幕的配置文件,根据我的屏幕类型lvds,uboot-board-lvds.conf;
      uboot-files.png

      修改完后,./build.sh 修改编译选项,重新烧录即可
      build-lcd.png

      最后我们截屏看看
      使用这个命令可以截屏ok113-Screen.bmp

      root@ok113i:/# echo 0 >/sys/class/disp/disp/attr/disp
      root@ok113i:/# echo /home/forlinx/ok113-Screen.bmp >/sys/class/disp/disp/attr/

      cat.png

      问题总结:

      1 buidl前需要整体编译一遍,有问题可以群里提问。
      2 buidl内核前先clean,减少修改后不生效的问题。
      3 修改后不生效,需要查看UBOOT启动的默认选项。

      附录
      内核配置文件
      编译好的LCD支持内核
      编译的LCD支持系统镜像


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板体验-1开箱和基本使用

      感谢电子发烧友论坛和飞凌公司所提供的测试机会。
      最早是在20年前用过飞凌的产品2440,知道飞凌是一个芯片产品的方案提供商,自己也从事嵌入式相关的工作,所以此次试用可以增加对飞凌产品更多了解。
      OK113i-S开发板的功能齐全,制作工艺成熟,是一个不错的工业级开发板。是采用邮票孔核心板加底板方式,性能稳定,价格便宜。
      其详细资料可以访问飞凌的网站:

      全志T113处理器设计全国产化工业级T113核心板
      全志T113i开发板 国产工业级T113开发板

      开发板开箱
      收到了OK113i-S开发板,周六联系的,下周一就收到了,飞凌就是有效率
      板子有电源,天线2个,USB线,还有一个产品小册子,里面介绍了各种产品特点,这个销售还挺有心的。
      box1.jpg
      b11.jpg
      b0.jpg
      box-2.jpg

      设备介绍
      T113-i 是一种为多媒体解码平台设计的高级应用处理器。T113-i 集成了64位玄铁C906 RISC-V CPU, 双核 Cortex - A7 CPU 1.2G和 HiFi4 DSP,这次测试主要是测试32位双核A7CPU的性能。
      board.png

      特色功能
      我用过很多开发板,2440,imx6q,3288,3568 等,这个板子给我感觉有特色的功能有这两个,第一是硬件调试线type-c,省去了使用USB-转串口调试线。下图左边是usb转串口调试线,右边是usb下载接口,一根线两用,方便多了。

      usb.jpg
      第二是uboot里面可以按键切换屏幕类型,如下图显示

      UBOOT.png
      连续按2可以显示其他的显示类型,按后就保存。这极大的提高了开发效率,方便显示切换。

      界面效果展示
      在编译系统时测试程序一起用buildroot系统。下面展示了几个基本系统程序。
      系统开机启动一个程序 Matrix_Browser,自己开发时,可以针对这个界面进行裁剪。不过这个系统内存只有512M,app的切换就比较慢。推荐不用这个窗口,直接启动自己的界面。

      UBOOT界面
      GUI1.jpg

      主界面

      GUI.jpg

      App界面2
      gui-3.jpg

      web界面

      如果你没有lcd屏幕,用浏览器也可以看,但是只能看到第一屏和命令行的程序。这是因为主界面是个B/S结构

      pc-web.png

      web2.png

      web3.png

      系统开机启动的程序和性能
      top.png

      系统开机运行了ftp程序和sshd,方便大家登录和传输文件,matrix-browser是主界面的进程,可以看到系统内存已经用了一半。这对开发性能是足够的。

      开发环境
      官方提供了一键式开发环境,安装好开发环境ubuntu20的vmware虚拟机,只需开机,build就ok了。相比之前不需要安装太多软件,大大节省了时间,真是太方便了。如果提供云端的开发环境,那就更人性化了。
      系统下载大约需要20G的空间,运行大约需要100G磁盘。

      Demo程序
      开发板自带几个demo的程序,这些程序展示了系统的一些基本功能。
      demo代码位置在:platform/framework/auto/qt_demo Qt 测试程序源码目录,具体的内容在《1-OK113i-S_Linux5.4.61+Qt5.12.2_用户编译手册》里面有详细说明,我发现还有一个目录sdk_dem,里面有更多的demo可供开发参考。

      sdk.png

      串口程序
      serial.jpg
      AudioRecoder 这个录音程序支持多种录音格式。
      record.png

      Sql程序
      sql.jpg

      SPI 接口

      spi.jpg

      其他还有许多实用的功能,这些功能极大的方便了大家开发自己的app,期待大家去发现。
      通过多次启动程序发现,这个板子对于取代串口屏之类的单一应用是绰绰有余,无论是性能还是价格都有绝对的优势,期待有更多的进一步开发。


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板-4视频编解码测试

      前言

      本文测试OK113i-S开发板-视频编解码的功能

      OK113i-S开发板是支持视频的编解码的,下面是官方介绍的编解码功能

      T113-i 是一种为多媒体解码平台设计的高级应用处理器。T113-i 集成了64位玄铁C906 RISC-V CPU,
      双核 Cortex - A7 CPU 和 HiFi4 DSP,提供高效的计算能力。
       主要特性
      支持 H.265、H.264、MPEG-1/2/4、JPEG 等全格式解码。独立的编码器可以用 JPEG 或 MJPEG 来进行编
      码。
       T113-i 集成了 H.265/H.264 4K 解码和 SmartColor2.0 后处理,提供完美的视频娱乐体验。

      下面我们来测试一下音视频的编码解码功能。

      编解码代码

      在系统的代码中,下面是程序的位置

      ----------------
      视频
      /sdk/platform/framework/auto/cmd_demo/decoderTest 
      /sdk/platform/framework/auto/sdk_demo/decoderTest
      /sdk/platform/framework/auto/sdk_demo/encoderTest
      /sdk/platform/framework/auto/sdk_demo/fltest_streamPlayer
      
      ------------------
      音频
      /sdk/platform/framework/auto/cmd_demo/audplayer
      /sdk/platform/framework/auto/qt_demo/fltest_qt_musicplayer
      /sdk/platform/framework/auto/sdk_demo/audioencTest
      /sdk/platform/framework/auto/sdk_demo/audplayerTest
      

      编译音视频库

      系统的音视频库主要是cedarx 和libcedarc;这个在buuildroot中需要选定。如下图

      Target Packages
        Allwinner platform private package select
        Libcedcrc
        Cedarx
      

      微信截图_20231220140841.png

      微信截图_20231221103631.png

      错误

      =================
      >>> cedarx  Installing to target
      cp -rf /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf 
      /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/target/etc/cedarx.conf
      cp: cannot stat '/home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf': No such file or directory
      make[1]: *** [package/pkg-generic.mk:335: /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/.stamp_target_installed] Error 1
      

      解决办法

      cp -rf /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/conf/default_cedarx.conf  
      /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf
      

      ./build.sh
      ./build.sh pack

      =============================================
      视频解码264

      fltest_decoderTest 解码/tmp.h264 为yuv 格式。

      root@ok113i:/forlinx/media# ls
      1.jpg                1280x720_video3.yuv    tmp.h264
      1024x600.rgba        2.jpg                  tmp.h265
      1280x720_video0.yuv  2560x1440_dcvideo.yuv  videotestsrc_1280x720.nv21
      1280x720_video1.yuv  30s.wav
      1280x720_video2.yuv  test.mp3
      
      root@ok113i:/forlinx/media# fltest_decoderTest
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      [ 1097.603725] VE: VE real_freq=576000000
      [ 1097.603725]
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 17:35:24] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      decoderTest version:V2.0.20220506
      decoderTest intputFile:/forlinx/media/tmp.h264
      [D]singleDecoderH264Test                 ================================
      [D]singleDecoderH264Test                 ====     CedarC  Decoder    ====
      [D]singleDecoderH264Test                 ====  singleDecoderTest cbk ====
      [D]singleDecoderH264Test                 ================================
      [E][decoderTest.cpp]singleDecoderH264Test line:271 open intputFile:/forlinx/media/tmp.h264
      [E][decoderTest.cpp]singleDecoderH264Test line:294 open outputFile:/tmp/800x480nv21_sgl.yuv
      new AWVideoDecoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1559, g_context = 0x28b3b8
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      DEBUG  : cedarc <CdcIniParserInit:41>: load conf file /etc/cedarc.conf ok!
      
      INFO   : cedarc <log_set_level:43>: Set log level to 5 from /vendor/etc/cedarc.conf
      ERROR  : cedarc <DebugCheckConfig:316>: now cedarc log level:5
      WARNING: cedarc <InitializeVideoDecoder:619>: warning: the nDeInterlaceHoldingFrameBufferNum is 0
      [D]singleDecoderH264Test decode process[0/821226]
      ======================= ret:-6  
      [D]singleDecoderH264Test decode process[815936/821226]
      offset>(size-4)
      [D]decoderDataReady decode write[384000/192000]
      ======================= ret:3
      output file is saved:/tmp/
      

      =============================================
      视频解码h265

      demoVdecoder 这个文件失败

      ==================================

      ok113i:/forlinx/media# demoVdecoder -i /forlinx/media/tmp.h265 -o dec265.yuv
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 19:28:03] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 19:28:03] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1074>:  ==== CedarX linux decoder demo help start =====
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1075>:  -h or --help to show the demo usage
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1076>:  demo created by zouwenhuan, allwinnertech/AL3
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1077>:  email: zouwenhuan@allwinnertech.com
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1078>:  ===== CedarX linux decoder demo help end ======
      [2023-12-20 19:28:03] DEBUG  : awplayer <main:1254>: nDecoderNum = 1
      [2023-12-20 19:28:03] DEBUG  : awplayer <ChannelThread:1093>: ChannelThread 11, 0
      [2023-12-20 19:28:03] DEBUG  : awplayer <ParseArgument:193>:  get input file: file:///forlinx/media/tmp.h265
      [2023-12-20 19:28:03] DEBUG  : awplayer <ParseArgument:210>:  get save pic path: dec265.yuv
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1773, g_context = 0xb5d02528
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      [2023-12-20 19:28:03] DEBUG  : awplayer <CdxParserPrepare:778>: source uri 'file:///forlinx/media/tmp.h265'
      [2023-12-20 19:28:03] DEBUG  : awplayer <__FileStreamConnect:407>: (5/0/1133141) path:'file:///forlinx/media/tmp.h265'
      [2023-12-20 19:28:03] ERROR  : CdxFlacParser <__FlacParserProbe:1133>: Flac probe failed.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.frames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence offrames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] ERROR  : awplayer <__G729ParserProbe:290>: g729 SYNC_WORD probe failed.
      [2023-12-20 19:28:03] ERROR  : awplayer <__Id3v2ParserProbe:330>: Probe ID3_header loss sync...
      [2023-12-20 19:28:03] WARNING: awplayer <CdxParserCreate:711>: Sorry, I don't know what it is!
      [2023-12-20 19:28:03] WARNING: awplayer <CdxParserOpen:756>: should not be here.
      [2023-12-20 19:28:03] ERROR  : awplayer <CdxParserPrepare:789>: open parser fail, uri(file:///forlinx/media/tmp.h265)
      [2023-12-20 19:28:03] ERROR  : awplayer <initDecoder:278>:  decoder open parser error nRet = -1, Decoder->parser: (nil)
      [2023-12-20 19:28:03] ERROR  : awplayer <ChannelThread:1156>:  decoder demom initDecoder error
      

      =============================================

      我们修改decoderTest这个程序,使它能解码h265的格式,其中下面代码红色是我修改的。

      source ~/113/OK113i-linux-sdk/.buildconfig
      ~/113/OK113i-linux-sdk/platform/framework/auto/sdk_demo/decoderTest$ make
      

      ==============================================

      //decoderTest 265
      int main(int argc, char** argv)
      {
          printf("decoderTest265 version:%s\n", MODULE_VERSION);
          /******** begin set the default encode param ********/
          memset(&decodeParam, 0, sizeof(decodeParam));
          memset(&testParam, 0, sizeof(testParam));
      
          decodeParam.srcW = 800;
          decodeParam.srcH = 480;
          decodeParam.dstW = 800;
          decodeParam.dstH = 480;
          decodeParam.rotation = Angle_0;
          decodeParam.scaleRatio = ScaleNone;
          decodeParam.codecType = CODEC_H265;
          decodeParam.pixelFormat = PIXEL_NV21;
      
          testParam.testTimes = 1;
          testParam.testWay = 0;
          strcpy((char*)testParam.intputFile,        "/tmp/tmp.h265");
      strcpy((char*)testParam.outputFile,        "/tmp/dec265_out.yuv");
      

      ================================================================

      Makefile的修改
      
      all: $(Target) 
      $(Target) : decoderTest.cpp 
      	$(CPP) decoderTest.cpp -o $(Target)  $(LIBS) $(LDFLAGS) -lpthread $(CXXFLAGS)
      	$(CPP) decoderTest265.cpp -o $(Target)265  $(LIBS) $(LDFLAGS) -lpthread $(CXXFLAGS)
      	@echo "generate $(Target) success!!!"
      	@cp -f $(Target)    $(INSTATLL_PATH)
      	@cp -f $(Target)265 $(INSTATLL_PATH)
      	@echo -e '\e[1;33m cp -f $(Target) $(INSTATLL_PATH) \e[0m'
      

      =============================================
      测试解码效果

      play.png

      ./decoderTest265
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      [ 3213.535493] VE: VE real_freq=576000000
      [ 3213.535493]
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-21 01:51:19] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      decoderTest265 version:V2.0.20220506
      intputFile  :/tmp/tmp.h265
      outputFile  :/tmp/d5_out.yuv
      [D]singleDecoderTest             ================================
      [D]singleDecoderTest             ====     CedarC  Decoder    ====
      [D]singleDecoderTest             ====  singleDecoderTest cbk ====
      [D]singleDecoderTest             ================================
      new AWVideoDecoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1597, g_context = 0x198c480
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      DEBUG  : cedarc <CdcIniParserInit:41>: load conf file /etc/cedarc.conf ok!
      
      INFO   : cedarc <log_set_level:43>: Set log level to 5 from /vendor/etc/cedarc.conf
      ERROR  : cedarc <DebugCheckConfig:316>: now cedarc log level:5
      WARNING: cedarc <InitializeVideoDecoder:619>: warning: the nDeInterlaceHoldingFrameBufferNum is 0
      [D]singleDecoderTest decode process[0/1133141]
      [W][decoderTest265.cpp]singleDecoderTest line:514 decode failed,error code:-6
      [D]singleDecoderTest decode process[28/1133141]
      [W][decoderTest265.cpp]singleDecoderTest line:514 decode failed,error code:-6
      [D]singleDecoderTest decode process[86/1133141]
      
      [D]singleDecoderTest decode process[1127265/1133141]
      offset>(size-4)
      WARNING: cedarc <HevcDecoderAddPtsToList:933>:  h265 pts list is full
      [D]decoderDataReady decode write[384000/192000]
      [D]printfArgs    -i:/tmp/tmp.h265
      [D]printfArgs    -s:[800x480]
      [D]printfArgs    -f:278
      [D]printfArgs    -p:5
      [D]printfArgs    -o:/tmp/d5_out.yuv
      output file is saved:/tmp/d5_out.yuv
      ~ AWVideoDecoderImpl()
      Test 1 times.
      

      =============================================
      视频编码

      root@ok113i:/forlinx/media# encoderTest
      encoderTest version:V2.0.2022050[ 5100.284684] VE: VE real_freq=576000000
      [ 5100.284684]
      6
      intputFile /tmp/800_480.yuv
      outputFile /tmp/enc720_30p.265
      outputFile  CODEC_H265
      [D]singleEncoderTest             ================================
      [D]singleEncoderTest             ====     CedarC  Encoder    ====
      [D]singleEncoderTest             ====    singleDecoderTest    ====
      [D]singleEncoderTest             ================================
      [D]printfArgs    -s:800x480
      [D]printfArgs    -n:1
      [D]printfArgs    -f:3
      [D]printfArgs    -p:1
      [D]printfArgs    -r:30
      [D]printfArgs    -d:800x480
      sdk_memory version:V2.0.20220506
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      [D]encodeFile malloc pIonMem->vir=0xb6a63000!
      new AWVideoEncoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      ERROR  : cedarc <H265EncOpen:6246>: error: the driver do not support the ic 1667
      [E][AWVidoeEncoder.cpp]init line:389 VideoEncCreate error, return[E][encoderTest.cpp]encodeFile line:412 init:ffffffff
      ~ AWVideoEncoderImpl()
      ERROR  : cedarc <ReleaseAllocInputBuffer:456>: ReleaseAllocInputBuffer, pEncoder is NULL
      [D]printfArgs    -s:800x480
      [D]printfArgs    -n:1
      [D]printfArgs    -f:3
      [D]printfArgs    -p:1
      [D]printfArgs    -r:30
      [D]printfArgs    -d:800x480
      output file is saved:/tmp/enc720_30p.265
      Test 1 times.
      

      编码失败,文件为0

      =============================================
      音频编码

      root@ok113i:/forlinx/media# cp 30s.wav /tmp/test.wav
      root@ok113i:/forlinx/media# audioenc_test
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 18:48:57] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwMuxerInit:53>: aw muxer init ..
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwMuxerInit:62>: aw muxer size:4
      audioenc test version:V2.0.20220506
      12-20 18:48:57.953  AudioEnc(W) : AudioEncInit success
      fopen /tmp/test.wav OK
      fopen /tmp/test.mp3 ok
      12-20 18:48:57.955  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:48:58.001  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.031  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.077  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.123  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.169  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      file end exit.
      audioenc test run finish
      

      =============================================
      音频解码

      下图是
      fltest_qt_musicplayer
      微信图片_20231220112009.jpg

      root@ok113i:/forlinx/media# fltest_audioplayer   /forlinx/media/test.mp3
      [2023-12-20 19:02:26] WARNING: awplayer <log_set_level:30>: Set log level to 3
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 19:02:26] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwMuxerInit:53>: aw muxer init ..
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwMuxerInit:62>: aw muxer size:4
      set url:/forlinx/media/test.mp3
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerCreate:216>: XPlayerCreate.
      [2023-12-20 19:02:26] DEBUG  : awplayer <LogVersionInfo:34>:
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CedarX <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      tag   : cedarx
      branch: stable_v2.8_common
      commit: 967535b8ff6a073cb4f38e85a4ae5fa6008014d8
      date  : Mon, 15 May 2017 01:30:22 +0000 (09:30 +0800)
      author:
      ----------------------------------------------------------------------
      
      xfang tinyalsa SoundDeviceCreate
      [2023-12-20 19:02:26] DEBUG  : awplayer <LayerCreate_DE:1540>: libsdk_player version:V2.0.20220516, LayerCreate
      
      (getInstance 93) version:V2.0.20220506
      init chwd sucess !
      (HwDisplay 279)
      (hwd_init 1258)
      [2023-12-20 19:02:26] DEBUG  : awplayer <LayerCreate_DE:1593>: screen:w 1024, screen:h 600 disp
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1608, g_context = 0x274370
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetVideoSurfaceTexture:597>: setVideoSurfaceTexture, surface = 0x26fc60
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:1977>: process message XPLAYER_COMMAND_SET_SURFACE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <SubtitleCreate:88>: ==== pCallback: 0xb67e3574, pUser: 0x26b280
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2038>: ==== process message XPLAYER_COMMAND_SET_SUBCTRL.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetDeinterlace:718>: set deinterlace
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2053>: ==== process message XPLAYER_COMMAND_SET_SUBCTRL.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetDataSourceUrl:462>: setDataSource(url), url='/forlinx/media/test.mp3'
      [2023-12-20 19:02:26] INFO   : awplayer <XPlayerThread:1814>: process message XPLAYER_COMMAND_SET_SOURCE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerPrepare:767>: prepare
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2067>: process message XPLAYER_COMMAND_PREPARE. mPriData->mStatus: 1
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <DemuxThread:1792>: process message DEMUX_COMMAND_PREPARE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserPrepare:778>: source uri 'file:///forlinx/media/test.mp3'
      [2023-12-20 19:02:26] DEBUG  : awplayer <__FileStreamConnect:407>: (6/0/4818092) path:'file:///forlinx/media/test.mp3'
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:668>: parser node is id3v2.
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:717>: Good, it's 'id3v2'
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:717>: Good, it's 'mp3'
      [2023-12-20 19:02:26] WARNING: awplayer <CdxMp3ParserControl:1267>: not implement...(18)
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:468>: *********PrintMediaInfo begin*********
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:482>: fileSize = 4818092, bSeekable = 1, duration = 300016, audioNum = 1, videoNum = 0, subtitleNum = 0
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:520>: ***Audio[0]*** eCodecFormat = 0x3, eSubCodecFormat = 0x0, nChannelNum = 2, nBitsPerSample = 0, nSampleRate = 44100
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:536>: *********P[ 2124.461204] [SNDCODEC][sunxi_card_hw_params][651]:stream_flag: 0
      rintMediaInfo end*********
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:468>: *********PrintMediaInfo begin*********
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:482>: fileSize = 4818092, bSeekable = 1, duration = 300016, audioNum = 1, videoNum = 0, subtitleNum = 0
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:520>: ***Audio[0]*** eCodecFormat = 0x3, eSubCodecFormat = 0x0, nChannelNum = 2, nBitsPerSample = 0, nSampleRate = 44100
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:536>: *********PrintMediaInfo end*********
      [2023-12-20 19:02:26] DEBUG  : awplayer <AudioRenderCompSetAudioSink:195>: audio render component setting AudioSink
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerPrepareAsync:747>: prepareAsync
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2067>: process message XPLAYER_COMMAND_PREPARE. mPriData->mStatus: 4
      12-20 19:02:26.531  (W) AUTPlayer info: prepare ok.
      
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerStart:797>: start
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2275>: process message XPLAYER_COMMAND_START.
      [2023-12-20 19:02:26] DEBUG  : awplayer <[ 2124.569726] [SNDCODEC][sunxi_card_hw_params][651]:stream_flag: 0
      PlayerStart:740>: player start
      [2023-12-20 19:02:26] DEBUG  : awplayer <BaseCompPostAndWait:61>: audio decoder receive cmd: start
      (Allwinner Audio Middle Layer),line(971) : Create Decoder!!=====
      [2023-12-20 19:02:26] DEBUG  : awplayer <handleStart:1086>: Create libadecoder success...
      (Allwinner Audio Middle Layer),line(603) : AudioDec_Installaudiolib ok
      (Allwinner Audio Middle Layer),line(606) : audio decoder init start ...
      (AllwinnerAlibs),line(50) :
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Audio <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      tag   : audiocodec-v1.2
      branch: new
      commit: 3ba65962c01cbf1280ddda19d843009b6ef8ce85
      date  : Tue Jan 8 16:25:27 2019 +0800
      ----------------------------------------------------------------------
      
      (AllwinnerAlibs),line(700) : ----Loading so success!
      (AllwinnerAlibs),line(902) : *************pAudioStreamInfo start******************
      (AllwinnerAlibs),line(903) : eCodecFormat         :id(3), name(mpeg layer-III)
      (AllwinnerAlibs),line(904) : eSubCodecFormat      :0
      (AllwinnerAlibs),line(905) : nChannelNum          :2
      (AllwinnerAlibs),line(906) : nBitsPerSample       :16
      (AllwinnerAlibs),line(907) : nSampleRate          :44100
      (AllwinnerAlibs),line(908) : nAvgBitrate          :128000
      (AllwinnerAlibs),line(909) : nMaxBitRate          :128000
      (AllwinnerAlibs),line(910) : nFileSize            :0
      (AllwinnerAlibs),line(911) : eAudioBitstreamSource:0
      (AllwinnerAlibs),line(912) : eDataEncodeType      :0
      (AllwinnerAlibs),line(913) : nCodecSpecificDataLen:0
      (AllwinnerAlibs),line(914) : pCodecSpecificData   :(nil)
      (AllwinnerAlibs),line(915) : nFlags               :0
      (AllwinnerAlibs),line(916) : nBlockAlign          :0
      (AllwinnerAlibs),line(917) : *************pAudioStreamInfo end  ******************
      (Allwinner Audio Libs),line(27) : init successs...
      (Allwinner Audio Middle Layer),line(614) : AUDIO DECODE INIT OK...0
      [2023-12-20 19:02:26] DEBUG  : awplayer <BaseCompPostAndWait:61>: audio render receive cmd: start
      [2023-12-20 19:02:26] INFO   : awplayer <handleStart:295>: audio render process start message.
      [2023-12-20 19:02:26] DEBUG  : awplayer <initSoundDevice:478>: init sound device.
      [2023-12-20 19:02:26] DEBUG  : awplayer <initSoundDevice:486>: set sound devide param, sample rate = 44100, channel num = 2.
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <DemuxThread:2053>: process message DEMUX_COMMAND_START.
      [2023-12-20 19:02:26] WARNING: awplayer <callbackProcess:3656>: message 0x40a not handled.
      ======================================
      |Space  key | start or pause    |
      |Left   key | seek backend      |
      |Right  key | seek forward      |
      |Up     key | audio volume larger       |
      |Down   key | audio volume small        |
      ======================================
      [2023-12-20 19:02:26] DEBUG  : awplayer <startSoundDevice:684>: start sound device.
      [2023-12-20 19:02:26] DEBUG  : awplayer <startSoundDevice:686>: audio device start end
      
      [2023-12-20 19:02:26] DEBUG  : awplayer <CallbackProcess:2959>: first audio pts = 0
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:644>: sample rate change from 44100 to 44100.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:646>: channel num change from 2 to 2.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:648>: bitPerSample num change from 16 to 16.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:650>: if need direct out put flag change from 0 to 1.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:652>: data type change from 1 to 1.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:671>: start sound devide again because samplaRate or channelNum change
      [2023-12-20 19:02:26] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:26] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:27] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:27] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      

      =============================================
      测试结果

      视频 h264的文件能解,h265也可以解了;编码h264不正常。
      音频 编码解码都可以正常运行。Sdk和测试app都可以运行,但是具体的编码格式没有详细测试。

      如有错误,欢迎指正,一起学习


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板-3测试实时系统

      前言
      OK113i-S开发板上测试实时linux系统的效果

      Linux下的实时系统有三种方案:这三种方案各有优缺点

      1.PREEMPT-RT:PREEMPT-RT是一个基于Linux内核的实时补丁,也被称为Real-Time(RT)补丁。它通过增加内核的可抢占性,使得Linux内核能够实现实时性能。PREEMPT-RT补丁提供了可配置的实时选项,可以根据应用程序的需求进行调整。这个版本跟内核的版本匹配很细致,几乎每一个内核的小版本都有配套的补丁。

      2.Xenomai:Xenomai提供了一个实时框架,为Linux操作系统添加了实时性能。它支持具有硬实时和软实时要求的应用程序,并通过分时多任务和抢占式调度来提供可预测性。
      这个系统就版本变化比较多,4之前是pipe,5后面是Dovetail,而且与内核版本匹配不太紧密,

      3.RTAI(Real-Time Application Interface):RTAI是一个开源实时应用程序接口,提供了类似API的接口和实时任务调度。它在Linux内核上运行,并通过插入抢占式调度器来实现实时性能。

      这里我们测试一下PREEMPT-RT的效果。

      编译desktop系统

      首先我们编译一个desktop的系统版本,官方提供的镜像是默认的PREEMPT-RT的。
      默认配置如下

      rt-low.png

      我们选择Desktop,

      rt-3.png
      选择Desktop,

      然后退出保存。

      Cp  ~/OK113i-linux-sdk/kernel/linux-5.4/arch/arm/configs/OK113I_linux_defconfig  ok-def
      Cp .config  ~/OK113i-linux-sdk/kernel/linux-5.4/arch/arm/configs/OK113I_linux_defconfig
      ~/OK113i-linux-sdk/build.sh kernel
      
      

      编译测试程序

      为了测试对比效果,我们还需要编译一个测试程序rt-test

      进入OK113i-linux-sdk/buildroot/buildroot-201902
      make menuconfig ARCH=arm
      
      选择
         Target packages
           Debugging,profileing and benchmark
      

      rt0.png

      然后OK113i-linux-sdk/buildroot/buildroot-201902/build.sh
      
      最后 ~/OK113i-linux-sdk/build.sh  pack
      Cp  ~/OK113i-linux-sdk/out/t113_i_linux_ok113i_uart0.img  t113-desk.img
      

      测试效果

      我们测试两个系统镜像,一个是desktop版本t113-desk.img,
      一个是PREEMPT-RT版本,下面是运行的测试结果

      我们这里就比较几个简单的命令coremark,和cyclictest
      cyclictest -t 5 -p 80 ,5个任务跑80个进程,计算时间

      ==============
      Desktop

      root@ok113i:/#uname -a
      Linux ok113i 5.4.61 #3 SMP Mon Dec 18 14:42:10 CST 2023 armv7l GNU/Linux
      
      root@ok113i:/# /usr/bin/coremark
      2K performance run parameters for coremark.
      CoreMark Size    : 666
      Total ticks      : 17257
      Total time (secs): 17.257000
      Iterations/Sec   : 3476.849974
      Iterations       : 60000
      Compiler version : GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
      Compiler flags   : -O2   -lrt
      Memory location  : Please put data memory location here
                              (e.g. code in flash, data on heap etc)
      seedcrc          : 0xe9f5
      [0]crclist       : 0xe714
      [0]crcmatrix     : 0x1fd7
      [0]crcstate      : 0x8e3a
      [0]crcfinal      : 0xbd59
      Correct operation validated. See readme.txt for run and reporting rules.
      CoreMark 1.0 : 3476.849974 / GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] -O2   -lrt / Heap
      
      root@ok113i:/# cyclictest -t 5 -p 80 
       //5个任务跑80个进程,计算时间
      # /dev/cpu_dma_latency set to 0us
      policy: fifo: loadavg: 1.09 0.80 0.38 2/70 1575
      policy: fifo: loadavg: 1.17 0.82 0.39 1/68 1576
      T: 0 ( 1517) P:80 I:1000 C:   9393 Min:     10 Act:   20 Avg:   15 Max:     152
      T: 0 ( 1517) P:80 I:1000 C:  11554 Min:     10 Act:   11 Avg:   15 Max:     754
      T: 1 ( 1518) P:80 I:1500 C:   7702 Min:     10 Act:   11 Avg:   14 Max:     140
      T: 2 ( 1519) P:80 I:2000 C:   5773 Min:     10 Act:   11 Avg:   16 Max:    4850
      T: 3 ( 1520) P:80 I:2500 C:   4619 Min:     10 Act:   12 Avg:   17 Max:    5174
      T: 4 ( 1521) P:80 I:3000 C:   3850 Min:     10 Act:   11 Avg:   16 Max:    4726
       Disable gpadc0
      policy: fifo: loadavg: 1.06 0.85 0.43 1/72 1634
      

      ===========
      PREEMPT-RT

      root@ok113i:/# coremark
      2K performance run parameters for coremark.
      CoreMark Size    : 666
      Total ticks      : 17200
      Total time (secs): 17.200000
      Iterations/Sec   : 3488.372093
      Iterations       : 60000
      Compiler version : GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
      Compiler flags   : -O2   -lrt
      Memory location  : Please put data memory location here
                              (e.g. code in flash, data on heap etc)
      seedcrc          : 0xe9f5
      [0]crclist       : 0xe714
      [0]crcmatrix     : 0x1fd7
      [0]crcstate      : 0x8e3a
      [0]crcfinal      : 0xbd59
      Correct operation validated. See readme.txt for run and reporting rules.
      CoreMark 1.0 : 3488.372093 / GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] -O2   -lrt / Heap
      
      root@ok113i:/# cyclictest -t 5 -p 80 
       //5个任务跑80个进程,计算时间
      # /dev/cpu_dma_latency set to 0us
      policy: fifo: loadavg: 1.00 0.67 0.30 1/79 1651
      
      T: 0 ( 1647) P:80 I:1000 C:  85352 Min:     13 Act:   16 Avg:   16 Max:      57
      T: 1 ( 1648) P:80 I:1500 C:  56901 Min:     13 Act:   16 Avg:   15 Max:      74
      T: 2 ( 1649) P:80 I:2000 C:  42671 Min:     13 Act:   16 Avg:   15 Max:      39
      T: 3 ( 1650) P:80 I:2500 C:  34136 Min:     13 Act:   20 Avg:   16 Max:      51
      T: 4 ( 1651) P:80 I:3000 C:  28447 Min:     13 Act:   16 Avg:   16 Max:      80
      

      =========

      可以看到 Total time相差不大,但是 cyclictest 的Max时间是大大减少的。 可看到Linux-RT内核与普通Linux内核相比,系统延时更加稳定,平均延时、最大延时更低,系统实时性更佳

      PREEMPT-RT和xenomai

      在buildroot里面,大家可以选择xenomai系统进行选择,对比效果

      微信截图_20231219163741.png

      这两个的测试结果就不太明显,因为我们的软件没有严格限制,这里就不详细介绍了。感兴趣的可以学习相关内容。

      附录
      实时系统镜像
      Dedktop系统镜像

      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer

    BSPlayer 发布的最新帖子

    • 回复: OK113i-S开发板-2适配10寸LCD显示

      @dudu152 是的,因为我这个屏幕的40pin排线无法接入板子,只能通过转接板接入。
      这个转接板是我们另一个荣品的产品用的,我这里借用过来的。

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • 回复: OK113i-S开发板体验-1开箱和基本使用

      @fengdao 应该不能,核心板外观都 不一样

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板-4视频编解码测试

      前言

      本文测试OK113i-S开发板-视频编解码的功能

      OK113i-S开发板是支持视频的编解码的,下面是官方介绍的编解码功能

      T113-i 是一种为多媒体解码平台设计的高级应用处理器。T113-i 集成了64位玄铁C906 RISC-V CPU,
      双核 Cortex - A7 CPU 和 HiFi4 DSP,提供高效的计算能力。
       主要特性
      支持 H.265、H.264、MPEG-1/2/4、JPEG 等全格式解码。独立的编码器可以用 JPEG 或 MJPEG 来进行编
      码。
       T113-i 集成了 H.265/H.264 4K 解码和 SmartColor2.0 后处理,提供完美的视频娱乐体验。

      下面我们来测试一下音视频的编码解码功能。

      编解码代码

      在系统的代码中,下面是程序的位置

      ----------------
      视频
      /sdk/platform/framework/auto/cmd_demo/decoderTest 
      /sdk/platform/framework/auto/sdk_demo/decoderTest
      /sdk/platform/framework/auto/sdk_demo/encoderTest
      /sdk/platform/framework/auto/sdk_demo/fltest_streamPlayer
      
      ------------------
      音频
      /sdk/platform/framework/auto/cmd_demo/audplayer
      /sdk/platform/framework/auto/qt_demo/fltest_qt_musicplayer
      /sdk/platform/framework/auto/sdk_demo/audioencTest
      /sdk/platform/framework/auto/sdk_demo/audplayerTest
      

      编译音视频库

      系统的音视频库主要是cedarx 和libcedarc;这个在buuildroot中需要选定。如下图

      Target Packages
        Allwinner platform private package select
        Libcedcrc
        Cedarx
      

      微信截图_20231220140841.png

      微信截图_20231221103631.png

      错误

      =================
      >>> cedarx  Installing to target
      cp -rf /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf 
      /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/target/etc/cedarx.conf
      cp: cannot stat '/home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf': No such file or directory
      make[1]: *** [package/pkg-generic.mk:335: /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/.stamp_target_installed] Error 1
      

      解决办法

      cp -rf /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/conf/default_cedarx.conf  
      /home/forlinx/113/OK113i-linux-sdk/out/t113_i/ok113i/longan/buildroot/build/cedarx/config/_cedarx.conf
      

      ./build.sh
      ./build.sh pack

      =============================================
      视频解码264

      fltest_decoderTest 解码/tmp.h264 为yuv 格式。

      root@ok113i:/forlinx/media# ls
      1.jpg                1280x720_video3.yuv    tmp.h264
      1024x600.rgba        2.jpg                  tmp.h265
      1280x720_video0.yuv  2560x1440_dcvideo.yuv  videotestsrc_1280x720.nv21
      1280x720_video1.yuv  30s.wav
      1280x720_video2.yuv  test.mp3
      
      root@ok113i:/forlinx/media# fltest_decoderTest
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      [ 1097.603725] VE: VE real_freq=576000000
      [ 1097.603725]
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 17:35:24] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 17:35:24] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      decoderTest version:V2.0.20220506
      decoderTest intputFile:/forlinx/media/tmp.h264
      [D]singleDecoderH264Test                 ================================
      [D]singleDecoderH264Test                 ====     CedarC  Decoder    ====
      [D]singleDecoderH264Test                 ====  singleDecoderTest cbk ====
      [D]singleDecoderH264Test                 ================================
      [E][decoderTest.cpp]singleDecoderH264Test line:271 open intputFile:/forlinx/media/tmp.h264
      [E][decoderTest.cpp]singleDecoderH264Test line:294 open outputFile:/tmp/800x480nv21_sgl.yuv
      new AWVideoDecoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1559, g_context = 0x28b3b8
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      DEBUG  : cedarc <CdcIniParserInit:41>: load conf file /etc/cedarc.conf ok!
      
      INFO   : cedarc <log_set_level:43>: Set log level to 5 from /vendor/etc/cedarc.conf
      ERROR  : cedarc <DebugCheckConfig:316>: now cedarc log level:5
      WARNING: cedarc <InitializeVideoDecoder:619>: warning: the nDeInterlaceHoldingFrameBufferNum is 0
      [D]singleDecoderH264Test decode process[0/821226]
      ======================= ret:-6  
      [D]singleDecoderH264Test decode process[815936/821226]
      offset>(size-4)
      [D]decoderDataReady decode write[384000/192000]
      ======================= ret:3
      output file is saved:/tmp/
      

      =============================================
      视频解码h265

      demoVdecoder 这个文件失败

      ==================================

      ok113i:/forlinx/media# demoVdecoder -i /forlinx/media/tmp.h265 -o dec265.yuv
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 19:28:03] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 19:28:03] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 19:28:03] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1074>:  ==== CedarX linux decoder demo help start =====
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1075>:  -h or --help to show the demo usage
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1076>:  demo created by zouwenhuan, allwinnertech/AL3
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1077>:  email: zouwenhuan@allwinnertech.com
      [2023-12-20 19:28:03] DEBUG  : awplayer <DemoHelpInfo:1078>:  ===== CedarX linux decoder demo help end ======
      [2023-12-20 19:28:03] DEBUG  : awplayer <main:1254>: nDecoderNum = 1
      [2023-12-20 19:28:03] DEBUG  : awplayer <ChannelThread:1093>: ChannelThread 11, 0
      [2023-12-20 19:28:03] DEBUG  : awplayer <ParseArgument:193>:  get input file: file:///forlinx/media/tmp.h265
      [2023-12-20 19:28:03] DEBUG  : awplayer <ParseArgument:210>:  get save pic path: dec265.yuv
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1773, g_context = 0xb5d02528
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      [2023-12-20 19:28:03] DEBUG  : awplayer <CdxParserPrepare:778>: source uri 'file:///forlinx/media/tmp.h265'
      [2023-12-20 19:28:03] DEBUG  : awplayer <__FileStreamConnect:407>: (5/0/1133141) path:'file:///forlinx/media/tmp.h265'
      [2023-12-20 19:28:03] ERROR  : CdxFlacParser <__FlacParserProbe:1133>: Flac probe failed.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.frames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence offrames found.
      [2023-12-20 19:28:03] WARNING: awplayer <Mp3Probe:854>: Wav parser : no dice, no valid sequence of frames found.
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] DEBUG  : awplayer <__WvParserProbe:575>: __WvParserProbe:
      [2023-12-20 19:28:03] ERROR  : awplayer <__G729ParserProbe:290>: g729 SYNC_WORD probe failed.
      [2023-12-20 19:28:03] ERROR  : awplayer <__Id3v2ParserProbe:330>: Probe ID3_header loss sync...
      [2023-12-20 19:28:03] WARNING: awplayer <CdxParserCreate:711>: Sorry, I don't know what it is!
      [2023-12-20 19:28:03] WARNING: awplayer <CdxParserOpen:756>: should not be here.
      [2023-12-20 19:28:03] ERROR  : awplayer <CdxParserPrepare:789>: open parser fail, uri(file:///forlinx/media/tmp.h265)
      [2023-12-20 19:28:03] ERROR  : awplayer <initDecoder:278>:  decoder open parser error nRet = -1, Decoder->parser: (nil)
      [2023-12-20 19:28:03] ERROR  : awplayer <ChannelThread:1156>:  decoder demom initDecoder error
      

      =============================================

      我们修改decoderTest这个程序,使它能解码h265的格式,其中下面代码红色是我修改的。

      source ~/113/OK113i-linux-sdk/.buildconfig
      ~/113/OK113i-linux-sdk/platform/framework/auto/sdk_demo/decoderTest$ make
      

      ==============================================

      //decoderTest 265
      int main(int argc, char** argv)
      {
          printf("decoderTest265 version:%s\n", MODULE_VERSION);
          /******** begin set the default encode param ********/
          memset(&decodeParam, 0, sizeof(decodeParam));
          memset(&testParam, 0, sizeof(testParam));
      
          decodeParam.srcW = 800;
          decodeParam.srcH = 480;
          decodeParam.dstW = 800;
          decodeParam.dstH = 480;
          decodeParam.rotation = Angle_0;
          decodeParam.scaleRatio = ScaleNone;
          decodeParam.codecType = CODEC_H265;
          decodeParam.pixelFormat = PIXEL_NV21;
      
          testParam.testTimes = 1;
          testParam.testWay = 0;
          strcpy((char*)testParam.intputFile,        "/tmp/tmp.h265");
      strcpy((char*)testParam.outputFile,        "/tmp/dec265_out.yuv");
      

      ================================================================

      Makefile的修改
      
      all: $(Target) 
      $(Target) : decoderTest.cpp 
      	$(CPP) decoderTest.cpp -o $(Target)  $(LIBS) $(LDFLAGS) -lpthread $(CXXFLAGS)
      	$(CPP) decoderTest265.cpp -o $(Target)265  $(LIBS) $(LDFLAGS) -lpthread $(CXXFLAGS)
      	@echo "generate $(Target) success!!!"
      	@cp -f $(Target)    $(INSTATLL_PATH)
      	@cp -f $(Target)265 $(INSTATLL_PATH)
      	@echo -e '\e[1;33m cp -f $(Target) $(INSTATLL_PATH) \e[0m'
      

      =============================================
      测试解码效果

      play.png

      ./decoderTest265
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      [ 3213.535493] VE: VE real_freq=576000000
      [ 3213.535493]
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-21 01:51:19] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-21 01:51:19] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      decoderTest265 version:V2.0.20220506
      intputFile  :/tmp/tmp.h265
      outputFile  :/tmp/d5_out.yuv
      [D]singleDecoderTest             ================================
      [D]singleDecoderTest             ====     CedarC  Decoder    ====
      [D]singleDecoderTest             ====  singleDecoderTest cbk ====
      [D]singleDecoderTest             ================================
      new AWVideoDecoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1597, g_context = 0x198c480
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      DEBUG  : cedarc <CdcIniParserInit:41>: load conf file /etc/cedarc.conf ok!
      
      INFO   : cedarc <log_set_level:43>: Set log level to 5 from /vendor/etc/cedarc.conf
      ERROR  : cedarc <DebugCheckConfig:316>: now cedarc log level:5
      WARNING: cedarc <InitializeVideoDecoder:619>: warning: the nDeInterlaceHoldingFrameBufferNum is 0
      [D]singleDecoderTest decode process[0/1133141]
      [W][decoderTest265.cpp]singleDecoderTest line:514 decode failed,error code:-6
      [D]singleDecoderTest decode process[28/1133141]
      [W][decoderTest265.cpp]singleDecoderTest line:514 decode failed,error code:-6
      [D]singleDecoderTest decode process[86/1133141]
      
      [D]singleDecoderTest decode process[1127265/1133141]
      offset>(size-4)
      WARNING: cedarc <HevcDecoderAddPtsToList:933>:  h265 pts list is full
      [D]decoderDataReady decode write[384000/192000]
      [D]printfArgs    -i:/tmp/tmp.h265
      [D]printfArgs    -s:[800x480]
      [D]printfArgs    -f:278
      [D]printfArgs    -p:5
      [D]printfArgs    -o:/tmp/d5_out.yuv
      output file is saved:/tmp/d5_out.yuv
      ~ AWVideoDecoderImpl()
      Test 1 times.
      

      =============================================
      视频编码

      root@ok113i:/forlinx/media# encoderTest
      encoderTest version:V2.0.2022050[ 5100.284684] VE: VE real_freq=576000000
      [ 5100.284684]
      6
      intputFile /tmp/800_480.yuv
      outputFile /tmp/enc720_30p.265
      outputFile  CODEC_H265
      [D]singleEncoderTest             ================================
      [D]singleEncoderTest             ====     CedarC  Encoder    ====
      [D]singleEncoderTest             ====    singleDecoderTest    ====
      [D]singleEncoderTest             ================================
      [D]printfArgs    -s:800x480
      [D]printfArgs    -n:1
      [D]printfArgs    -f:3
      [D]printfArgs    -p:1
      [D]printfArgs    -r:30
      [D]printfArgs    -d:800x480
      sdk_memory version:V2.0.20220506
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      [D]encodeFile malloc pIonMem->vir=0xb6a63000!
      new AWVideoEncoderImpl() version:V2.0.20220506
      sdk_memory version:V2.0.20220506
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      ERROR  : cedarc <H265EncOpen:6246>: error: the driver do not support the ic 1667
      [E][AWVidoeEncoder.cpp]init line:389 VideoEncCreate error, return[E][encoderTest.cpp]encodeFile line:412 init:ffffffff
      ~ AWVideoEncoderImpl()
      ERROR  : cedarc <ReleaseAllocInputBuffer:456>: ReleaseAllocInputBuffer, pEncoder is NULL
      [D]printfArgs    -s:800x480
      [D]printfArgs    -n:1
      [D]printfArgs    -f:3
      [D]printfArgs    -p:1
      [D]printfArgs    -r:30
      [D]printfArgs    -d:800x480
      output file is saved:/tmp/enc720_30p.265
      Test 1 times.
      

      编码失败,文件为0

      =============================================
      音频编码

      root@ok113i:/forlinx/media# cp 30s.wav /tmp/test.wav
      root@ok113i:/forlinx/media# audioenc_test
      INFO   : cedarc <log_set_level:43>: Set log level to 3 from /vendor/etc/cedarc.conf
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 18:48:57] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 18:48:57] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwMuxerInit:53>: aw muxer init ..
      [2023-12-20 18:48:57] DEBUG  : awplayer <AwMuxerInit:62>: aw muxer size:4
      audioenc test version:V2.0.20220506
      12-20 18:48:57.953  AudioEnc(W) : AudioEncInit success
      fopen /tmp/test.wav OK
      fopen /tmp/test.mp3 ok
      12-20 18:48:57.955  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:48:58.001  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.031  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.077  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.123  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      12-20 18:49:05.169  AudioEnc(E) : audio encode ERR_AUDIO_ENC_PCMUNDERFLOW
      file end exit.
      audioenc test run finish
      

      =============================================
      音频解码

      下图是
      fltest_qt_musicplayer
      微信图片_20231220112009.jpg

      root@ok113i:/forlinx/media# fltest_audioplayer   /forlinx/media/test.mp3
      [2023-12-20 19:02:26] WARNING: awplayer <log_set_level:30>: Set log level to 3
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry adecoder-15 fail!
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry vdecoder-9 fail!
      INFO   : cedarc <CedarPluginVDInit:79>: register h264 decoder success!
      INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!
      INFO   : cedarc <CedarPluginVDInit:86>: register mpeg2 decoder success!
      [2023-12-20 19:02:26] WARNING: awplayer <DlOpenPlugin:112>: Invalid plugin,function CedarPluginVDInit not found.
      INFO   : cedarc <CedarPluginVDInit:92>: register mpeg4dx decoder success!
      INFO   : cedarc <CedarPluginVDInit:79>: register mpeg4H263 decoder success!
      INFO   : cedarc <CedarPluginVDInit:90>: register mpeg4Normal decoder success!
      INFO   : cedarc <CedarPluginVDInit:74>: register vc1 decoder success!
      INFO   : cedarc <CedarPluginVDInit:85>: register h265 decoder success!
      [2023-12-20 19:02:26] ERROR  : awplayer <ReadPluginEntry:194>: read plugin entry plugin-0 fail!
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwStreamInit:99>: aw stream init...
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwMuxerInit:53>: aw muxer init ..
      [2023-12-20 19:02:26] DEBUG  : awplayer <AwMuxerInit:62>: aw muxer size:4
      set url:/forlinx/media/test.mp3
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerCreate:216>: XPlayerCreate.
      [2023-12-20 19:02:26] DEBUG  : awplayer <LogVersionInfo:34>:
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CedarX <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      tag   : cedarx
      branch: stable_v2.8_common
      commit: 967535b8ff6a073cb4f38e85a4ae5fa6008014d8
      date  : Mon, 15 May 2017 01:30:22 +0000 (09:30 +0800)
      author:
      ----------------------------------------------------------------------
      
      xfang tinyalsa SoundDeviceCreate
      [2023-12-20 19:02:26] DEBUG  : awplayer <LayerCreate_DE:1540>: libsdk_player version:V2.0.20220516, LayerCreate
      
      (getInstance 93) version:V2.0.20220506
      init chwd sucess !
      (HwDisplay 279)
      (hwd_init 1258)
      [2023-12-20 19:02:26] DEBUG  : awplayer <LayerCreate_DE:1593>: screen:w 1024, screen:h 600 disp
      sdk_memory version:V2.0.20220506
      DEBUG  : ionAlloc <__GetIonMemOpsS:833>: *** get __GetIonMemOpsS ***
      INFO   : cedarc <VeInitialize:1307>: *** ic_version = 0x1301000010210,
      DEBUG  : cedarc <VeInitialize:1347>: *** nPhyOffset = 0x0
      DEBUG  : ionAlloc <ion_alloc_open2:177>: pid: 1608, g_context = 0x274370
      
      DEBUG  : ionAlloc <ion_alloc_open2:204>: ion alloc open ok
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetVideoSurfaceTexture:597>: setVideoSurfaceTexture, surface = 0x26fc60
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:1977>: process message XPLAYER_COMMAND_SET_SURFACE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <SubtitleCreate:88>: ==== pCallback: 0xb67e3574, pUser: 0x26b280
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2038>: ==== process message XPLAYER_COMMAND_SET_SUBCTRL.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetDeinterlace:718>: set deinterlace
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2053>: ==== process message XPLAYER_COMMAND_SET_SUBCTRL.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerSetDataSourceUrl:462>: setDataSource(url), url='/forlinx/media/test.mp3'
      [2023-12-20 19:02:26] INFO   : awplayer <XPlayerThread:1814>: process message XPLAYER_COMMAND_SET_SOURCE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerPrepare:767>: prepare
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2067>: process message XPLAYER_COMMAND_PREPARE. mPriData->mStatus: 1
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <DemuxThread:1792>: process message DEMUX_COMMAND_PREPARE.
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserPrepare:778>: source uri 'file:///forlinx/media/test.mp3'
      [2023-12-20 19:02:26] DEBUG  : awplayer <__FileStreamConnect:407>: (6/0/4818092) path:'file:///forlinx/media/test.mp3'
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:668>: parser node is id3v2.
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:717>: Good, it's 'id3v2'
      [2023-12-20 19:02:26] DEBUG  : awplayer <CdxParserCreate:717>: Good, it's 'mp3'
      [2023-12-20 19:02:26] WARNING: awplayer <CdxMp3ParserControl:1267>: not implement...(18)
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:468>: *********PrintMediaInfo begin*********
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:482>: fileSize = 4818092, bSeekable = 1, duration = 300016, audioNum = 1, videoNum = 0, subtitleNum = 0
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:520>: ***Audio[0]*** eCodecFormat = 0x3, eSubCodecFormat = 0x0, nChannelNum = 2, nBitsPerSample = 0, nSampleRate = 44100
      [2023-12-20 19:02:26] DEBUG  : awplayer <PrintMediaInfo:536>: *********P[ 2124.461204] [SNDCODEC][sunxi_card_hw_params][651]:stream_flag: 0
      rintMediaInfo end*********
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:468>: *********PrintMediaInfo begin*********
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:482>: fileSize = 4818092, bSeekable = 1, duration = 300016, audioNum = 1, videoNum = 0, subtitleNum = 0
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:520>: ***Audio[0]*** eCodecFormat = 0x3, eSubCodecFormat = 0x0, nChannelNum = 2, nBitsPerSample = 0, nSampleRate = 44100
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <PrintMediaInfo:536>: *********PrintMediaInfo end*********
      [2023-12-20 19:02:26] DEBUG  : awplayer <AudioRenderCompSetAudioSink:195>: audio render component setting AudioSink
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerPrepareAsync:747>: prepareAsync
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2067>: process message XPLAYER_COMMAND_PREPARE. mPriData->mStatus: 4
      12-20 19:02:26.531  (W) AUTPlayer info: prepare ok.
      
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerStart:797>: start
      [2023-12-20 19:02:26] DEBUG  : awplayer <XPlayerThread:2275>: process message XPLAYER_COMMAND_START.
      [2023-12-20 19:02:26] DEBUG  : awplayer <[ 2124.569726] [SNDCODEC][sunxi_card_hw_params][651]:stream_flag: 0
      PlayerStart:740>: player start
      [2023-12-20 19:02:26] DEBUG  : awplayer <BaseCompPostAndWait:61>: audio decoder receive cmd: start
      (Allwinner Audio Middle Layer),line(971) : Create Decoder!!=====
      [2023-12-20 19:02:26] DEBUG  : awplayer <handleStart:1086>: Create libadecoder success...
      (Allwinner Audio Middle Layer),line(603) : AudioDec_Installaudiolib ok
      (Allwinner Audio Middle Layer),line(606) : audio decoder init start ...
      (AllwinnerAlibs),line(50) :
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Audio <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      tag   : audiocodec-v1.2
      branch: new
      commit: 3ba65962c01cbf1280ddda19d843009b6ef8ce85
      date  : Tue Jan 8 16:25:27 2019 +0800
      ----------------------------------------------------------------------
      
      (AllwinnerAlibs),line(700) : ----Loading so success!
      (AllwinnerAlibs),line(902) : *************pAudioStreamInfo start******************
      (AllwinnerAlibs),line(903) : eCodecFormat         :id(3), name(mpeg layer-III)
      (AllwinnerAlibs),line(904) : eSubCodecFormat      :0
      (AllwinnerAlibs),line(905) : nChannelNum          :2
      (AllwinnerAlibs),line(906) : nBitsPerSample       :16
      (AllwinnerAlibs),line(907) : nSampleRate          :44100
      (AllwinnerAlibs),line(908) : nAvgBitrate          :128000
      (AllwinnerAlibs),line(909) : nMaxBitRate          :128000
      (AllwinnerAlibs),line(910) : nFileSize            :0
      (AllwinnerAlibs),line(911) : eAudioBitstreamSource:0
      (AllwinnerAlibs),line(912) : eDataEncodeType      :0
      (AllwinnerAlibs),line(913) : nCodecSpecificDataLen:0
      (AllwinnerAlibs),line(914) : pCodecSpecificData   :(nil)
      (AllwinnerAlibs),line(915) : nFlags               :0
      (AllwinnerAlibs),line(916) : nBlockAlign          :0
      (AllwinnerAlibs),line(917) : *************pAudioStreamInfo end  ******************
      (Allwinner Audio Libs),line(27) : init successs...
      (Allwinner Audio Middle Layer),line(614) : AUDIO DECODE INIT OK...0
      [2023-12-20 19:02:26] DEBUG  : awplayer <BaseCompPostAndWait:61>: audio render receive cmd: start
      [2023-12-20 19:02:26] INFO   : awplayer <handleStart:295>: audio render process start message.
      [2023-12-20 19:02:26] DEBUG  : awplayer <initSoundDevice:478>: init sound device.
      [2023-12-20 19:02:26] DEBUG  : awplayer <initSoundDevice:486>: set sound devide param, sample rate = 44100, channel num = 2.
      [2023-12-20 19:02:26] DEBUG  : demuxComponent <DemuxThread:2053>: process message DEMUX_COMMAND_START.
      [2023-12-20 19:02:26] WARNING: awplayer <callbackProcess:3656>: message 0x40a not handled.
      ======================================
      |Space  key | start or pause    |
      |Left   key | seek backend      |
      |Right  key | seek forward      |
      |Up     key | audio volume larger       |
      |Down   key | audio volume small        |
      ======================================
      [2023-12-20 19:02:26] DEBUG  : awplayer <startSoundDevice:684>: start sound device.
      [2023-12-20 19:02:26] DEBUG  : awplayer <startSoundDevice:686>: audio device start end
      
      [2023-12-20 19:02:26] DEBUG  : awplayer <CallbackProcess:2959>: first audio pts = 0
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:644>: sample rate change from 44100 to 44100.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:646>: channel num change from 2 to 2.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:648>: bitPerSample num change from 16 to 16.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:650>: if need direct out put flag change from 0 to 1.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:652>: data type change from 1 to 1.
      [2023-12-20 19:02:26] WARNING: awplayer <checkSampleRate:671>: start sound devide again because samplaRate or channelNum change
      [2023-12-20 19:02:26] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:26] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:27] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      [2023-12-20 19:02:27] INFO   : demuxComponent <DemuxThread:3226>: waiting for audio stream buffer.
      

      =============================================
      测试结果

      视频 h264的文件能解,h265也可以解了;编码h264不正常。
      音频 编码解码都可以正常运行。Sdk和测试app都可以运行,但是具体的编码格式没有详细测试。

      如有错误,欢迎指正,一起学习


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板-3测试实时系统

      前言
      OK113i-S开发板上测试实时linux系统的效果

      Linux下的实时系统有三种方案:这三种方案各有优缺点

      1.PREEMPT-RT:PREEMPT-RT是一个基于Linux内核的实时补丁,也被称为Real-Time(RT)补丁。它通过增加内核的可抢占性,使得Linux内核能够实现实时性能。PREEMPT-RT补丁提供了可配置的实时选项,可以根据应用程序的需求进行调整。这个版本跟内核的版本匹配很细致,几乎每一个内核的小版本都有配套的补丁。

      2.Xenomai:Xenomai提供了一个实时框架,为Linux操作系统添加了实时性能。它支持具有硬实时和软实时要求的应用程序,并通过分时多任务和抢占式调度来提供可预测性。
      这个系统就版本变化比较多,4之前是pipe,5后面是Dovetail,而且与内核版本匹配不太紧密,

      3.RTAI(Real-Time Application Interface):RTAI是一个开源实时应用程序接口,提供了类似API的接口和实时任务调度。它在Linux内核上运行,并通过插入抢占式调度器来实现实时性能。

      这里我们测试一下PREEMPT-RT的效果。

      编译desktop系统

      首先我们编译一个desktop的系统版本,官方提供的镜像是默认的PREEMPT-RT的。
      默认配置如下

      rt-low.png

      我们选择Desktop,

      rt-3.png
      选择Desktop,

      然后退出保存。

      Cp  ~/OK113i-linux-sdk/kernel/linux-5.4/arch/arm/configs/OK113I_linux_defconfig  ok-def
      Cp .config  ~/OK113i-linux-sdk/kernel/linux-5.4/arch/arm/configs/OK113I_linux_defconfig
      ~/OK113i-linux-sdk/build.sh kernel
      
      

      编译测试程序

      为了测试对比效果,我们还需要编译一个测试程序rt-test

      进入OK113i-linux-sdk/buildroot/buildroot-201902
      make menuconfig ARCH=arm
      
      选择
         Target packages
           Debugging,profileing and benchmark
      

      rt0.png

      然后OK113i-linux-sdk/buildroot/buildroot-201902/build.sh
      
      最后 ~/OK113i-linux-sdk/build.sh  pack
      Cp  ~/OK113i-linux-sdk/out/t113_i_linux_ok113i_uart0.img  t113-desk.img
      

      测试效果

      我们测试两个系统镜像,一个是desktop版本t113-desk.img,
      一个是PREEMPT-RT版本,下面是运行的测试结果

      我们这里就比较几个简单的命令coremark,和cyclictest
      cyclictest -t 5 -p 80 ,5个任务跑80个进程,计算时间

      ==============
      Desktop

      root@ok113i:/#uname -a
      Linux ok113i 5.4.61 #3 SMP Mon Dec 18 14:42:10 CST 2023 armv7l GNU/Linux
      
      root@ok113i:/# /usr/bin/coremark
      2K performance run parameters for coremark.
      CoreMark Size    : 666
      Total ticks      : 17257
      Total time (secs): 17.257000
      Iterations/Sec   : 3476.849974
      Iterations       : 60000
      Compiler version : GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
      Compiler flags   : -O2   -lrt
      Memory location  : Please put data memory location here
                              (e.g. code in flash, data on heap etc)
      seedcrc          : 0xe9f5
      [0]crclist       : 0xe714
      [0]crcmatrix     : 0x1fd7
      [0]crcstate      : 0x8e3a
      [0]crcfinal      : 0xbd59
      Correct operation validated. See readme.txt for run and reporting rules.
      CoreMark 1.0 : 3476.849974 / GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] -O2   -lrt / Heap
      
      root@ok113i:/# cyclictest -t 5 -p 80 
       //5个任务跑80个进程,计算时间
      # /dev/cpu_dma_latency set to 0us
      policy: fifo: loadavg: 1.09 0.80 0.38 2/70 1575
      policy: fifo: loadavg: 1.17 0.82 0.39 1/68 1576
      T: 0 ( 1517) P:80 I:1000 C:   9393 Min:     10 Act:   20 Avg:   15 Max:     152
      T: 0 ( 1517) P:80 I:1000 C:  11554 Min:     10 Act:   11 Avg:   15 Max:     754
      T: 1 ( 1518) P:80 I:1500 C:   7702 Min:     10 Act:   11 Avg:   14 Max:     140
      T: 2 ( 1519) P:80 I:2000 C:   5773 Min:     10 Act:   11 Avg:   16 Max:    4850
      T: 3 ( 1520) P:80 I:2500 C:   4619 Min:     10 Act:   12 Avg:   17 Max:    5174
      T: 4 ( 1521) P:80 I:3000 C:   3850 Min:     10 Act:   11 Avg:   16 Max:    4726
       Disable gpadc0
      policy: fifo: loadavg: 1.06 0.85 0.43 1/72 1634
      

      ===========
      PREEMPT-RT

      root@ok113i:/# coremark
      2K performance run parameters for coremark.
      CoreMark Size    : 666
      Total ticks      : 17200
      Total time (secs): 17.200000
      Iterations/Sec   : 3488.372093
      Iterations       : 60000
      Compiler version : GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
      Compiler flags   : -O2   -lrt
      Memory location  : Please put data memory location here
                              (e.g. code in flash, data on heap etc)
      seedcrc          : 0xe9f5
      [0]crclist       : 0xe714
      [0]crcmatrix     : 0x1fd7
      [0]crcstate      : 0x8e3a
      [0]crcfinal      : 0xbd59
      Correct operation validated. See readme.txt for run and reporting rules.
      CoreMark 1.0 : 3488.372093 / GCC7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] -O2   -lrt / Heap
      
      root@ok113i:/# cyclictest -t 5 -p 80 
       //5个任务跑80个进程,计算时间
      # /dev/cpu_dma_latency set to 0us
      policy: fifo: loadavg: 1.00 0.67 0.30 1/79 1651
      
      T: 0 ( 1647) P:80 I:1000 C:  85352 Min:     13 Act:   16 Avg:   16 Max:      57
      T: 1 ( 1648) P:80 I:1500 C:  56901 Min:     13 Act:   16 Avg:   15 Max:      74
      T: 2 ( 1649) P:80 I:2000 C:  42671 Min:     13 Act:   16 Avg:   15 Max:      39
      T: 3 ( 1650) P:80 I:2500 C:  34136 Min:     13 Act:   20 Avg:   16 Max:      51
      T: 4 ( 1651) P:80 I:3000 C:  28447 Min:     13 Act:   16 Avg:   16 Max:      80
      

      =========

      可以看到 Total time相差不大,但是 cyclictest 的Max时间是大大减少的。 可看到Linux-RT内核与普通Linux内核相比,系统延时更加稳定,平均延时、最大延时更低,系统实时性更佳

      PREEMPT-RT和xenomai

      在buildroot里面,大家可以选择xenomai系统进行选择,对比效果

      微信截图_20231219163741.png

      这两个的测试结果就不太明显,因为我们的软件没有严格限制,这里就不详细介绍了。感兴趣的可以学习相关内容。

      附录
      实时系统镜像
      Dedktop系统镜像

      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板-2适配10寸LCD显示

      前言

      本文介绍如何在OK113i-S开发板上适配一个自己的10寸LCD。

      OK113i-S 是一个优秀的开发板,支持lvds 单8,双8显示,最大分辨率1280x800

      也支持RG666显示,由于我手头只有lvds 单8,40pin的显示器,今天我就适配一下这个LCD的显示。

      显示效果

      GUI.jpg

      设备接线

      我这个转接板是两部分,左边的是触摸线,右边的是屏幕接线,触摸的调试见另一篇文章。这里只说屏幕的适配;从图上可以看到,液晶屏的排线40pin经过转接板转为20pin接入主板。

      LCD-Cable.jpg

      首先根据主板使用说明,LVDS接口信息,主板是LVDS双8信号,我这里只有LVDS接口的屏幕,其他工程剩余的,是LVDS单8信号,需要做一些修改。屏幕是10寸的40pinLVDS 单8接口。40pinLVDS 接口经过转接板只有20接口线。下面是关键信息。

      主板的LCD接口信息
      2-主板接口LVDS-双8.png

      LCD的LVDS 40PIN接口信息
      1-LVDS-40PIN-单8-LCD接口.png

      接口板接口信息定义
      30-40-pin-接口.png

      我们要做的就是把主板的接口与20pin的转接板连接起来,调整排线的线序,具体做法如下

      conn.png

      屏幕接口说明书

      代码适配修改

      首先找到内核的设备树文件OK113i-C-Linux.dts和 OK113i-C-Common.dtsi

      Device/config/chips/t113_i/config/ok113i/目录下有同名的链接文件,都指向同一个文件
      link.png

      根据屏幕说明书,找到屏幕的关键参数,如下图
      LCD-10--1.png

      Default 注释的是原来的内容,1024x600是我的屏幕分辨率,这里面有许多参数,具体的说明如下:我们这里只关心几个即可
      lcd注释.png

      lcd-10.png
      ////////////////////////////////////
      Lcd_if: HV模式,见lcd屏幕说明
      lcd_lvds_if: 0:single link; 1:dual link
      lcd_lvds_mode: 0:NS mode; 1:JEIDA mode;这里是JEIDA显示序列

      Lcd_x 分辨率x
      Lcd_y 分辨率y
      Lcd_width 物理尺寸
      Lcd_height 物理尺寸

      lcd_hbp: hsync back porch(pixel) + hsync plus width(pixel);
      lcd_ht: hsync total cycle(pixel)
      lcd_vbp: vsync back porch(line) + vysnc plus width(line)
      lcd_vt: vysnc total cycle(line)
      lcd_hspw: hsync plus width(pixel)
      lcd_vspw: vysnc plus width(pixel)
      ////////////////////////////////////////

      UBOOT的配置文件在这里:
      kernel/linux-5.4/arch/arm/boot/dts/uboot-board-lvds.dts

      这里看到有看到其他的不同屏幕的配置文件,根据我的屏幕类型lvds,uboot-board-lvds.conf;
      uboot-files.png

      修改完后,./build.sh 修改编译选项,重新烧录即可
      build-lcd.png

      最后我们截屏看看
      使用这个命令可以截屏ok113-Screen.bmp

      root@ok113i:/# echo 0 >/sys/class/disp/disp/attr/disp
      root@ok113i:/# echo /home/forlinx/ok113-Screen.bmp >/sys/class/disp/disp/attr/

      cat.png

      问题总结:

      1 buidl前需要整体编译一遍,有问题可以群里提问。
      2 buidl内核前先clean,减少修改后不生效的问题。
      3 修改后不生效,需要查看UBOOT启动的默认选项。

      附录
      内核配置文件
      编译好的LCD支持内核
      编译的LCD支持系统镜像


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • OK113i-S开发板体验-1开箱和基本使用

      感谢电子发烧友论坛和飞凌公司所提供的测试机会。
      最早是在20年前用过飞凌的产品2440,知道飞凌是一个芯片产品的方案提供商,自己也从事嵌入式相关的工作,所以此次试用可以增加对飞凌产品更多了解。
      OK113i-S开发板的功能齐全,制作工艺成熟,是一个不错的工业级开发板。是采用邮票孔核心板加底板方式,性能稳定,价格便宜。
      其详细资料可以访问飞凌的网站:

      全志T113处理器设计全国产化工业级T113核心板
      全志T113i开发板 国产工业级T113开发板

      开发板开箱
      收到了OK113i-S开发板,周六联系的,下周一就收到了,飞凌就是有效率
      板子有电源,天线2个,USB线,还有一个产品小册子,里面介绍了各种产品特点,这个销售还挺有心的。
      box1.jpg
      b11.jpg
      b0.jpg
      box-2.jpg

      设备介绍
      T113-i 是一种为多媒体解码平台设计的高级应用处理器。T113-i 集成了64位玄铁C906 RISC-V CPU, 双核 Cortex - A7 CPU 1.2G和 HiFi4 DSP,这次测试主要是测试32位双核A7CPU的性能。
      board.png

      特色功能
      我用过很多开发板,2440,imx6q,3288,3568 等,这个板子给我感觉有特色的功能有这两个,第一是硬件调试线type-c,省去了使用USB-转串口调试线。下图左边是usb转串口调试线,右边是usb下载接口,一根线两用,方便多了。

      usb.jpg
      第二是uboot里面可以按键切换屏幕类型,如下图显示

      UBOOT.png
      连续按2可以显示其他的显示类型,按后就保存。这极大的提高了开发效率,方便显示切换。

      界面效果展示
      在编译系统时测试程序一起用buildroot系统。下面展示了几个基本系统程序。
      系统开机启动一个程序 Matrix_Browser,自己开发时,可以针对这个界面进行裁剪。不过这个系统内存只有512M,app的切换就比较慢。推荐不用这个窗口,直接启动自己的界面。

      UBOOT界面
      GUI1.jpg

      主界面

      GUI.jpg

      App界面2
      gui-3.jpg

      web界面

      如果你没有lcd屏幕,用浏览器也可以看,但是只能看到第一屏和命令行的程序。这是因为主界面是个B/S结构

      pc-web.png

      web2.png

      web3.png

      系统开机启动的程序和性能
      top.png

      系统开机运行了ftp程序和sshd,方便大家登录和传输文件,matrix-browser是主界面的进程,可以看到系统内存已经用了一半。这对开发性能是足够的。

      开发环境
      官方提供了一键式开发环境,安装好开发环境ubuntu20的vmware虚拟机,只需开机,build就ok了。相比之前不需要安装太多软件,大大节省了时间,真是太方便了。如果提供云端的开发环境,那就更人性化了。
      系统下载大约需要20G的空间,运行大约需要100G磁盘。

      Demo程序
      开发板自带几个demo的程序,这些程序展示了系统的一些基本功能。
      demo代码位置在:platform/framework/auto/qt_demo Qt 测试程序源码目录,具体的内容在《1-OK113i-S_Linux5.4.61+Qt5.12.2_用户编译手册》里面有详细说明,我发现还有一个目录sdk_dem,里面有更多的demo可供开发参考。

      sdk.png

      串口程序
      serial.jpg
      AudioRecoder 这个录音程序支持多种录音格式。
      record.png

      Sql程序
      sql.jpg

      SPI 接口

      spi.jpg

      其他还有许多实用的功能,这些功能极大的方便了大家开发自己的app,期待大家去发现。
      通过多次启动程序发现,这个板子对于取代串口屏之类的单一应用是绰绰有余,无论是性能还是价格都有绝对的优势,期待有更多的进一步开发。


      OK113i-S开发板体验-1开箱和基本使用
      OK113i-S开发板-2适配10寸LCD显示
      OK113i-S开发板-3测试实时系统
      OK113i-S开发板-4视频编解码测试

      发布在 飞凌嵌入式专区
      B
      BSPlayer
    • 回复: t113-上 一个核跑linux,另一个核跑rtos,官方有提供实例或者有参考文档吗

      你使用实时内核就行了
      xenomai,5 以后内核用 Dovetail,5以前内核用 cobalt;
      这就是启动两个内核,xenomai 有用户空间的lib可以使用。
      参考:

      https://source.denx.de/Xenomai/xenomai/-/wikis/home

      发布在 其它全志芯片讨论区
      B
      BSPlayer