jernejsk / OpenELEC-OPi2

OpenELEC - The living room PC for everyone
http://openelec.tv
87 stars 25 forks source link

Cannot set 4K resolution? #29

Closed KojoePi closed 7 years ago

KojoePi commented 8 years ago

Hello! I am searching for a possibility to change resolution to 4K in devel-20160224230643-r22172-gf32cae9 In System setting theres only 1920x1280 available? Do i have to change xorg.conf?

jernejsk commented 8 years ago

You must change script.bin with sunxi-tools. In line "screen0_output_mode = 10", chage "10" to: 0x1c for 4K @ 30Hz 0x1d for 4K @ 25Hz 0x1e for 4K @ 24Hz

BTW, there is no X11, it runs directly on framebuffer.

KojoePi commented 8 years ago

okay. Can you give me a short tut on how to do it? Is it possible to switch to 1080p in openelec settings when i change it in script.bin?

jernejsk commented 8 years ago

Extremely short version: 1) install sunxi-tools 2) copy script.bin from FAT partition on SD card to some folder 3) run bin2fex script.bin script.fex 4) edit script.fex as described above 5) run fex2bin script.fex script.bin 6) replace script.bin on FAT partition with modified one

KojoePi commented 8 years ago

Thanks! I did what you said. It seems too boot. The green led is lit. I do not get a screen, but i guess this is normal when outputting 4k on a fullhd screen?

For others: Follow this steps: (I used an Orange Pi Plus running armbian)

  1. apt-get install libusb-1.0-0-dev
  2. optional: mkdir convert && cd convert Copy the script.bin you want to edit in that folder
  3. git clone https://github.com/linux-sunxi/sunxi-tools
  4. cd sunxi-tools
  5. make 6 cd ..
  6. sunxi-tools/bin2fex script.bin script.fex
  7. do the changes needed in the converted script.fex
  8. sunxi-tools/bin2fex script.fex script.bin
jernejsk commented 8 years ago

If I understand you correctly, your screen doesn't support 4K natively? Then you won't get any output. If you only mean to play 4K videos on FullHD display, then you don't need to do anything as they are automatically downscaled. However, only H265 4K videos seem to be supported (as described in chip datasheet and tested).

KojoePi commented 8 years ago

No. I have a customer asking if i could set up 4k output on his device, he wants to view 4k pictures in full resolution. So i think, because the green led is lit, and i can connect via ssh, that its setup right..

KojoePi commented 8 years ago

So. 4K output runs only after the first boot. after that the orange pi pc shows the openELEC bootscreen and then the screen gets black. is there any other setting that has to be made?

jernejsk commented 8 years ago

It should be working. I don't have 4K display, so I can't help you more, sorry.

galeots commented 8 years ago

@jernejsk 4K resolution is not working! part 4k you see the logo OpenELEC remains after black screen and change resolution to 1270 × 720 remaining all black

jernejsk commented 8 years ago

There are some problems:

  1. I'm not expert in HDMI, but from what I understand, 25 Hz and 30 Hz refresh rates @ 4K are too high for Orange Pi to handle.
  2. Your TV/monitor must support refresh rate set for 4K.
  3. There are still some issues at resolution switching inside Kodi. I will fix this soon. Kodi also remembers previous resolution and it sets it again at next boot, so only setting higher resolution in script.bin is not enough.
  4. I don't have an acces to any 4K TV

Maybe you can try with fresh image which was not booted before and change script.bin with 4K @ 24 Hz and test it.

galeots commented 8 years ago

@jernejsk patch 4k not worck mode 0x1e for 4K @ 24Hz, 0x1c for 4K @ 30Hz 0x1d for 4K @ 25Hz l logo OpenELEC remains after black screen and change resolution to 1270 × 720 remaining all black https://github.com/codesnake/OpenELEC.tv/blob/wetek_play_plus/projects/WeTek_Core/patches/kodi/0006-aml-Add-support-for-4k-resolutions.patch

https://github.com/xbmc/xbmc/blob/Isengard/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.cpp

jernejsk commented 7 years ago

I think I know why 4K kodi doesn't work. Issue lies in the fact that GUI is the same size as is the resolution of the monitor. While this is natural, it doesn't have to be, if HW image scaling is used. Mali400 GPU is not capable of processing 4K so this doesn't work on H3. While there might be a way to draw GUI in 1080p max, it is too much work for now.

Mali450 on PC 2 should work, but OE must be ported first.