RockChip GMS media FAQ

Android 13

1. CtsMediaPlayerTestCases

android.media.player.cts.StreamingMediaPlayerTest#testHTTP_H264Base_AAC_Video1
android.media.player.cts.StreamingMediaPlayerTest#testHTTP_H264Base_AAC_Video2
android.media.player.cts.StreamingMediaPlayerTest#testHTTP_MPEG4SP_AAC_Video1
android.media.player.cts.StreamingMediaPlayerTest#testHTTP_MPEG4SP_AAC_Video2
android.media.player.cts.StreamingMediaPlayerTest#testHTTP_H263_AMR_Video1
android.media.player.cts.StreamingMediaPlayerTest#testHTTP_H263_AMR_Video2

这几项对网络要求非常高,如果网络状况不好或者谷歌服务器有问题,很难pass,可用本地媒体包测试,如下:

下载 https://storage.googleapis.com/cts_media/CtsMediaTestCases.zip
下载 https://storage.googleapis.com/android_media/cts/tests/tests/media/playe    r/CtsMediaPlayerTestCases-1.0.zip

adb push CtsMediaTestCases /sdcard/
cd CtsMediaPlayerTestCases-1.0
./copy_media.sh

run cts --module-arg CtsMediaPlayerTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig_local.json -m CtsMediaPlayerTestCases

2. CtsMediaCodecTestCases

android.media.codec.cts.MediaCodecCapabilitiesTest#testAvcHigh31	
android.media.codec.cts.MediaCodecCapabilitiesTest#testAvcHigh40	
android.media.codec.cts.MediaCodecCapabilitiesTest#testAvcBaseline12	
android.media.codec.cts.MediaCodecCapabilitiesTest#testAvcBaseline3

这几项对网络要求非常高,如果网络状况不好或者谷歌服务器有问题,很难pass,可用本地媒体包测试,如下:

下载 https://storage.googleapis.com/cts_media/CtsMediaTestCases.zip
下载 https://storage.googleapis.com/android_media/cts/tests/tests/media/codec/CtsMediaCodecTestCases-1.0.zip

adb push CtsMediaTestCases /sdcard/
cd CtsMediaCodecTestCases-1.0
./copy_media.sh

run cts --module-arg CtsMediaCodecTestCases:config-url:https://storage.googleapis.com/cts_media/DynamicConfig_local.json -m CtsMediaCodecTestCases

3. CtsMediaDecoderTestCases

