Unhandled context fault on MPEG-2 Video Transcoding

Hi,

I try to transcode MPEG-2 video and AAC audio on TX2 (R28.1).

GStreamer Ver. 1.12
Input Source: Japan BS Broadcasting

gst-launch-1.0 \
udpsrc port=6510 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33" \
! queue \
! rtpbin \
! queue \
! rtpmp2tdepay \
! queue \
! tsparse \
! queue \
! tsdemux name=demux program-number=$SID \
demux.video_0_$VPID \
! queue \
! mpegvideoparse \
! queue \
! omxmpeg2videodec \
! queue \
! nvvidconv ! "video/x-raw(memory:NVMM),width=960,height=540,format=(string)I420" \
! queue \
! omxh264enc bitrate=4000000 \
! queue \
! h264parse \
! queue \
! rtph264pay config-interval=1 pt=96 \
! queue \
! udpsink host=127.0.0.1 port=9010 sync=false async=false \
demux.audio_0_$APID \
! queue \
! faad \
! queue \                                                                                                                                                                                                    
! audioconvert \
! queue \
! audioresample \
! queue \
! opusenc perfect-timestamp=true bitrate=192000 \
! queue \
! rtpopuspay pt=97 \
! queue \
! udpsink host=127.0.0.1 port=9016 sync=false async=false

At first it works good, but after long period of time (about 8~30 hours), the following message gets logged on the console.

[510411.405360] __arm_smmu_context_fault: 207 callbacks suppressed
[510411.411279] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5ad20000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=222e30003, pte=0
[510411.737654] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5cd20000, fsynr=0x40003, cb=12, sid=57(0x39 - (null)), pgd=26afc2003, pud=26afc2003, pmd=221037003, pte=0
[510411.988081] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5c120000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=e01b4003, pte=0
[510412.229165] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5c120000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=e01b4003, pte=0
[510412.700998] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5ad20000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=222e30003, pte=0
[510412.932946] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5ad20000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=222e30003, pte=0
[510413.255350] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x61020000, fsynr=0x40003, cb=12, sid=57(0x39 - (null)), pgd=26afc2003, pud=26afc2003, pmd=221391003, pte=0
[510413.489244] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5c120000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=e01b4003, pte=0
[510413.730370] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5c120000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=e01b4003, pte=0
[510414.271313] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x5ad20000, fsynr=0x40003, cb=11, sid=56(0x38 - (null)), pgd=26aa13003, pud=26aa13003, pmd=222e30003, pte=0

At that time, the following decode frame rates are shown.
TVMR: FrameRate = 26.251129
TVMR: FrameRate = 26.251129
TVMR: FrameRate = 26.640027

The true frame rate is 29.970090.

When I use software decoder element, the above messages are not logged.

Please give me any advice.

Hi Kazz1113,

Can you please share detail about this? The only HW element in your pipeline is omxh264enc, which is encoder.

Hi DaneLLL,

Is not omxmpeg2videodec HW element?

The pipeline which uses software decoder element (avdec_mpeg2video) is following.

gst-launch-1.0 \
udpsrc port=6510 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33" \
! queue \
! rtpbin \
! queue \
! rtpmp2tdepay \
! queue \
! tsparse \
! queue \
! tsdemux name=demux program-number=$SID \
demux.video_0_$VPID \
! queue \
! mpegvideoparse \
! queue \
! avdec_mpeg2video \
! queue \
! deinterlace \
! queue \
! videoscale ! "video/x-raw,width=960,height=540" \
! queue \
! videorate ! "video/x-raw,framerate=(fraction)30000/1001" \
! queue \
! omxh264enc bitrate=4000000 \
! queue \
! h264parse \
! queue \
! rtph264pay config-interval=1 pt=96 \
! queue \
! udpsink host=127.0.0.1 port=9010 sync=false async=false \
demux.audio_0_$APID \
! queue \
! faad \
! queue \                                                                                                                                                                                                    
! audioconvert \
! queue \
! audioresample \
! queue \
! opusenc perfect-timestamp=true bitrate=192000 \
! queue \
! rtpopuspay pt=97 \
! queue \
! udpsink host=127.0.0.1 port=9016 sync=false async=false

Hi Kazz1113,
We don’t support HW mpeg2 decoding. Please use avdec_mpeg2video

Per your comment, omxmpeg2videodec may not link to correct SW decoder. We will check it.

Hi DaneLLL,

Thank you for your reply.

In Jetson TX2 Module Data Sheet, video decode includes MPEG1/2: Main.

When I use the pipeline which includes omxmpeg2videodec element, tegrastats show following.

RAM 1476/7851MB (lfb 788x4MB) cpu [0%@2034,off,off,0%@2035,0%@2035,0%@2034] EMC 7%@1600 APE 150 NVDEC 268 MSENC 115 GR3D 0%@1134
RAM 1476/7851MB (lfb 788x4MB) cpu [10%@2006,off,off,8%@2016,8%@2013,9%@2020] EMC 7%@1600 APE 150 NVDEC 268 MSENC 115 GR3D 0%@1134
RAM 1476/7851MB (lfb 788x4MB) cpu [12%@2004,off,off,9%@2019,7%@2018,10%@2026] EMC 7%@1600 APE 150 NVDEC 268 MSENC 115 GR3D 0%@1134
RAM 1477/7851MB (lfb 788x4MB) cpu [8%@2006,off,off,7%@2015,8%@2029,7%@2024] EMC 7%@1600 APE 150 NVDEC 268 MSENC 115 GR3D 0%@1134
RAM 1477/7851MB (lfb 788x4MB) cpu [8%@2020,off,off,9%@2018,6%@2021,7%@2028] EMC 7%@1600 APE 150 NVDEC 268 MSENC 115 GR3D 0%@1134

I guess TX2 uses hardware accelerated because the logs include NVDEC.

Hi Kazz1113,
The implementation is still there but we no longer maintain it. We are now focusing on h264/h265/vp9.

If you meet issues in running it, we suggest use SW decoder.

Thank you DaneLLL.

I decide to use SW decoder.