ubports-santoni / projectmanagement

UBports Project Management for Xiaomi Redmi 4X
2 stars 0 forks source link

[HW] Video decoding doesn't work #10

Closed Danct12 closed 4 years ago

Danct12 commented 4 years ago

When attempting to play a video, this shows up in dmesg:

[ 2500.244864] msm_vidc: info: Opening video instance: 0000000000000000, 0
[ 2500.247949] subsys-restart: __subsystem_get(): Changing subsys fw_name to venus
[ 2500.275043] subsys-pil-tz 1de0000.qcom,venus: venus: loading from 0x000000008f800000 to 0x000000008fc00000
[ 2500.334607] subsys-pil-tz 1de0000.qcom,venus: venus: Brought out of reset
[ 2500.363921] msm_vidc: info: Closed video instance: 0000000000000000
[ 2500.464047] msm_vidc: info: Opening video instance: 0000000000000000, 1
[ 2500.476487] msm_vidc: info: Closed video instance: 0000000000000000
[ 2500.483274] msm_vidc: info: Opening video instance: 0000000000000000, 1
[ 2500.495427] msm_vidc: info: Closed video instance: 0000000000000000
[ 2500.504104] msm_vidc: info: Opening video instance: 0000000000000000, 1
[ 2500.514746] msm_vidc: info: Closed video instance: 0000000000000000
[ 2500.523383] msm_vidc: info: Opening video instance: 0000000000000000, 1
[ 2500.535303] msm_vidc: info: Closed video instance: 0000000000000000
[ 2501.181167] msm_vidc: info: Opening video instance: 0000000000000000, 1
[ 2501.882093] KPI: Bootloader start count = 26245
[ 2501.882107] KPI: Bootloader end count = 177060
[ 2501.882114] KPI: Bootloader display count = 74289
[ 2501.882122] KPI: Bootloader load kernel count = 2827614037
[ 2501.882130] KPI: Kernel MPM timestamp = 82158279
[ 2501.882137] KPI: Kernel MPM Clock frequency = 32768
[ 2501.895324] msm_vidc:  err: HFI_EVENT_SESSION_ERROR
[ 2501.895366] msm_vidc: warn: Session error received for session ffffffc063034000
[ 2501.895377] msm_vidc: warn: Unsupported bitstream in ffffffc063034000
[ 2501.895528] msm_vidc:  err: HFI_EVENT_SYS_ERROR: 1, 0x35224
[ 2501.895540] msm_vidc:  err: Dumping Venus registers...
[ 2501.895548] msm_vidc:  err: VENUS_VBIF_XIN_HALT_CTRL1: 0x70000
[ 2501.895557] msm_vidc:  err: VIDC_VENUS_WRAPPER_MMCC_VENUS0_POWER_STATUS: 0x5
[ 2501.895565] msm_vidc:  err: VIDC_WRAPPER_CPU_STATUS: 0x0
[ 2501.895573] msm_vidc:  err: VIDC_CPU_CS_SCIACMDARG0: 0x3
[ 2501.895605] msm_vidc:  err: SFR Message from FW: Err_Fatal - Z:\b\venus_proc\venus\decoders\common\src\video_decoder_utils.c:3330:
[ 2501.895637] msm_vidc: warn: SYS_ERROR 8 received for core ffffffc0af771000
[ 2501.895647] msm_vidc: warn: msm_comm_clean_notify_client: Core ffffffc0af771000
[ 2501.895656] msm_vidc: warn: msm_comm_clean_notify_client Send sys error for inst ffffffc063034000
[ 2502.886473] msm_vidc:  err: Wait interrupted or timed out: 16
[ 2502.886510] msm_vidc:  err: __iface_cmdq_write_relaxed - fw not in init state
[ 2502.886520] msm_vidc:  err: msm_comm_session_abort session_abort failed rc: -39
[ 2502.886537] msm_vidc:  err: __iface_cmdq_write_relaxed - fw not in init state
[ 2502.886545] msm_vidc:  err: msm_comm_session_abort session_abort failed rc: -39
[ 2502.886575] msm_vidc: warn: Failed to release scratch buffers
[ 2502.886721] msm_vidc:  err: __iface_cmdq_write_relaxed - fw not in init state
[ 2502.886729] msm_vidc:  err: vidc_hal_session_set_buffers failed
[ 2502.886747] msm_vidc:  err: Failed to set scratch buffers: -39
[ 2502.886759] msm_vidc:  err: Streamon failed on: 9 capability for inst: 0000000000000000
[ 2502.886772] msm_vidc:  err: streamon failed on port: 9
[ 2502.899348] msm_vidc:  err: Core is in bad state can't change the state
[ 2502.899366] msm_vidc:  err: Failed to move from state: 17 to 5
[ 2502.899377] msm_vidc:  err: Failed to move inst: 0000000000000000 to start done state
[ 2502.899502] msm_vidc:  err: __iface_cmdq_write_relaxed - fw not in init state
[ 2502.899512] msm_vidc:  err: msm_comm_session_abort session_abort failed rc: -39
[ 2502.899521] msm_vidc:  err: Fail to clean session: -39
[ 2502.899532] msm_vidc:  err: Core 0000000000000000 and inst 0000000000000000 are in bad state
[ 2502.899799] msm_vidc:  err: Core is in bad state can't change the state
[ 2502.899809] msm_vidc:  err: Failed to move from state: 17 to 13
[ 2502.899818] msm_vidc:  err: Failed to move inst: 0000000000000000 to start done state
[ 2502.899831] msm_vidc:  err: Resume from power collapse failed
[ 2502.899839] msm_vidc:  err: Failed to set clock rate: -19
[ 2502.899847] msm_vidc: warn: Failed to scale clocks. Performance might be impacted
[ 2502.899867] msm_vidc:  err: Failed to move inst: 0000000000000000, cap = 10 to state: 13
[ 2502.901627] msm_vidc:  err: Core 0000000000000000 in bad state, ignoring release output buf
[ 2502.901642] msm_vidc:  err: Core 0000000000000000 in bad state, ignoring release output buf
[ 2502.901651] msm_vidc:  err: Core 0000000000000000 in bad state, ignoring release output buf
[ 2502.901660] msm_vidc:  err: Core 0000000000000000 in bad state, ignoring release output buf
[ 2503.189354] wlan: [4225:E :DAT] dxeTXCompFrame :ARP packet DMA-ed 
[ 2503.277235] wlan: [4225:E :DAT] dxeTXCompFrame :ARP packet DMA-ed 
[ 2504.012532] send_filled_buffers_to_user: 1 callbacks suppressed
[ 2504.012549] send_filled_buffers_to_user: Send Failed -3 drop_count = 708
[ 2505.901439] msm_vidc:  err: __iface_cmdq_write_relaxed - fw not in init state
[ 2505.901456] msm_vidc:  err: msm_comm_session_abort session_abort failed rc: -39
[ 2505.901630] msm_vidc: info: Closed video instance: 0000000000000000
[ 2508.026934] q6asm_callback: payload size of 8 is less than expected.

And logcat is filled with:

01-14 15:32:57.529     0  8430 D MediaCodecLayer: dequeueOutputBuffer() ret: -11
01-14 15:32:57.529     0  8430 D MediaCodecLayer: dequeueOutputBuffer returned -11
01-14 15:32:57.529     0  8430 V MediaCodecLayer: int media_codec_dequeue_output_buffer(MediaCodecDelegate, MediaCodecBufferInfo *, int64_t)
Danct12 commented 4 years ago

The cause appears to be from libmedia_compat_layer, however NotKit also pointed us to this, which should fix video decode, and at the same time also fixes video recording.

Danct12 commented 4 years ago

Fixed in ubports-santoni/android_device_xiaomi_santoni@545b3be98588a0b26df3cb8ebbd3f9de0702a59f