RGA 16bit color format has changed

Post Reply
crashoverride
Posts: 5658
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 534 times
Contact:

RGA 16bit color format has changed

Post by crashoverride »

This is more informative than an issue. The RGA 16bit color format has changed endian. Programs using RK_FORMAT_RGB_565 will now need to use RK_FORMAT_BGR_565 and vice versa. This will affect anyone porting code from GO-Advance/Super targeting the RGA accelerator.
These users thanked the author crashoverride for the post (total 4):
tobetter (Mon Apr 11, 2022 8:23 am) • odroid (Mon Apr 11, 2022 9:16 am) • Luke.go (Mon Apr 11, 2022 9:17 am) • AreaScout (Sun Apr 17, 2022 6:08 pm)

AreaScout
Posts: 1793
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: german, english
ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
N1, Go, VU5A, Show2, CloudShell2,
H2, N2, VU7A, VuShell, Go2, C4
Has thanked: 120 times
Been thanked: 370 times
Contact:

Re: RGA 16bit color format has changed

Post by AreaScout »

    crashoverride wrote:
    Mon Apr 11, 2022 8:18 am
    This is more informative than an issue. The RGA 16bit color format has changed endian. Programs using RK_FORMAT_RGB_565 will now need to use RK_FORMAT_BGR_565 and vice versa. This will affect anyone porting code from GO-Advance/Super targeting the RGA accelerator.
    Hi crash ! :ugeek: and any other who is reading this, help is demanded !

    I can't get lib RGA to work on my M1, I only get a green screen, same samples work on GoA namely https://github.com/JeffyCN/FFmpeg (which uses RGA color blit for anything other than AV_PIX_FMT_DRM_PRIME) and https://github.com/AreaScout/moonlight-embedded (which uses RGA to rotate the Display on GoA), do you have any clue why it fails ? Does it fail because of different frame high we have to use for the buffers, like we had on GoA with SDL2 ?

    Also I was about to build Kodi because of the vast storage capabilities the M1 has, Kodi runs we have TrueHD, Dolby Digital and what not via HDMI Audio Passthrough visible and available inside the menus, the problem is that after some frames the playback stucks when using drmPrime renderer and one video get's a rotated screen !!?? when using DirectToPlane render method, it's ok with EGL drmPrime

    P.S.: I can share my patches (needed do not leak memory) and build instructions to reproduce the error quickly if you need ;)

    RG

    AreaScout
    Posts: 1793
    Joined: Sun Jul 07, 2013 3:05 am
    languages_spoken: german, english
    ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
    N1, Go, VU5A, Show2, CloudShell2,
    H2, N2, VU7A, VuShell, Go2, C4
    Has thanked: 120 times
    Been thanked: 370 times
    Contact:

    Re: RGA 16bit color format has changed

    Post by AreaScout »

      To sum up what I have found out so far
      • librga RGA (Raster Graphic Acceleration Unit) blit not correctly working, I can't play videos with ffplay from JeffyCN github, this works on different RK Platforms like GoA -> only green and messed up screen, color conversion or stride size wrong ?
      • Kodi starts to play only the first few frames and then the video get's stuck and only audio continues to play, it's not a libmpp problem, it's not a DRM problem, I think it's a FFmpeg or Kodi problem not closing a prime file handle ??
      Here is a prove from my command line player tool that the VPU works correct with MPP and drmPrime handle, the VPU->VOP playback method reaches 366 fps on video with HEVC codec, which I think is by far faster like the N1, Go2 and GoA



      Regards,
      Daniel

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

      Re: RGA 16bit color format has changed

      Post by crashoverride »

      AreaScout wrote:
      Mon Apr 18, 2022 1:13 am
      librga RGA (Raster Graphic Acceleration Unit) blit not correctly working
      RGA has passed all my tests. If you are experiencing issues, ensure you are not using a 8GB device. If you have 8GB of RAM, you will need to reduce the memory to 4GB on the kernel command line.
      These users thanked the author crashoverride for the post:
      AreaScout (Mon Apr 18, 2022 6:38 pm)

      AreaScout
      Posts: 1793
      Joined: Sun Jul 07, 2013 3:05 am
      languages_spoken: german, english
      ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
      N1, Go, VU5A, Show2, CloudShell2,
      H2, N2, VU7A, VuShell, Go2, C4
      Has thanked: 120 times
      Been thanked: 370 times
      Contact:

      Re: RGA 16bit color format has changed

      Post by AreaScout »

      crashoverride wrote:
      Mon Apr 18, 2022 1:49 pm
      RGA has passed all my tests. If you are experiencing issues, ensure you are not using a 8GB device. If you have 8GB of RAM, you will need to reduce the memory to 4GB on the kernel command line.
      It works with 4GB limit, I am glad you found a workaround, but that smells like we are leaking memory somewhere, I also lost RGA again having only green screen with 4GB when I was playing with audio because SDL2 on FFplay couldn't open audio device, I was changing /etc/asound.conf type to plughw, tried to play with that, deleted it entirely and then all of a sudden, playback stopped with 'Double free memory corruption' and or green screen. I will try to troubleshoot and narrow down the problem

      Regards,
      Daniel

      User avatar
      rooted
      Posts: 9436
      Joined: Fri Dec 19, 2014 9:12 am
      languages_spoken: english
      Location: Gulf of Mexico, US
      Has thanked: 758 times
      Been thanked: 479 times
      Contact:

      Re: RGA 16bit color format has changed

      Post by rooted »

      The 4GB workaround isn't due to a memory leak it's something to do with 64bit compatibility.

      AreaScout
      Posts: 1793
      Joined: Sun Jul 07, 2013 3:05 am
      languages_spoken: german, english
      ODROIDs: X2, U3, XU3, C2, HiFi Shield, XU4, XU4Q,
      N1, Go, VU5A, Show2, CloudShell2,
      H2, N2, VU7A, VuShell, Go2, C4
      Has thanked: 120 times
      Been thanked: 370 times
      Contact:

      Re: RGA 16bit color format has changed

      Post by AreaScout »

      rooted wrote:
      Wed Apr 20, 2022 9:46 am
      The 4GB workaround isn't due to a memory leak it's something to do with 64bit compatibility.
      I hope it will get fixed by crash or any other interested in this :)

      @all

      Soon I will release Kodi 18.9 Leia arm 32bit, Kodi 19.4 arm64 and Kodi 19.4 arm 32 bit, it will be installable from within my package servers on official Linux Ubuntu 20.04 server image and later on hopefully on Ubuntu 22.04 too, arm 32 bit version has to be installed inside a Debian Bullseye chroot environment -> all testet and runs smooth, there will be an HowTo like we had on XU4 viewtopic.php?f=98&t=34149, that Kodi installation will be fully customizable running on regular Linux Ubuntu as I told already, chrooted Debian ready for LinuxTV, Myth-TV streaming project a.s.o or just as a Home entertainment center. I do not have much time so you have to be patient, I can only work for it on weekends if I find time, I would have more time for ODROID's but it's like it is.



      RG
      These users thanked the author AreaScout for the post (total 3):
      odroid (Sun May 01, 2022 9:06 pm) • istanbulls (Mon May 02, 2022 1:59 am) • mctom (Tue May 03, 2022 6:33 am)

      User avatar
      rooted
      Posts: 9436
      Joined: Fri Dec 19, 2014 9:12 am
      languages_spoken: english
      Location: Gulf of Mexico, US
      Has thanked: 758 times
      Been thanked: 479 times
      Contact:

      Re: RGA 16bit color format has changed

      Post by rooted »

      Great work Daniel.
      These users thanked the author rooted for the post:
      AreaScout (Sun May 08, 2022 3:17 am)

      Post Reply

      Return to “Issues”

      Who is online

      Users browsing this forum: No registered users and 1 guest