Permalink
Browse files

xvba: better strategy of transfer surface

  • Loading branch information...
1 parent 92bd082 commit c6331599dc165aed98d59a61c2ad32198a18c588 @FernetMenta committed Mar 29, 2012
@@ -2671,7 +2671,7 @@ void CLinuxRendererGL::UploadXVBATexture(int index)
CLog::Log(LOGWARNING,"CLinuxRendererGL::UploadXVBATexture no xvba texture, index: %d", index);
return;
}
- xvba->Transfer();
+// xvba->Transfer();
fields[0][1].id = xvba->texture;
@@ -335,12 +335,12 @@ unsigned int CXBMCRenderManager::PreInit(CDVDClock *pClock)
UpdateDisplayLatency();
m_swapCount = 1;
- std::string Vendor = g_Windowing.GetRenderVendor();
- std::transform(Vendor.begin(), Vendor.end(), Vendor.begin(), ::tolower);
- if (Vendor.compare(0, 3, "ati") == 0)
- {
- m_swapCount = 2;
- }
+// std::string Vendor = g_Windowing.GetRenderVendor();
+// std::transform(Vendor.begin(), Vendor.end(), Vendor.begin(), ::tolower);
+// if (Vendor.compare(0, 3, "ati") == 0)
+// {
+// m_swapCount = 2;
+// }
ResetRenderBuffer();
m_bUseBuffering = false;
m_overlays.SetNumBuffers(m_iNumRenderBuffers);
@@ -2010,20 +2010,20 @@ CXvbaRenderPicture* COutput::ProcessPicture()
// if (!(cmd & DVP_FLAG_SKIP_PROC))
// {
// transfer surface
-// XVBA_Transfer_Surface_Input transInput;
-// transInput.size = sizeof(transInput);
-// transInput.session = m_config.xvbaSession;
-// transInput.src_surface = m_processPicture.render->surface;
-// transInput.target_surface = glSurface->glSurface;
-// transInput.flag = m_field;
-// { CSingleLock lock(*(m_config.apiSec));
-// if (Success != g_XVBA_vtable.TransferSurface(&transInput))
-// {
-// CLog::Log(LOGERROR,"(XVBA) failed to transfer surface");
-// m_xvbaError = true;
-// return retPic;
-// }
-// }
+ XVBA_Transfer_Surface_Input transInput;
+ transInput.size = sizeof(transInput);
+ transInput.session = m_config.xvbaSession;
+ transInput.src_surface = m_processPicture.render->surface;
+ transInput.target_surface = glSurface->glSurface;
+ transInput.flag = m_field;
+ { CSingleLock lock(*(m_config.apiSec));
+ if (Success != g_XVBA_vtable.TransferSurface(&transInput))
+ {
+ CLog::Log(LOGERROR,"(XVBA) failed to transfer surface");
+ m_xvbaError = true;
+ return retPic;
+ }
+ }
// make sure that transfer is completed
// uint64_t maxTimeout = 1000000000LL;

22 comments on commit c633159

I tested this change. I get continuous drop (not much but continuous around 1 per s) and sometimes have a 1 pixel horizontal black line. Note that I'm using 12.3 driver now.

Owner

FernetMenta replied Mar 30, 2012

greetings to AMD. It works well with 11.12. Will look into this.

Well visually its not bad at all. I restarted without reboot after more than 10 hours non stop TV playing without crash. Got the black line. So checked the info with -o. after reboot, and various things, I do not get the horizontal black line any more. But the ~1 drop per s remains.

Top command gives a CPU at 118% but its not a problem: anyway software decoding is a no go on this machine.

Tail of my xbmc.log

15:40:00 T:140040172676864 NOTICE: Thread Jobworker start, auto delete: true
15:40:00 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:01 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:08 T:140040539371264 DEBUG: Previous line repeats 8 times.
15:40:08 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:08 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:09 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:10 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:11 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:11 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:12 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:13 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:13 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:15 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:15 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:16 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:16 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:17 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:19 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:19 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:20 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:20 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:21 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 3
15:40:22 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:22 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:27 T:140040539371264 DEBUG: Previous line repeats 5 times.
15:40:27 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 3
15:40:28 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:28 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:29 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:30 T:140040172676864 DEBUG: Previous line repeats 1 times.
15:40:30 T:140040172676864 DEBUG: Thread Jobworker 140040172676864 terminating (autodelete)
15:40:30 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:31 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:33 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:33 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:33 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3
15:40:34 T:140040539371264 DEBUG: Previous line repeats 1 times.
15:40:34 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.010000, Bufferlevel: 4
15:40:36 T:140040539371264 DEBUG: CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: -0.030000, Bufferlevel: 3

