Hardware overlays
Pages: 1 2
Jeffrey Lee (213) 6048 posts |
Last night I managed to check in the first set of changes to add hardware video overlay support to the OS: A mostly-working OMAPVideo (for OMAP3 & OMAP4 machines), and a basic version of the VideoOverlay module (“Z-Order” overlays should work OK but handling of “basic” overlays is still rudimentary). For OS developers:
For app developers:
For everyone else:
Other stuff: Now that OMAPVideo actually enables alpha-blending when alpha-channel screen modes are in use, it’s clear that there are some deficiencies in the OS that need to be tackled for things to work nicely:
Next steps for me will probably be to add overlay support to BCMVideo, which I’m hoping won’t be too painful, and should help shake out any remaining issues with the GraphicsV API. Then I should be able to start work on tidying up the loose ends with OMAPVideo/VideoOverlay, while working out whether anything useful can be done for IMX6. Iyonix support should also appear at some point as well, thanks to Adrian Lees making me realise that there’s some unused code for YUV overlays inherited from the haiku NVidia driver sources. |
nemo (145) 2546 posts |
As I’m sure you’re aware, the Wimp is far from the only system to use EOR while drawing. It will have to work sensibly everywhere. ColourTrans certainly needs to become alpha aware. This will need a new flag. I wonder whether the existing ‘background is transparent’ bit is enough to switch between replacing the screen alpha and inverse multiplying it. |
Chris Gransden (337) 1207 posts |
Is overlay support fully enabled on BCMVideo. The overlay enabled version of Kino works OK on BBxM and Pandaboard ES but gives a green screen with parts of the video showing or duplicated on the Raspberry PI. Fullscreen errors as the LARGB/BGR modes also don’t seem to exist. The Basic test program works OK though. |
Jeffrey Lee (213) 6048 posts |
Yes. What does the KinoAmp film info window show? I think there are some combinations of format & dimensions which aren’t dealt with correctly yet. Also make sure cropping / pan & scan is disabled (I haven’t tested it, and I think it needs fixing).
I’ve only been testing KinoAmp with the Multitasking mode – possibly the other modes are a bit broken (and VideoOverlay currently only supports using overlays when in the Wimp). For LARGB/BGR modes to be available you need to explicitly set framebuffer_ignore_alpha to 0 in config.txt (it defaults to 1, with no way of overriding it at runtime via the mailbox interface). |
Chris Gransden (337) 1207 posts |
That was the bit I was missing. Thanks. I’ve found switching to 64K colours displays the video OK. It’s a Bluray converted to 1080p mpg2. Switching back to 16M colours while it’s playing and then playing the film again in 16M colours seems to work. |
Jeffrey Lee (213) 6048 posts |
OK, that sounds like the GPU might be a bit low on memory or is having trouble due to fragmentation. I’ll make a note to do some testing for that kind of situation. |
André Timmermans (100) 655 posts |
I am integrating Overlays into my development version of KinoAmp. I managed to make it work in full-screen mode by creating a transparent window on top of the screen. Here are some results on my PI3: I also noticed the green tint issue. For some files once you change mode once it nevers occurs again, for some othe files the issue is permanant. |
André Timmermans (100) 655 posts |
Some more work to do: For the later, I presume the overlays do not offer an option to control the YUV to RGB conversion? |
André Timmermans (100) 655 posts |
By the way once I start using overlays I get ZeroPains (whcih continue to occur even after quitting KinoAmp): Time: Thu Aug 9 22:41:39 2018 R0 = 00000000 R1 = 88000211 R2 = 00000000 R3 = 00010017 fc224e48 : 0000001c : ANDEQ R0,R0,R12,LSL R0 R15 = fc224e90 = BCMVideo +1880 SVC stack: R14_usr = 00031520 = +29520 in application memory = player_redrawLastFrame +1ac |
Jeffrey Lee (213) 6048 posts |
Cool – feel free to use any of the changes in the sources I posted a link to above. Also, I’ve been keeping the ModeVars doc up to date with the list of YUV formats that are supported by VideoOverlay / drivers. The Pi supports some RGB formats, YV12, YV16 and NV12. YV12 and YV16 look like they’d be good fits for KinoAmp (you might even be able to decode directly into the overlay buffers), but those KinoAmp sources don’t support them. Out of the formats that KinoAmp does support, YUY2 is supported by OMAP3/4/5, and NV12 is supported by OMAP4/5 (and Pi). I guess it would be useful if I added that info to a doc, or the wiki, so that people testing overlay support know what to expect on each platform.
I’ll see if I can add proper support for full-screen / non-desktop use in the next VideoOverlay version (it’ll mostly be the same API, you just won’t attach the overlay to a window). There is one noteworthy VideoOverlay bug that I’m aware of, which is that “basic” overlays remain visible when their window is iconised. I thought iconised windows would get closed, but it turns out they just get moved to the back of the window stack, behind the pinboard. So I need to fix VideoOverlay to detect when windows/overlays are fully obscured so that it can auto-hide the overlay (I’ll probably leave use this logic for both overlay types, since it’ll help on memory bandwidth). |
Jeffrey Lee (213) 6048 posts |
That’s a VideoOverlay bug I’ll be fixing. - handle brightness, contrast, color options in overlay. Some hardware does – I’ll take a closer look at what KinoAmp needs and see if there’s a way to support it.
OK, I’ll look into it. |
André Timmermans (100) 655 posts |
Here is a test version of KinoAmp I still have to had the OSD and image control (brightness, …) for overlays but the rest works. Not that by using triple buffering to avoid tearing performance dropeed somewhat (instead of 60 fps with a 25% wait/free time I dropped to 56 fps. Another issue GraphicsV do mention new mode variable 12 for specifying the numbe of required banks. |
Jeffrey Lee (213) 6048 posts |
I’ll make a note to look into it (I’ve got a list of potential performance improvements to make to the overlay support in the OS)
Yes, 13 is the correct number. I’ll correct the GraphicsV docs. |
Jeffrey Lee (213) 6048 posts |
Now in CVS:
I had a look at the green screen/corruption issue – it looks like it could be a firmware bug when it runs low on memory. I’ll try and investigate more to rule out the OS causing the corruption. A couple more notes for the Pi driver:
|
André Timmermans (100) 655 posts |
Here is a new test version of KinoAmp I have now implemented all the types of overlays listed in the docs for 4:2:0, 4:2:2, 4:4:4 and monochrome (Y only). I also could verify that all [T|A][RGB][BGR] 32bit overlays worked, but encountered some curious results for the 16bit (64K colours). Only RGB16 is supported as screen-mode on the PI3, but for some reason both RGB16 and BGR16 are accepted as overlays and curiously the RGB16 shows weird colours. |
Jeffrey Lee (213) 6048 posts |
OK, looks like that’s another bug in BCMVideo – RGB16 should be the only supported 16bpp overlay format, but the driver isn’t checking the requested format correctly. |
Jeffrey Lee (213) 6048 posts |
Tomorrow’s Pi ROM should contain fixes for the green screen/corruption, and the phantom 16bpp overlay formats. |
David Pitt (3386) 1248 posts |
This fixes the flickering sidebars reported here. Tested with OS5.24 and OS5.25 (14-Aug-18) on the RPi3B+ |
André Timmermans (100) 655 posts |
I confirm that the green screen/corruption disappeared as well as the phantom overlay format. Regarding the RGB16 overlay colour issues it is my fault. I defined a seperate colour conversion to TBGR32 for sprite saving when overlays are in use since for most overlay the image remain in YUV like colorspace and sprites must be saved in an RGB format. The problem is that I forgot that both first fill the same conversion table so the overlay got 8-bit values from the conversion table instead of 5-bit one. Here is a new test version of KinoAmp |
André Timmermans (100) 655 posts |
Final (?) test version of KinoAmp . This version adds brightness, contrast and colour control and OSD visibility on the YUV overlays (slows KinoAmp a bit though). Can someone confirm that UYVY and YUY2 overlays work for all type of MPEG: YUV420, YUV422 and Y444? Please also check the monochrome option. |
Jeffrey Lee (213) 6048 posts |
YUV420 & YUV422 seem to be working fine with UYVY & YUY2 overlays on OMAP3. However, I’m having trouble convincing ffmpeg to produce a YUV444 MPEG, and I can’t find any test clips online. Do you have any clips you can share? |
André Timmermans (100) 655 posts |
I only have stream444.mpg . |
Jeffrey Lee (213) 6048 posts |
Thanks – that clip plays fine too. Thanks for tidying up my code! |
André Timmermans (100) 655 posts |
Removed post, wrong diagnose on my part |
André Timmermans (100) 655 posts |
While playing around with KinoAmp on the PI3, I noticed a few display issues with overlays of type YV16 and NV12 (YV12 seems fine). When I size down the image of HD videos, at some point the display turns entirely black. I increase the size again and the screen reappears. For smaller videos that does not seem to cause an issue. When I display a KinoAmp window with “Lock size to window” disabled and scroll within the window, the chroma becomes de-synchronized. It occurs when I scroll down for YV16 and when I scroll to the right for NV12. |
Pages: 1 2