Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

XBMC - Hardware Accelerated Decoding - What works and what doesn't.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    XBMC - Hardware Accelerated Decoding - What works and what doesn't.

    Hi Folks!

    In this thread i hope to collect all the information you need to run XBMC with NATIVE hardware (HW) accelerated decoding on any RK3066 device. (So no external players like MX player)

    Here is a summary of the information i've collected over the past few weeks:

    First HERE is a great thread by dark_angel where you can read all about XBMC, what it can do, what nice plugins there are and how to install them. Also there is information how to use XBMC in combination with an external player (MX player) for hardware acceleration. But if you ended up here i guess you know what XBMC is and you know you want it!

    BASIC INFO

    Hardware accelerated decoding means the video is decoded by the GPU (graphics processing unit) instead of the CPU. (i know that's hardware too right??? ) This is often more efficient/faster so you can play higher resolution videos.

    The standard version of XBMC for android doesn't support HW accel decoding but uses software decoders to decode video. This means it's very slow and you wont even get close to playing HD video.

    But the developers of XBMC do have "test builds" available with HW accel decoding.
    You can find those HERE
    The ones with HWACCEL or STAGEFRIGHT in the filename are the ones with HW accel decoding.
    So THIS one is the latest.
    But with THIS one you can check CPU load, cache size (for non-local files) and the amount of dropped frames by pressing the letter O while playing a video. (not working with the latest version)

    The HW accel version of XBMC for android is still in a very early stage of development. So expect some bugs, but also expect it to get better and hopefully faster!

    WHAT WORKS AND WHAT DOESN'T

    LIBSTAGEFRIGHT
    Rockchip released a patch to fix or at least improve the HW accel decoding. This patch is called libstagefright. I haven't done tesst without this patch, but lets just assume results will be worse.
    As far as i know pretty much all available custom ROMs (the later versions) have the libstagefright patch. If your custom ROM doesn't have it or you want to use the stock ROM there are ways to "install" it. Just search the forum how to do that.

    XBMC FOR ANDROID WITH HW ACCEL DECODING
    Without tweaks XBMC will only use the HW accel decoder on videos where the resolution is dividable by 16. For instance 1280x720 (720/16=45). But for a very common movie resolution like 1280x532 (532/16=33,25) the HW accel decoder wont be used and while it is a lower resolution video as the 1280x720 one it will play much much worse. This also means that, without tweaks, the HW accel decoder will also not be used for full 1080p/1920x1080 (1080/16=67,5) videos. So here is the tweak to fix it...

    ADVANCEDSETTINGS.XML
    Lewy20041 pointed out that you can tweak XBMC by using the advancedsettings.xml file. By adding the following code to that file you will force XBMC to always use the HW accel decoder even if the video is not dividable by 16. It will also force it to use the HW accel decoder for different codecs. The advancedsettings.xml file must be placed in /android/data/org.xbmc.xbmc/files/.xbmc/userdata

    Code:
    <advancedsettings>
      <video>
        <stagefright>
          <!--  -1 is default, 0 is never used this codec, 1 is always use this codec, bypassing blacklist -->
          <useavccodec>1</useavccodec>
          <usevc1codec>1</usevc1codec>
          <usevpxcodec>1</usevpxcodec>
          <usemp4codec>1</usemp4codec>
          <usempeg2codec>1</usempeg2codec>
          <useswrenderer>false</useswrenderer>
        </stagefright>
      </video>
    </advancedsettings>
    You can get a pre-made advancedsettings.xml file HERE (Right mouse click and "save target as")
    Or a zipped version HERE

    AUDIO 2.0/5.1
    As it seems right now these RK3066 devices will only output stereo/2.0 audio. While HDMI can handle much higher and with the right speaker system with digital receiver any AC3 or DTS audio stream could just be send directly to that digital receiver (passthrough) it doesn't seem to be working. HERE you can find a thread about a MINIX firmware apparently supporting 5.1 audio, but i think it only works with AC3 and not in combination with XBMC. But i guess they are working on it. Lets hope they dont forget about the RK3066 now that the RK3188 devices are here.

    LIVE STREAMS PATCH
    Again big thanks to Lewy20041 for providing a patch for live video streams.
    Lewy20041:
    unpack thease files http://d-h.st/lQB into /system/etc/
    set permisions "rwx --- ---" to install-recovery.sh
    this way it load fix at startup.
    Finless:
    Additionally if your using one of my ROMs it has init.d script support.
    Just rename the script to 00script
    copy it into the init.d folder.
    reboot
    720p vs 1080p
    There are 720p kernels and 1080p kernels available.
    These devices by default have a 720p kernel, meaning the "internal system" will run at 720p resolution no matter what. Even if you set the output to 1080p under settings it will just take that 720p resolution and upscale it to 1080p.
    So when you watch a 1080p movie on a 720p kernel (and the output set to 1080p under settings), that video image will first be downscaled to 720p (loosing detail in the process) and then upscaled again to 1080p (just increasing pixels, not adding detail) before it's send to the TV/Monitor. So even if you are able to play a 1080p movie on a 720p kernel, all detail over 1280x720 resolution will be lost. That doesn't mean it still cant look very good and you'll have the benefit of a fast running android and other apps. Also i think you will be able to play 1920x800 resolution videos (a very common movie resolution) without having to overclock the device (even though you wont get the full detail).

    With a 1080p kernel you will have real 1920x1080 output to your TV/Monitor. Meaning when you watch a 1080p movie you will also see that 1080p detail. However with a stock/non-overclocked kernel you wont be able to watch even the lowest common 1080p movie resolution which is 1920x800 without a lot of dropped frames. So you will have to overclock...

    So with 720p kernel you can play (most) 1080p movies, but you wont see the detail so there is no real reason to watch a 1080p movie. And with a 1080p kernel you will be able to see the extra detail of a 1080p movie but you wont be able to play them!!! I think that's what they call a "catch 22"
    Unless... you overclock...

    PERFORMANCE UG007II with Finless 1.7a with stock and 2dark4u (UG802) OC kernel.
    These are some rough indications of what you will be able to play with that kernel. (720p/1080p/stock/overclocked)

    720p kernel, stock speed (GPU at 266mhz)
    I haven't tested this but i'm expecting videos with a resolution up to 1920x800 to play. (Can somebody confirm?)

    720p kernel, overclocked (GPU at 466mhz)
    Again not tested, but by looking at the 1080p results this shouldn't even break a sweat with 1920x1080 videos.

    1080p kernel, stock speed (GPU at 266mhz)
    Video with a resolution up to 1920x688 (not a standard movie resolution) can be played. 1920x800 unfortunately has way too much dropped frames.

    1080p kernel, overclocked (GPU at 466mhz)
    Video with a resolution up to 1920x1080 can be played

    NOTES
    - When i use 1080p50hz it seems i always have quite a bit less dropped frames compared to 1080p60hz. Maybe because the GPU only has to do 50 updates/sec instead of 60 or maybe it has to do with something else, but i assume the same applies to 720p 60hz/50hz, so i suggest you use 50hz if that's possible.
    If this really makes that big a difference, maybe kernel makers are able to build a 24hz option in there since quite a few TV's support that and MAYBE that means there is no need for overclocking. (For the 720p kernels at least)

    - With the overclock kernel (GPU at 466mhz) i can play 1920x1080 videos perfectly even when i lock the CPU to 816mhz. Of course this is because the GPU does most of the work. But this also means you dont need a kernel that overclocks the CPU, just the GPU. Even if i use "interactive" or "ondemand" governor with a max of 1.6ghz i will get random dropped frames. I have no idea what the real difference is between these scaling governors, but "hotplug" seems to work best for me. Since 816mhz seems to be enough and apparently these governors dont always scale fast enough (considering the dropped frames) i'm not using hotplug governor with a min freq of 816mhz and a max or 1.6ghz. But like i said the stock 1.2Ghz is more than enough.

    - For people having problems with streaming movies over a SMB/Windows network maybe there is a workaround. I just tested playing files from my local server using the SMB/Windows network and XBMC doesn't seem to buffer anything or at least very little. This wont be a problem most of the time but during very high motion scenes or scenes with a lot of movie grain the bitrate can be much higher than the movie average and your WIFI connection might not be able to keep up with that.
    I also have a remote server and i stream my movies from that server using an FTP server. That way XBMC will use a buffer of at least 25MB. That way bitrate bursts are covered by the buffer.
    I know a lot of NAS devices have FTP servers build in and on normal computers/servers you can always use the free filezilla (windows).

    - Overclocked kernels: As far as i know right now there are overclocked kernels available for the MK808 (non-B) and the UG802 and i think that UG802 kernel should be compatible with Minix Neo G4 and the Rikomagic MK802 III. That doesn't mean all other sticks wont be able to use overclocked kernels, that just means if you do use one of those kernels you will loose WIFI (and BT) and will have to use an USB WIFI dongle or USB to ethernet adapter. However the MK808 kernels dont work on my UG007. So maybe for some devices neither kernel works, but i think for most at least one will (please correct me if i'm wrong). With the MK808 kernels the GPU is clocked at 433mhz or 400mhz. I'm not sure if that will be enough for 1920x1080. 1920x800 shouldn't be a problem.

    - I have this simple wattage meter and figured i share some results.
    Stock/non-overclocked 1080p kernel, max load (Epic Citadel) it consumes 5w, but since the power supply itself gets a little warm lets just assume my UG007II uses about 4w.
    2dark4u OC 1080p kernel CPU 1.6Ghz GPU466mhz, max load (Epic Citadel) 7w, again my UG007II probably 6w. But while watching a 1920x1080p movie in XBMC it's at 4-5w 99% of the time. So that would be 3-4w for the UG007II, the same as the stock kernel under full load.
    So when comparing the full load there is an 50% increase in power usage (4w -> 6w), but when using an overclocked kernel to watch even 1080p movies using XBMC the max power usage is about the same as the full load power usage with the stock kernel. I'm definately not saying use overclocked kernels without a heatsink, but "i think" a rather small heatsink (like on the MK808(B)) should be enough, since even such a small heatsink will AT LEAST quadruple the cooling surface area compared to no heatsink at all.
    BUT! OVERCLOCK AT YOUR OWN RISK! AND NOT WITHOUT A HEATSINK! (even if it's just a small one) That's what she said....
    Last edited by Finless; 04-24-2013, 03:55. Reason: per request
    - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
    - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
    - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

    #2
    Great write-up. Im defiantly going to keep an eye on this to see where it goes.

    I would give you Reddit Gold if this was Reddit, but this is FreakTab so a nice dancing banana will do...
    TV Stick: MK808 // Tronsmart T428
    ROM: Finless 1.7c w/Pimp My Rom // Nexus SDK2 Multi-Window v1.2
    CPU: @1.6GHz OnDemand Governor NOOP I/O Scheduler
    Recovery: ClockworkMod
    Kernel: Omegamoon // 1080p OC kernel 720ddr 1.9cpu
    Phone: Samsung Galaxy Note II
    ROM: Whompasaurus v4.2
    Kernel: Persus

    Comment


      #3
      Thanks for the great info and test results. As you have said Since the hardware accelerated version of XBMC for android is still in a very early stage of development, it will get better and better day by day. In the mean time I am enjoying what we have right now! Believe me a few months ago I did NOT even expect that XBMC will arrive on Android! LOL

      Comment


        #4
        I'll take it! (the dancing banana) Only 999 to go before i can get that beachchair!

        Looks like 1536x800 (or 1228800 pixels) is close to the limit for me. Tomorrow i'll try a 1920x640 video (also 1228800 pixels) to see if that results in about the same performance.

        If there is anybody out there with an overclocked kernel (CPU and/or GPU). It would be great to hear your results. I'll also add a 1920x1072 version tomorrow for the people with overclocked kernels. (1080 isn't dividable by 16 so will have to be 1072).
        Last edited by Abducted; 03-28-2013, 23:22.
        - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
        - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
        - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

        Comment


          #5
          I had issues playing sd videos but after flashing 1.7 Finless no such issues. my only gripe has been smb files.is there a way we could get external player like Archos to play smb?

          Comment


            #6
            I first thought you ment SMB as in files over a windows network. But i think you mean SMB video files dont you? Just curious what content can be found that uses this format?

            Just tested a 1920x640 file and it played flawlessly. Now for a 1152x1072 file (1234944 pixels). If that plays oke then i guess there isn't so much a vertical or horizontal limitation (within 1080p resolution) but it's most likely the amount of pixels.

            Not that i was assuming it was either a height or width problem, but it's good to have it checked

            Update: 1152x1072 plays fine too.
            Last edited by Abducted; 03-29-2013, 17:30.
            - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
            - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
            - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

            Comment


              #7
              Originally posted by Abducted View Post
              I first thought you ment SMB as in files over a windows network. But i think you mean SMB video files dont you? Just curious what content can be found that uses this format?

              I meant the samba shares, in XAF builds I used Archos videos player to play them, which was a breeze, but with hwaccel xbmc the stock player stutters hey it plays all the stuff I throw @ Amazon prime 720ps/sportsdevil so no complains

              Comment


                #8
                For XBMC HW 19/02/2013 you need to create advancedsettings.xml to have more resolution and formats unlocked.
                Koying purposly locked some becouse they are not stable but you can try it if you wont.

                Code:
                [COLOR=#000000][FONT=monospace]<advancedsettings>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]...[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]  <video>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]    <stagefright>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <!--  -1 is default, 0 is never used this codec, 1 is always use this codec, bypassing blacklist -->[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <useavccodec>1</useavccodec>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <usevc1codec>1</usevc1codec>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <usevpxcodec>1</usevpxcodec>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <usemp4codec>1</usemp4codec>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]      <usempeg2codec>1</usempeg2codec>[/FONT][/COLOR]
                
                [COLOR=#000000][FONT=monospace]      <useswrenderer>false</useswrenderer>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]    </stagefright>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]  </video>[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]...[/FONT][/COLOR]
                [COLOR=#000000][FONT=monospace]</advancedsettings>[/FONT][/COLOR]
                Everything is possible if we work together!
                ApkFreak

                Comment


                  #9
                  Excellent information! I'll give it a try later today.

                  Thanks!

                  EDIT: That works great! I guess i have to re-write the opening post. :P That solves the x16 problem and by looking at the other advancedsettings i guess it also enables HW acceleration for other video formats. So now i just have a maximum resolution limit probably because of the lower GPU clockspeed. Going to see if i can test an overclock kernel later. (after placing a heatsink!!!! )
                  Last edited by Abducted; 04-01-2013, 17:52.
                  - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
                  - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
                  - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

                  Comment


                    #10
                    I have a MK802iiis with Finless 1.7a for Imito MX1/MX2 on it and the XBMC HW accelerated test build from 19/02 on it. Compared to a non HW accelerated build, the test build works a lot better for me since the non HW build would play 720p like a slide show. But the test build doesn't play 1080p at all, and 720p is slightly choppy from time to time, and it seems to happen when there are a lot of motion in the scene
                    I do believe that the 1.7a should have the fixed libstagefright.

                    Comment


                      #11
                      I still need to rewrite the starting post, sorry about that.

                      Lately i've been testing a 720p kernel and now XBMC can handle higher resolution files. I guess since the 720p screen resolution compared to 1080p takes some load of the GPU which it can use to decode the video. With the 1080p kernel 1920x688 was about the max resolution it could handle. With the 720p kernel it plays 1920x816 just fine (and maybe even higher i haven't tested yet). Of course when using a 720p kernel any video resolution over 720p is lost! But at least it plays it.
                      After 1920x816 i've only tested 1920x1040 (nothing in between yet) and that doesn't even play that bad.
                      I'm hoping a kernel with the GPU is overclocked to 433mhz and maybe the CPU limited to 1000mhz would play 1080p fine and might not need a heatsink.
                      - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
                      - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
                      - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

                      Comment


                        #12
                        new xbmc hw ver. http://mirrors.xbmc.org/test-builds/...rmeabi-v7a.apk
                        Everything is possible if we work together!
                        ApkFreak

                        Comment


                          #13
                          Originally posted by lewy20041 View Post
                          What's the difference with the build of 19 febr?

                          Comment


                            #14
                            I can confirm that 1920x838 very high bit rate (40 mbits/s) works well on 720p kernel
                            (Ug007 with finless bob 1.7b) , 1080 and 1040 are a no go (excessive frame drops)
                            The XBMC HW decoding is very close to the full 1080p , in fact most of my movies
                            Are 1920x800 or 816 , this is the most used resolution for full hd movies.

                            Comment


                              #15
                              So far i haven't noticed any changes with the new build except that the decoder and cpu information (when u press O) layout is changed and the CPU load status isn't working anymore. (0% all the time). Maybe the extra lines in the advancedsettings.xml aren't needed anymore? Need to test that.

                              Thanks opengl1971 for the info. This is what i'm getting too.
                              - UG007-II with Finless iMito MX1/2 1.7a ROM and UG802 2Dark4U 1080p overclock kernel and USB WIFI dongle.
                              - MK808 with Finless MK808 1.7c ROM and 2Dark4U 1.4 MK808 1080p overclock kernel.
                              - MK908-II: XBMC full 1080p playback with a 1080p kernel HERE

                              Comment

                              Working...
                              X