Owner

FernetMenta replied Mar 30, 2012

I tried with the patch reverted and it still drops. Works quite well with older driver. Look like AMD has screwed up 12.3

Grrr. Hope 12.4 with X 1.12 support will be better.

Owner

FernetMenta replied Mar 30, 2012

Can you check again with the last patch reverted. Then we should notify AMD that this version is bad.

Reverted the patch. Get even slightly more drops (3 every 2s). So the culprit is the driver change indeed.

If you are at "driver testing":
http://developer.amd.com/Downloads/OpenCL1.2betadriversLinux.tgz

There is a 12.4 beta included which will be the stable driver within the upcoming ubuntu. This driver fixes playback issues with HD5XXX. For me it seems to boost performance a bit. No regressions, but a small artefact problem with 1080 height VC-1 files (Elephant`s dream).

If surface handling really changes from driver to driver. Perhaps it is good to optimize for the upcoming driver within a distribution used by a lot of people.

The zotac is a E350 and the GPU is 6310. Using source driver from AMD usually mess up my system installing 32 bits apps and libs, when I'm using "pure" 64 bits model. For sure it does not compile although I have provided them with a 5 lines patch for months that fixes the problem for me (no word from them, not even your patch is broken we will not integrate it...).

Will see if I can rebuild debian packages from source.

BTW:'m not testing driver just updating my system when a particular problem has been solved to try to not chnage things during trying to fix a particular bug.

Hi Eric,

I can give you ubuntu packages from this new version. Btw. if I see this right. We are trying to optimize xvba for a specific driver version. 12.3 is in my opinion not a very good candidate. So just mail me if you want these packages.

Sure 12.4 (as it is a Xorg 1.12 capable driver) is the way to go. Will give a shot at producing debian package from amd source packages. If I fail I may try ubuntu one.

Guess I will be able to check monday (machine is at work).

dpkg-deb : construction du paquet « fglrx-driver » dans « ../fglrx-driver_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « libfglrx:amd64 » dans « ../libfglrx_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « libxvbaw1:amd64 » dans « ../libxvbaw1_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « libxvbaw-dev » dans « ../libxvbaw-dev_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « libgl1-fglrx-glx:amd64 » dans « ../libgl1-fglrx-glx_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-glx » dans « ../fglrx-glx_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-glx-ia32 » dans « ../fglrx-glx-ia32_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « libfglrx-ia32 » dans « ../libfglrx-ia32_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-modules-dkms » dans « ../fglrx-modules-dkms_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-source » dans « ../fglrx-source_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-control » dans « ../fglrx-control_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « fglrx-atieventsd » dans « ../fglrx-atieventsd_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « amd-opencl-icd:amd64 » dans « ../amd-opencl-icd_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « amd-libopencl1:amd64 » dans « ../amd-libopencl1_12-4beta-1_amd64.deb ».
dpkg-deb : construction du paquet « amd-clinfo » dans « ../amd-clinfo_12-4beta-1_amd64.deb ».

EricV replied Apr 2, 2012

Just finished the rebuild at work. Same results as 12.3 Continuous drop around 1 drop per s.

I have 12.4 beta running from ubuntu. I have an E45-M1 since some minutes ago and my normal Zotac AD-10 System. I cannot reproduce this. What "Sync Display to match Video" method are you using?

EricV replied Apr 2, 2012

I use the "always on" settings that I was using with the other drivers. If I go down to the lef were performance is, I get no more drops but thta was not the way I was testing with other drivers version.

EricV replied Apr 2, 2012

EricV replied Apr 2, 2012

BTW: do you use Xorg 1.11 or Xorg 1.12. I tried to install 1.12 after changing recompiling some packages cause of the input-abi and video-abi but failed. I had tio revert to Xorg 1.11.

EricV replied Apr 2, 2012

1.11.4 on my side.

I found a file which exactly show your errors. But this is a 1080p file with 5 reframes. So out of spec.
Do you mean this behaviour: http://dl.dropbox.com/u/55728161/adel.mkv together with this sample?

Does this happen with all your files? Can we "exchange" sample files? :-)

Update: Ah! And this only happens, if I choose Sync Method: Audio Clock - so - no, I cannot reproduce it with Sync: Video Clock (Resample Audio) or Video Clock (Drop/Dup Audio)

EricV replied Apr 2, 2012

I use the french HD TV streaming via tvheadend or tvheadend recordings of HD TV which keeps the codevc but remuxes it to mkv on the fly. Its 1080i50 either vbr or cbr depending on channels. Using use ARTE HD as its less paintfull to watch during the day...

I cannot access dropbox from http (or must use special network).

Please sign in to comment.