Author Topic: Change resolution and refresh rate for the "nand images"?  (Read 9678 times)

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Change resolution and refresh rate for the "nand images"?
« on: October 29, 2013, 03:04:45 pm »
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.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #1 on: October 29, 2013, 03:42:34 pm »
Android or linux?  Any details on the kernel version?

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #2 on: October 29, 2013, 05:45:32 pm »
Thanks and sorry for incomplete information.
I need it for "lubuntu-desktop-12.xx_v1.05.img" nand linux image.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #3 on: October 30, 2013, 01:30:56 am »
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.

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #4 on: October 30, 2013, 10:31:45 am »
Thanks a lot dear Patwood for your great help.
I really appreciate. :)

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #5 on: October 30, 2013, 12:41:31 pm »
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?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #6 on: October 30, 2013, 03:46:07 pm »
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.

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #7 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?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #8 on: October 31, 2013, 12:05:12 pm »
"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:

Code: [Select]
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:

Code: [Select]
[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).

Offline Dariush

  • Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #9 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:
Code: [Select]
[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?
« Last Edit: October 31, 2013, 04:08:36 pm by Dariush »

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #10 on: October 31, 2013, 04:28:48 pm »
Thanks a lot dear Patwood,
There is no boot.scr but a "boot.ini" file with the following content:
Code: [Select]
[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

  • Guest
Re: Change resolution and refresh rate for the "nand images"?
« Reply #11 on: January 13, 2014, 12:47:35 pm »
This kind of topics (Patwood's Master lessons style) should be pinned

Offline redmaskxux

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Change resolution and refresh rate for the "nand images"?
« Reply #12 on: April 26, 2019, 04:38:04 pm »
"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.