Opened 6 years ago

Last modified 6 years ago

#7210 new defect

avcodec decoder error: existing hardware acceleration cannot be reused

Reported by: Julian Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: vdpau videolan
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello,

I encountered an issue while using vlc + vdpau and reported a bug there. The vlc team thinks it's a failure within libavcodec.
The report can be found here: https://trac.videolan.org/vlc/ticket/20477

As seen in the bug report there using the hardware acceleration fails for some unknown reason:

vdp_decoder_query_capabilities(1, 8, -, -, -, -, -)
    -> 0, 1, 41, 9216, 2048, 1152
[00007fd478c106a0] avcodec decoder error: existing hardware acceleration cannot be reused
vdp_video_surface_destroy(6)
    -> 0

I'll upload a sample file on your ftp server including this bug report's ID in its filename.

Attachments (4)

vlc_vdpau_trace_vvv.txt (52.3 KB ) - added by Julian 6 years ago.
output of " VDPAU_TRACE=1 vlc -vvv -I lua <file>"
vlc_vdpau_trace.txt (10.1 KB ) - added by Julian 6 years ago.
output of "VDPAU_TRACE=1 vlc -I lua <file>"
vdpauinfo.txt (3.9 KB ) - added by Julian 6 years ago.
output of vdpauinfo
ffmpeg_debugoutput.txt (29.8 KB ) - added by Julian 6 years ago.
output of "ffmpeg -v debug -hwaccel vdpau -i your_file -f null -" (metadata edited)

Download all attachments as: .zip

Change History (15)

by Julian, 6 years ago

Attachment: vlc_vdpau_trace_vvv.txt added

output of " VDPAU_TRACE=1 vlc -vvv -I lua <file>"

by Julian, 6 years ago

Attachment: vlc_vdpau_trace.txt added

output of "VDPAU_TRACE=1 vlc -I lua <file>"

by Julian, 6 years ago

Attachment: vdpauinfo.txt added

output of vdpauinfo

comment:1 by Julian, 6 years ago

Installed libavcodec:

ii  libavcodec56:amd64                                               10:2.8.6-dmo2                          amd64        Library to encode decode multimedia streams - runtime files
ii  libavcodec57:amd64                                               10:3.4.1-dmo3                          amd64        Library to encode decode multimedia streams - runtime files
ii  libavcodec57:i386                                                10:3.4.1-dmo3                          i386         Library to encode decode multimedia streams - runtime files

AFAIK libavcodec57:amd64 is used by vlc.

Hardware:

$ lspci -vnn | grep VGA -A 12
00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler [Radeon HD 6320] [1002:9806] (prog-if 00 [VGA controller])
	Subsystem: Hewlett-Packard Company Wrestler [Radeon HD 6320] [103c:3577]
	Flags: bus master, fast devsel, latency 0, IRQ 29
	Memory at e0000000 (32-bit, prefetchable) [size=256M]
	I/O ports at 4000 [size=256]
	Memory at f0400000 (32-bit, non-prefetchable) [size=256K]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: radeon
	Kernel modules: radeon

00:01.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler HDMI Audio [1002:1314]
	Subsystem: Hewlett-Packard Company Wrestler HDMI Audio [103c:3577]

I cannot upload my sample file to your ftp server (I can't connect at all):

ftp: connect to address 2a01:e0d:1:3:58bf:fa77:f00d:face: Connection timed out
Trying 88.191.250.119...
ftp: connect: Connection timed out

Is it down?

comment:2 by Julian, 6 years ago

Version: unspecified3.4

comment:3 by Carl Eugen Hoyos, 6 years ago

Does vlc compilation work with current FFmpeg git head?

comment:4 by jkqxz, 6 years ago

Can you provide the log from ffmpeg?

ffmpeg -v debug -hwaccel vdpau -i your_file -f null -

Given that it stops just after querying the capabilities, I suspect that your file is not supported (or can't be determined to be supported) by the hardware - e.g. maybe it's H.264 baseline or extended profile.

comment:5 by Carl Eugen Hoyos, 6 years ago

Is there an encoder that is able to encode to baseline or extended profile?

in reply to:  1 comment:6 by Carl Eugen Hoyos, 6 years ago

Replying to styxxx:

I cannot upload my sample file to your ftp server (I can't connect at all):

Please use a file host of your choice.

in reply to:  5 ; comment:7 by jkqxz, 6 years ago

Replying to cehoyos:

Is there an encoder that is able to encode to baseline or extended profile?

Any constrained baseline stream can be marked as baseline or extended, and any non-CABAC main stream can be marked as extended - it's not required that it uses the rarely-implemented features. (Mislabelled streams of this form should be decodable with -hwaccel_flags +allow_profile_mismatch.)

in reply to:  7 comment:8 by Carl Eugen Hoyos, 6 years ago

Replying to jkqxz:

Replying to cehoyos:

Is there an encoder that is able to encode to baseline or extended profile?

Any constrained baseline stream can be marked as baseline or extended, and any non-CABAC main stream can be marked as extended - it's not required that it uses the rarely-implemented features.

(Mislabelled streams of this form should be decodable with -hwaccel_flags +allow_profile_mismatch.)

I guess this should be the default then.

by Julian, 6 years ago

Attachment: ffmpeg_debugoutput.txt added

output of "ffmpeg -v debug -hwaccel vdpau -i your_file -f null -" (metadata edited)

comment:9 by Julian, 6 years ago

Thanks for all your replies!
I attached the requested output (no error message there?) and uploaded a file:

https://styxxx.de/temp/ffmpeg/Ticket_7210_-_avcodec_decoder_error_existing_hardware_acceleration_cannot_be_reused__sample.mkv (First ~5M of one of the videos)

comment:10 by jkqxz, 6 years ago

That seems to all be fine with ffmpeg:

[AVHWDeviceContext @ 0x55be5154dc20] Successfully created a VDPAU device (G3DVL VDPAU Driver Shared Library version 1.0) on X11 display :0
[h264 @ 0x55be51601a80] Reinit context to 1280x720, pix_fmt: vdpau

I suspect it's failing the level check when run in vlc? The file is marked as level 5.1, but your hardware only declares support up to 4.1. The AV_HWACCEL_FLAG_IGNORE_LEVEL flag is set by default in libavcodec with ffmpeg (since the speed element doesn't matter for non-realtime use, and the dimensions are checked separately), but vlc might be overriding it.

comment:11 by Carl Eugen Hoyos, 6 years ago

Keywords: videolan added
Version: 3.4unspecified
Note: See TracTickets for help on using tickets.