intel / libyami

Yet Another Media Infrastructure. it is core part of media codec with hardware acceleration, it is yummy to your video experience on Linux like platform.
Apache License 2.0
146 stars 106 forks source link

osd.cl not working #870

Closed neon12345 closed 5 years ago

neon12345 commented 5 years ago

With a recent kernel is is possible to use NV12 on a target framebuffer with intel graphics. Since this is a requirement for osd, I was now able to test it.

The osd.cl gives compiler errors because __write_only images are used with read_imagef. Changing the images to the read only ones make it possible to compile but the result is unexpected.

I get wrong colors and some colors are working like a mask showing the background instead of the osd. Would be nice if someone can confirm osd.cl is working as desired or provide a working version.

xuguangxin commented 5 years ago

@neon12345 , could you provide some description for your env? so we can reproduce the issue on our side? thanks

neon12345 commented 5 years ago

Debian stretch

Linux mylap 4.18.0-0.bpo.1-amd64 #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) x86_64 GNU/Linux


Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 158
Model name: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
Stepping: 9
CPU MHz: 800.039
CPU max MHz: 3500,0000
CPU min MHz: 800,0000
BogoMIPS: 4992.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
NUMA node0 CPU(s): 0-3
Flags: ..


libyami 1.3.1 libva 2.3.0 intel-vaapi-driver 2.1.0

xuguangxin commented 5 years ago

@neon12345 , what's is the ocl env and version you used? with your beignet? https://www.freedesktop.org/wiki/Software/Beignet

neon12345 commented 5 years ago

Debian defaults:

beignet 1.3.0-4
beignet-dev:amd64 1.3.0-4 beignet-opencl-icd:amd64 1.3.0-4 ocl-icd-dev:amd64 2.2.11-1
ocl-icd-libopencl1:amd64 2.2.11-1
ocl-icd-opencl-dev:amd64 2.2.11-1 opencl-c-headers 2.1-1
opencl-clhpp-headers 2.0.10-1 opencl-headers 2.1-1

neon12345 commented 5 years ago

I have the same issue with Ubuntu 18.04.1 default installation and another machine.

xuguangxin commented 5 years ago

it's wired, i have no this issue. My machine is

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic

neon12345 commented 5 years ago

Do you have a small example I can run?

xuguangxin commented 5 years ago

you can check blend.cpp in libyami-utils/examples. It will enabled by --enable-oclblender

neon12345 commented 5 years ago

I use a different setup with no windows.

VADisplay vadisplay = vaGetDisplayDRM(drm_fd); cr.pixel_format = DRM_FORMAT_NV12; ret = ioctl(drm_fd, DRM_IOCTL_MODE_ADDFB2, &cr);

I will test libyami-utils and see if it works. Then the problem is perhaps with this setup that only works with a recent kernel.

neon12345 commented 5 years ago

I managed to compile (some smart pointers cannot be auto converted to bool) and run (hit an assertion so I need to disabled it) the blend example but it also looks strange. What is the desired output? I get some lines of numbers and letters moving up and down. Colors are only alternating white and grey tones with some additional flickering.

neon12345 commented 5 years ago

The other examples with blend seem to work fine.

xuguangxin commented 5 years ago

it's related to the background if the background is black, the font will be white, if the background is white, the font will be black.

neon12345 commented 5 years ago

When I adjust the blend example in bool drawSurfaceRGBA(SharedPtr& frame, bool text = false)

to fixed colors with

        uint8_t r = 0;
        uint8_t g = 255;
        uint8_t b = 0;
        uint8_t a = 255;

I see nothing. With

        uint8_t r = 255;
        uint8_t g = 0;
        uint8_t b = 0;
        uint8_t a = 255; 

I see red.

Is this the desired behaviour and can you confirn?

xuguangxin commented 5 years ago

Not sure, could you try other color? thanks

From: neon12345 [mailto:notifications@github.com] Sent: Wednesday, December 5, 2018 2:40 PM To: intel/libyami libyami@noreply.github.com Cc: Xu, Guangxin guangxin.xu@intel.com; Comment comment@noreply.github.com Subject: Re: [intel/libyami] osd.cl not working (#870)

When I adjust the blend example in bool drawSurfaceRGBA(SharedPtr& frame, bool text = false)

to fixed colors with

    uint8_t r = 0;

    uint8_t g = 255;

    uint8_t b = 0;

    uint8_t a = 255;

I see nothing. With

    uint8_t r = 255;

    uint8_t g = 0;

    uint8_t b = 0;

    uint8_t a = 255;

I see red.

Is this the desired behaviour and can you confirn?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intel/libyami/issues/870#issuecomment-444376392, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGW9GkFlmZDMMMMmpUC1WwVHJt7-0wtsks5u12o-gaJpZM4ZBysj.

neon12345 commented 5 years ago

It is not so much about colors. If you use the blend example with -b then you see 3 colored bars which are now of the color set in drawSurfaceRGBA. The bars are overlaying the video with the red color but with the green color there are no bars and the video is fully visible.

xuguangxin commented 5 years ago

It because the sample application’s rgb order not machine the filters.

Please use this https://github.com/intel/libyami-utils/pull/137 thanks

From: neon12345 [mailto:notifications@github.com] Sent: Wednesday, December 5, 2018 2:56 PM To: intel/libyami libyami@noreply.github.com Cc: Xu, Guangxin guangxin.xu@intel.com; Comment comment@noreply.github.com Subject: Re: [intel/libyami] osd.cl not working (#870)

It is not so much about colors. If you use the blend example with -b then you see 3 colored bars which are now of the color set in drawSurfaceRGBA. The bars are overlaying the video with the red color but with the green color there are no bars and the video is fully visible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/intel/libyami/issues/870#issuecomment-444379416, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGW9GojNL4Vxo3ecMa7LSRCnOPQN4YrXks5u123vgaJpZM4ZBysj.

neon12345 commented 5 years ago

It works as expected now, thanks!

xuguangxin commented 5 years ago

Glad to hear this. thanks for report the issue.