MakakLabs / linux-meson

GNU General Public License v2.0
2 stars 1 forks source link

Boot Resolution @ 1080p instead of 720p on some M3 boxes #2

Closed Ilia closed 10 years ago

Ilia commented 10 years ago

I got a new box for a friend and strangely on same build/kernel/libplayer i get variation in boot resolution (which some users on forum found too) where the splash screens do not look fullscreen. I found that on those boxes i get in dmesg:

Kernel command line: rootfstype=ext3 androidboot.resolution=1080p rootwait init=/init console=ttyS0,115200n8 nohlt logo=osd1,0x84100000,loaded,1080p a9_clk=600M clk81=187500000 mem=1024m

vs

Kernel command line: rootfstype=ext3 androidboot.resolution=720p rootwait init=/init console=ttyS0,115200n8 nohlt logo=osd1,0x84100000,loaded,720p a9_clk=600M clk81=187500000 mem=1024m

and in J1nx tlbb kernel defconfig he has:

CONFIG_CMDLINE="androidboot.resolution=720p logo=osd1,0x84100000,loaded,720p a9_clk=800M clk81=187500k root=/dev/mtdblock5 rw rootfstype=yaffs2 init=/sbin/init"

I am trying to build with that as well see what happens but you may have a better idea about this.


If you need any logs let me know I will keep the device for a bit before i give it to my friend.

dhead666 commented 10 years ago

"make menuconfig" -> go to the boot options. The default kernel command is

root=/dev/mtdblock5 rw rootfstype=yaffs2 init=/sbin/init

We're appending the default kernel command to the bootloader arguments so the rest of the boot arguments coming from the bootloader (u-boot).

With the Append method, a parameter from the kernel command should be preferred on u-boot , (unless I mixed it up with the Extend method), so just add the androidboot.resolution to your default kernel command.

Ilia commented 10 years ago

Thanks for the info, will give it a go and report back

Ilia commented 10 years ago

@dhead666

when I add androidboot.resolution=720p to boot options, i get the following in dmesg:

[ 0.000000] Kernel command line: rootfstype=ext3 androidboot.resolution=1080p rootwait init=/init console=ttyS0,115200n8 nohlt logo=osd1,0x84100000,loaded,1080p a9_clk=600M clk81=187500000 mem=1024m mac=c4:4e:ac:05:01:a7 root=/dev/mtdblock5 rw rootfstype=yaffs2 init=/sbin/init androidboot.resolution=720p

It appends it but for some reason it has androidboot.resolution=1080p already set, any ideas that i can follow up?

dhead666 commented 10 years ago

It looks like the Append method works as it should, the firsts kernel parameters coming from u-boot, the lasts from the default kernel command. You don't need to care about the first value of androidboot.resolution, only the last value is in affect.

The first splash screen (black MX Linux) is loaded by uboot, you can't change the resolution without changing u-boot parameters (I'm not quite sure which, I need to look it up) and for that you'll need to solder the uart port and use usb-ttl adapter. (there's another way with factory_update_param.ubt but it's a little bit complicated to explain how-to and I never tried it)

If the other splash screen images appeared right then the setting works.

I plan to look into compiling my own u-boot thus it would be possible to upgrade the u- boot with the usual update method.

p.s. I forgot to mention that the second splash screen (and the only one loaded by the kernel is the one set with logo=osd1,0x84100000,loaded,1080p , and this of course need to change to logo=osd1,0x84100000,loaded,720p

Ilia commented 10 years ago

The first screen resolution is fine as in 720p (linux mx) its the splash screen (complete.fb.lzop, etc) that are shown in 1080p mode.

I will change the second one (logo=...) and see how it works. Its bizarre that same build has such difference on two boxes sources by same chinese supplier - hence the vague reports on the forum.

Ilia commented 10 years ago

Its the strangest thing. I have an old build that I did from j1nx with his kernel (90ed253180dd4a9239d79c74294b3644c6bb58c5) and it does not show the issue. If i use the same kernel with coreys repo i have this issue on the same box. I am stumped.

also i found Corey mentioning this on his forum thread at xda (but i had no luck finding out what the change is):

(G18REF/MX2REF) NOTE: If your 2nd boot splash is not displayed properly do the following

dhead666 commented 10 years ago

@Ilia

If you ask me then it might be better just to remove the silly logo (I'm not sure but maybe by disabling the osd kernel module), I don't really understand why the frack someone decided it will be a good idea that the kernel would display a logo, let the bootloader do this and/or get it done in userspace, not in the fracking kernel.

Anyway, the second logo is loaded to a specific memory address by the u-boot from the logo/aml_logo partition, the memory address is the value you sent to the kernel which display the logo while booting.

I'm not sure why the issue occurs, you might want to compare the original Android boot log (in regards to nand layout) to the recovery boot log (which is basically a Linux kernel with with the recovery rootfs) and also to the u-boot param value of the logo that is loaded to the address 0x84100000 (and you'll need to connect to the serial/ttl port).

For example on my M3 device the u-boot command to read the logo is

nand read aml_logo 0x84100000 0 400000

As you can see the command read 400000 bytes (that's hex) of the logo from partition aml_logo and offset 0 and load it to the address 0x84100000.

Few ideas what might happening: the logo is not read fully by the u-boot, logo partition address in u-boot differs a bit from the one in the recovery.

Ilia commented 10 years ago

@dhead666 I think this is got to do with the framebuffer splash screens being 720p even though for some reason everything is loading at 1080p until xbmc loads. The boot logo (MX linux) is loading fine though I think it is stretched to 1080p so less noticeable.

I guess i could try creating 1080p fb splash logos, but its bizarre that they is such inconsistency even though it the same hardware/kernel :(

Ilia commented 10 years ago

Looks like adding

echo "720p" > /sys/class/amhdmitx/amhdmitx0/disp_mode echo "720p" > /sys/class/display/mode

to S05Splash fixes the issue :)

dhead666 commented 10 years ago

Thanks Ilia for the update.