android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[43(video/avc_c2.rk.avc.decoder_128x128_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[45(video/avc_c2.rk.avc.decoder_144x136_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[47(video/avc_c2.rk.avc.decoder_136x144_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[49(video/avc_c2.rk.avc.decoder_132x130_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[51(video/avc_c2.rk.avc.decoder_130x132_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[85(video/hevc_c2.rk.hevc.decoder_128x128_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[87(video/hevc_c2.rk.hevc.decoder_144x136_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[89(video/hevc_c2.rk.hevc.decoder_136x144_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[91(video/hevc_c2.rk.hevc.decoder_132x130_10bit_swirl_imagereader)]	
android.media.decoder.cts.ImageReaderDecoderTest#decodeTest[93(video/hevc_c2.rk.hevc.decoder_130x132_10bit_swirl_imagereader)]

分析:ImageReader里面会设置GRALLOC_USAGE_SW_READ_OFTEN,这个usage传到gralloc会导致fbc不支持,如果不走fbc,rk 10bit输出和上层的对不上,解码输出有问题

目前解决思路:(diff是3588对应的修改,356x请在356x对应的xml中去修改)

diff --git a/vpu/etc/media_codecs_c2_rk3588.xml b/vpu/etc/media_codecs_c2_rk3588.xml
index 10c2c7c..bcd7fc0 100755
--- a/vpu/etc/media_codecs_c2_rk3588.xml
+++ b/vpu/etc/media_codecs_c2_rk3588.xml
@@ -20,7 +20,7 @@
     Settings>
     <Decoders>
         <MediaCodec name="c2.rk.avc.decoder" type="video/avc">
-            <Limit name="size" min="2x2" max="7680x4320" />
+            <Limit name="size" min="176x144" max="7680x4320" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="1-129600" /> 
@@ -32,7 +32,7 @@
             <Limit name="performance-point-3840x2160" value="120" />
         MediaCodec>
         <MediaCodec name="c2.rk.hevc.decoder" type="video/hevc">
-            <Limit name="size" min="2x2" max="7680x4320" />
+            <Limit name="size" min="176x144" max="7680x4320" />
             <Limit name="alignment" value="2x2" />
             <Limit name="block-size" value="16x16" />
             <Limit name="block-count" range="1-129600" /> 

5. CtsVideoTestCases

5.1 performance-point问题

android.video.cts.CodecDecoderPerformanceTest#testPerformanceOfHardwareVideoDecoders[112(c2.rk.vp9.decoder_1_2.5)]

报错信息:

java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/x-vnd.on2.vp9, Decoder: c2.rk.vp9.decoder, resolution: 2160p, Key-priority: 1 :: act/exp fps: 41.586958329867755/57.0

rk356x对应的vendor/rockchip/common/vpu/etc/media_codecs_c2_rk356x.xml文件中c2.rk.vp9.decoder的配置如下:

        <MediaCodec name="c2.rk.vp9.decoder" type="video/x-vnd.on2.vp9">
            <Limit name="size" min="320x182" max="4096x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="block-count" range="1-32768" /> 
            <Limit name="blocks-per-second" range="1-1966080" />
            <Limit name="frame-rate" range="1-60" />
            <Limit name="bitrate" range="1-20000000" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="32" />
            <Limit name="performance-point-3840x2160" value="60" />
        MediaCodec>

Android支持的standard point如下:

List<VideoCapabilities.PerformancePoint> standardPoints = Arrays.asList(
      VideoCapabilities.PerformancePoint.UHD_240,/*3840x2160@240*/
      VideoCapabilities.PerformancePoint.UHD_200,/*3840x2160@200*/
      VideoCapabilities.PerformancePoint.UHD_120,/*3840x2160@120*/
      VideoCapabilities.PerformancePoint.UHD_100,/*3840x2160@100*/
      VideoCapabilities.PerformancePoint.UHD_60, /*3840x2160@60*/
      VideoCapabilities.PerformancePoint.UHD_50, /*3840x2160@50*/
      VideoCapabilities.PerformancePoint.UHD_30, /*3840x2160@30*/
      VideoCapabilities.PerformancePoint.UHD_25, /*3840x2160@25*/
      VideoCapabilities.PerformancePoint.UHD_24, /*3840x2160@24*/
      VideoCapabilities.PerformancePoint.FHD_240,/*1920x1080@240*/
      VideoCapabilities.PerformancePoint.FHD_200,/*1920x1080@200*/
      VideoCapabilities.PerformancePoint.FHD_120,/*1920x1080@120*/
      VideoCapabilities.PerformancePoint.FHD_100,/*1920x1080@100*/
      VideoCapabilities.PerformancePoint.FHD_60, /*1920x1080@60*/
      VideoCapabilities.PerformancePoint.FHD_50, /*1920x1080@50*/
      VideoCapabilities.PerformancePoint.FHD_30, /*1920x1080@30*/
      VideoCapabilities.PerformancePoint.FHD_25, /*1920x1080@25*/
      VideoCapabilities.PerformancePoint.FHD_24, /*1920x1080@24*/
      VideoCapabilities.PerformancePoint.HD_240, /*1280x720@240*/
      VideoCapabilities.PerformancePoint.HD_200, /*1280x720@200*/
      VideoCapabilities.PerformancePoint.HD_120, /*1280x720@120*/
      VideoCapabilities.PerformancePoint.HD_100, /*1280x720@100*/
      VideoCapabilities.PerformancePoint.HD_60,  /*1280x720@60*/
      VideoCapabilities.PerformancePoint.HD_50,  /*1280x720@50*/
      VideoCapabilities.PerformancePoint.HD_30,  /*1280x720@30*/
      VideoCapabilities.PerformancePoint.HD_25,  /*1280x720@25*/
      VideoCapabilities.PerformancePoint.HD_24,  /*1280x720@24*/
      VideoCapabilities.PerformancePoint.SD_60,  /*720x480@60*/
      VideoCapabilities.PerformancePoint.SD_50,  /*720x576@50*/
      VideoCapabilities.PerformancePoint.SD_48,  /*720x480@48*/
      VideoCapabilities.PerformancePoint.SD_30,  /*720x480@30*/
      VideoCapabilities.PerformancePoint.SD_25,  /*720x576@25*/
      VideoCapabilities.PerformancePoint.SD_24); /*720x480@24*/

分析:

exp: 60 * 0.95 = 57
测试实际能达到的fps = 41.5 / 0.95 = 43.1
43介于30和50之间,若想测试通过且符合谷歌标准,performance-point-3840x2160的value需改成30

补丁:

diff --git a/vpu/etc/media_codecs_c2_rk356x.xml b/vpu/etc/media_codecs_c2_rk356x.xml
index b3288c6..0fb8e75 100644
--- a/vpu/etc/media_codecs_c2_rk356x.xml
+++ b/vpu/etc/media_codecs_c2_rk356x.xml
@@ -50,7 +50,7 @@
             <Limit name="bitrate" range="1-20000000" />
             <Feature name="adaptive-playback" />
             <Limit name="concurrent-instances" max="32" />
-            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-3840x2160" value="30" />
         MediaCodec>
         <MediaCodec name="c2.rk.vp8.decoder" type="video/x-vnd.on2.vp8">
             <Limit name="size" min="2x2" max="1920x1088" />

注意:以上是以rk356x为例说明,其它芯片平台修改方法一致,请修改对应的media_codecs_c2_rkxxx.xml

Android 12

1.CtsMediaTestCases

1.1 帧率问题

#测试case
android.media.cts.VideoDecoderPerfTest#testHevcOther0Perf3840x2160
#此类的case通常的报错信息如下
junit.framework.AssertionFailedError: Expected achievable frame rates for c2.rk.hevc.decoder video/hevc 3840x2160: [30.0, 40.0].
Measured frame rate: [91.08030347957119, 91.23578875873709].
#报错信息中会提示当前配置的范围和实际测试的范围,应当将当前配置的范围改成实际测试的范围
#当前范围 range="30-40" 修改范围range="90-100" 将实际测试的数值包含进去即可

修改补丁:

vendor/rockchip/common/

diff --git a/vpu/etc/media_codecs_performance_rk356x.xml b/vpu/etc/media_codecs_performance_rk356x.xml
index e763b0f8..eee9e925 100644
--- a/vpu/etc/media_codecs_performance_rk356x.xml
+++ b/vpu/etc/media_codecs_performance_rk356x.xml
@@ -113,7 +113,7 @@
             <Limit name="measured-frame-rate-720x480" range="550-543" />
             <Limit name="measured-frame-rate-1280x720" range="200-203" />
             <Limit name="measured-frame-rate-1920x1080" range="175-180" />
-            <Limit name="measured-frame-rate-3840x2160" range="30-40" />
+            <Limit name="measured-frame-rate-3840x2160" range="90-100" />
         MediaCodec>
         <MediaCodec name="c2.rk.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
             <Limit name="measured-frame-rate-320x180" range="500-500" />

注意:以上是以rk356x为例说明,其它芯片平台修改方法一致,请修改对应的media_codecs_performance_rkxx.xml

你可能感兴趣的:(android,GMS,media,rockchip)