Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页
    1. Home
    2. yimu163com
    Y
    • Profile
    • Following 0
    • Followers 0
    • my integral 550
    • Topics 4
    • Posts 9
    • Best 1
    • Groups 0

    yimu163comLV 4

    @yimu163com

    550
    integral
    1
    Reputation
    3
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    yimu163com Unfollow Follow

    Best posts made by yimu163com

    • 基于R329开发板构建多房间音频组播系统1——测评

      一直想自己动手做一套多房间音频组播系统,研发硬件产品得选择电子器件,而其中很重要的器件就是主控CPU。搜集了不少资料,最终选择全志R329,因为它内置双核A53作为Linux主控性能够强大,此外还集成专业音频处理核HiFi4 DSP(不需要额外硬件就能实现音响产品必须的调音量、调EQ等功能)以及AI核Zhouyi NPU(满足个性化语音控制等智能化需求)。
      选好了主控,接下来该弄块电路板玩玩,最快捷的方式是买开发板。全志官方推出了R329 evb5开发板,板载WiFi模组、MIC阵列、喇叭接口,还几乎引出了所有IO,是我想要的。在全志官方淘宝店咨询了客服,没有现货,多问几次后给了我在线官方交流群号,让我找产品经理提购买需求,加群后成功买到开发板,还特意送了我一块。
      开发板到手,按照官方指引测试了点灯、WiFi联网和录音与播放都正常。但我更关注WiFi和音频的性能:WiFi连接下的ping值和吞吐量,音频的声道数、采样率和采样精度。
      1 WiFi性能测试
      R329 evb5开发板、Dell Ubuntu笔记本和Lenovo win10一体机都通过无线连接到路由器,将Ubuntu作为对照组来评估R329开发板WiFi性能。为排除干扰因素保证测试准确性,路由器WAN口未上联到任何网络。
      1.1 ping值测试
      R329 evb5 ping路由器

      root@TinaLinux:/# ping 192.168.2.1 -c 20
      PING 192.168.2.1 (192.168.2.1): 56 data bytes
      64 bytes from 192.168.2.1: seq=0 ttl=64 time=6.348 ms
      64 bytes from 192.168.2.1: seq=1 ttl=64 time=7.485 ms
      64 bytes from 192.168.2.1: seq=2 ttl=64 time=6.894 ms
      64 bytes from 192.168.2.1: seq=3 ttl=64 time=5.353 ms
      64 bytes from 192.168.2.1: seq=4 ttl=64 time=8.104 ms
      64 bytes from 192.168.2.1: seq=5 ttl=64 time=19.801 ms
      64 bytes from 192.168.2.1: seq=6 ttl=64 time=7.150 ms
      64 bytes from 192.168.2.1: seq=7 ttl=64 time=6.628 ms
      64 bytes from 192.168.2.1: seq=8 ttl=64 time=7.348 ms
      64 bytes from 192.168.2.1: seq=9 ttl=64 time=6.825 ms
      64 bytes from 192.168.2.1: seq=10 ttl=64 time=7.057 ms
      64 bytes from 192.168.2.1: seq=11 ttl=64 time=6.887 ms
      64 bytes from 192.168.2.1: seq=12 ttl=64 time=7.128 ms
      64 bytes from 192.168.2.1: seq=13 ttl=64 time=7.208 ms
      64 bytes from 192.168.2.1: seq=14 ttl=64 time=7.008 ms
      64 bytes from 192.168.2.1: seq=15 ttl=64 time=6.811 ms
      64 bytes from 192.168.2.1: seq=16 ttl=64 time=2.825 ms
      64 bytes from 192.168.2.1: seq=17 ttl=64 time=7.661 ms
      64 bytes from 192.168.2.1: seq=18 ttl=64 time=8.144 ms
      64 bytes from 192.168.2.1: seq=19 ttl=64 time=6.582 ms
      
      --- 192.168.2.1 ping statistics ---
      20 packets transmitted, 20 packets received, 0% packet loss
      round-trip min/avg/max = 2.825/7.462/19.801 ms
      

      Ubuntu ping路由器

      gmei@dell:~$ ping 192.168.2.1 -c 20
      PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
      64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=3.59 ms
      64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=3.46 ms
      64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=3.43 ms
      64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=3.51 ms
      64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=3.40 ms
      64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=6.13 ms
      64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=3.48 ms
      64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=3.53 ms
      64 bytes from 192.168.2.1: icmp_seq=9 ttl=64 time=3.50 ms
      64 bytes from 192.168.2.1: icmp_seq=10 ttl=64 time=2.88 ms
      64 bytes from 192.168.2.1: icmp_seq=11 ttl=64 time=2.90 ms
      64 bytes from 192.168.2.1: icmp_seq=12 ttl=64 time=2.95 ms
      64 bytes from 192.168.2.1: icmp_seq=13 ttl=64 time=3.64 ms
      64 bytes from 192.168.2.1: icmp_seq=14 ttl=64 time=5.46 ms
      64 bytes from 192.168.2.1: icmp_seq=15 ttl=64 time=3.92 ms
      64 bytes from 192.168.2.1: icmp_seq=16 ttl=64 time=3.94 ms
      64 bytes from 192.168.2.1: icmp_seq=17 ttl=64 time=3.68 ms
      64 bytes from 192.168.2.1: icmp_seq=18 ttl=64 time=3.37 ms
      64 bytes from 192.168.2.1: icmp_seq=19 ttl=64 time=3.19 ms
      64 bytes from 192.168.2.1: icmp_seq=20 ttl=64 time=3.32 ms
      
      --- 192.168.2.1 ping statistics ---
      20 packets transmitted, 20 received, 0% packet loss, time 19031ms
      rtt min/avg/max/mdev = 2.880/3.664/6.130/0.770 ms
      

      结论:R329开发板ping值是Dell笔记本的2倍??
      1.2 吞吐量测试
      R329开发板作为服务端,win10台式机作为客户端。
      TCP:

      F:\sw\it\iperf-2.0.9-win64>iperf -c 192.168.2.31 -i 1 -t 30 -p 5001 -b 1000M
      ------------------------------------------------------------
      Client connecting to 192.168.2.31, TCP port 5001
      TCP window size:  208 KByte (default)
      ------------------------------------------------------------
      [  3] local 192.168.2.11 port 65519 connected with 192.168.2.31 port 5001
      [ ID] Interval       Transfer     Bandwidth
      [  3]  0.0- 1.0 sec  2.85 MBytes  23.9 Mbits/sec
      [  3]  1.0- 2.0 sec  2.97 MBytes  24.9 Mbits/sec
      [  3]  2.0- 3.0 sec  3.16 MBytes  26.5 Mbits/sec
      [  3]  3.0- 4.0 sec  1.70 MBytes  14.3 Mbits/sec
      [  3]  4.0- 5.0 sec  3.45 MBytes  29.0 Mbits/sec
      [  3]  5.0- 6.0 sec  2.10 MBytes  17.6 Mbits/sec
      [  3]  6.0- 7.0 sec  2.30 MBytes  19.3 Mbits/sec
      [  3]  7.0- 8.0 sec  2.68 MBytes  22.5 Mbits/sec
      [  3]  8.0- 9.0 sec  3.02 MBytes  25.3 Mbits/sec
      [  3]  9.0-10.0 sec  2.75 MBytes  23.1 Mbits/sec
      [  3] 10.0-11.0 sec  3.53 MBytes  29.6 Mbits/sec
      [  3] 11.0-12.0 sec  3.60 MBytes  30.2 Mbits/sec
      [  3] 12.0-13.0 sec  3.32 MBytes  27.8 Mbits/sec
      [  3] 13.0-14.0 sec  3.50 MBytes  29.4 Mbits/sec
      [  3] 14.0-15.0 sec  3.34 MBytes  28.1 Mbits/sec
      [  3] 15.0-16.0 sec  1.14 MBytes  9.53 Mbits/sec
      [  3] 16.0-17.0 sec  2.46 MBytes  20.7 Mbits/sec
      [  3] 17.0-18.0 sec  3.26 MBytes  27.3 Mbits/sec
      [  3] 18.0-19.0 sec  3.63 MBytes  30.5 Mbits/sec
      [  3] 19.0-20.0 sec  3.31 MBytes  27.8 Mbits/sec
      [  3] 20.0-21.0 sec  3.21 MBytes  26.9 Mbits/sec
      [  3] 21.0-22.0 sec  2.97 MBytes  24.9 Mbits/sec
      [  3] 22.0-23.0 sec  3.08 MBytes  25.9 Mbits/sec
      [  3] 23.0-24.0 sec  3.52 MBytes  29.6 Mbits/sec
      [  3] 24.0-25.0 sec  2.48 MBytes  20.8 Mbits/sec
      [  3] 25.0-26.0 sec  2.22 MBytes  18.6 Mbits/sec
      [  3] 26.0-27.0 sec  3.27 MBytes  27.4 Mbits/sec
      [  3] 27.0-28.0 sec  3.09 MBytes  25.9 Mbits/sec
      [  3] 28.0-29.0 sec  1.94 MBytes  16.3 Mbits/sec
      [  3] 29.0-30.0 sec  2.59 MBytes  21.7 Mbits/sec
      [  3]  0.0-30.0 sec  86.5 MBytes  24.2 Mbits/sec
      
      F:\sw\it\iperf-2.0.9-win64>
      

      UDP:

      root@TinaLinux:/# iperf -u -s -i 1 -p 5001
      ------------------------------------------------------------
      Server listening on UDP port 5001
      Receiving 1470 byte datagrams
      UDP buffer size:  224 KByte (default)
      ------------------------------------------------------------
      [  3] local 192.168.2.31 port 5001 connected with 192.168.2.11 port 57044
      [ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
      [  3]  0.0- 1.0 sec  2.05 MBytes  17.2 Mbits/sec   1.282 ms  639/ 2104 (30%)
      [  3]  1.0- 2.0 sec  2.41 MBytes  20.2 Mbits/sec   1.165 ms 5324/ 7041 (76%)
      [  3]  2.0- 3.0 sec  2.15 MBytes  18.1 Mbits/sec   0.712 ms 3982/ 5518 (72%)
      [  3]  3.0- 4.0 sec  2.26 MBytes  19.0 Mbits/sec   0.928 ms 5366/ 6979 (77%)
      [  3]  4.0- 5.0 sec  2.26 MBytes  19.0 Mbits/sec   2.296 ms 4061/ 5674 (72%)
      [  3]  5.0- 6.0 sec  2.04 MBytes  17.1 Mbits/sec   1.324 ms 4636/ 6089 (76%)
      [  3]  6.0- 7.0 sec  2.29 MBytes  19.2 Mbits/sec   0.931 ms 5174/ 6807 (76%)
      [  3]  7.0- 8.0 sec  2.39 MBytes  20.0 Mbits/sec   1.682 ms 4343/ 6046 (72%)
      [  3]  8.0- 9.0 sec  1.96 MBytes  16.5 Mbits/sec   0.640 ms 3504/ 4903 (71%)
      [  3]  9.0-10.0 sec  2.60 MBytes  21.8 Mbits/sec   0.922 ms 4491/ 6345 (71%)
      [  3] 10.0-11.0 sec  2.55 MBytes  21.4 Mbits/sec   1.571 ms 2774/ 4592 (60%)
      [  3] 11.0-12.0 sec  2.04 MBytes  17.1 Mbits/sec   1.242 ms 2751/ 4209 (65%)
      [  3] 12.0-13.0 sec  2.21 MBytes  18.6 Mbits/sec   0.632 ms 5089/ 6668 (76%)
      [  3] 13.0-14.0 sec  2.32 MBytes  19.4 Mbits/sec   1.602 ms 4464/ 6116 (73%)
      [  3] 14.0-15.0 sec  2.35 MBytes  19.7 Mbits/sec   0.825 ms 4585/ 6263 (73%)
      [  3] 15.0-16.0 sec  2.37 MBytes  19.9 Mbits/sec   1.590 ms 4099/ 5790 (71%)
      [  3] 16.0-17.0 sec  2.19 MBytes  18.4 Mbits/sec   0.402 ms 3852/ 5417 (71%)
      [  3] 17.0-18.0 sec  2.54 MBytes  21.3 Mbits/sec   2.604 ms 3999/ 5811 (69%)
      [  3] 18.0-19.0 sec  2.09 MBytes  17.5 Mbits/sec   0.871 ms 3217/ 4705 (68%)
      [  3] 19.0-20.0 sec  1.85 MBytes  15.5 Mbits/sec   1.224 ms 4089/ 5409 (76%)
      [  3] 20.0-21.0 sec  2.58 MBytes  21.7 Mbits/sec   1.067 ms 5517/ 7360 (75%)
      [  3] 21.0-22.0 sec  2.43 MBytes  20.4 Mbits/sec   1.182 ms 3624/ 5359 (68%)
      [  3] 22.0-23.0 sec  2.35 MBytes  19.7 Mbits/sec   1.085 ms 4552/ 6227 (73%)
      [  3] 23.0-24.0 sec  2.37 MBytes  19.9 Mbits/sec   0.519 ms 3974/ 5662 (70%)
      [  3] 24.0-25.0 sec  2.30 MBytes  19.3 Mbits/sec   0.930 ms 4587/ 6229 (74%)
      [  3] 25.0-26.0 sec  2.36 MBytes  19.8 Mbits/sec   0.795 ms 4314/ 6000 (72%)
      [  3] 26.0-27.0 sec  2.36 MBytes  19.8 Mbits/sec   0.528 ms 4714/ 6394 (74%)
      [  3] 27.0-28.0 sec  2.41 MBytes  20.2 Mbits/sec   1.235 ms 3772/ 5489 (69%)
      [  3] 28.0-29.0 sec  2.30 MBytes  19.3 Mbits/sec   1.076 ms 4112/ 5751 (72%)
      [  3] 29.0-30.0 sec  2.48 MBytes  20.8 Mbits/sec   0.734 ms 4058/ 5824 (70%)
      [  3]  0.0-30.2 sec  70.3 MBytes  19.5 Mbits/sec   1.797 ms 2147257037/2147307148 (1e+02%)
      root@TinaLinux:/# 
      

      Dell笔记本作为服务端,win10一体机作为客户端。
      TCP:

      F:\sw\it\iperf-2.0.9-win64>iperf -c 192.168.2.21 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   161 MBytes  45.0 Mbits/sec
      
      F:\sw\it\iperf-2.0.9-win64>
      

      UDP:

      gmei@dell:~iperf -u -s -i 1 -p 5001
      ......
      [  3]  0.0-29.9 sec   196 MBytes  55.0 Mbits/sec   1.027 ms  977/140872 (0.69%)
      gmei@dell:~$ 
      

      win10一体机作为服务端,R329开发板作为客户端。
      TCP:

      root@TinaLinux:/# iperf -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   145 MBytes  40.6 Mbits/sec
      root@TinaLinux:/# 
      

      UDP:

      root@TinaLinux:/# iperf -u -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   165 MBytes  46.1 Mbits/sec
      [  3] Sent 117592 datagrams
      root@TinaLinux:/# 
      

      win10一体机作为服务端,Dell笔记本开发板作为客户端。
      TCP:

      gmei@dell:~$ iperf -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   170 MBytes  47.6 Mbits/sec
      gmei@dell:~$ 
      

      UDP:

      gmei@dell:~$ iperf -u -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   207 MBytes  57.9 Mbits/sec
      [  3] Sent 147853 datagrams
      gmei@dell:~$ 
      

      结论:作为服务端,R329吞吐量只有Dell笔记本的一半;作为客户端,R329吞吐量与Dell笔记本相当??
      2 音频性能测试
      利用Tina SDK自带的arecord测试R329开发板支持的声道数、采样率和采样精度。
      是否支持192K采样率、24位采样精度?

      root@TinaLinux:/# arecord -r 192000 -c 2 -f U24_LE -d 10 20211119.wav
      [13449.631722] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [13449.639222] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [13449.646676] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [13449.653912] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [13449.660469] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [13449.667220] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [13449.673980] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [13449.681317] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [13449.687972] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [13449.695212] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [13449.702548] sunxi-internal-cpudai cpudai: ===========================
      [13449.734939] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '20211119.wav' : Unsigned 24 bit Little Endian, Rate 192000 Hz, Stereo
      arecord: begin_wave:2521: [13449.776745] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      Wave doesn't support U24_LE format...
      [13449.911776] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      不支持U24_LE,那支持哪几种格式?查代码,得到如下结果:

      out/r329-evb5/compile_dir/target/alsa-utils-1.1.0/aplay/aplay.c
      2505         switch ((unsigned long) hwparams.format) {
      2506         case SND_PCM_FORMAT_U8:
      2507                 bits = 8;
      2508                 break;
      2509         case SND_PCM_FORMAT_S16_LE:
      2510                 bits = 16;
      2511                 break;
      2512         case SND_PCM_FORMAT_S32_LE:
      2513         case SND_PCM_FORMAT_FLOAT_LE:
      2514                 bits = 32;
      2515                 break;
      2516         case SND_PCM_FORMAT_S24_LE:
      2517         case SND_PCM_FORMAT_S24_3LE:
      2518                 bits = 24;
      2519                 break;
      2520         default:
      2521                 error(_("Wave doesn't support %s format..."), snd_pcm_format_name(hwparams.format));
      2522                 prg_exit(EXIT_FAILURE);
      2523         }
      

      可知支持U8、S16_LE、S24_LE、S24_3LE、S32_LE,对应8位、16位、24位、32位采样精度。

      root@TinaLinux:/# arecord -r 192000 -c 3 -f S32_LE -d 5 20211119.wav
      [10023.671676] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [10023.679195] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [10023.686649] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [10023.693897] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [10023.700460] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [10023.707213] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [10023.713970] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [10023.721307] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [10023.727961] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [10023.735207] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [10023.742546] sunxi-internal-cpudai cpudai: ===========================
      [10023.774954] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '20211119.wav' : Signed 32 bit Little Endian, Rate 192000 Hz, Channels 3
      overrun!!! (at least 0.021 ms long)
      overrun!!! (at least 0.021 ms long)
      overrun!!! (at least 0.022 ms long)
      overrun!!! (at least 0.021 ms long)
      [10032.378621] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      [10032.431634] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      提示缓冲区溢出,录制出来的音频文件听起来不连续,扩大alsa音频缓冲区即可解决问题。

      root@TinaLinux:/# arecord -r 192000 -c 3 -f S32_LE --buffer-time 500000 -d 5 27.wav
      [24079.831625] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [24079.839114] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [24079.846570] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [24079.853815] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [24079.860461] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [24079.867219] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [24079.873972] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [24079.881310] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [24079.887965] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [24079.895202] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [24079.902582] sunxi-internal-cpudai cpudai: ===========================
      [24079.934899] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '27.wav' : Signed 32 bit Little Endian, Rate 192000 Hz, Channels 3
      [24085.699938] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      [24085.771732] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      声道数,由于板载三颗MIC,测试使用3声道,看资料可知最高支持8声道。
      结论:开发板最高支持192KHz采样率、8声道、32位采样精度,满足超高清音频应用要求。

      DSP核功能和性能没有直接测试,因为即便在https://www.synaptics.com/contact申请了多次也拿不到源码、lisence和编译工具链。有老哥以个人名义申请到这些了吗?

      posted in R128系列-智能硬件
      Y
      yimu163com

    Latest posts made by yimu163com

    • Reply: R329开发板烧录失败

      @xiaowenge 你说得对,就是因为没有装驱动。谢谢了!🤝 🤝

      posted in R128系列-智能硬件
      Y
      yimu163com
    • Reply: R329开发板烧录失败

      @yuzukitsuru 试过的,结果一样。

      posted in R128系列-智能硬件
      Y
      yimu163com
    • Reply: R329开发板烧录失败

      @yuzukitsuru 开发板是官网里( https://r329.docs.aw-ol.com/r329_evb5/ )介绍的这一块,NAND Flash用的ESMT F50L1G41LB,官网资料Allwinner SPI NAND Flash Support List_v1.9.pdf里提到了这一款存储芯片。

      posted in R128系列-智能硬件
      Y
      yimu163com
    • R329开发板烧录失败

      开发板正在跑的时候(仅仅是系统启动了,没有跑其他任何应用),用“PhoenixSuit”一键刷机工具来升级固件,如图所示,点击“立即升级”
      开始烧录.PNG
      之后,串口提示:

      [  717.701304] store rtc flag 0x5a
      [  717.704988] android_work: sent uevent USB_STATE=DISCONNECTED
      [  717.880590] br-lan: port 1(eth0) entered disabled state
      [  717.889436] device eth0 left promiscuous mode
      [  717.890083] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [  717.890327] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [  717.890336] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [  717.890342] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [  717.890347] sunxi-internal-cpudai cpudai: pcm_params->channels:2
      [  717.890353] sunxi-internal-cpudai cpudai: pcm_params->rate:48000
      [  717.890358] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [  717.890363] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [  717.890368] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [  717.890374] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [  717.890378] sunxi-internal-cpudai cpudai: ===========================
      [  717.920540] ffs_data_put(): freeing
      [  717.976526] br-lan: port 1(eth0) entered disabled state
      [  717.983986] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
      [  718.049868] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      [  718.852487] [STA_WRN] !!! xradio_remove_interface: vif_id=0
      [  721.850950] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      [  722.030067] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      [  723.553123] [alarmtimer] have no shutdown alarm! alarmtimer_shutdown 322
      [  723.968680] [LCD_FB] lcd_fb_gpio_set_value,line:353:
      [  723.974081] OSAL_GPIO_DevWRITE_ONEPIN_DATA, hdl is NULL
      [  724.024640] [LCD_FB] lcd_fb_shutdown,line:89:
      [  724.029358] Finish
      [  724.031940] sunxi_ohci_hcd_shutdown, ohci0-controller is disable, need not shutdown
      [  724.040549] sunxi_ehci_hcd_shutdown, ehci0-controller is disable, need not shutdown
      [  724.049254] reboot: Restarting system
      [37]HELLO! BOOT0 is starting!
      [40]BOOT0 commit : 97444f5
      [43]set pll start
      [45]periph0 has been enabled
      [48]set pll end
      [50]board init ok
      [52]rtc[3] value = 0xa102
      [54]the chip id is 0x3
      [56]the chip id is 0x3
      [59]the chip id is 0x3
      [61]the chip id is 0x3
      [63]the chip id is 0x3
      [65]chip id check OK
      [68][AUTO DEBUG] two rank and full DQ!
      [72][AUTO DEBUG] DDR3 try success
      [76][AUTO DEBUG] single rank and full DQ!
      [81][AUTO DEBUG] rank 0 row = 14 
      [84][AUTO DEBUG] rank 0 bank = 8 
      [88][AUTO DEBUG] rank 0 page size = 2 KB 
      [92]DRAM BOOT DRIVE INFO: V0.171
      [95]DRAM Type = 3 (2:DDR2,3:DDR3)
      [98]DRAMC read ODT  off.
      [101]DRAM ODT off.
      [104]DRAM CLK = 774 MHz
      [106]DRAM SIZE =256 M
      [112]DRAM simple test OK.
      [114]dram size =256
      [117]spinand UBOOT_START_BLK_NUM 8 UBOOT_LAST_BLK_NUM 32
      [123]block from 8 to 32
      [232]Check is correct.
      [234]dma 0x107f70 int is not used yet
      [238]dma 0x107f70 int is free, you do not need to free it again
      [244]Entry_name        = u-boot
      [250]Entry_name        = monitor
      [254]Entry_name        = dtb
      [257]Jump to second Boot.
      NOTICE:  BL3-1: v1.0(debug):3eba4b6
      NOTICE:  BL3-1: Built : 10:18:25, 2020-05-21
      NOTICE:  BL3-1 commit: 8
      ERROR:   Error initializing runtime service tspd_fast
      NOTICE:  BL3-1: Preparing for EL3 exit to normal world
      NOTICE:  BL3-1: Next image address = 0x43000000
      ÿOTICE:  BL3-1: Next image spsr = 0x1d3
      
      U-Boot 2018.05-00013-g7af46550cd (Dec 25 2020 - 08:28:52 +0000) Allwinner Technology
      
      [00.314]CPU:   Allwinner Family
      [00.317]Model: sun50iw11
      I2C:   ready
      [00.440]DRAM:  256 MiB
      [00.443]Relocation Offset is: 0ceff000
      [00.465]secure enable bit: 0
      [00.468]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=0Mhz
      [00.479]gic: sec monitor mode
      [00.481]flash init start
      [00.484]workmode = 0,storage type = 0
      [00.493]sunxi-spinand-phy: not detect any munufacture from id table
      [00.500]sunxi-spinand-phy: get spi-nand Model from fdt fail
      [00.505]sunxi-spinand-phy: get phy info from fdt fail
      
      device nand0 <nand>, # parts = 5
       #: name		size		offset		mask_flags
       0: boot0               0x00100000	0x00000000	1
       1: uboot               0x00300000	0x00100000	1
       2: secure_storage      0x00100000	0x00400000	1
       3: pstore              0x00080000	0x00500000	1
       4: sys                 0x07a80000	0x00580000	0
      
      active partition: nand0,0 - (boot0) 0x00100000 @ 0x00000000
      
      defaults:
      mtdids  : nand0=nand
      mtdparts: mtdparts=nand:1024k@0(boot0)ro,3072k@1048576(uboot)ro,1024k@4194304(secure_storage)ro,512k@5242880(pstore)ro,-(sys)
      [00.762]ubi0: attaching mtd5
      [00.892]ubi0: scanning is finished
      [00.899]ubi0: attached mtd5 (name "sys", size 122 MiB)
      [00.903]ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 258048 bytes
      [00.910]ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 2048
      [00.916]ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
      [00.922]ubi0: good PEBs: 490, bad PEBs: 0, corrupted PEBs: 0
      [00.928]ubi0: user volume: 12, internal volumes: 1, max. volumes count: 128
      [00.934]ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0
      [00.942]ubi0: available PEBs: 0, total reserved PEBs: 490, PEBs reserved for bad PEB handling: 20
      [00.950]sunxi flash init ok
      [00.953]bmp_name=bootlogo.bmp
      307254 bytes read in 20 ms (14.7 MiB/s)
      [01.167]Loading Environment from SUNXI_FLASH... OK
      [01.192]Item0 (Map) magic is bad
      [01.195]usb burn from boot
      delay time 0
      weak:otg_phy_config
      [01.207]usb prepare ok
      [01.413]usb sof ok
      [01.415]usb probe ok
      [01.417]usb setup ok
      set address 0x1b
      set address 0x1b ok
      [04.423]do_burn_from_boot usb : have no handshake
      partno erro : can't find partition private
      [04.457]bootmode[2]:0x5a
      [37]HELLO! BOOT0 is starting!
      [40]BOOT0 commit : 97444f5
      [43]set pll start
      [45]periph0 has been enabled
      [48]set pll end
      [50]board init ok
      [52]rtc[2] value = 0x5aa5a55a
      [54]rtc[3] value = 0xa102
      [57]eraly jump fel
      

      后面就卡住不动了,一会后,烧录工具跳出如下提示:
      提示.PNG
      手头四块板都是一样的现象,买到手之后没有烧录过。有大佬知道是什么原因吗?该如何解决?

      posted in R128系列-智能硬件
      Y
      yimu163com
    • Reply: 基于R329开发板构建多房间音频组播系统2——基于Ubuntu 20搭建开发环境

      @yimu163com 有无大佬使用E5处理器编译的?效果如何?

      posted in R128系列-智能硬件
      Y
      yimu163com
    • 基于R329开发板构建多房间音频组播系统2——基于Ubuntu 20搭建开发环境

      搭建环境是做开发的前提,官网有介绍如何基于Ubuntu 14搭建R329开发环境,我的笔记本上本身装有Ubuntu 20,本文记录搭建Ubuntu 20开发环境的过程。
      1 配置软件源
      官网里的配置对Ubuntu 20来说不好用,改为:

      gmei@dell:~$ cat /etc/apt/sources.list
      # deb cdrom:[Ubuntu 20.04.3 LTS _Focal Fossa_ - Release amd64 (20210819)]/ focal main restricted
      
      # deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
      # deb http://mirrors.aliyun.com/ubuntu/ focal universe
      # deb http://mirrors.aliyun.com/ubuntu/ focal multiverse
      # deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
      # deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
      # deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
      # deb http://security.ubuntu.com/ubuntu/ focal-security universe restricted multiverse main
      
      
      
      deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
      deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
      deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
      deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
      ##测试版源
      deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
      # 源码
      deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
      deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
      deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
      deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
      ##测试版源
      deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
      
      
      gmei@dell:~$ 
      

      2 安装依赖软件包
      官网指引安装如下软件包:

      gcc,binutils,bzip2,flex, python,perl,make,ia32-libs,find,grep,diff,unzip,gawk,getopt,subversion,libz-dev
      

      安装报错:

      gmei@dell:~/share/r329/evb5$ sudo apt-get install -y gcc binutils bzip2 flex python perl make ia32-libs find grep diff unzip gawk getopt subversion libz-dev
      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      Note, selecting 'python-is-python2' instead of 'python'
      Note, selecting 'zlib1g-dev' instead of 'libz-dev'
      Package diff is not available, but is referred to by another package.
      This may mean that the package is missing, has been obsoleted, or
      is only available from another source
      However the following packages replace it:
        diffutils diffutils:i386
      
      Package ia32-libs is not available, but is referred to by another package.
      This may mean that the package is missing, has been obsoleted, or
      is only available from another source
      However the following packages replace it:
        lib32z1
      
      E: Package 'ia32-libs' has no installation candidate
      E: Unable to locate package find
      E: Package 'diff' has no installation candidate
      E: Unable to locate package getopt
      gmei@dell:~/share/r329/evb5$ 
      

      系统已自带diff、find、getopt命令,忽略之;用lib32z1替换ia32-libs,用python-is-python2替换python,用zlib1g-dev替换libz-dev。用以下命令即可成功安装。

      sudo apt-get install -y gcc binutils bzip2 flex python-is-python2 perl make lib32z1 grep unzip gawk subversion zlib1g-dev
      

      官网提示,对于Ubuntu 16.04以上版本,还要执行以下命令:

      sudo apt-get install libc6:i386 libstdc++6:i386 lib32ncurses5 lib32z1
      

      提示:

      E: Unable to locate package lib32ncurses
      

      解决方案:用lib32ncurses5-dev替换lib32ncurses,用以下命令即可成功安装。

      sudo apt-get install libc6:i386 libstdc++6:i386 lib32ncurses5-dev lib32z1
      

      为了在Ubuntu 20.04上成功编译,还需要执行以下命令安装额外的软件包:

      sudo apt-get install -y build-essential git-core libncurses5-dev quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs lib32z1-dev lib32stdc++6 libstdc++6
      

      3 编译
      make -j1后报错:

      gdbusauth.c: In function '_g_dbus_auth_run_server':
      gdbusauth.c:1298:11: error: '%s' directive argument is null [-Werror=format-overflow=]
       1298 |           debug_print ("SERVER: WaitingForBegin, read '%s'", line);
            |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cc1: some warnings being treated as errors
      make[8]: *** [Makefile:3530: libgio_2_0_la-gdbusauth.lo] Error 1
      make[8]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1/gio'
      make[7]: *** [Makefile:4357: all-recursive] Error 1
      make[7]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1/gio'
      make[6]: *** [Makefile:1981: all] Error 2
      make[6]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1/gio'
      make[5]: *** [Makefile:1201: all-recursive] Error 1
      make[5]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1'
      make[4]: *** [Makefile:843: all] Error 2
      make[4]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1'
      make[3]: *** [Makefile:177: /home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/host/glib-2.50.1/.built] Error 2
      make[3]: Leaving directory '/home/gmei/share/r329/evb5/package/libs/glib2'
      make[2]: *** [package/Makefile:192: package/libs/glib2/host/compile] Error 2
      make[2]: Leaving directory '/home/gmei/share/r329/evb5'
      make[1]: *** [package/Makefile:189: /home/gmei/share/r329/evb5/out/r329-evb5/staging_dir/target/stamp/.package_compile] Error 2
      make[1]: Leaving directory '/home/gmei/share/r329/evb5'
      make: *** [/home/gmei/share/r329/evb5/build/toplevel.mk:306: world] Error 2
      

      找到gdbusauth.c文件:

      gmei@dell:~/share/r329/evb5$ find -name gdbusauth.c
      ./out/r329-evb5/compile_dir/target/host/glib-2.50.1/gio/gdbusauth.c
      ./out/r329-evb5/compile_dir/target/glib-2.50.1/gio/gdbusauth.c
      gmei@dell:~/share/r329/evb5$
      

      在报错语句前加入非空判断即可解决问题。继续编译,gdbusmessage.c的2698行还会报错,用同样的方式处理。继续编译,报错:

      gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
      	-v prefix=GPG_ERR_ -v namespace=errnos_ \
      	./errnos.in >errnos-sym.h
      gawk: fatal: cannot use gawk builtin `namespace' as variable name
      make[6]: *** [Makefile:1324: errnos-sym.h] Error 2
      make[6]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/libgpg-error-1.27/src'
      make[5]: *** [Makefile:474: all-recursive] Error 1
      make[5]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/libgpg-error-1.27'
      make[4]: *** [Makefile:405: all] Error 2
      make[4]: Leaving directory '/home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/libgpg-error-1.27'
      make[3]: *** [Makefile:81: /home/gmei/share/r329/evb5/out/r329-evb5/compile_dir/target/libgpg-error-1.27/.built] Error 2
      make[3]: Leaving directory '/home/gmei/share/r329/evb5/package/libs/libgpg-error'
      make[2]: *** [package/Makefile:193: package/libs/libgpg-error/compile] Error 2
      make[2]: Leaving directory '/home/gmei/share/r329/evb5'
      make[1]: *** [package/Makefile:189: /home/gmei/share/r329/evb5/out/r329-evb5/staging_dir/target/stamp/.package_compile] Error 2
      make[1]: Leaving directory '/home/gmei/share/r329/evb5'
      make: *** [/home/gmei/share/r329/evb5/build/toplevel.mk:306: world] Error 2
      

      将out/r329-evb5/compile_dir/target/libgpg-error-1.27/src/目录下的编译相关文件Makefile、Makefile.am、Makefile.in、mkstrtable.awk里的namespace都改为pkg_namespace,编译通过。
      做上述改动后能编译通过,但make clean之后再次编译,还是报同样的错。原因在于clean之后,会从dl目录下拷贝压缩包解压到out目录,覆盖了手动改过的内容。彻底的解决办法是,解压dl目录下的glib-2.50.1.tar.xz,修改其中的gdbusauth.c和gdbusmessage.c文件,打包后放回dl目录;解压dl目录下的libgpg-error-1.27.tar.bz2,修改其中的Makefile、Makefile.am、Makefile.in和mkstrtable.awk,打包后放回dl目录。
      4 编译加速
      编译在开发过程中得反复进行,提升编译效率就是提升开发效率。编译是CPU密集型和IO密集型任务,可从CPU效率和IO效率两个方面来提升编译效率。
      4.1 提升CPU效率——多线程编译
      make -j1只启用一个线程来编译,编译整个软件包花50分钟以上:

      #### make completed successfully (51:17 (mm:ss)) ####
      

      make -j尽可能启用多的线程来编译,编译整个R329软件包花18分钟以下:

      #### make completed successfully (17:53 (mm:ss)) ####
      

      结论:启用多线程多编译效率提升很明显,可节省65%时间。
      4.2 提升IO效率——整个软件包放入内存
      用dd命令测试硬盘和内存读写速度:

      gmei@dell:~/share/shm_test$ dd if=/dev/zero of=file.4k.1g bs=4k count=250000 oflag=direct
      250000+0 records in
      250000+0 records out
      1024000000 bytes (1.0 GB, 977 MiB) copied, 7.05123 s, 145 MB/s
      gmei@dell:~/share/shm_test$ sudo dd if=/dev/zero of=/dev/shm/r329/file.4k.1g bs=4k count=250000
      [sudo] password for gmei: 
      250000+0 records in
      250000+0 records out
      1024000000 bytes (1.0 GB, 977 MiB) copied, 0.507771 s, 2.0 GB/s
      gmei@dell:~/share/shm_test$ 
      gmei@dell:~/share/shm_test$ 
      gmei@dell:~/share/shm_test$ dd if=file.4k.1g of=/dev/null iflag=direct
      2000000+0 records in
      2000000+0 records out
      1024000000 bytes (1.0 GB, 977 MiB) copied, 51.0799 s, 20.0 MB/s
      gmei@dell:~/share/shm_test$ sudo dd if=/dev/shm/r329/file.4k.1g of=/dev/null
      2000000+0 records in
      2000000+0 records out
      1024000000 bytes (1.0 GB, 977 MiB) copied, 2.25148 s, 455 MB/s
      gmei@dell:~/share/shm_test$ 
      

      可知,内存的写速度是硬盘的2000/145=13.7倍,内存的读速度是硬盘的455/20=22.7倍。Dell笔记本配置了32G内存,R329软件包编译后大小为19G,将Ubuntu的共享内存扩大到25G,最大节点数扩大为10000000,将Tina SDK拷贝到共享内存中:

      gmei@dell:~/share/r329/evb5$ sudo mount -o size=25G -o nr_inodes=10000000 -o noatime,nodiratime -o remount /dev/shm
      gmei@dell:~/share/r329/evb5$ sudo mkdir -p /dev/shm/r329/evb5
      gmei@dell:~/share/r329/evb5$ sudo cp -rf ./* /dev/shm/r329/evb5/
      gmei@dell:~/share/r329/evb5$ 
      

      cd到/dev/shm/r329/evb5/,再次用make -j编译

      #### make completed successfully (17:53 (mm:ss)) ####
      

      可知,花费的时间与放在硬盘中分秒不差,提升IO性能不能提升编译效率。
      结论:六代4核i7处理器与SATA固态硬盘搭配起来跑Ubuntu 20编译R329软件包,编译效率的瓶颈在于处理器性能。

      posted in R128系列-智能硬件
      Y
      yimu163com
    • Reply: 基于R329开发板构建多房间音频组播系统1——测评

      @bedrock 这个系统主要用来听。家庭多个空间里的音箱同步播放相同的音频,在家里多个空间穿梭时能够听到连续的音乐,而不用随身携带发声源。用WiFi来传输。

      posted in R128系列-智能硬件
      Y
      yimu163com
    • 基于R329开发板构建多房间音频组播系统1——测评

      一直想自己动手做一套多房间音频组播系统,研发硬件产品得选择电子器件,而其中很重要的器件就是主控CPU。搜集了不少资料,最终选择全志R329,因为它内置双核A53作为Linux主控性能够强大,此外还集成专业音频处理核HiFi4 DSP(不需要额外硬件就能实现音响产品必须的调音量、调EQ等功能)以及AI核Zhouyi NPU(满足个性化语音控制等智能化需求)。
      选好了主控,接下来该弄块电路板玩玩,最快捷的方式是买开发板。全志官方推出了R329 evb5开发板,板载WiFi模组、MIC阵列、喇叭接口,还几乎引出了所有IO,是我想要的。在全志官方淘宝店咨询了客服,没有现货,多问几次后给了我在线官方交流群号,让我找产品经理提购买需求,加群后成功买到开发板,还特意送了我一块。
      开发板到手,按照官方指引测试了点灯、WiFi联网和录音与播放都正常。但我更关注WiFi和音频的性能:WiFi连接下的ping值和吞吐量,音频的声道数、采样率和采样精度。
      1 WiFi性能测试
      R329 evb5开发板、Dell Ubuntu笔记本和Lenovo win10一体机都通过无线连接到路由器,将Ubuntu作为对照组来评估R329开发板WiFi性能。为排除干扰因素保证测试准确性,路由器WAN口未上联到任何网络。
      1.1 ping值测试
      R329 evb5 ping路由器

      root@TinaLinux:/# ping 192.168.2.1 -c 20
      PING 192.168.2.1 (192.168.2.1): 56 data bytes
      64 bytes from 192.168.2.1: seq=0 ttl=64 time=6.348 ms
      64 bytes from 192.168.2.1: seq=1 ttl=64 time=7.485 ms
      64 bytes from 192.168.2.1: seq=2 ttl=64 time=6.894 ms
      64 bytes from 192.168.2.1: seq=3 ttl=64 time=5.353 ms
      64 bytes from 192.168.2.1: seq=4 ttl=64 time=8.104 ms
      64 bytes from 192.168.2.1: seq=5 ttl=64 time=19.801 ms
      64 bytes from 192.168.2.1: seq=6 ttl=64 time=7.150 ms
      64 bytes from 192.168.2.1: seq=7 ttl=64 time=6.628 ms
      64 bytes from 192.168.2.1: seq=8 ttl=64 time=7.348 ms
      64 bytes from 192.168.2.1: seq=9 ttl=64 time=6.825 ms
      64 bytes from 192.168.2.1: seq=10 ttl=64 time=7.057 ms
      64 bytes from 192.168.2.1: seq=11 ttl=64 time=6.887 ms
      64 bytes from 192.168.2.1: seq=12 ttl=64 time=7.128 ms
      64 bytes from 192.168.2.1: seq=13 ttl=64 time=7.208 ms
      64 bytes from 192.168.2.1: seq=14 ttl=64 time=7.008 ms
      64 bytes from 192.168.2.1: seq=15 ttl=64 time=6.811 ms
      64 bytes from 192.168.2.1: seq=16 ttl=64 time=2.825 ms
      64 bytes from 192.168.2.1: seq=17 ttl=64 time=7.661 ms
      64 bytes from 192.168.2.1: seq=18 ttl=64 time=8.144 ms
      64 bytes from 192.168.2.1: seq=19 ttl=64 time=6.582 ms
      
      --- 192.168.2.1 ping statistics ---
      20 packets transmitted, 20 packets received, 0% packet loss
      round-trip min/avg/max = 2.825/7.462/19.801 ms
      

      Ubuntu ping路由器

      gmei@dell:~$ ping 192.168.2.1 -c 20
      PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
      64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=3.59 ms
      64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=3.46 ms
      64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=3.43 ms
      64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=3.51 ms
      64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=3.40 ms
      64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=6.13 ms
      64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=3.48 ms
      64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=3.53 ms
      64 bytes from 192.168.2.1: icmp_seq=9 ttl=64 time=3.50 ms
      64 bytes from 192.168.2.1: icmp_seq=10 ttl=64 time=2.88 ms
      64 bytes from 192.168.2.1: icmp_seq=11 ttl=64 time=2.90 ms
      64 bytes from 192.168.2.1: icmp_seq=12 ttl=64 time=2.95 ms
      64 bytes from 192.168.2.1: icmp_seq=13 ttl=64 time=3.64 ms
      64 bytes from 192.168.2.1: icmp_seq=14 ttl=64 time=5.46 ms
      64 bytes from 192.168.2.1: icmp_seq=15 ttl=64 time=3.92 ms
      64 bytes from 192.168.2.1: icmp_seq=16 ttl=64 time=3.94 ms
      64 bytes from 192.168.2.1: icmp_seq=17 ttl=64 time=3.68 ms
      64 bytes from 192.168.2.1: icmp_seq=18 ttl=64 time=3.37 ms
      64 bytes from 192.168.2.1: icmp_seq=19 ttl=64 time=3.19 ms
      64 bytes from 192.168.2.1: icmp_seq=20 ttl=64 time=3.32 ms
      
      --- 192.168.2.1 ping statistics ---
      20 packets transmitted, 20 received, 0% packet loss, time 19031ms
      rtt min/avg/max/mdev = 2.880/3.664/6.130/0.770 ms
      

      结论:R329开发板ping值是Dell笔记本的2倍??
      1.2 吞吐量测试
      R329开发板作为服务端,win10台式机作为客户端。
      TCP:

      F:\sw\it\iperf-2.0.9-win64>iperf -c 192.168.2.31 -i 1 -t 30 -p 5001 -b 1000M
      ------------------------------------------------------------
      Client connecting to 192.168.2.31, TCP port 5001
      TCP window size:  208 KByte (default)
      ------------------------------------------------------------
      [  3] local 192.168.2.11 port 65519 connected with 192.168.2.31 port 5001
      [ ID] Interval       Transfer     Bandwidth
      [  3]  0.0- 1.0 sec  2.85 MBytes  23.9 Mbits/sec
      [  3]  1.0- 2.0 sec  2.97 MBytes  24.9 Mbits/sec
      [  3]  2.0- 3.0 sec  3.16 MBytes  26.5 Mbits/sec
      [  3]  3.0- 4.0 sec  1.70 MBytes  14.3 Mbits/sec
      [  3]  4.0- 5.0 sec  3.45 MBytes  29.0 Mbits/sec
      [  3]  5.0- 6.0 sec  2.10 MBytes  17.6 Mbits/sec
      [  3]  6.0- 7.0 sec  2.30 MBytes  19.3 Mbits/sec
      [  3]  7.0- 8.0 sec  2.68 MBytes  22.5 Mbits/sec
      [  3]  8.0- 9.0 sec  3.02 MBytes  25.3 Mbits/sec
      [  3]  9.0-10.0 sec  2.75 MBytes  23.1 Mbits/sec
      [  3] 10.0-11.0 sec  3.53 MBytes  29.6 Mbits/sec
      [  3] 11.0-12.0 sec  3.60 MBytes  30.2 Mbits/sec
      [  3] 12.0-13.0 sec  3.32 MBytes  27.8 Mbits/sec
      [  3] 13.0-14.0 sec  3.50 MBytes  29.4 Mbits/sec
      [  3] 14.0-15.0 sec  3.34 MBytes  28.1 Mbits/sec
      [  3] 15.0-16.0 sec  1.14 MBytes  9.53 Mbits/sec
      [  3] 16.0-17.0 sec  2.46 MBytes  20.7 Mbits/sec
      [  3] 17.0-18.0 sec  3.26 MBytes  27.3 Mbits/sec
      [  3] 18.0-19.0 sec  3.63 MBytes  30.5 Mbits/sec
      [  3] 19.0-20.0 sec  3.31 MBytes  27.8 Mbits/sec
      [  3] 20.0-21.0 sec  3.21 MBytes  26.9 Mbits/sec
      [  3] 21.0-22.0 sec  2.97 MBytes  24.9 Mbits/sec
      [  3] 22.0-23.0 sec  3.08 MBytes  25.9 Mbits/sec
      [  3] 23.0-24.0 sec  3.52 MBytes  29.6 Mbits/sec
      [  3] 24.0-25.0 sec  2.48 MBytes  20.8 Mbits/sec
      [  3] 25.0-26.0 sec  2.22 MBytes  18.6 Mbits/sec
      [  3] 26.0-27.0 sec  3.27 MBytes  27.4 Mbits/sec
      [  3] 27.0-28.0 sec  3.09 MBytes  25.9 Mbits/sec
      [  3] 28.0-29.0 sec  1.94 MBytes  16.3 Mbits/sec
      [  3] 29.0-30.0 sec  2.59 MBytes  21.7 Mbits/sec
      [  3]  0.0-30.0 sec  86.5 MBytes  24.2 Mbits/sec
      
      F:\sw\it\iperf-2.0.9-win64>
      

      UDP:

      root@TinaLinux:/# iperf -u -s -i 1 -p 5001
      ------------------------------------------------------------
      Server listening on UDP port 5001
      Receiving 1470 byte datagrams
      UDP buffer size:  224 KByte (default)
      ------------------------------------------------------------
      [  3] local 192.168.2.31 port 5001 connected with 192.168.2.11 port 57044
      [ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
      [  3]  0.0- 1.0 sec  2.05 MBytes  17.2 Mbits/sec   1.282 ms  639/ 2104 (30%)
      [  3]  1.0- 2.0 sec  2.41 MBytes  20.2 Mbits/sec   1.165 ms 5324/ 7041 (76%)
      [  3]  2.0- 3.0 sec  2.15 MBytes  18.1 Mbits/sec   0.712 ms 3982/ 5518 (72%)
      [  3]  3.0- 4.0 sec  2.26 MBytes  19.0 Mbits/sec   0.928 ms 5366/ 6979 (77%)
      [  3]  4.0- 5.0 sec  2.26 MBytes  19.0 Mbits/sec   2.296 ms 4061/ 5674 (72%)
      [  3]  5.0- 6.0 sec  2.04 MBytes  17.1 Mbits/sec   1.324 ms 4636/ 6089 (76%)
      [  3]  6.0- 7.0 sec  2.29 MBytes  19.2 Mbits/sec   0.931 ms 5174/ 6807 (76%)
      [  3]  7.0- 8.0 sec  2.39 MBytes  20.0 Mbits/sec   1.682 ms 4343/ 6046 (72%)
      [  3]  8.0- 9.0 sec  1.96 MBytes  16.5 Mbits/sec   0.640 ms 3504/ 4903 (71%)
      [  3]  9.0-10.0 sec  2.60 MBytes  21.8 Mbits/sec   0.922 ms 4491/ 6345 (71%)
      [  3] 10.0-11.0 sec  2.55 MBytes  21.4 Mbits/sec   1.571 ms 2774/ 4592 (60%)
      [  3] 11.0-12.0 sec  2.04 MBytes  17.1 Mbits/sec   1.242 ms 2751/ 4209 (65%)
      [  3] 12.0-13.0 sec  2.21 MBytes  18.6 Mbits/sec   0.632 ms 5089/ 6668 (76%)
      [  3] 13.0-14.0 sec  2.32 MBytes  19.4 Mbits/sec   1.602 ms 4464/ 6116 (73%)
      [  3] 14.0-15.0 sec  2.35 MBytes  19.7 Mbits/sec   0.825 ms 4585/ 6263 (73%)
      [  3] 15.0-16.0 sec  2.37 MBytes  19.9 Mbits/sec   1.590 ms 4099/ 5790 (71%)
      [  3] 16.0-17.0 sec  2.19 MBytes  18.4 Mbits/sec   0.402 ms 3852/ 5417 (71%)
      [  3] 17.0-18.0 sec  2.54 MBytes  21.3 Mbits/sec   2.604 ms 3999/ 5811 (69%)
      [  3] 18.0-19.0 sec  2.09 MBytes  17.5 Mbits/sec   0.871 ms 3217/ 4705 (68%)
      [  3] 19.0-20.0 sec  1.85 MBytes  15.5 Mbits/sec   1.224 ms 4089/ 5409 (76%)
      [  3] 20.0-21.0 sec  2.58 MBytes  21.7 Mbits/sec   1.067 ms 5517/ 7360 (75%)
      [  3] 21.0-22.0 sec  2.43 MBytes  20.4 Mbits/sec   1.182 ms 3624/ 5359 (68%)
      [  3] 22.0-23.0 sec  2.35 MBytes  19.7 Mbits/sec   1.085 ms 4552/ 6227 (73%)
      [  3] 23.0-24.0 sec  2.37 MBytes  19.9 Mbits/sec   0.519 ms 3974/ 5662 (70%)
      [  3] 24.0-25.0 sec  2.30 MBytes  19.3 Mbits/sec   0.930 ms 4587/ 6229 (74%)
      [  3] 25.0-26.0 sec  2.36 MBytes  19.8 Mbits/sec   0.795 ms 4314/ 6000 (72%)
      [  3] 26.0-27.0 sec  2.36 MBytes  19.8 Mbits/sec   0.528 ms 4714/ 6394 (74%)
      [  3] 27.0-28.0 sec  2.41 MBytes  20.2 Mbits/sec   1.235 ms 3772/ 5489 (69%)
      [  3] 28.0-29.0 sec  2.30 MBytes  19.3 Mbits/sec   1.076 ms 4112/ 5751 (72%)
      [  3] 29.0-30.0 sec  2.48 MBytes  20.8 Mbits/sec   0.734 ms 4058/ 5824 (70%)
      [  3]  0.0-30.2 sec  70.3 MBytes  19.5 Mbits/sec   1.797 ms 2147257037/2147307148 (1e+02%)
      root@TinaLinux:/# 
      

      Dell笔记本作为服务端,win10一体机作为客户端。
      TCP:

      F:\sw\it\iperf-2.0.9-win64>iperf -c 192.168.2.21 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   161 MBytes  45.0 Mbits/sec
      
      F:\sw\it\iperf-2.0.9-win64>
      

      UDP:

      gmei@dell:~iperf -u -s -i 1 -p 5001
      ......
      [  3]  0.0-29.9 sec   196 MBytes  55.0 Mbits/sec   1.027 ms  977/140872 (0.69%)
      gmei@dell:~$ 
      

      win10一体机作为服务端,R329开发板作为客户端。
      TCP:

      root@TinaLinux:/# iperf -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   145 MBytes  40.6 Mbits/sec
      root@TinaLinux:/# 
      

      UDP:

      root@TinaLinux:/# iperf -u -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   165 MBytes  46.1 Mbits/sec
      [  3] Sent 117592 datagrams
      root@TinaLinux:/# 
      

      win10一体机作为服务端,Dell笔记本开发板作为客户端。
      TCP:

      gmei@dell:~$ iperf -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   170 MBytes  47.6 Mbits/sec
      gmei@dell:~$ 
      

      UDP:

      gmei@dell:~$ iperf -u -c 192.168.2.11 -i 1 -t 30 -p 5001 -b 1000M
      ......
      [  3]  0.0-30.0 sec   207 MBytes  57.9 Mbits/sec
      [  3] Sent 147853 datagrams
      gmei@dell:~$ 
      

      结论:作为服务端,R329吞吐量只有Dell笔记本的一半;作为客户端,R329吞吐量与Dell笔记本相当??
      2 音频性能测试
      利用Tina SDK自带的arecord测试R329开发板支持的声道数、采样率和采样精度。
      是否支持192K采样率、24位采样精度?

      root@TinaLinux:/# arecord -r 192000 -c 2 -f U24_LE -d 10 20211119.wav
      [13449.631722] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [13449.639222] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [13449.646676] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [13449.653912] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [13449.660469] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [13449.667220] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [13449.673980] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [13449.681317] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [13449.687972] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [13449.695212] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [13449.702548] sunxi-internal-cpudai cpudai: ===========================
      [13449.734939] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '20211119.wav' : Unsigned 24 bit Little Endian, Rate 192000 Hz, Stereo
      arecord: begin_wave:2521: [13449.776745] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      Wave doesn't support U24_LE format...
      [13449.911776] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      不支持U24_LE,那支持哪几种格式?查代码,得到如下结果:

      out/r329-evb5/compile_dir/target/alsa-utils-1.1.0/aplay/aplay.c
      2505         switch ((unsigned long) hwparams.format) {
      2506         case SND_PCM_FORMAT_U8:
      2507                 bits = 8;
      2508                 break;
      2509         case SND_PCM_FORMAT_S16_LE:
      2510                 bits = 16;
      2511                 break;
      2512         case SND_PCM_FORMAT_S32_LE:
      2513         case SND_PCM_FORMAT_FLOAT_LE:
      2514                 bits = 32;
      2515                 break;
      2516         case SND_PCM_FORMAT_S24_LE:
      2517         case SND_PCM_FORMAT_S24_3LE:
      2518                 bits = 24;
      2519                 break;
      2520         default:
      2521                 error(_("Wave doesn't support %s format..."), snd_pcm_format_name(hwparams.format));
      2522                 prg_exit(EXIT_FAILURE);
      2523         }
      

      可知支持U8、S16_LE、S24_LE、S24_3LE、S32_LE,对应8位、16位、24位、32位采样精度。

      root@TinaLinux:/# arecord -r 192000 -c 3 -f S32_LE -d 5 20211119.wav
      [10023.671676] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [10023.679195] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [10023.686649] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [10023.693897] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [10023.700460] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [10023.707213] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [10023.713970] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [10023.721307] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [10023.727961] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [10023.735207] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [10023.742546] sunxi-internal-cpudai cpudai: ===========================
      [10023.774954] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '20211119.wav' : Signed 32 bit Little Endian, Rate 192000 Hz, Channels 3
      overrun!!! (at least 0.021 ms long)
      overrun!!! (at least 0.021 ms long)
      overrun!!! (at least 0.022 ms long)
      overrun!!! (at least 0.021 ms long)
      [10032.378621] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      [10032.431634] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      提示缓冲区溢出,录制出来的音频文件听起来不连续,扩大alsa音频缓冲区即可解决问题。

      root@TinaLinux:/# arecord -r 192000 -c 3 -f S32_LE --buffer-time 500000 -d 5 27.wav
      [24079.831625] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_startup
      [24079.839114] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_hw_params
      [24079.846570] sunxi-internal-cpudai cpudai: ======== hw_params ========
      [24079.853815] sunxi-internal-cpudai cpudai: pcm_params->format:2
      [24079.860461] sunxi-internal-cpudai cpudai: pcm_params->channels:5
      [24079.867219] sunxi-internal-cpudai cpudai: pcm_params->rate:16000
      [24079.873972] sunxi-internal-cpudai cpudai: pcm_params->period_size:1024
      [24079.881310] sunxi-internal-cpudai cpudai: pcm_params->periods:4
      [24079.887965] sunxi-internal-cpudai cpudai: pcm_params->pcm_frames:1024
      [24079.895202] sunxi-internal-cpudai cpudai: pcm_params->buffer_size:4096
      [24079.902582] sunxi-internal-cpudai cpudai: ===========================
      [24079.934899] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_params
      Recording WAVE '27.wav' : Signed 32 bit Little Endian, Rate 192000 Hz, Channels 3
      [24085.699938] sunxi-internal-cpudai cpudai: sunxi_hifi_pcm_hw_free
      [24085.771732] sunxi-codec-machine sndcodec: sunxi_hifi_sndcodec_shutdown
      root@TinaLinux:/# 
      

      声道数,由于板载三颗MIC,测试使用3声道,看资料可知最高支持8声道。
      结论:开发板最高支持192KHz采样率、8声道、32位采样精度,满足超高清音频应用要求。

      DSP核功能和性能没有直接测试,因为即便在https://www.synaptics.com/contact申请了多次也拿不到源码、lisence和编译工具链。有老哥以个人名义申请到这些了吗?

      posted in R128系列-智能硬件
      Y
      yimu163com