• 1
  • 16
  • 17
  • 18(current)
  • 19
  • 20
  • 23
hardware acceleration on allwinner A10/A20 with vdpau and OpenGLES (zero-copy)
(2017-08-08, 23:37)matrzh Wrote: @mosterta. Another quick question: Are you using the official youtube plugin and does it work?
While I was still struggling with the videos, I could always navigate within the plugin but the crash occurred as soon as I clicked on a video.
When I looked into the compilation again, starting about 2 weeks ago, the plugin threw error messages which I have just posted here:
https://forum.kodi.tv/showthread.php?tid...0&page=171
When importing the python modules directly in a python console, I do not get any errors

What I may want to add: some googling has shown that these EOFErrors may occur if several instances of python concurrently try to access the same pyc file (in Python 2.7). Not sure how it exactly works, but I could well imagine that this is the case.

I do use the official youtube plugin and I don't have any issues with it. I do not see the error. I have python version 2.7.12. I only use python modules that come with the distribution, did you install any (incompatible/parallel) modules with pip?
Have you had a look to the offending python file? maybe the file is corrupted, as you have seen with the shader files.
Reply
Hi Mosterta,
thanks for the feedback. I did not do anything special with my python ditribution, I just do regular system updates and upgrades with apt-get (Debian). I did look at the imported files also to see if they are corrupted, but it does not look like it. Also, if I open a python console and type the import commands where the EOF error occurs, I do not receive any errors.
I will just try and re-install the python modules and/or delete the youtube setup.exe file.

**Solved**
I re-installed (and updated) python. It worked afterwards. I am now also at 2.7.13, I think. For some reason, the update was held back by the apt management
Reply
(2017-08-09, 16:51)matrzh Wrote: Hi Mosterta,
thanks for the feedback. I did not do anything special with my python ditribution, I just do regular system updates and upgrades with apt-get (Debian). I did look at the imported files also to see if they are corrupted, but it does not look like it. Also, if I open a python console and type the import commands where the EOF error occurs, I do not receive any errors.
I will just try and re-install the python modules and/or delete the youtube setup.exe file.

youtube setup.exeHuh are we both talking about the allwinner environment?
Reply
Hi Mosterta
Good news!!
Your latest commit fixed thumbnails generation
And libcedarjpeg is working now , I don't know why it was hanging the system maybe I was using incorrect version of linump or so , of course with few modifications to make it compile.
However it has a problem which is incorrect colors see the photos:
This how should blue look like in nasa logo
https://drive.google.com/file/d/0BzQVVX8...Rienc/view

And this how cedarjpeg displays it
https://drive.google.com/file/d/0BzQVVX8...JLeGc/view
Reply
(2017-08-09, 21:18)xchetah Wrote: Hi Mosterta
Good news!!
Your latest commit fixed thumbnails generation
And libcedarjpeg is working now , I don't know why it was hanging the system maybe I was using incorrect version of linump or so , of course with few modifications to make it compile.
However it has a problem which is incorrect colors see the photos:
This how should blue look like in nasa logo
https://drive.google.com/file/d/0BzQVVX8...Rienc/view

And this how cedarjpeg displays it
https://drive.google.com/file/d/0BzQVVX8...JLeGc/view

