FS#37888 - [libdrm] 2.4.49-1 breaks AMD radeon vdpau in xbmc
Attached to Project:
Arch Linux
Opened by Ruben Van Boxem (rubenvb) - Saturday, 23 November 2013, 18:36 GMT
Last edited by Andreas Radke (AndyRTR) - Thursday, 20 March 2014, 16:47 GMT
Opened by Ruben Van Boxem (rubenvb) - Saturday, 23 November 2013, 18:36 GMT
Last edited by Andreas Radke (AndyRTR) - Thursday, 20 March 2014, 16:47 GMT
|
Details
Description:
With libdrm-2.4.47-1, I could enablee VDPAU by adding the following to xbmc's .bashrc: export LIBVA_DRIVER_NAME=vdpau export VDPAU_DRIVER=r600 and using the open source Radeon driver. No other settings were used for anything. Using libdrm-2.4.49-1, playing a video with these exact settings freezes xbmc. The same kind of freeze can be seen when also enabling VAAPI acceleration in xbmc using the old libdrm. The program vdpauinfo also reflects the absence of working VDPAU support with the new libdrm. This is using kernel 3.12(.1), and mesa/mesa-libgl/ati-dri 9.2.3. |
This task depends upon
For reference, the GPU is an HD6450:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450]
Also, you might want to revert this commit:
https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/libdrm&id=0ca3903e9affbee936285d72855f9d73a6e92f4e
If reverting to clang fixes your bug, there's another bug in libdrm that is caused by undefined behaviour in gcc.
I'm confused on how reinstalling the package would prevent the freeze from happening though.
Try the patch I'm sending.
The commit of the patch is:
http://cgit.freedesktop.org/mesa/drm/commit/?id=c8a437f4c76527b3c8385699ccee07f35fe3f166
I had this bug and this patch fixed it to me.
This seems to be the same bug of https://bugs.archlinux.org/task/37903.
1. install libdrm (2.4.47 or the patched 2.4.49). Start xbmc (with aforementioned settings for vdpau through ati-dri). Everything works.
2. reboot. Start xbmc. Freezes on initiation of video playback. Exit xbmc. Reinstall libdrm (2.4.47 or patched 2.4.49). Start xbmc. Everything works.
3. reboot. Start xbmc. Freezes. systemctl restart xbmc. Everything works.
4. reboot. Start xbmc. Restart xbmc. Freezes. Restart xbmc. Everything works.
An xbmc log when the freeze happens:
[snip]
20:05:06 T:140296952198912 NOTICE: CDVDVideoCodecFFmpeg::Open() Creating VDPAU(1920x816, 28)
20:05:15 T:140297713821440 DEBUG: Suspended the Sink
20:05:33 T:140297388422912 DEBUG: Thread Jobworker 140297388422912 terminating (autodelete)
[end of log]
Log of identical actions after a systemctl restart xbmc:
[snip]
20:08:37 T:139810916267776 NOTICE: CDVDVideoCodecFFmpeg::Open() Creating VDPAU(1920x816, 28)
20:08:37 T:139812461995968 DEBUG: ------ Window Init (DialogBusy.xml) ------
20:08:37 T:139810916267776 NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
20:08:37 T:139810916267776 NOTICE: VDPAU Decoder capabilities:
20:08:37 T:139810916267776 NOTICE: name level macbs width height
20:08:37 T:139810916267776 NOTICE: ------------------------------------
20:08:37 T:139810916267776 NOTICE: MPEG1 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: MPEG2_SIMPLE 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: MPEG2_MAIN 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: H264_BASELINE 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: H264_MAIN 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: H264_HIGH 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: VC1_SIMPLE 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: VC1_MAIN 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: VC1_ADVANCED 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: MPEG4_PART2_ASP 16 9216 2048 1152
20:08:37 T:139810916267776 NOTICE: ------------------------------------
20:08:37 T:139810916267776 NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION
20:08:37 T:139810916267776 NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_SHARPNESS
20:08:37 T:139810916267776 NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
20:08:37 T:139810916267776 DEBUG: FactoryCodec - Video: ff-h264_vdpau-vdpau - Opened
20:08:37 T:139810916267776 NOTICE: Creating video thread
[more succes]
GDB backtrace at the moment of the freeze of the relevant xbmc process (I think):
#0 0x00007f809a2b703f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f809704e0f0 in ?? () from /usr/lib/libX11.so.6
#2 0x00007f809705fc98 in ?? () from /usr/lib/libX11.so.6
#3 0x00007f8091585977 in ?? () from /usr/lib/libxcb.so.1
#4 0x00007f8091585f4e in xcb_send_request () from /usr/lib/libxcb.so.1
#5 0x00007f809179c33d in xcb_dri2_swap_buffers_unchecked () from /usr/lib/libxcb-dri2.so.0
#6 0x00007f80996ae4b7 in ?? () from /usr/lib/libGL.so.1
#7 0x00000000010b2ca7 in CWinSystemX11GL::PresentRenderImpl(std::vector<CDirtyRegion, std::allocator<CDirtyRegion> > const&) ()
#8 0x000000000100d2cf in CRenderSystemGL::PresentRender(std::vector<CDirtyRegion, std::allocator<CDirtyRegion> > const&) ()
#9 0x0000000000ede2d9 in CApplication::Render() ()
#10 0x00000000009b862e in CGUIWindowManager::ProcessRenderLoop(bool) ()
#11 0x00000000009efbb2 in CDVDPlayer::OpenFile(CFileItem const&, CPlayerOptions const&) ()
#12 0x0000000000ee9d82 in CApplication::PlayFile(CFileItem const&, bool) ()
#13 0x0000000000eeae9d in CApplication::PlayMedia(CFileItem const&, int) ()
#14 0x0000000000cddb16 in CBuiltins::Execute(CStdStr<char> const&) ()
#15 0x0000000000eef169 in CApplication::ExecuteXBMCAction(std::string) ()
#16 0x0000000000eeff10 in CApplication::OnMessage(CGUIMessage&) ()
#17 0x00000000009b8df2 in CGUIWindowManager::SendMessage(CGUIMessage&) ()
#18 0x000000000091bb5d in CGUIAction::ExecuteActions(int, int) const ()
#19 0x000000000092455c in CGUIBaseContainer::OnClick(int) ()
#20 0x00000000009b666a in CGUIWindow::OnAction(CAction const&) ()
#21 0x00000000009b927d in CGUIWindowManager::OnAction(CAction const&) ()
#22 0x0000000000eeb620 in CApplication::OnAction(CAction const&) ()
#23 0x0000000000eed0a4 in CApplication::OnKey(CKey const&) ()
#24 0x0000000000eedd64 in CApplication::OnEvent(XBMC_Event&) ()
#25 0x0000000000eba668 in CWinEventsSDL::MessagePump() ()
#26 0x0000000000eeebf4 in CApplication::FrameMove(bool, bool) ()
#27 0x0000000000f7bf62 in CXBApplicationEx::Run() ()
#28 0x0000000000f839b7 in XBMC_Run ()
#29 0x00000000006ad33a in main ()
How can restarting xbmc "fix" the issue? Is there any way to get more debug info out of this?
I don't know where to start looking :-/
There are another bug in vdpau that sends invalid frames and causes the freezes.
And it occurs only when using glamor.
I had no time to investigate this, but I know that bug exists.
But for me only a few movies triggers this bug.
Can you test to see if it freezes with all movies or only a few??
The bug in libdrm did exist too but it is fixed now.
Please also check the 3.13 kernel currently in testing that has many Ati card related improvements.
I installed the linux-3.13.1 package from testing manually. All the below is using that kernel. I will attempt to describe and analyze the situation as best I can. I understand issue 3 and 4 are unrelated to the original issue, I can open a nuw bug for them.
I have my HTPC connected to my HiFi, which taps off the sound and sends the video to my TV.
1. If I boot with the receiver off, I can't get any video output until I restart X.
2. If the receiver is on, but the TV is off during boot, turning on the tv gives me video output as expected, but starting playback now crashes xbmc (xbmc_vdpau_glamor.log). After the first crash, consequent playback works. Setting AccelerationMethod in /etc/X11/xorg.conf.d/radeon.conf to e.g. "EXA" also crashes XBMC (xbmc_vdpau_exa.log). I confirmed in Xorg.log that Glamor is not being used in this case.
3. When playing a video using vdpau (after booting with TV on, or after the first restart after the crash), pressing the back button crashes XBMC (xbmc_vdpau_back_button.log)
4. Playback with vdpau enabled has a very irritating sync issue where the top 5% rows are out of sync with the rest of the screen. This causes very noticeable flickers especially with panning shots. I can film this with e.g. my phone if you think it is helpful, but a screenshot is impossible as pausing removes the tear from the image. When vdpau is off in XBMC settings, the issue is much less pronounced but still present (only top 5 or 10 pixel rows show the sync issue).
All these don't happen if I disable vdpau acceleration in the xbmc settings.
My conclusion: it's not fixed in linux 3.13, it's not a glamor issue. I don't know how to disable DRI here and still use xf86-video-ati/libdrm's vdpau driver.
Backtrace is the same as
"
GDB backtrace at the moment of the freeze of the relevant xbmc process (I think):
#0 0x00007f809a2b703f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f809704e0f0 in ?? () from /usr/lib/libX11.so.6
#2 0x00007f809705fc98 in ?? () from /usr/lib/libX11.so.6
#3 0x00007f8091585977 in ?? () from /usr/lib/libxcb.so.1
#4 0x00007f8091585f4e in xcb_send_request () from /usr/lib/libxcb.so.1
....
"
And also tried with downgrading the libdrm, doesn't help.
Thanks for the help!