AMD Advanced Media Acceleration (AMA) Troubleshooting

Overview

This section describes various troubleshooting methods and workarounds for some known issues such as out of memory errors, low frame-rate, etc.

Memory Usage

Messages such as:

  • ERROR: from element xxxxx: Internal data stream error.

  • ERROR [Channel] Cannot create channel: DeviceAllocate failed

...

, indicate memory pressure on the accelerator card.

Workaround: Other than the obvious over-subscription use-cases, these issues can be resolved by decrementing the lookahead buffer size.

AV1 Slow Playback

An AV1 HLS stream may playback at slower than real time speeds.

Workaround: Recommend explicitly setting of FPS playback frame rate when using ffplay or use ffplay from FFmpeg 5.1.2 or 6.0.

AV1 MP4 Playback

AV1 muxed into an MP4 container may not play back properly.

Workaround: Recommend playback of raw video using more recent versions of ffplay (n5.1.2 or later) or more recent versions of media players such as VLC v3.0.17.4. Alternatively, muxing the raw video into an IVF container format is also permitted.

30 FPS Density

30 FPS transcodes and below can not run at full density with default lookahead depth.

Workaround: Decrease lookahead depth or density. Required decrease is dependent upon resolution/frame rate. See Performance Tables Section for details.

Gstreamer Variable Frame Rate

Variable frame rate files are not supported by the Gstreamer AMA plugins.

Workaround: Turn XRM off and add a videorate filter and caps filter before the encoder to set a fixed frame rate.

400 Mbps Max Bit Rate

Encoders do not support a target or max bitrate above 400 Mbps.

Workaround: This issue can be avoided by constraining the bitrate values below to 400 Mbps.

Many Parallel Encodes

Encountering Cannot create channel: DeviceAllocate failed error, when running high number of encoding operations in parallel.

Workaround: Reduce the memory requirements by lowering the lookahead depth of the encoding operation. This can be controlled with the -lookahead_depth argument. Default values depend on the FPS and bitdepth of the input source. The following are some starting points:

30fps: -lookahead_depth 26 (reduce by steps of 2)

60fps: -lookahead_depth 46 (reduce by steps of 4)

HDR & spatialAqGain

Encoding HDR content with a spatialAqGain of 1 or 2 is not supported.

Workaround: Using the default values of spatialAqGain is recommended for best video quality when possible. If it is desirable to reduce the spatialAqGain from the recommended range of 60 - 100, using a value of 3 or greater will avoid this issue.

Codec Issues in VM

If codec operations are hanging in a VM, while the following sudo dmesg -w output log is observed:

...
[  323.436842] ama_transcoder0 0000:05:00.0 hdma: warning:hdma_link_rc2ep_xfer status is done, c:2,status=0x1,condition=0
[  323.440802] ama_transcoder0 0000:05:00.0 hdma: dir:rc2ep element_cnt=1 channel:2 link_table_pa:0x160000
[  323.443387] ama_transcoder0 0000:05:00.0 hdma: ctl:0x01 size:0x4 sh:0x2 sl:0x97e00000 dh:0x0 dl:0x20831000
[  323.445538] ama_transcoder0 0000:05:00.0 hdma: end ctrl:0x06 rsv:0x0 llp_h:0x0 llp_l:0x160000
[  323.447257] ama_transcoder0 0000:05:00.0 hdma: rc2ep PF c=2 0x500 = 0x1
...

, with host reporting IO_PAGE_FAULT in its dmesg logs, then this is an indication of a mis-configured VM.

Workaround: Ensure that VM has been properly created as per Virtualization.