please check the latest libcedarjpeg code. I did a fix, hopefully color is better now
Reply
Sad 
Quote:please check the latest libcedarjpeg code. I did a fix, hopefully color is better now
Unfortunately there was no change.
Does libcedarjpeg check for screen color depth ( 16bit ,32bit )?
I think I saw somewhere in the log the depth detected is 16
EDIT according to source code :
Code:
if (jpeg->cedar_engine_version < 0x1680)
    {
      status = vedisp_convertMb2ARGB(jpeg, width, height, color, jpeg->luma_output,
                  jpeg->chroma_output, jpeg->decodedPic);
    }
    if(status == 0)
    {
      void *y = malloc(cedarv_getSize(jpeg->luma_output));
      void *c = malloc(cedarv_getSize(jpeg->chroma_output));
      if(y && c)
      {
        cedarv_sw_convertMb32420ToNv21Y(cedarv_getPointer(jpeg->luma_output), y, width, height);
cedarv_sw_convertMb32420ToNv21C(cedarv_getPointer(jpeg->chroma_output), c, width, height);
vedisp_convertMb2ARGB returns 1 , which means the followed code will not run i changed the code to
Code:
if(status == 1)
    {
      void *y = malloc(cedarv_getSize(jpeg->luma_output));
      void *c = malloc(cedarv_getSize(jpeg->chroma_output));
      if(y && c)
      {
        cedarv_sw_convertMb32420ToNv21Y(cedarv_getPointer(jpeg->luma_output), y, width, height);
cedarv_sw_convertMb32420ToNv21C(cedarv_getPointer(jpeg->chroma_output), c, width, height);
now cedarv_sw_convertMb32420ToNv21C gives segmentation fault Confused
EDIT: I'm debugging the issue seems A13 specific
Reply
(2017-08-10, 00:04)xchetah Wrote:
Quote:please check the latest libcedarjpeg code. I did a fix, hopefully color is better now
Unfortunately there was no change.
Does libcedarjpeg check for screen color depth ( 16bit ,32bit )?
I think I saw somewhere in the log the depth detected is 16
EDIT according to source code :
Code:
if (jpeg->cedar_engine_version < 0x1680)
    {
      status = vedisp_convertMb2ARGB(jpeg, width, height, color, jpeg->luma_output,
                  jpeg->chroma_output, jpeg->decodedPic);
    }
    if(status == 0)
    {
      void *y = malloc(cedarv_getSize(jpeg->luma_output));
      void *c = malloc(cedarv_getSize(jpeg->chroma_output));
      if(y && c)
      {
        cedarv_sw_convertMb32420ToNv21Y(cedarv_getPointer(jpeg->luma_output), y, width, height);
cedarv_sw_convertMb32420ToNv21C(cedarv_getPointer(jpeg->chroma_output), c, width, height);
vedisp_convertMb2ARGB returns 1 , which means the followed code will not run i changed the code to
Code:
if(status == 1)
    {
      void *y = malloc(cedarv_getSize(jpeg->luma_output));
      void *c = malloc(cedarv_getSize(jpeg->chroma_output));
      if(y && c)
      {
        cedarv_sw_convertMb32420ToNv21Y(cedarv_getPointer(jpeg->luma_output), y, width, height);
cedarv_sw_convertMb32420ToNv21C(cedarv_getPointer(jpeg->chroma_output), c, width, height);
now cedarv_sw_convertMb32420ToNv21C gives segmentation fault Confused
EDIT: I'm debugging the issue seems A13 specific
I have to check more in detail. Currently it is unclear for me, whether the jpeg decoding process has issues with colors too light, or if that happens later when the data is converted from YUV to RGB.
The code above is ok, on A10/A13/A20 a hardware conversion from YUV to RGB is done, while on H3 a conversion in software is used. If you change the code as you did, you do the conversion twice on A10/A20.

I guess the fix can take a while. If you want normal colors without waiting, you have to disable hardware jpeg decoding, e.g. recompile without libcedarjpeg.
Reply
Hi Mosterta
About the colors any image looks like it's greyscale with weak colors.
Well I used to run kodi without cedarjpeg , but it's just that I want your implementation to fully support A13,
I think the reverse engineering effort is not mature enough, sometimes after playing youtube videos all jpegs decoded by cedar becomes pixely and greenish !
After a few debugging about colors , I concluded that the problem is when using yuv422 format,
I converted the nasa logo to yuv420 and it displayed fine !
Well another strange behavior is after viewing the yuv420, then loading the yuv422 it kinda displays correct colors but with strange looking image
Reply
@mosterta

You made great work! Finally i compile kodi :-) i guess with vdpau. Thank you for help, now the real fun begins. Propably i will need much more help in the near future.

First of all, how can i install any plugin to kodi? Im looking for tvheadend plugin.
Reply
(2017-08-10, 23:44)xchetah Wrote: Hi Mosterta
About the colors any image looks like it's greyscale with weak colors.
Well I used to run kodi without cedarjpeg , but it's just that I want your implementation to fully support A13,
I think the reverse engineering effort is not mature enough, sometimes after playing youtube videos all jpegs decoded by cedar becomes pixely and greenish !
After a few debugging about colors , I concluded that the problem is when using yuv422 format,
I converted the nasa logo to yuv420 and it displayed fine !
Well another strange behavior is after viewing the yuv420, then loading the yuv422 it kinda displays correct colors but with strange looking image

just as an comment: There are some issues with the lib on A10 as well, I do see the pixely and greenish pictures after watching a movie. The issue is that jpeg and video decoding use the same hardware and if the access to the hardware is intermixed there can be issues. I haven't had the time to investigate this issue more in detail, since in my case it is also not that often. I had added some code to prevent parallel acces to the HW, but there may be some holes in the code.
Thanks regarding the hint with the yuv422 decoding. I can have a look, but the issue is not obvious, but maye something is missing in the reverse engineered code.
What do you mean by "strange looking image"?
Reply
Can anyone tell me how to properly set "neon" flag to enable those SoC instructions while compile? I got message while compilation that my build-env should be build with neon flag when i --enable-optimizaton while kodi configuration

I tried compile libcedarjpeg but errors occurs

Code:
cbkodi ~/kodi_stuff/libcedarjpeg-toms81 # make
CC main.c
In file included from jpeg.h:26:0,
                 from main.c:43:
../libvdpau-sunxi/EGL/eglplatform_fb.h:95:36: error: conflicting types for ‘EGLNativeWindowType’
typedef struct mali_native_window *EGLNativeWindowType;
                                    ^
In file included from ../libvdpau-sunxi/EGL/egl.h:36:0,
                 from cedarJpegLib.h:4,
                 from main.c:41:
../libvdpau-sunxi/EGL/eglplatform.h:42:26: note: previous declaration of ‘EGLNativeWindowType’ was here
typedef NativeWindowType EGLNativeWindowType;
                          ^
In file included from jpeg.h:26:0,
                 from main.c:43:
../libvdpau-sunxi/EGL/eglplatform_fb.h:104:30: error: conflicting types for ‘NativeWindowType’
typedef EGLNativeWindowType  NativeWindowType;
                              ^
In file included from ../libvdpau-sunxi/EGL/egl.h:36:0,
                 from cedarJpegLib.h:4,
                 from main.c:41:
../libvdpau-sunxi/EGL/eglplatform.h:31:23: note: previous declaration of ‘NativeWindowType’ was here
typedef fbdev_window* NativeWindowType;
                       ^
main.c: In function ‘decode_jpeg’:
main.c:150:62: warning: unused parameter ‘width’ [-Wunused-parameter]
static void decode_jpeg(struct cedarJpeg_handle *handle, int width, int height)
                                                              ^
main.c:150:73: warning: unused parameter ‘height’ [-Wunused-parameter]
static void decode_jpeg(struct cedarJpeg_handle *handle, int width, int height)
                                                                         ^
main.c: At top level:
main.c:512:12: warning: ‘TestGLError’ defined but not used [-Wunused-function]
static int TestGLError(const char* pszLocation){
            ^
make: *** [Makefile:52: main.o] Błąd 1

which version of libcedarjpeg should i compile?
Reply
Ok here's how it goes:
-opening the orignal image (yuv422) displays like this:
https://drive.google.com/file/d/0BzQVVX8...p=drivesdk
-then opening the yuv420 image displays like this ( perfectly fine) :
https://drive.google.com/file/d/0BzQVVX8...p=drivesdk
-now reopening the original image (yuv420) displays like this (strange looking):
https://drive.google.com/file/d/0BzQVVX8...p=drivesdk

Anyway I think I'll drop libcedarjpeg for now and stop debugging,
Thank you so much for support.
P.S be prepared for another questions after a while as I will try your implementation on another tablet (A23),
Also I might send you code fixes later.
Reply
does anyone know how to fix any of following issues?

Code:
cbkodi ~ # cat kodi.error
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
PICTURE::LoadImageFromMemory: Unable to determine image type.PICTURE::LoadImageFromMemory: Unable to decode image. Error:Decode: Unknown or wrong format
libpng warning: iCCP: known incorrect sRGB profile
shared memfd open() failed: Function not implemented
Reply
(2017-08-12, 15:54)pdrobek Wrote: does anyone know how to fix any of following issues?

Code:
cbkodi ~ # cat kodi.error
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
PICTURE::LoadImageFromMemory: Unable to determine image type.PICTURE::LoadImageFromMemory: Unable to decode image. Error:Decode: Unknown or wrong format
libpng warning: iCCP: known incorrect sRGB profile
shared memfd open() failed: Function not implemented

you have to
export VDPAU_DRIVER=sunxi
before starting kodi
Reply
(2017-08-12, 15:54)pdrobek Wrote: does anyone know how to fix any of following issues?

Code:
cbkodi ~ # cat kodi.error
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
PICTURE::LoadImageFromMemory: Unable to determine image type.PICTURE::LoadImageFromMemory: Unable to decode image. Error:Decode: Unknown or wrong format
libpng warning: iCCP: known incorrect sRGB profile
shared memfd open() failed: Function not implemented
For the first error type
Code:
export VDPAU_DRIVER=sunxi
Before running kodi, and to make it permenant on every boot add VDPAU_DRIVER=sunxi to /etc/environment
Reply
  • 1
  • 16
  • 17
  • 18(current)
  • 19
  • 20
  • 23

Logout Mark Read Team Forum Stats Members Help
hardware acceleration on allwinner A10/A20 with vdpau and OpenGLES (zero-copy)2