fb alpha channel vs vpu

Post Reply
extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

fb alpha channel vs vpu

Post by extphy »

I've noticed that EGL works differently with VPU (HW) video decoding for C1 and C2, i.e. I can fill screen using EGL using alpha channel and playing video using HW decoding will result in semi-transparent overlay over video in this case. But exactly the same code wouldn't work the same way in case of C2 (both versions use mali-fbdev). For C2 case, alpha channel doesn't appear as transparent, it is always drawing without transparency over video, i.e. no blending or something like that. May it be some settings dependent feature?

User avatar
odroid
Site Admin
Posts: 37555
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1846 times
Been thanked: 1160 times
Contact:

Re: fb alpha channel vs vpu

Post by odroid »

Did you use @crashoverride's c2play for HW accelerated video decoder?
viewtopic.php?f=136&t=23143

extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Re: fb alpha channel vs vpu

Post by extphy »

@odroid, I wasn't able to built c2play for C2 (I use bulidroot fbdev version), but I almost completely repeated its approach in my app, I would try to build small sample. I run the same amvdec / egl application on C1 and C2, but see different behaviour -- C2 HW decoded video isn't visible under transparent egl cleared fbdev window:

Code: Select all

 void
 HWSurface::clearDisplay()
 {
   FILE_LOG(logINFO) << "hwsurface: clearDisplay";

   glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   eglSwapBuffers(esContext_.eglDisplay, esContext_.eglSurface);
 }
 
If I disable fb, the video becomes visible:

Code: Select all

$ echo 1 > /sys/class/graphics/fb0/blank

extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Re: fb alpha channel vs vpu

Post by extphy »

I tried to compare /sys/class/vfm/map for C1:

Code: Select all

default_osd { osd(0) amvideo4osd}
default { decoder(0) ppmgr(0) amvideo}
default_amlvideo2 { vdin1(0) amlvideo2}

provider list:

receiver list:
   ppmgr
   amlvideo
   ionvideo
   deinterlace
   amvideo
   amvideo4osd
Vs C2:

Code: Select all

default_osd { osd(0) amvideo4osd}
default { decoder(0) ppmgr(0) deinterlace(0) amvideo}

provider list:

receiver list:
   amvideo
   amvideo4osd
   deinterlace
   ppmgr
   ionvideo
   amlvideo
Setting C2 /sys/class/vfm/map setttings equal to C1 results in no video output from decoder (no errors during decoding though).

User avatar
odroid
Site Admin
Posts: 37555
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1846 times
Been thanked: 1160 times
Contact:

Re: fb alpha channel vs vpu

Post by odroid »

I have very limited knowledge about the alpha transparent layer.
Can you try it on Ubuntu 20.04 image to narrow down root causes?
I hope other users(especially @crashoverride) can help you too.

extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Re: fb alpha channel vs vpu

Post by extphy »

@odroid, thanks, I would try Ubuntu 20.04 too, probably would get some clue

extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Re: fb alpha channel vs vpu

Post by extphy »

Was able to rebuild c2play (it has some incompatibilities with latest ffmpeg lib), it plays video well, would check what really happens there.

crashoverride
Posts: 5384
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 458 times
Contact:

Re: fb alpha channel vs vpu

Post by crashoverride »

Make sure you are setting a video mode that has transparency:
https://github.com/OtherCrashOverride/c ... pp#L46-L65

Code: Select all

	info.transp.offset = 24;
	info.transp.length = 8;
These users thanked the author crashoverride for the post:
odroid (Thu May 27, 2021 9:29 am)

extphy
Posts: 93
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 1 time
Contact:

Re: fb alpha channel vs vpu

Post by extphy »

@crashoverride, yes, seems that it did the trick, thank you!

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest