imx8qxp how to use vpu encoder,vpu decoder is ok

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8qxp how to use vpu encoder,vpu decoder is ok

Jump to solution
875 Views
zhou1211
Contributor II

When not using VPU, many videos may not play smoothly, just like pictures;I have enabled VPU, the vpu decoder is normal, but the vpu encoder has failed; This leads to abnormal recording function. Is there any solution to this problem.

dmesg log for encoder:

[VPU Encoder] vpu vpu_enc_probe :6002
vpu-b0-encoder 2d000000.vpu_encoder: mbox_request_channel_byname() could not locate channel named "enc1_tx0"
[VPU Encoder] Failed to request mbox chan enc1_tx0, ret: -22
[VPU Encoder] init rtx channel failed, ret: -22
vpu-b0-encoder 2d000000.vpu_encoder: mbox_request_channel_byname() could not locate channel named "enc2_tx0"
[VPU Encoder] Failed to request mbox chan enc2_tx0, ret: -22
[VPU Encoder] init rtx channel failed, ret: -22
[VPU Encoder] fail to request mailbox, ret = -22
[VPU Encoder] vpu probe fialed....

 

logcat log for Abnormal recording function:

D V4l2Dev : open dev name /dev/video13
E IMXC2VideoEncoder: mEncoder OpenDevice fail
E MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 5
I hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
E StagefrightRecorder: Failed to create video encoder

0 Kudos
1 Solution
803 Views
zhou1211
Contributor II

Added HAL configuration and adjusted the number of devices, the encoding function is normal.

hal:

+ <hal format="hidl">
+ <name>android.hardware.media.c2</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IComponentStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>

dts:

&vpu_encoder {
+ boot-region = <&encoder_boot>;
+ rpc-region = <&encoder_rpc>;
+ reserved-region = <&encoder_reserved>;
+ reg-rpc-system = <0x40000000>;
+ resolution-max = <1920 1920>;
+ fps-max = <120>;
+ mbox-names = "enc1_tx0", "enc1_tx1", "enc1_rx";
+ mboxes = <&mu1_m0 0 0
+ &mu1_m0 0 1
+ &mu1_m0 1 0>;
status = "okay";
+
+ core0@1020000 {
+ compatible = "fsl,imx8-mu1-vpu-m0";
+ reg = <0x1020000 0x20000>;
+ reg-csr = <0x1050000 0x10000>;
+ interrupts = <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>;
+ fsl,vpu_ap_mu_id = <17>;
+ fw-buf-size = <0x200000>;
+ rpc-buf-size = <0x80000>;
+ print-buf-size = <0x80000>;
+ };
};

During video playback, it was found that two so files were missing, resulting in the inability to play rmvb and wmv videos. Can you provide the corresponding files. The log is attached and the main errors are as follows:

QuickViewIntentBuilder: Preparing intent for doc:3510-114C:zhq_zhq/Movies/testrmvb.rmvb
ImxExtractor: ImxExtractor::ImxExtractor mime=video/rmff
ImxExtractor: ImxExtractor::Init BEGIN
ImxExtractor: GetLibraryName /system/lib64/extractors/lib_rm_parser_arm11_elinux.3.0.so
ImxExtractor: dlopen fail

Cactus : Url is /storage/3510-114C/zhq_zhq/Movies/testwmv.wmv
ImxExtractor: ImxExtractor::ImxExtractor mime=video/x-ms-wmv
ImxExtractor: ImxExtractor::Init BEGIN
ImxExtractor: GetLibraryName /system/lib64/extractors/lib_asf_parser_arm11_elinux.3.0.so
ImxExtractor: dlopen fail

View solution in original post

0 Kudos
5 Replies
826 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @zhou1211,

I hope you are doing well.

The device tree seems ok. Please check there isn't any typo error. 
Please share the whole log file to further debug the issue.
 
One can refer below document for more information related to the same.
->i.MX Android Extended Codec Release Notes.pdf from the https://www.nxp.com/webapp/Download?colCode=11.0.0_2.4.0_DOCS
 
Thanks & Regards,
Dhruvit Vasavada
0 Kudos
804 Views
zhou1211
Contributor II

Added HAL configuration and adjusted the number of devices, the encoding function is normal.

hal:

+ <hal format="hidl">
+ <name>android.hardware.media.c2</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IComponentStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>

dts:

