Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
1080i deinterlace issue #70
Comments
|
Hi, |
|
No. Deinterlacing of HD streams suffers from either limited memory bandwidth or bad implementation. I have now my Cubox with an up-to-date kernel up and running and will continue to work on this in future. If the latter is the case I have already some initial work in place towards an additional mixer thread that could help. In case of hardware limitations (VPU/IPU/GPU utilization) we have to test other options. Stephan already proposed some kernel tweaks but all this needs time and proper testing. |
susisstrolch
commented
Jul 10, 2014
|
@smallint - can you state more precisely what you mean by "up-to-date kernel"? |
piotrasd
commented
Aug 1, 2014
|
any progress with deinterlace issue ? for now i think this is the biggest problem :( |
jillesv
commented
Aug 11, 2014
|
It is like there is no interest in solving this issue. For me it is also very important that 1080i Live TV playback is working. That is why I bought this device in the first place. My raspberry was not powerfull enough to play the 1080i stream. I thought this device was powerfull enough, but now there are other issues that prevent to watch Live-TV. This issue is also not on the known issue list for Openelec and Geexbox... I don't understand why... I think it is really important. |
koying
commented
Aug 11, 2014
|
@jillesv Your priorities might not be the priorities of everybody... |
rabeeh
commented
Aug 11, 2014
|
Maybe someone can shed some light on where the bottlenecks are? |
jillesv
commented
Aug 11, 2014
|
Link to test TS 1080i file: http://jillesathome.nl:5050/fbsharing/lwHy0Rta |
|
Hi there, |
jillesv
commented
Aug 11, 2014
|
Wolfgar, |
piotrasd
commented
Aug 16, 2014
|
so we waiting for fix :) is good to know there is hope :) anyway i was testing last time - latest build and deinterlace for SD also i no perfect, |
|
yes there is hope for sure ! ;) |
piotrasd
commented
Aug 16, 2014
|
MatrixTV v2.1 and i was used latest MatrixTV os v1.0.0.9 and also latest openelec. |
|
Yes I alluded to half an full deinterlace from video settings. |
|
@piotrasd : you should have received a mail from me |
|
Sorry for my long absence. I am currently setting up a build environment on my cubox with Archlinux and xbmc compiled already. I am going to look into the deinterlacing issue and will try different methods to test and improve performance. This is scheduled for Monday. |
|
@smallint : Nice to see you back ! |
|
I have tested deinterlacing with a dedicated mixer thread that does deinterlacing in parallel to decoding and rendering. The results are not very promising but I will investigate further. The synchronization itself is quite tricky and once this is stable I will do more tests on performance. What I can say is that the performance with my old kernel (3.0.xx) on the Wandboard and the Yocto build was much faster. Not sure if the kernel frequency setting did the trick before. |
|
HI Jan, Regarding your performance, I am unsure about the root cause : Take your time, as I know you are working on it there is no risk of duplicate work and do not hesitate to tell me if I can help in any way... |
|
Currently I still need to figure out how exactly the sychronization performs. I am going to build a dummy deinterlacer (e.g. sleep(30ms)) and check if the playback is still smooth. If so I can assume that both pipelines are really parallel and do not block each other, the output should be in the interval of the maximum processing time (VPU or IPU). Once I introduce the real IPU and the performance drops dramatically it is likely that we are dealing with hardware limitations. Take my word that I am continuously working on that during the next weeks and will let you know how things are going. |
cmichal2
commented
Sep 2, 2014
|
I recompiled the Geexbox kernel with CONFIG_MX6_VPU_352M, and it makes a big improvement. It doesn't completely fix the issue, but obvious glitches in 1080i videos are much less frequent than without it. |
piotrasd
commented
Sep 2, 2014
|
maybe kernel 3.14 resolve some problems |
|
@cmichal2 : Thanks for your feedback : Which board and which kernel do you use for your test @352m ? |
cmichal2
commented
Sep 2, 2014
|
I'm using a Cubox-i4. The kernel is 3.10.30 from geexbox-devel |
|
Thanks a lot, I asked because contrary to the 3.0.35 version, the 3.10 freescale kernel seemed to ignore this configuration option... |
cmichal2
commented
Sep 2, 2014
|
You know, I went grepping through the source, and I couldn't find anywhere that that configuration option actually affected anything. But honestly, it does seem to make a big difference. |
|
hehe the same from my previous look at the source (while in 3.0.35, this config was clearly taken into account through code) Anyway, many thanks for confirming that it has the expected effect ! (even if not yet enough any improvement is good at this stage...) |
cmichal2
commented
Sep 3, 2014
|
I'll be interested to hear if you can find any effect of that config option. I'm a little unsure now of what's going on. After xbmc (and tvheadend) have been running for a day the glitches seem to be more frequent again. I tried each kernel, and immediately after booting it does seem as though with the clock speed option it is better, but I'm not that confident. Could there be a memory management aspect to this? |
|
Funny, while I am working currently on the deinterlacing issue I came to the conclusion that the IMX6 is not powerful enough with current kernel configuration (3.10.30, ArchLinux) to run VPU, IPU and GPU at the same time with 1080i. This is either related to limited memory bandwidth or that the IPU is stalling the VPU. Thats why I wanted to apply the CONFIG_MX6_VPU_352M option as well. But checking the sources I could not find any place where this option is used at all. So from my understanding this option cannot change anything unless there is some real magic done. I am about to publish some numbers soon. What I would like to have is a small performance test tool built with the XBMC libraries to decode and process a stream using the IMX6 codec. Does there anything exist somewhere? |
rabeeh
commented
Sep 3, 2014
|
@smallint we had a fix ages ago for LK 3.0.35 to improve IPU to DDR internal buses quality of service. Can you please check that register by - @wolfgar Please look at LK 3.14.14 too. It performs way better on the i.MX6 hardware. Jon Nettleton and RMK had added lots of fixes for CMA, GPU, IPU and one featured that boosted the performance on HummingBoard-i1 (the single cpu) was BFQ scheduler that boosted the performance to decode 80Mbps h.264 content. |
|
@rabeeh The performance does not seem to be related to the IPU which processes fine within given time frames but the VPU. Its performance decreases significantly if IPU is active and the decode times are not fitting anymore into one frame (40ms for 25fps). So we need to find a good balance for the two. |
pepedog
commented
Sep 3, 2014
|
Not in official git or repo |
|
Thanks a lot, I will try it out. Btw, what is hbi1? |
rabeeh
commented
Sep 3, 2014
|
Is the current firmware compatible with LK 3.14.x or to put it in other words: can I just replace 3.10.x with 3.14.x and it should work? |
pepedog
commented
Sep 3, 2014
|
With arch it is comparable. |
|
@pepedog Thank you very much. I have already recompiled the current kernel on Arch, so no issue at all here. XBMC also compiles fine. I just want to replace my kernel with your package and check the performance difference. |
pepedog
commented
Sep 3, 2014
|
Will be interested if you can point out any improvements @smallint |
|
Hi there, @smallint : I have sent to you a private email with additional detailed data regarding the way to configure qos for the different blocks Unfortunately, here we use IPU for 2 different use cases : first one to use DP and to display the fb on the HDMI interface, the other one to use VDI block to deinterlace our fields @cmichal2 : Apart from the CONFIG_MX6_VPU_352M option, have you changed other options compared to the default geexbox configuration ? Especially, have you changed the CONFIG_PREEMPT config ? I ask because I cannot find how the option VPU_352M would be handled and I wonder whether another option would be responsible for your improved behavior... |
cmichal2
commented
Sep 3, 2014
|
I enabled highmem, and heavily patched the au0828 tuner driver, but that's all. And those changes are the same in the two kernels I'm comparing. It is possible I imagined the improvement - I'll try to do a better comparison of the two kernels sometime in the next few days, will test Rabeeh's suggestion of setting the ipu qos register as well. |
|
Thanks for your answer |
|
Here are two plots showing the processing times of an 1080i stream. The first figure is with GPU active while the second is not (frames are not rendered). You can easily see at the first figure how the green plot (VPU decode times per frame in ms with IPU active in parallel) is mostly above 40ms while the red (VPU decode times per frame in ms without IPU active) is much below this limit. The IPU performs fine and is very well below the limit of 40 ms. This figures are for LK 3.10.30 on a CuBox-i4Pro under ArchLinux. |
|
I checked with LK 3.14 and the overall situation has not improved. The figures are almost the same ... the deinterlacing plot seems smoother now and the mean is also a bit lower. So deinterlacing improved with that kernel. |
|
Regarding LK 3.14: some CEC patches are probably missing. I cannot use my remote anymore after restarting XBMC. Only reboot deactivates it. This is never an issue with 3.10.30. |
cmichal2
commented
Sep 4, 2014
|
@smallint, do you see any difference if you set bpp=16 vs bpp=32 in uEnv.txt ? |
|
I haven't checked and my current setting is bpp=16. Do you think it would run faster? bpp=32 seems to need even more memory bandwidth than less. But anyhow, it is worth a try. |
cmichal2
commented
Sep 5, 2014
|
It looks to me like bpp=32 is worse, but I'm learning not to trust my eyes. It would be interesting to have numbers. |
cmichal2
commented
Sep 7, 2014
|
Baby step: in 3.0.52, setting CONFIG_MX6_VPU_352M does a number of things: sets a couple of voltages to 1.25V rather than 1.175 (pu_voltage, soc_voltage), also disables bus frequency scaling, changes the cpu frequency and the vpu frequency. It looks like all of these settings are now exported in /sys For example, /sys/bus/platform/drivers/imx6_busfreq/busfreq.13/enable lets you turn bus frequency scaling on/off. It looks like the voltages can be changed on the fly in /sys/bus/platfor/devices/soc.1/2000000.aips-bus/20c8000.anatop/regulator-vddpu.9/regulator/regulator.5/microvolts (and regulator-vddsoc.10/regulator/regulator.6/microvolts). The clock frequencies appear to be in /sys/kernel/debug/clk/osc/pll2_bus but I haven't figured out which is which (help!) Searching the 3.0.52 source for VPU_352M shows the things it touches - not all of which are totally transparent to me. But presumably with the knowledge of what that config option does we could just set the settings in /sys to reproduce the effect of the old CONFIG_MX6_VPU_352M configure option. There's a little information here: https://community.freescale.com/thread/309304 |
|
@cmichal2 I was thinking af something like that after checking the current sources. Since the option has no real effect the VPU frequency must be changable either on the fly or via a kernel parameter (unless disabled at all). Wolfgar told me already how to increase the memory qos parameter for the VPU and it already helped along with other code optimizations to increase the deinterlacing speed. But unfortunately we are still not able to decode, deinterlace and render a 1080i with 25 fps. I was able to show that VPU and IPU can work together within 20ms but a soon as the GPU comes into play the whole things breaks down and we are slightly above 40ms. For sure the old v4l way was much faster but comes with other drawbacks in combination with XBMC (3d, subtext, ...). This stuff is harder to solve than I thought in the beginning. ;) And we are still far away from double rate rendering for HD ... P.S. Again, LK 3.14 did not help at all to improve the speed. I tested two days all kind of combinations without break through. Btw, got anyone Gstreamer running under Arch to test playbacks? I was not able to install the required plugins ... probably haven't tried hard enough. |
cmichal2
commented
Sep 7, 2014
|
Can you let me know what you did for the memory qos parameter? |
|
@cmichal2 This is what wolfgar sent me and it worked nicely:
The gives the VPU memory read and write highest priority. I have also tested a small Canadian stream with 30 fps some time ago and it worked better. Probably the encoding was different to the German 25 fps streams. But we need a lot of tests to figure out the best settings if there are any eventually. |
|
@pepedog Can I use the package linux-imx6-cubox with LK 3.0.35 on my Cubox-i? I am currently running linux-imx6-cubox-dt with LK 3.10.30. I would like to test the older kernel. |
pepedog
commented
Sep 8, 2014
|
Yes, they all work, and don't conflict, uboot will take zimage first, if present so rename it, or remove the -dt pkg |
cmichal2
commented
Sep 9, 2014
|
I asked in the freescale forums about CONFIG_MX6_VPU_352M, and got a very helpful response. It looks like they added the patches for this feature back recently (June). I picked up three patches: |
|
Guys, to say it in wolfgars words: there is hope! @cmichael Great, I will test that asap. Can I ask you for a 1080i@30 sample preferably with fast motions (ice hockey game)? I only have a commercial to test with and its boring ;) |
rabeeh
commented
Sep 9, 2014
|
@smallint do you know for a fact if that's because overclocking the vpu or because cpu freq scaling is disabled (i.e. you are probably running at 1.2ghz)? |
|
@rabeeh No, I don't know. I have to do further tests. But I can say that I have just enabled the 352M config option in the kernel and thats it. No clue if the box is running with 1.2ghz. I can provide any information you need, just tell me. Memory benchmarks have shown that the Wandboard memory throughput is less than the Cubox-i with the latest official Arch kernel but the rendering is slower on the Cubox-i. At this stage I cannot interpret that observations. |
rabeeh
commented
Sep 9, 2014
|
i suggest then you go back to 352M patch disabled and perform the following - please notice the bogomips; it's two times the processor currently running frequency. For instance with 1.2ghz you should be seeing ~2400 bogomips changing the scaling governor to performance will force the processor to be at it's highest speed regadless of the workload |
|
The BogoMIPS I checked yesterday were 1988. On the Cubox-i instead 790 (even if xbmc is running). After putting some stress on the box they increased also up 1988. |
cmichal2
commented
Sep 9, 2014
|
@cmichal2 1min would be better because it always takes some time to start the stream and I need to test skipping as well. But I take what you have. Thanks. |
|
I checked with VPU at 352Mhz (Cubox-i, LK 3.10.30) and it is not better ... going back to 3.0.35 on that box and trying again. |
|
@cmichal2 |
|
@smallint could you diff the kernel configuration please ? |
|
The configs are https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/core/linux-imx6-cubox/config and https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/core/linux-imx6-cubox-dt/config. The diff is quite large so it is better to do it locally yourself. |
|
After some code cleanups I will push my current testing branch that you can try it yourself. Probably it is related to my configuration and the Arch configuration itself. |
|
Thanks a lot @smallint, could you also share your wandboard 3.0.35 config that works fine please ? |
cmichal2
commented
Sep 11, 2014
|
@smallint, I have a clip for you. If you send me an email, I'll email you a link. |
|
@wolfgar https://raw.githubusercontent.com/smallint/meta-jabe/master/recipes-jabe/linux/files/defconfig except that CONFIG_MX6_VPU_352M=y for the running kernel. |
rabeeh
commented
Sep 11, 2014
|
@smallint do you have a CuBox-i or HummingBoard? |
|
@rabeeh CuBox-i4Pro |
|
@cmichal2 Although I don't like that beer the clip plays smoothly on LK 3.0.35. Also my test clips render almost smoothly with triple buffering enabled. Again: there is hope! |
|
I added the branch featdeintrework for testing. |
cmichal2
commented
Sep 16, 2014
|
To provide some feedback on this. I applied the changes in the featdeintrework branch to the xbmc version used in Geexbox (only a little manual work on a few rejected hunks) and have been using it for a few days. I'm still using the 3.10 kernel so I don't expect perfection. It feels to me like it is much better. I do still see occasional stutters in what should be smooth movement, but it is relatively tolerable (certainly compared to the situation without these changes). I haven't noticed it introducing any new problems. |
|
Thank you for the feedback. Yes, it should perform better due to the better parallelization. Are you running LK 3.10 with overclocked VPU or with default config? I am still not happy with the performance with my 25fps streams. I tried lots of combinations regarding kernel and OS but only 3.0.35 with older Vivante libs works perfectly on a Wandboard (I have no Cubox-i kernel for that build). I hope we can figure that out. But I am happy that you are able to watch your streams now in a relatively tolerable manner ;) P.S. The codec logs a lot at info level. You should comment the PROFILE_BUFFERS define in the codec header to get rid of it. |
cmichal2
commented
Sep 23, 2014
|
Yes, I am using 3.10 with the VPU clock at 352MHz. Thanks for the pointer to get rid of the logs! |
|
This patch is not in any of the kernels I am using. |
cmichal2
commented
Sep 23, 2014
|
I don't think that patch is relevant actually. The only call to the one function touched by the patch is commented out in 3.10. |
piotrasd
added a commit
to piotrasd/OpenELEC.tv
that referenced
this issue
Nov 9, 2014
|
|
piotrasd |
7251e5c
|
This was referenced Nov 9, 2014
rabeeh
commented
Nov 30, 2014
|
@wolfgar / @smallint - will this be helpful - Any one has content to test with? |
fritsch
commented
Nov 30, 2014
|
Here is content for testing: |
|
@rabeeh This is @wolfgars patch for his Utilite kernel. Where did you get it from and why didn't you post a Github link but pastebin? |
Gobam
commented
Feb 13, 2015
|
Hi, |
|
The following PR fixes all "normal" 1080i contents : xbmc#6351 |
|
As a remembering, all development happens upstream now... |
fritsch
commented
Feb 13, 2015
|
@Gobam 5.0.1 did not have this rework at all ... 5.0.2 has -> still this is not a user forum |
|
We should close this issue, shouldn't we? |
Gobam
commented
Feb 16, 2015
|
Hi, Not sure if I am doing something wrong, but in my case 1080i deinterlaced is still not working. I am testing in a Cubox-i4P with OpelenELEC 5.0.2, which should include the fixes. I am attaching two small samples of 1080i video I am using: https://db.tt/hkdjYEjO : Captured from 1080i source using Hauppauge HD-PVR2 In both cases video is really choppy, it runs like in slow motion, and audio is running at normal speed, so it's not syncronized with the video. This is happening also with LiveTV, which is a critical usage scenario in my case. Both samples (and same LiveTV channels) are working flawless in both Raspberry PI B+ and Intel-ION systems, both using the same OpenELEC version (5.0.2) Please let me know if there is another Kodi version I can test with. Thanks! |
piotrasd
commented
Feb 16, 2015
|
im not sure if guys from OE apply this to build which is needed for good working deinterlace: Recommendations for client setup: enable VPU@352Mhz in kernel |
Gobam
commented
Feb 16, 2015
|
I can confirm that uEnv.txt parameters are correct: mmcargs=setenv bootargs 'boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 dmfc=3 consoleblank=0' How can be confirmed that VPU@352Mhz is enabled in the kernel? Thanks. |
piotrasd
commented
Feb 16, 2015
|
no i was checked MXC VPU(Video Processing Unit) support |
susisstrolch
commented
Feb 16, 2015
|
CONFIG_MX6_VPU_352M is a relict from older kernels. On 02/16/2015 03:14 PM, piotrasd wrote:
|
|
There are patches to make that work again with >= kernel 3.10. I have my VPU running at 352 Mhz with kernel 3.14. |
susisstrolch
commented
Feb 16, 2015
|
Do you have a patchset against current kernel? On 02/16/2015 03:30 PM, smallint wrote:
|
fritsch
commented
Feb 16, 2015
|
Deinterlacing of 1080i50 content is fine for me, without that 352 overclock and overvoltage hack. I really don't like to force that frequency fixed and don't tell users, cause that might harm and if something gets broken, all start to whine. @rabeeh did some rework with cpufreq - I think this dynamic higher clocking has more potential and is additionally more safe. @rabeeh what do you suggest from a hw point of view? Clock to 352 Mhz fixed - what are the dangers when doing so? Which patches should distributions like OpenELEC ship to not put the hw at risk? OpenELEC 5.0.2 ships the latest code done by @smallint but missing the RenderCapture code @wolfgar finished some days ago. @piotrasd you are always the first whiner in such threads - why don't you just provide some builds for testing with the 352 Mhz patches in, the RenderCapture work and so on? It seems you have too much time. |
piotrasd
commented
Feb 16, 2015
|
@fritsch sorry i just checked recomended stuff for client setup which was in PR and only show difrents from openelec confs |
|
@fritsch, does OpenELEC 5.0.2 work for your streams as good as the test build with Kodi master you did? |
fritsch
commented
Feb 16, 2015
|
@smallint: It works the same as kodi master. I only ported the patches that were needed to make it work correctly, see: https://github.com/fritsch/xbmc/commits/imx-rebase-pr It was integrated into OpenELEC master already: https://github.com/OpenELEC/OpenELEC.tv/tree/master/projects/imx6/patches/kodi 5.0.x does not have this code. |
piotrasd
commented
Feb 16, 2015
|
@fritsch big thanks and sorry i caused frustrations in you ;( |
|
I have to say I have run several imx6Q based product (utilite, cuboxi, tbs2910) with VPU@352Mhz for several months without major troubles (it was my own default 3.0.35 kernel config and has become mine with the mentioned patches for 3.14) |
fritsch
commented
Feb 16, 2015
|
Of course, no problem, I leave this thread open so that @rabeeh can come and express his point of view regarding VPU frequency for cuboxi products but as soon as this exchange is finished I will close it and link to the current xbmc#6351 that fixes this issue... |
fritsch
commented
Feb 16, 2015
|
Here is a build with the 352Mhz patch and the rendercapture code include and diverse fixups: https://dl.dropboxusercontent.com/u/55728161/OpenELEC-imx6.arm-devel-20150216220652-r20288-g20bad1e.tar Everything is build from: https://github.com/fritsch/OpenELEC.tv/commits/imx-master Edit: Handle with care - I don't want to take any guarantees with the 352 Mhz fix. |
cmichal2
commented
Feb 17, 2015
|
I'll be interested too in hearing what rabeeh has to say about the VPU frequency, but to add a few bits more data: I've been running a cubox-i4 with the vpu frequency at 352MHz for ~ 6 months with no issues. I also did some measurements of power consumption and found only a tiny difference with and without the patch (details in xbmc#5805). |
rabeeh
commented
Feb 17, 2015
|
As @wolfgar mentioned; vpu@352mhz can run without issues at all. The only bad impact it has is that it removes the lower processor frequency from the frequency scaling list; so when the processors are at idle they can't go to it's lower frequency state. |




Gobam commentedJun 5, 2014
Interlaced HD videos (1080i) are not properly processed using the existing deinterlace options in XBMC GUI. All the existing options are causing high frame drops/skips. Same videos are working properly in other platofrms (Raspberry Pi, ION). Thanks!