Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
Author: swordfish6975

Openelec Build for OPI PC and 2 now with HW decoding

  [Copy link]

4

Threads

1128

Posts

8251

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8251
Post time 2015-12-11 02:55:18 | Show all posts
runnerway replied at 2015-12-10 08:03
I tried this on my brand new OPi PC.

First of all of quick noob question:

Sorry, I missed questions at the end:
- By frame rate switching you mean display frequency? This already works for same resolution but the code is commented out, because I want complete solution - freely changing resolution from one to another together with frequency. In theory, dual display and analog output should also be easy to add.
- Yes, HW deinterlacing is simple by itself. I must figure out how it fits in Kodi decoding/rendering loop.

I think that first priority is to bypass GPU for rendering. It's not hard but it takes quiet some time.

Current model is: VPU -> memory -> copy to another memory -> GPU -> framebufer -> display
Then it would be: VPU -> memory -> display.

0

Threads

41

Posts

213

Credits

Intermediate member

Rank: 3Rank: 3

Credits
213
Post time 2015-12-11 02:55:51 | Show all posts
jernej replied at 2015-12-11 02:11
H265 is fixed now. Other two codec did work before, if you have height > 480. I removed this limit ...

Thank you.
I will try and report back as soon as download finishes.

Can i ask you how to change resolution here in OpenELEC?

By the way in next days i will download sources and try to see if i can help too.
I've a bit of experience in these things.

Do you have any idea about:
- Auto frame rate switching?
- HW deinterlace?

4

Threads

1128

Posts

8251

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8251
Post time 2015-12-11 03:01:32 | Show all posts
runnerway replied at 2015-12-10 19:55
Thank you.
I will try and report back as soon as download finishes.

Probably you missed my comment just seconds before?

0

Threads

41

Posts

213

Credits

Intermediate member

Rank: 3Rank: 3

Credits
213
Post time 2015-12-11 03:33:53 | Show all posts
jernej replied at 2015-12-11 02:55
Sorry, I missed questions at the end:
- By frame rate switching you mean display frequency? This a ...

Yes. I missed this post.

I don't know how to change resolution to 1080p 60Hz.
I tried adding to uEnv.txt "disp.screen0_output_mode=1920x1080p-60" but after this edit if i start my OPi screen remains black.
Any idea? Sorry. Maybe it's a noob question. I've some experience with SBCs but this is my second day with OPi PC.

Yes i meant that. I can't get why you want to change resolution too.
I think one sets resolution to the one of his monitor and leaves that even if he watches videos with different resolution.
So the only thing he wants to change is frequency to be the same of the video.

Maybe i'm missing something?

This is a good build. Thank you very much!
It's fast and the problems i pointed out seem resolved.


Good to know that deinterlace should be easy to add.
This and display frequency are the only things i need to say this image is perfect
Zero copy display will be a nice bonus.


After i've sorted out resolution i will test audio passthrough.

4

Threads

1128

Posts

8251

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8251
Post time 2015-12-11 03:58:04 | Show all posts
Edited by jernej at 2015-12-10 20:59
runnerway replied at 2015-12-10 20:33
Yes. I missed this post.

I don't know how to change resolution to 1080p 60Hz.

If that doesn't work, only script fex file change would help, but for that you need custom build as explained in comment 29#.

You can check my patch for windowing support on github. You can see some commented code inside, which should theoretically be able to switch resolution and frequencies. As you probably noticed, I rather work on HW decoding. However, in the meantime, I learned that probably only thing needed to be done in order to support resolution and frequency switching is to add quirk flag (if you know something about kodi windowing, you would know what I mean).

However, I don't know yet all the details about vsync, which is the thing you are probably after. There are only few frequencies supported and not every combination of frequency and resolution is supported. I think that implementation of vsync and HW deinterlacing becomes very easy once you have zero copy displaying. You also gain automatic scaling.

HW deinterlacing is basically just opening /dev/deinterlace and calling one ioctl on that file. I don't know how much time this call takes.

I'm not sure if audio passthrough even works. There is option for raw audio in the kernel, but if it is enabled, alsa can't configure any sound device anymore. If you would like to investigate the issue, then by all means, do so

