rk3588 - broken hevc hardware decoding with android MediaCodec API
Not sure if this is duplicated case, we are seeing green artifacts when decoding hevc source (encoded with x265 encoder - main10 profile) with Android MediaCodec API (media player: kodi/vlc). codec: c2.rk.hevc.decoder called process: [email protected]
some discussion: https://forum.radxa.com/t/x265-decoding-broken-on-android-green-screen/14000
The issue doesnt seems to be persisting on rockchip API(rockchip media player, mx-player), though the number of video player utilizing it is limited
hardware used: radxa rock5, may persist on orange pi 5

kodi log:
2023-02-20 04:52:34.750 T:8508 info
CCodec log: 02-20 04:30:03.107 5249 5326 D CCodec : allocate(c2.rk.hevc.decoder) 02-20 04:30:03.108 5249 5326 I CCodec : setting up 'default' as default (vendor) store 02-20 04:30:03.110 5249 5326 I CCodec : Created component [c2.rk.hevc.decoder] 02-20 04:30:03.111 5249 5326 D CCodecConfig: read media type: video/hevc 02-20 04:30:03.112 5249 5326 D CCodecConfig: ignoring local param raw.size (0xd2001800) as it is already supported 02-20 04:30:03.112 5249 5326 D CCodecConfig: ignoring local param default.color (0x5200180b) as it is already supported 02-20 04:30:03.112 5249 5326 I CCodecConfig: query failed after returning 12 values (BAD_INDEX) 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2 config diff is Dict { 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 algo.low-latency.value = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.pl.level = 24584 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.pl.profile = 24576 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.vui.color.matrix = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.vui.color.primaries = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.vui.color.range = 2 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 coded.vui.color.transfer = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 default.color.matrix = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 default.color.primaries = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 default.color.range = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 default.color.transfer = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 input.buffers.max-size.value = 2097152 02-20 04:30:03.112 5249 5326 D CCodecConfig: string input.media-type.value = "video/hevc" 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 output.delay.value = 16 02-20 04:30:03.112 5249 5326 D CCodecConfig: string output.media-type.value = "video/raw" 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.color.matrix = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.color.primaries = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.color.range = 2 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.color.transfer = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.max-size.height = 240 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.max-size.width = 320 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.pixel-format.value = 35 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::i32 raw.rotation.flip = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::i32 raw.rotation.value = 0 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.sar.height = 1 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.sar.width = 1 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.size.height = 240 02-20 04:30:03.112 5249 5326 D CCodecConfig: c2::u32 raw.size.width = 32 02-20 04:30:03.126 5249 5326 D CCodec : [c2.rk.hevc.decoder] buffers are bound to CCodec for this session 02-20 04:30:03.126 5249 5326 D CCodecConfig: no c2 equivalents for feature-tunneled-playback 02-20 04:30:03.126 5249 5326 D CCodecConfig: no c2 equivalents for native-window 02-20 04:30:03.126 5249 5326 D CCodecConfig: no c2 equivalents for flags 02-20 04:30:03.126 5249 5326 D CCodecConfig: config failed => CORRUPTED 02-20 04:30:03.126 5249 5326 D CCodecConfig: c2 config diff is c2::u32 default.color.range = 1 02-20 04:30:03.126 5249 5326 D CCodecConfig: c2::u32 raw.size.height = 800 02-20 04:30:03.126 5249 5326 D CCodecConfig: c2::u32 raw.size.width = 1920 02-20 04:30:03.127 5249 5326 D CCodec : setup formats input: AMessage(what = 0x00000000) = { 02-20 04:30:03.127 5249 5326 D CCodec : int32_t height = 800 02-20 04:30:03.127 5249 5326 D CCodec : int32_t level = 65536 02-20 04:30:03.127 5249 5326 D CCodec : int32_t max-input-size = 2097152 02-20 04:30:03.127 5249 5326 D CCodec : string mime = "video/hevc" 02-20 04:30:03.127 5249 5326 D CCodec : int32_t profile = 1 02-20 04:30:03.127 5249 5326 D CCodec : int32_t width = 1920 02-20 04:30:03.127 5249 5326 D CCodec : Rect crop(0, 0, 1919, 799) 02-20 04:30:03.127 5249 5326 D CCodec : } 02-20 04:30:03.127 5249 5326 D CCodec : setup formats output: AMessage(what = 0x00000000) = { 02-20 04:30:03.127 5249 5326 D CCodec : int32_t android._color-format = 2135033992 02-20 04:30:03.127 5249 5326 D CCodec : int32_t android._video-scaling = 1 02-20 04:30:03.127 5249 5326 D CCodec : int32_t rotation-degrees = 0 02-20 04:30:03.127 5249 5326 D CCodec : int32_t color-standard = 1 02-20 04:30:03.127 5249 5326 D CCodec : int32_t color-range = 2 02-20 04:30:03.127 5249 5326 D CCodec : int32_t color-transfer = 3 02-20 04:30:03.127 5249 5326 D CCodec : int32_t sar-height = 1 02-20 04:30:03.127 5249 5326 D CCodec : int32_t sar-width = 1 02-20 04:30:03.127 5249 5326 D CCodec : Rect crop(0, 0, 1919, 799) 02-20 04:30:03.127 5249 5326 D CCodec : int32_t width = 1920 02-20 04:30:03.127 5249 5326 D CCodec : int32_t height = 800 02-20 04:30:03.127 5249 5326 D CCodec : int32_t max-height = 240 02-20 04:30:03.127 5249 5326 D CCodec : int32_t max-width = 320 02-20 04:30:03.127 5249 5326 D CCodec : string mime = "video/raw" 02-20 04:30:03.127 5249 5326 D CCodec : int32_t android._dataspace = 260 02-20 04:30:03.127 5249 5326 D CCodec : int32_t color-format = 2130708361 02-20 04:30:03.127 5249 5326 D CCodec : } 02-20 04:30:03.127 5249 5326 I CCodecConfig: query failed after returning 12 values (BAD_INDEX) 02-20 04:30:03.127 5249 5326 D CCodecConfig: c2 config diff is c2::u32 raw.max-size.height = 800 02-20 04:30:03.127 5249 5326 D CCodecConfig: c2::u32 raw.max-size.width = 1920 02-20 04:30:03.131 5249 5326 D CCodecBufferChannel: [c2.rk.hevc.decoder#476] Created input block pool with allocatorID 16 => poolID 17 - OK (0) 02-20 04:30:03.131 5249 5326 D CCodecBufferChannel: [c2.rk.hevc.decoder#476] Query output surface allocator returned 0 params => BAD_INDEX (6) 02-20 04:30:03.131 5249 5326 I CCodecBufferChannel: [c2.rk.hevc.decoder#476] Created output block pool with allocatorID 18 => poolID 29 - OK 02-20 04:30:03.132 5249 5326 D CCodecBufferChannel: [c2.rk.hevc.decoder#476] Configured output block pool ids 29 => OK 02-20 04:30:03.182 5249 5326 D CCodecConfig: c2 config diff is c2::u32 raw.crop.height = 800 02-20 04:30:03.182 5249 5326 D CCodecConfig: c2::u32 raw.crop.left = 0 02-20 04:30:03.182 5249 5326 D CCodecConfig: c2::u32 raw.crop.top = 0 02-20 04:30:03.182 5249 5326 D CCodecConfig: c2::u32 raw.crop.width = 1920
H265_PARSER_REF: 02-20 04:41:43.938 539 6088 E H265_PARSER_REF: Could not find ref with POC 440 02-20 04:41:43.939 539 6088 E H265_PARSER_REF: Could not find ref with POC 438 02-20 04:41:43.939 539 6088 E H265_PARSER_REF: Could not find ref with POC 436 02-20 04:41:43.939 539 6088 E H265_PARSER_REF: Could not find ref with POC 432 02-20 04:41:49.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 509 02-20 04:41:49.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 508 02-20 04:41:49.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 506 02-20 04:41:49.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 504 02-20 04:41:52.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 632 02-20 04:41:52.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 631 02-20 04:41:52.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 629 02-20 04:41:52.082 539 6088 E H265_PARSER_REF: Could not find ref with POC 627 02-20 04:41:57.841 539 6088 E H265_PARSER_REF: Could not find ref with POC 888 02-20 04:41:57.841 539 6088 E H265_PARSER_REF: Could not find ref with POC 887 02-20 04:41:57.841 539 6088 E H265_PARSER_REF: Could not find ref with POC 885 02-20 04:41:57.841 539 6088 E H265_PARSER_REF: Could not find ref with POC 880 02-20 04:43:23.882 539 6088 E H265_PARSER_REF: Could not find ref with POC 2917 02-20 04:43:23.882 539 6088 E H265_PARSER_REF: Could not find ref with POC 2916 02-20 04:43:23.882 539 6088 E H265_PARSER_REF: Could not find ref with POC 2914 02-20 04:43:23.882 539 6088 E H265_PARSER_REF: Could not find ref with POC 2910 02-20 04:43:25.960 539 6088 E H265_PARSER_REF: Could not find ref with POC 3026 02-20 04:43:25.960 539 6088 E H265_PARSER_REF: Could not find ref with POC 3024 02-20 04:43:25.960 539 6088 E H265_PARSER_REF: Could not find ref with POC 3022 02-20 04:43:25.960 539 6088 E H265_PARSER_REF: Could not find ref with POC 3018
mali: 02-20 04:44:55.773 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.773 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.773 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.806 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.806 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.806 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.806 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.856 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.856 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.856 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.856 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.889 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.889 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.889 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.889 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.939 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.939 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.939 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.940 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.972 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.972 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.972 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:55.973 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.022 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.022 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.023 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.023 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.056 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.056 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.056 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.056 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.106 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.106 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.106 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.106 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.274 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.274 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.274 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.274 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.306 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.306 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.306 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.306 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.356 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.356 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.356 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.356 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.389 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.389 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.389 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.390 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.439 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.439 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.439 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.439 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.472 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.473 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.473 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.473 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.522 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.523 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.523 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.523 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.556 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.556 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.556 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.556 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.606 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.606 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.606 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.606 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.639 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.639 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.639 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.640 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.689 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.689 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.690 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.690 409 496 W mali_gralloc: Could not find component description for FourCC value 3531564e 02-20 04:44:56.694 5966 6085 D BufferPoolAccessor2.0: bufferpool2 0xb40000748745e7c8 : 4(8388608 size) total buffers -
system.err: 02-20 04:38:30.039 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.039 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.039 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.039 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.039 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.039 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.039 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.039 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.039 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025) 02-20 04:38:30.040 5742 5830 W System.err: java.lang.IllegalArgumentException: codec does not support type 02-20 04:38:30.040 5742 5830 W System.err: at android.media.MediaCodecInfo.getCapabilitiesForType(MediaCodecInfo.java:4025)
I am having the same issue on linux so it's seems to be MPP related. Although ffmpeg plays the stream fine in my case (and it uses mpp as well) so it must be a problem with how MPP is used.
Is it fixed on latest mpp code?
for android, mo123 (https://github.com/mo123) managed to find the workaround to get the stream decoded properly. He applied workaround on his android tv build and its rendered perfectly (for hevc, hi10p and av1 10bit)
for android, mo123 (https://github.com/mo123) managed to find the workaround to get the stream decoded properly. He applied workaround on his android tv build and its rendered perfectly (for hevc, hi10p and av1 10bit)
What was the workaround ?
This should be reopened, the issue is not resolved unless you use mo123's private build. This needs to be fixed in upstream.
@HermanChen there is requests to had this case re-open.
Which patch fix the issue?
no idea, it havent been disclosed by mr mo123 i believe khadas managed to get this fixed too.