&vpu_encoder {
+ boot-region = <&encoder_boot>;
+ rpc-region = <&encoder_rpc>;
+ reserved-region = <&encoder_reserved>;
+ reg-rpc-system = <0x40000000>;
+ resolution-max = <1920 1920>;
+ fps-max = <120>;
+ mbox-names = "enc1_tx0", "enc1_tx1", "enc1_rx";
+ mboxes = <&mu1_m0 0 0
+ &mu1_m0 0 1
+ &mu1_m0 1 0>;
status = "okay";
+
+ core0@1020000 {
+ compatible = "fsl,imx8-mu1-vpu-m0";
+ reg = <0x1020000 0x20000>;
+ reg-csr = <0x1050000 0x10000>;
+ interrupts = <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>;
+ fsl,vpu_ap_mu_id = <17>;
+ fw-buf-size = <0x200000>;
+ rpc-buf-size = <0x80000>;
+ print-buf-size = <0x80000>;
+ };
};

During video playback, it was found that two so files were missing, resulting in the inability to play rmvb and wmv videos. Can you provide the corresponding files. The log is attached and the main errors are as follows:

QuickViewIntentBuilder: Preparing intent for doc:3510-114C:zhq_zhq/Movies/testrmvb.rmvb
ImxExtractor: ImxExtractor::ImxExtractor mime=video/rmff
ImxExtractor: ImxExtractor::Init BEGIN
ImxExtractor: GetLibraryName /system/lib64/extractors/lib_rm_parser_arm11_elinux.3.0.so
ImxExtractor: dlopen fail

Cactus : Url is /storage/3510-114C/zhq_zhq/Movies/testwmv.wmv
ImxExtractor: ImxExtractor::ImxExtractor mime=video/x-ms-wmv
ImxExtractor: ImxExtractor::Init BEGIN
ImxExtractor: GetLibraryName /system/lib64/extractors/lib_asf_parser_arm11_elinux.3.0.so
ImxExtractor: dlopen fail

0 Kudos
774 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @zhou1211,

I hope you are doing well
 

The packages you listed are restricted codec packages and are not generally available.
Please take a look at Table 1. Enhanced codecs and Section 6 License-Restricted Codecs from the i.MX Android ™ Extended Codec Release Notes of your Android version for more information.
 
Thanks & Regards,
Dhruvit Vasavada
0 Kudos
862 Views
zhou1211
Contributor II

kernel 5.10.72

android 11

0 Kudos
871 Views
zhou1211
Contributor II
The DTS configuration is as follows
 
&mu_m0{
status = "okay";
};

&mu1_m0{
status = "okay";
};

&mu2_m0{
status = "okay";
};

&vpu_encoder {
status = "okay";

compatible = "nxp,imx8qxp-b0-vpuenc";
boot-region = <&encoder_boot>;
rpc-region = <&encoder_rpc>;
reserved-region = <&encoder_reserved>;
reg-rpc-system = <0x40000000>;
resolution-max = <1920 1080>;
fps-max = <120>;
// power-domains = <&pd IMX_SC_R_VPU_ENC_0>, <&pd IMX_SC_R_VPU_ENC_1>,
// <&pd IMX_SC_R_VPU>;
// power-domain-names = "vpuenc1", "vpuenc2", "vpu";
mbox-names = "enc1_tx0", "enc1_tx1", "enc1_rx",
"enc2_tx0", "enc2_tx1", "enc2_rx";
mboxes = <&mu1_m0 0 0
&mu1_m0 0 1
&mu1_m0 1 0
&mu2_m0 0 0
&mu2_m0 0 1
&mu2_m0 1 0>;

vpu_enc_core0: core0@1020000 {
compatible = "fsl,imx8-mu1-vpu-m0";
reg = <0x1020000 0x20000>;
reg-csr = <0x1090000 0x10000>;
interrupts = <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>;
fsl,vpu_ap_mu_id = <17>;
fw-buf-size = <0x200000>;
rpc-buf-size = <0x80000>;
print-buf-size = <0x80000>;
};

vpu_enc_core1: core1@1040000 {
compatible = "fsl,imx8-mu2-vpu-m0";
reg = <0x1040000 0x20000>;
reg-csr = <0x10A0000 0x10000>;
interrupts = <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>;
fsl,vpu_ap_mu_id = <18>;
fw-buf-size = <0x200000>;
rpc-buf-size = <0x80000>;
print-buf-size = <0x80000>;
};

};

&vpu_decoder {
boot-region = <&decoder_boot>;
rpc-region = <&decoder_rpc>;
reg-csr = <0x2d040000>;
core_type = <1>;
status = "okay";
};
0 Kudos