Post time 2015-12-11 05:26:33 | Show all posts
Wanted to test your OpenELEC version but it's broken. Only 3 CPU cores available due to adoption of the moronic Xunlong overvolted settings:
  1. [   32.290091] CPU Budget: Temperature: 71 Limit state:1 item[1200000,3,-1,0 0]
  2. [   32.290107] CPU Budget:Try to down cpu 3, cluster0 online 4, limit 3
  3. [   32.291826] CPU3: shutdown
  4. [   32.291839] [hotplug]: cpu(0) try to kill cpu(3)
  5. [   32.291910] [hotplug]: cpu3 is killed! .
  6. [   32.300546] [ddrfreq] temperature=71 C, ddr freq up
  7. [   32.300893] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  8. [   32.470121] vmouse_input_dev_close
  9. [   32.520310] vmouse_input_dev_open
  10. [   33.310112] CPU Budget: Temperature: 66 Limit state:0 item[1200000,4,-1,0 0]
  11. [   33.310128] [ddrfreq] temperature=66 C, ddr freq up
  12. [   33.310472] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  13. [   67.320087] CPU Budget: Temperature: 70 Limit state:1 item[1200000,3,-1,0 0]
  14. [   67.320104] [ddrfreq] temperature=70 C, ddr freq up
  15. [   67.324523] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  16. [   67.820087] CPU Budget: Temperature: 69 Limit state:0 item[1200000,4,-1,0 0]
  17. [   67.820104] [ddrfreq] temperature=69 C, ddr freq up
  18. [   67.826147] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  19. [   69.820088] CPU Budget: Temperature: 70 Limit state:1 item[1200000,3,-1,0 0]
  20. [   69.820104] [ddrfreq] temperature=70 C, ddr freq up
  21. [   69.824280] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  22. [   70.820077] CPU Budget: Temperature: 69 Limit state:0 item[1200000,4,-1,0 0]
  23. [   70.820094] [ddrfreq] temperature=69 C, ddr freq up
  24. [   70.825651] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  25. [   71.820080] CPU Budget: Temperature: 70 Limit state:1 item[1200000,3,-1,0 0]
  26. [   71.820098] [ddrfreq] temperature=70 C, ddr freq up
  27. [   71.824739] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  28. [   74.320089] CPU Budget: Temperature: 69 Limit state:0 item[1200000,4,-1,0 0]
  29. [   74.320107] [ddrfreq] temperature=69 C, ddr freq up
  30. [   74.326887] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
  31. [   75.320088] CPU Budget: Temperature: 70 Limit state:1 item[1200000,3,-1,0 0]
  32. [   75.320104] [ddrfreq] temperature=70 C, ddr freq up
  33. [   75.323615] CPU Budget:update CPU 0 cpufreq max to 1200000 min to 480000
Copy the Code
And now:
  1. OpenELEC:~ # cat /proc/cpuinfo
  2. Processor       : ARMv7 Processor rev 5 (v7l)
  3. processor       : 0
  4. BogoMIPS        : 5714.28

  5. processor       : 1
  6. BogoMIPS        : 5714.28

  7. processor       : 2
  8. BogoMIPS        : 5714.28

  9. Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt
  10. CPU implementer : 0x41
  11. CPU architecture: 7
  12. CPU variant     : 0x0
  13. CPU part        : 0xc07
  14. CPU revision    : 5

  15. Hardware        : sun8i
  16. Revision        : 0000
  17. Serial          : 34005034050c443f0ace
Copy the Code


Sorry, but still using the insane Xunlong settings it can't work. If you stop overvolting the H3 will be also faster. There are a couple of threads here the last few days full of details.

