RK3576 android14 GMS CtsVideoTestCases 测试fail

平台:RK3576,android14 

CtsVideoTestCases 测试有如下fail

arm64-v8a CtsVideoTestCases
TestResultDetails
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[193_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_2.5_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.915002422350216/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[194_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_2.5_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.8067767531632/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[195_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_2.5_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.231572320444887/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[196_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1.25_true_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 28.156323910350267/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[197_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1.25_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.826912758879704/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[198_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1.25_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.923698239190134/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[199_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1.25_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.923698239190134/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[200_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1_true_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.69371629918317/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[201_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.930949046644404/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[202_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 28.03004821168292/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[203_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_1_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.54350480437437/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[208_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_0_true_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 27.019724398811135/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[209_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_0_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.860059092130005/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[210_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_0_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.609898882384247/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[211_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_0_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.98472664471909/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[212_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_-1_true_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 25.87723838111997/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[213_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_-1_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 28.31417407554222/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[214_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_-1_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 27.04603234705469/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[215_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_-1_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 25.992929923060927/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[216_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_0_1_true_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 0 :: act/exp fps: 26.557603441865403/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[217_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_0_1_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 0 :: act/exp fps: 26.954177897574123/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[218_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_0_1_false_0]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 0 :: act/exp fps: 26.56748140276302/28.5
android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[219_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_0_1_false_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 0 :: act/exp fps: 27.548209366391188/28.5
android.video.cts.VideoEncoderDecoderTest#testPerf[video/x-vnd.on2.vp8_c2.android.vp8.encoder_640x360_0]
fail
java.lang.AssertionError: Expected achievable frame rates for c2.android.vp8.encoder video/x-vnd.on2.vp8 640x360: [130.0, 136.0].

 

可以看到错误大体上分为两种类型 testPerformanceOfHardwareVideoEncoders 和  testPerf 

先看 testPerformanceOfHardwareVideoEncoders 的测试源码。

    public void testPerformanceOfHardwareVideoEncoders() throws IOException, InterruptedException {
        encode();
        String log = String.format("DecodeMime: %s, Decoder: %s, resolution: %dp, EncodeMime: %s," +
                " Encoder: %s, Key-priority: %d :: ", mDecoderMime, mDecoderName, mHeight,
                mEncoderMime, mEncoderName, mKeyPriority);
        int maxExpectedFps = getMaxExpectedFps(mWidth, mHeight);
        double fpsToleranceFactor = FPS_TOLERANCE_FACTOR;
        if (VNDK_VERSION <= Build.VERSION_CODES.TIRAMISU) {
            fpsToleranceFactor = Math.min(0.9, fpsToleranceFactor);
        }
        double expectedFps =
                Math.min(mOperatingRateExpected * fpsToleranceFactor, maxExpectedFps);
        Log.d(LOG_TAG, log + "act/exp fps: " + mAchievedFps + "/" + expectedFps);
        assertTrue("Unable to achieve the expected rate. " + log + "act/exp fps: " + mAchievedFps
                + "/" + expectedFps, mAchievedFps >= expectedFps);
    }

 这是测试 你的实际帧率 必须大于 期望帧率。

已第一个测试个例为例子:

android.video.cts.CodecEncoderPerformanceTest#testPerformanceOfHardwareVideoEncoders[193_c2.rk.hevc.decoder_video/avc_c2.rk.avc.encoder_1_2.5_true_2]
fail
java.lang.AssertionError: Unable to achieve the expected rate. DecodeMime: video/hevc, Decoder: c2.rk.hevc.decoder, resolution: 2160p, EncodeMime: video/avc, Encoder: c2.rk.avc.encoder, Key-priority: 1 :: act/exp fps: 26.915002422350216/28.5

需要找到 c2.rk.avc.encoder 的配置。2160p

rk3576 平台在vendor/rockchip/common/vpu/etc/media_codecs_c2_rk3576.xml 下

        <MediaCodec name="c2.rk.avc.encoder" type="video/avc">
            <Alias name="OMX.rk.video_encoder.avc" />
            <Limit name="size" min="176x144" max="4096x2160" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="block-count" range="1-32768" /> <!-- max 4096x2160 -->
            <Limit name="blocks-per-second" range="1-1966080" />
            <Limit name="bitrate" range="1-20000000" />
            <Feature name="can-swap-width-height" />
            <Feature name="qp-bounds" />
            <Feature name="vq-minimum-quality" />
            <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 act:26.9
测试实际能达到的fps = 26.9 / 0.95 = 28.3
28介于25和30之间,若想测试通过且符合谷歌标准,performance-point-3840x2160的value需改成25

 

补丁如下:

diff --git a/vendor/rockchip/common/vpu/etc/media_codecs_c2_rk3576.xml b/vendor/rockchip/common/vpu/etc/media_codecs_c2_rk3576.xml
index a8768561938..06d7054a005 100644
--- a/vendor/rockchip/common/vpu/etc/media_codecs_c2_rk3576.xml
+++ b/vendor/rockchip/common/vpu/etc/media_codecs_c2_rk3576.xml
@@ -88,7 +88,7 @@
             <Feature name="qp-bounds" />
             <Feature name="vq-minimum-quality" />
             <Limit name="concurrent-instances" max="32" />
-            <Limit name="performance-point-3840x2160" value="60" />
+            <Limit name="performance-point-3840x2160" value="25" />
         </MediaCodec>
         <MediaCodec name="c2.rk.hevc.encoder" type="video/hevc">
             <Alias name="OMX.rk.video_encoder.hevc" />

 

第二个问题: testPerf  

跟踪下源码可以发现 

testPerf是CTS 中针对视频编解码器性能的测试方法,主要验证:

  • 视频编码器在指定参数(分辨率、帧率、B帧数量等)下的性能表现(FPS)

  • 解码器输出的图像质量(RMS误差)

  • 是否符合VideoCapabilitiesCodecCapabilities声明的能力(如支持的分辨率、帧率、色彩格式等)

调用关系是 testPerf 调用  perf ,在调用 doTest 在这里面做核心处理。

测试的结果是:

android.video.cts.VideoEncoderDecoderTest#testPerf[video/x-vnd.on2.vp8_c2.android.vp8.encoder_640x360_0]
fail
java.lang.AssertionError: Expected achievable frame rates for c2.android.vp8.encoder video/x-vnd.on2.vp8 640x360: [130.0, 136.0].

错误log:

E TestRunner: ----- begin exception -----
E TestRunner: java.lang.AssertionError: Expected achievable frame rates for
c2.android.vp8.encoder video/avc 640x360: [130.0, 136.0].
E TestRunner: Measured frame rate: [45.4609736934789, 54.4713543799203].
E TestRunner: expected null, but was:<Expected achievable frame rates for
c2.android.vp8.encoder video/avc 640x360: [130.0, 136.0].
E TestRunner: Measured frame rate: [45.4609736934789, 54.4713543799203].
E TestRunner: >
E TestRunner: at org.junit.Assert.fail(Assert.java:89)
E TestRunner: at org.junit.Assert.failNotNull(Assert.java:756)
E TestRunner: at org.junit.Assert.assertNull(Assert.java:738

根据报错信息可知,配置的是[130,136],实际测试才[45.4609736934789,54.4713543799203] ,说明原来的配置偏大,需要重新配置,将实际测试结果包含进去即可。可配置[45,55]

找到  c2.android.vp8.encoder  配置信息,修改即可。

diff --git a/vendor/rockchip/common/vpu/etc/media_codecs_performance_rk3576.xml b/vendor/rockchip/common/vpu/etc/media_codecs_performance_rk3576.xml
index 7e997927267..e015b99ab64 100644
--- a/vendor/rockchip/common/vpu/etc/media_codecs_performance_rk3576.xml
+++ b/vendor/rockchip/common/vpu/etc/media_codecs_performance_rk3576.xml
@@ -28,7 +28,7 @@
         </MediaCodec>
         <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
             <Limit name="measured-frame-rate-320x180" range="140-145" />
-            <Limit name="measured-frame-rate-640x360" range="130-136" />
+            <Limit name="measured-frame-rate-640x360" range="45-55" />
             <Limit name="measured-frame-rate-1280x720" range="20-30" />
         </MediaCodec>
         <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">

 

posted @ 2025-06-25 15:56  simple雨  阅读(107)  评论(0)    收藏  举报