Playback Hangs if VDPAU Fails
#1
[ Problem ]
If I have VDPAU enabled, playing a video with codecs that my video card's VDPAU implementation does not support causes XBMC to hang, instead of falling back to software decoding. Sometimes. Other times, it successfully falls back. I haven't yet found a consistent pattern, except that it never freezes when using software decoding.

[ System Data ]
Debug log
XBMC Version: Frodo 12.2
Linux Distribution: Gentoo
Kernel Version: 3.9.4
Architecture: x86_64
Install method: Gentoo ebuild (compile from source)
Video Hardware: AMD Radeon 6310 (integrated in E-350 APU)
Drivers: Open source in-kernel radeon driver, built as a module; xf86-video-ati-7.1.0
libvdpau version: 0.6
vdpauinfo:
Code:
    display: :0   screen: 0
    API version: 1
    Information string: G3DVL VDPAU Driver Shared Library version 1.0
    
    Video surface:
    
    name   width height types
    -------------------------------------------
    420    16384 16384  NV12 YV12
    422    16384 16384  NV12 YV12 UYVY YUYV
    444    16384 16384  NV12 YV12 Y8U8V8A8 V8U8Y8A8
    
    Decoder capabilities:
    
    name               level macbs width height
    -------------------------------------------
    MPEG1                16 1048576 16384 16384
    MPEG2_SIMPLE         16 1048576 16384 16384
    MPEG2_MAIN           16 1048576 16384 16384
    
    Output surface:
    
    name              width height nat types
    ----------------------------------------------------
    B8G8R8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
    R8G8B8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
    R10G10B10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
    B10G10R10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
    
    Bitmap surface:
    
    name              width height
    ------------------------------
    B8G8R8A8         16384 16384
    R8G8B8A8         16384 16384
    R10G10B10A2      16384 16384
    B10G10R10A2      16384 16384
    A8               16384 16384
    
    Video mixer:
    
    feature name                    sup
    ------------------------------------
    DEINTERLACE_TEMPORAL             -
    DEINTERLACE_TEMPORAL_SPATIAL     -
    INVERSE_TELECINE                 -
    NOISE_REDUCTION                  y
    SHARPNESS                        y
    LUMA_KEY                         -
    HIGH QUALITY SCALING - L1        -
    HIGH QUALITY SCALING - L2        -
    HIGH QUALITY SCALING - L3        -
    HIGH QUALITY SCALING - L4        -
    HIGH QUALITY SCALING - L5        -
    HIGH QUALITY SCALING - L6        -
    HIGH QUALITY SCALING - L7        -
    HIGH QUALITY SCALING - L8        -
    HIGH QUALITY SCALING - L9        -
    
    parameter name                  sup      min      max
    -----------------------------------------------------
    VIDEO_SURFACE_WIDTH              y        48    16384
    VIDEO_SURFACE_HEIGHT             y        48    16384
    CHROMA_TYPE                      y  
    LAYERS                           y         0        4
    
    attribute name                  sup      min      max
    -----------------------------------------------------
    BACKGROUND_COLOR                 y  
    CSC_MATRIX                       y  
    NOISE_REDUCTION_LEVEL            y      0.00     1.00
    SHARPNESS_LEVEL                  y     -1.00     1.00
    LUMA_KEY_MIN_LUMA                y  
    LUMA_KEY_MAX_LUMA                y

[ Media Details ]
sample file mediainfo:
Code:
    General
    Unique ID                                : 96775282810867885228297168670281601057 (0x48CE3DD3381E2FEBD412552F4DB29021)
    Complete name                            : Adventure Time - S05E22 - Ice King Gives Up.mkv
    Format                                   : Matroska
    Format version                           : Version 4 / Version 2
    File size                                : 172 MiB
    Duration                                 : 11mn 10s
    Overall bit rate                         : 2 145 Kbps
    Encoded date                             : UTC 2013-05-28 03:20:33
    Writing application                      : mkvmerge v6.0.0 ('Coming Up For Air') built on Jan 20 2013 10:28:01
    Writing library                          : libebml v1.3.0 + libmatroska v1.4.0
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : [email protected]
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 5 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 11mn 10s
    Bit rate                                 : 1 654 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.075
    Stream size                              : 132 MiB (77%)
    Writing library                          : x264 core 132 r2310 76a5c3a
    Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Language                                 : English
    Default                                  : Yes
    Forced                                   : No
    Matrix coefficients                      : BT.709
    
    Audio
    ID                                       : 2
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : A_AC3
    Duration                                 : 11mn 10s
    Bit rate mode                            : Constant
    Bit rate                                 : 448 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 35.8 MiB (21%)
    Default                                  : Yes
    Forced                                   : No

