December 10, 2019, 02:35:30 am

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


Change resolution and refresh rate for the "nand images"?

Started by Dariush, October 29, 2013, 03:04:45 pm

Previous topic - Next topic

Dariush

Hi.
Would anybody please tell me how can i change the resolution and refresh rate for the OS which is in Nand?
Thanks in advance.

patwood

Android or linux?  Any details on the kernel version?

Dariush

Thanks and sorry for incomplete information.
I need it for "lubuntu-desktop-12.xx_v1.05.img" nand linux image.

patwood

On your nanda partition, you can add a line to uEnv.txt to set the HDMI resolution.  For example:

extraargs=disp.screen0_output_mode=1280x720p60

Sets 720p with a 60Hz refresh rate.  You may have to experiment with different settings for your monitor.

Dariush

Thanks a lot dear Patwood for your great help.
I really appreciate. :)

Dariush

Actually there is no uEnv.txt and i made one and add it to nanda/linux folder and nothing changed.
Would you please tell more about uEnv.txt and what should be written in it and also what are the applications of the file and how it works?

patwood

I don't use this distro in nand, so I can only guess why it's not working.  Here are the most likely reasons:

1. There's a boot.scr file that's overriding the uEnv.txt settings.  If you see a boot.scr file, check its contents. Note that it can't be modified with a text editor -- it's a binary file with a size and checksum in the header that prevents modification.  If you want to create a new one, you'll need to use the mkimage tool, or you can simply remove it and put its contents in uEnv.txt.

2. The version of u-boot your distro's using doesn't read uEnv.txt; this would be a pretty old u-boot, but there are some.  I can't help you there.Do this:

cat /proc/cmdline

and report back here whether the disp.XXX argument made it to the kernel (acutally, report back the entire command line).

3. The version of the kernel in your distro doesn't support the disp.XXX module parameters.  I believe this distro uses the 3.4.x kernel, which should support this setting.

4. You put the uEnv.txt file in the wrong place.  Try both the top level directory and the linux directory.  I'm pretty sure it needs to be in the same place as the script.bin file.

Dariush

"cat /proc/cmdline" just echoes :
Quote
console=ttyS0,115200 console=tty1 root=/dev/nandc loglevel=5 rootwait

by the way, what are the accepted resolutions and refresh rates?

patwood

Quote from: Dariush on October 31, 2013, 11:23:56 am
"cat /proc/cmdline" just echoes :
Quote
console=ttyS0,115200 console=tty1 root=/dev/nandc loglevel=5 rootwait



So the uEnv.txt extraargs aren't making it into the kernel args. When u-boot reads uEnv.txt, it parses the various environment settings; extraargs is passed to the kernel command line along with other environment settings like this:

setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}


So perhaps you have a boot.scr that's setting extraargs to "rootwait"

Quote
by the way, what are the accepted resolutions and refresh rates?


When you boot or plug in your monitor, you should get messages like this in dmesg:

[126048.754571] PCLK=148500000 X 1920 2448 2492 2640 Y 1080 1084 1089 1125 fr 50 PP
[126048.760417] PCLK=74250000 X 1280 1390 1430 1650 Y 720 725 730 750 fr 60 PP
[126048.768975] PCLK=74250000 X 1280 1720 1760 1980 Y 720 725 730 750 fr 50 PP
[126048.775039] PCLK=27000000 X 720 732 796 864 Y 576 581 586 625 fr 50 NN
[126048.780539] PCLK=27000000 X 720 736 798 858 Y 480 489 495 525 fr 59 NN


These list the available X and Y resolutions and frame rates (not sure what the PP and NN mean, but 720x480x60 worked on my monitor and 720x480x59 didn't).

Dariush

Thanks a lot dear Patwood,
There is no boot.scr but a "boot.ini" file with the following content:

[system]
start_os_name=linux
timeout = -1
display_device=0
display_mode =0

erase_flash=1
[linux]


Would you please tell me whether changing the content of this file may change the screen resolution and how?

One other thing:
Apart from the resolution, is it possible to copy the script.bin from nanda then edit it and finally paste it again there.
Will the modifications take place?

patwood

Quote from: Dariush on October 31, 2013, 01:54:19 pm
Thanks a lot dear Patwood,
There is no boot.scr but a "boot.ini" file with the following content:

[system]
start_os_name=linux
timeout = -1
display_device=0
display_mode =0

erase_flash=1
[linux]


Would you please tell me whether changing the content of this file may change the screen resolution and how?


No.  This file is read by the AW bootloader prior to loading u-boot.bin.  It simply specifies the directory to look for the OS boot info (in this case, linux/linux.ini).

So if you want to change the kernel's arguments, you'll need to ask Benn if he knows whether uEnv.txt is read by this distro's u-boot.bin.

Quote
One other thing:
Apart from the resolution, is it possible to copy the script.bin from nanda then edit it and finally paste it again there.
Will the modifications take place?


Yes; however, will need special tools to "decompile" it into text format for editing (bin2fex) and another to convert the text form back to binary (fex2bin).  These can be found in the linux-sunxi github repositories.

ikeeki

This kind of topics (Patwood's Master lessons style) should be pinned

redmaskxux

Quote from: Darush on October 31, 2013, 11:23:56 am
"cat /proc/cmdline" just echoes :
Quote
console=ttyS0,115200 console=tty1 root=/dev/nandc loglevel=5 rootwait

by the way, what are the accepted resolutions and refresh rates?


kernel in your distro doesn't support the disp.XXX module parameters.