I would strongly recommend adjusting the fex values as follows (adopting the 'official' linux-sunxi settings):

  1. [target]
  2. boot_clock = 1008
  3. storage_type = -1

  4. [dram_para]
  5. dram_clk = 672
  6. dram_type = 3
  7. dram_zq = 0x3b3bfb
  8. dram_odt_en = 1
  9. dram_para1 = 283377664
  10. dram_para2 = 0
  11. dram_mr0 = 6208
  12. dram_mr1 = 64
  13. dram_mr2 = 24
  14. dram_mr3 = 2
  15. dram_tpr0 = 0x48a192
  16. dram_tpr1 = 0x1c2418d
  17. dram_tpr2 = 0x76051
  18. dram_tpr3 = 0x0
  19. dram_tpr4 = 0x0
  20. dram_tpr5 = 0x0
  21. dram_tpr6 = 0x64
  22. dram_tpr7 = 0x0
  23. dram_tpr8 = 0x0
  24. dram_tpr9 = 0x0
  25. dram_tpr10 = 0x0
  26. dram_tpr11 = 0x6aaa0000
  27. dram_tpr12 = 0x7979
  28. dram_tpr13 = 0x800800

  29. [ths_para]
  30. ths_used = 1
  31. ths_trip1_count = 6
  32. ths_trip1_0 = 80
  33. ths_trip1_1 = 85
  34. ths_trip1_2 = 95
  35. ths_trip1_3 = 95
  36. ths_trip1_4 = 100
  37. ths_trip1_5 = 105
  38. ths_trip1_6 = 0
  39. ths_trip1_7 = 0
  40. ths_trip1_0_min = 0
  41. ths_trip1_0_max = 1
  42. ths_trip1_1_min = 1
  43. ths_trip1_1_max = 2
  44. ths_trip1_2_min = 2
  45. ths_trip1_2_max = 3
  46. ths_trip1_3_min = 3
  47. ths_trip1_3_max = 4
  48. ths_trip1_4_min = 4
  49. ths_trip1_4_max = 5
  50. ths_trip1_5_min = 5
  51. ths_trip1_5_max = 5
  52. ths_trip1_6_min = 0
  53. ths_trip1_6_max = 0
  54. ths_trip2_count = 1
  55. ths_trip2_0 = 110

  56. [cooler_table]
  57. cooler_count = 6
  58. cooler0 = "1296000 4 4294967295 0"
  59. cooler1 = "1200000 4 4294967295 0"
  60. cooler2 = "1008000 4 4294967295 0"
  61. cooler3 =  "816000 4 4294967295 0"
  62. cooler4 =  "648000 4 4294967295 0"
  63. cooler5 =  "480000 1 4294967295 0"

  64. [dvfs_table]
  65. pmuic_type = 2
  66. pmu_gpio0 = port:PL06<1><1><2><1>
  67. pmu_level0 = 11300
  68. pmu_level1 = 1100
  69. max_freq = 1296000000
  70. min_freq = 648000000
  71. LV_count = 8
  72. LV1_freq = 1296000000
  73. LV1_volt = 1340
  74. LV2_freq = 1200000000
  75. LV2_volt = 1320
  76. LV3_freq = 1008000000
  77. LV3_volt = 1200
  78. LV4_freq = 816000000
  79. LV4_volt = 1100
  80. LV5_freq = 648000000
  81. LV5_volt = 1040
  82. LV6_freq = 0
  83. LV6_volt = 1040
  84. LV7_freq = 0
  85. LV7_volt = 1040
  86. LV8_freq = 0
  87. LV8_volt = 1040
Copy the Code


If the CPU cores stop overheating the SoC then there might be also more thermal headroom (performance) available to the GPU.

4

Threads

1128

Posts

8251

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8251
Post time 2015-12-11 05:31:44 | Show all posts
bronco replied at 2015-12-10 22:26
Wanted to test your OpenELEC version but it's broken. Only 3 CPU cores available due to adoption of  ...

I see that thread. Are those settings you wrote here optimized for video applications? I noticed that you have two sets, one for headless and one for interactive. It is definitely on my todo.

Post time 2015-12-11 05:45:34 | Show all posts
Edited by bronco at 2015-12-11 05:56
jernej replied at 2015-12-11 05:31
I see that thread. Are those settings you wrote here optimized for video applications? I noticed t ...

It's not about video or not. It's just about Xunlong manipulating settings in the beginning to advertise the H3 as an "1.6 GHz capable" SoC. Their two main mistakes:
  • staying with just 2 operating points in the dvfs table and increasing default voltages by 200mV leading to all the thermal problems the forums are full of (they could've also provided a few more operating points and most of the problems would've never occured)
  • wrongly "tuning" the thermal configuration. With Xunlong's default settings CPU cores are dropped instead of thermal throttling jumping in.

I tried to get a clue what's wrong the last few days/weeks and ended up with two settings that worked for me. I'll keep them for myself (especially the headless one since we want to use the OPi PC as IoT controller) but refrain now from the recommendation to use them everywhere. Better use the settings the linux-sunxi devs developed. They've a few years more experience with Allwinner SoCs (to be more precise: I know nothing compared to them ).


Details in this thread: https://groups.google.com/forum/#!topic/linux-sunxi/20Ir4It3GsA


Today my 2 OPi PC were busy comparing settings (also DRAM clockspeeds) and I ended up with the settings posted before (so you've not to deal with patches but can replace code blocks in the fex file). The linux-sunxi settings are way more safe than mine (adjusted to the minimum) since these guys care about every H3 device out there...

4

Threads

1128

Posts

8251

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8251
Post time 2015-12-11 06:10:31 | Show all posts
bronco replied at 2015-12-10 22:45
It's not about video or not. It's just about Xunlong manipulating settings in the beginning to adve ...

I tried your settings, but there seems to be some problem with HDMI. I don't get any image. Are you sure that your DRAM settings are correct? They are same as stock.

Post time 2015-12-11 06:22:52 | Show all posts
jernej replied at 2015-12-11 06:10
I tried your settings, but there seems to be some problem with HDMI. I don't get any image. Are yo ...

The DRAM settings are those from loboris. Identical with Xunlong's and linux-sunxi's. The adjusted dvfs/thermal settings are tested and work here (there's a problem with the LED configuration though -- interacts with Ethernet on the OPi PC -- that's why I omitted them)


You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2021-12-4 18:43 GMT+8 , Processed in 0.033766 second(s), 20 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list