mplayer2 -ao alsa:device=hw=0.3 --msglevel=decvideo=6:
Code:
    MPlayer2 2.0-712-gd3c5801 (C) 2000-2012 MPlayer Team
    Cannot open file '/home/mediacenter/.mplayer/input.conf': No such file or directory
    Failed to open /home/mediacenter/.mplayer/input.conf.
    
    Playing Adventure Time - S05E22 - Ice King Gives Up.mkv.
    [mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
    [mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
    [mkv] Will play video track 1.
    Detected file format: Matroska
    Load subtitles in .
    Opening video decoder: [ffmpeg] libavcodec video codecs
    Asking decoder to use 2 threads if supported.
    Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [libavcodec]
    Video codecs.conf entry: ffh264 (FFmpeg H.264)  vfm: ffmpeg
    Selected audio codec: ATSC A/52A (AC-3) [libavcodec]
    AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
    AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
    [AO_ALSA] Unable to find simple control 'Master',0.
    Starting playback...
    [ffmpeg] aspect_ratio: 0.000000
    VIDEO:  1280x720  23.976 fps    0.0 kbps ( 0.0 kB/s)
    VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
    Trying filter chain: vo
    VO: [vdpau] 1280x720 => 1280x720 Planar YV12
    [vdpau] Got display refresh rate 29.970 Hz.
    [vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.

excerpt from xbmc.log with successful software decoding fallback:
Code:
    INFO: ffmpeg[B8D08700]: Input #0, matroska,webm, from 'Adventure Time - S05E22 - Ice King Gives Up.mkv':
        INFO: ffmpeg[B8D08700]:   Metadata:
        INFO: ffmpeg[B8D08700]:     creation_time   : 2013-05-28 03:20:33
        INFO: ffmpeg[B8D08700]:   Duration: 00:11:10.92, start: 0.000000, bitrate: 2144 kb/s
        INFO: ffmpeg[B8D08700]:     Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.9 tbc (default)
        INFO: ffmpeg[B8D08700]:     Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s (default)
      NOTICE: Opening video stream: 0 source: 256
      NOTICE: Creating video codec with codec id: 28
       DEBUG: CDVDFactoryCodec: compiled in hardware support: CrystalHD:no OpenMax:no VDPAU:yes VAAPI:no
       DEBUG: FactoryCodec - Video:  - Opening
       DEBUG: DllAvUtilBase: Using libavutil system library
       DEBUG: DllAvCodec: Using libavcodec system library
       DEBUG: DllSwScale: Using libswscale system library
       DEBUG: DllAvFilter: Using libavfilter system library
      NOTICE: CDVDVideoCodecFFmpeg::Open() Creating VDPAU(1280x720, 28)
       DEBUG: DllAvUtilBase: Using libavutil system library
      NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
      NOTICE: VDPAU Decoder capabilities:
      NOTICE: name          level macbs width height
      NOTICE: ------------------------------------
      NOTICE: MPEG1            16 1048576 16384 16384
      NOTICE: MPEG2_SIMPLE     16 1048576 16384 16384
      NOTICE: MPEG2_MAIN       16 1048576 16384 16384
      NOTICE: ------------------------------------
      NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION
      NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_SHARPNESS
       ERROR:  (VDPAU) Error: An invalid/unsupported VdpDecoderProfile value was supplied.(14) checking for decoder support
      NOTICE: CDVDVideoCodecFFmpeg::Open() Failed to get VDPAU device
      NOTICE:  (VDPAU) Close
      NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
       DEBUG: FactoryCodec - Video: ff-h264 - Opened
      NOTICE: Creating video thread
Reply
#2
vdpau on AMD is flaky at best. Use the xvba enabled version with fglrx instead.

http://forum.xbmc.org/showthread.php?t=116996
Reply
#3
Except that it works in ffplay and mplayer. XBMC is the only multimedia app on my system that has issues. Sorry, not changing my whole driver stack because an application doesn't handle error conditions correctly.
Reply
#4
Sorry, not changing priorities because a very small amount of users testing experimental drivers.
Reply
#5
After talking to some people in #radeon, it appears there are a couple of issues at play here:
- There's a deadlock bug in libxcb (http://lists.freedesktop.org/archives/me...39190.html). This effectively excuses XBMC from any blame for locking up or not handling error conditions correctly, and so I apologize for leveling that accusation.
- The Mesa I was using predates the UVD source release, so it was using shaders instead of VDPAU. I've updated my Mesa, but will not be able to test further until this evening.

FernetMenta, I think I came off as more critical than I meant to. I don't mean to demand that the project or any of its developers change priorities or cater to my specific use cases, and I didn't intend to tear down the project as a whole because the application isn't behaving as I expect it to in my circumstances.
At the same time, I don't accept the response of "use a proprietary driver with a long history of stability and compatibility issues, with a featureset that presents a regression from what you're currently using" as valid. I prefer to work through the issue and find a proper solution.
Reply
#6
np

Quote:At the same time, I don't accept the response of "use a proprietary driver with a long history of stability and compatibility issues

I guess this was an attempt to help.

Can you elaborate on "regression" in that context, please.

Quote:I prefer to work through the issue and find a proper solution.

Good attitude. Let's hope that AMD continues to improve this path.
Reply
#7
(2013-06-07, 18:42)FernetMenta Wrote: Can you elaborate on "regression" in that context, please.
I looked at the Xvba thread, and at the top it lists two missing features:

What does not yet work:
- mpeg2/4: not yet enabled in fglrx
- fglrx doesn't support HD audio(DTS HD/MA) yet


mpeg2/4 works in radeon, as far as I know. I'll be able to provide a more concrete answer tonight.
HD audio has issues in radeon, with certain monitors. Alex Deucher submitted a patch to dri-devel this morning that should help there - I tested a prototype of it last night that worked for my card and monitor, and will be testing the submitted patch this evening.
I've also read that fglrx doesn't handle 2d acceleration very well at all.
Beyond that, I am very reticent to use fglrx in general based on my prior experiences with it in both Windows and Linux.

Quote:Good attitude. Let's hope that AMD continues to improve this path.
Based on my interactions with some of the Radeon developers over the last 2 days, I am very optimistic on this front.
Reply
#8
I hope your optimism won't be discouraged. We have been waiting for mpeg2/4 in fglrx for 2 years Sad
Now we have 2 paths, OSS and fglrx. Neither of those is appealing enough to make me invest money in AMD hardware. I would rather see them deciding for a single strategy and do this properly.

(this is frustration: we have spent countless hours of unpaid work in supporting this platform)
Reply
#9
(2013-06-07, 19:18)FernetMenta Wrote: I hope your optimism won't be discouraged. We have been waiting for mpeg2/4 in fglrx for 2 years Sad
Now we have 2 paths, OSS and fglrx. Neither of those is appealing enough to make me invest money in AMD hardware. I would rather see them deciding for a single strategy and do this properly.

(this is frustration: we have spent countless hours of unpaid work in supporting this platform)

That's precisely why I haven't bought any Radeon hardware since 2006, until last week. When I read about the UVD source drop, I perked up and thought I'd give it a shot.
Reply
#10
@UberPinguin:
Last time I tested OSS UVD it worked "okay" for 1080p with max 24fps. I talked with ckoenig in #radeon and he is also making tests with fernetmentas vdpau code.

About the missing hw accel, you can easily see this in your log:
Quote: MPEG1 16 1048576 16384 16384
MPEG2_SIMPLE 16 1048576 16384 16384
MPEG2_MAIN 16 1048576 16384 16384

The biggest problem currently for the OSS UVD is the speed of the GPU, which needs to be manually set to a higher speed, cause it is normally clocked quite low cause of Powermanagement Features missing. Also the ondemand governor highly influences MESA performance.

One of the biggest issues with OSS UVD for LiveTV (mpeg2 / h264) is the complete lag of deinterlacing.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#11
AMD will continue with XVBA in their proprietary drivers, so I am not sure which of those will get users the experience they need. I have three AMD Systems (2*E350, 1 E450) ...

When I bought the E350 approx 2 years ago - it was state of the art hardware, something with the potential to kill the ION-2 - the standard htpc system - at this time. But those important features are still missing today:

- No Bitstream Audio
- LPCM limited to 2.0 channels and max 48 khz Samplerate (use SPDIF if you can)
- No mpeg2 / mpeg4 accel support
- Only "Bob like" deinterlacing

I did not expect it two years ago, that "Bitstream Audio" will be _the_ key feature right now. Every bluray is acclerated quite well, but sound is a major disadvantage.

Concerning mpeg2/mpeg4 support via xvba-sdk. I asked for it (the 10st time) two weeks ago - no response yet. I am really happy, that AMD fixed a long standing bug for xbmc users in the current beta. So that finally after more than 8 months - xbmc is usable again on "current" AMD drivers.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#12
(2013-06-07, 20:00)fritsch Wrote: About the missing hw accel, you can easily see this in your log:
Quote: MPEG1 16 1048576 16384 16384
MPEG2_SIMPLE 16 1048576 16384 16384
MPEG2_MAIN 16 1048576 16384 16384
Right, aboll and agd5f clarified that for me in #radeon, and led me to the realization that my Mesa build was too old. I didn't know how to interpret the vdpauinfo output before, so it didn't stick out to me.
Quote:The biggest problem currently for the OSS UVD is the speed of the GPU, which needs to be manually set to a higher speed, cause it is normally clocked quite low cause of Powermanagement Features missing. Also the ondemand governor highly influences MESA performance.

One of the biggest issues with OSS UVD for LiveTV (mpeg2 / h264) is the complete lag of deinterlacing.
My display is 1440x480i, so unless I'm mistaken (which is likely), I don't actually want deinterlacing.
Is there documentation for manually clocking the GPU?
My governor is currently set to 'userspace,' but I haven't set up anything to control that yet. I'll play with that once I have the basic features I'm looking for, functional.
Reply
#13
http://www.x.org/wiki/RadeonFeature <- Here is some infos about the clocks.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#14
(2013-06-07, 20:05)fritsch Wrote: Concerning mpeg2/mpeg4 support via xvba-sdk. I asked for it (the 10st time) two weeks ago - no response yet. I am really happy, that AMD fixed a long standing bug for xbmc users in the current beta. So that finally after more than 8 months - xbmc is usable again on "current" AMD drivers.

After updating my Mesa, vdpauinfo now reports:
Code:
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12
422    16384 16384  NV12
444    16384 16384  NV12

Decoder capabilities:

name               level macbs width height
-------------------------------------------
MPEG1                16  9216  2048  1152
MPEG2_SIMPLE         16  9216  2048  1152
MPEG2_MAIN           16  9216  2048  1152
H264_BASELINE        16  9216  2048  1152
H264_MAIN            16  9216  2048  1152
H264_HIGH            16  9216  2048  1152
VC1_SIMPLE           16  9216  2048  1152
VC1_MAIN             16  9216  2048  1152
VC1_ADVANCED         16  9216  2048  1152
MPEG4_PART2_SP       16  9216  2048  1152
MPEG4_PART2_ASP      16  9216  2048  1152

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    y  NV12
R8G8B8A8         16384 16384    y  NV12
R10G10B10A2      16384 16384    y  NV12
B10G10R10A2      16384 16384    y  NV12

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         16384 16384
R8G8B8A8         16384 16384
R10G10B10A2      16384 16384
B10G10R10A2      16384 16384
A8               16384 16384

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             -
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         -
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y        48     2048
VIDEO_SURFACE_HEIGHT             y        48     1152
CHROMA_TYPE                      y
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y
CSC_MATRIX                       y
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y
LUMA_KEY_MAX_LUMA                y

So looks like the radeon driver supports MPEG2/MPEG4. I don't yet have any information about bitstream audio or real-world performance with the updated driver.

Edit: The patch I linked to above allows me to enable HDMI audio, so at this point it looks like radeon is feature-complete for me. I still need to play with it a bit when I get home tonight to be certain.
Reply
#15
Hdmi Audio is not the problem. This works since ages. But more than "two real" channels of it - is the problem. But nice to see all the capabilities :-)

What about the performance nowadays:
Does this one work: https://dl.dropboxusercontent.com/u/5572...lannad.mkv

How is all over performance for you?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Playback Hangs if VDPAU Fails1