Advertisement

Banana Pro – change display resolution for framebuffer automatically on boot

If you own a SoC (System-on-a-chip) named Banana Pro, you might face the issue that most Linux distros available for this board do not respect the display resolution that you set in the uEnv.txt file. Especially in case you are using some HDMI -> VGA converter, this resolution-related issue can be expected. Here is a working solution to fix it.

Advertisеment

banana soc banner logoThe default way to set the desired resolution from the resolutions supported by the board's GPU usually requires you to mount a FAT32 boot partition and edit the file named uEnv.txt. In the general case, the commands will look as follows:
# mount /dev/mmcblk0p1 /mnt
# nano /mnt/uEnv.txt

Then you can set the desired resolution in the bootargs line by changing the disp.screen0.output_mode part to something like this:

disp.screen0.output_mode=1920x1080p60

This means that the display resolution should be set to 1920x1080 and 60Hz at the next boot.
However, as I mentioned above, this has no effect. In case the described sequence does not work for you, here is another solution.

  1. List all the available display modes for your board. This can be done with the following command:
    # cat /sys/class/graphics/fb0/modes

    This will give you an idea which resolution can be set.

  2. Now, set the desired resolution with the following command:
    # echo "V:1024x768p-60" > /sys/class/graphics/fb0/mode

    Here I am assuming that you got the value V:1024x768p-60 from the list of modes you saw in the previous step.

  3. Now, install the fbset tool. The command can be different depending on the distro you installed on Banana Pro. For instance, for Arch Linux use the following command:
    # pacman -S fbset
  4. Run fbset without parameters. It will produce some output like this:fbset output
  5. Make sure that it matches the current resolution you set with the "echo" command. Now run the following command:
    # fbset >> /etc/fb.modes

    This will add your current mode to the file /etc/fb.modes.fbset output to the file

  6. Open the /etc/fb.modes file with any text editor (you can use something like nano). Go to the end of the file.
  7. There you will find the current mode. Rename the section to something like "mymode" and remove the rgba line. Before:beforeAfter:after
  8. Now, you can type the following command at any time to set the current resolution:
    # fbset mymode

    This will switch the display resolution for the console framebuffer.

Now, to change the Banana Pro display resolution automatically on every boot, you can do the following:

  • If your distro (Bananian, for example) does not come with the systemd init manager, add the fbset mymode command to the end of the /etc/rc.local file.
  • If you are using systemd (e.g. when you are using Arch Linux), create a new *.service file, i.e. display.service and put it in the following location:
    /etc/systemd/system/display.service
  • Add the following content to the display.service file:
    [Unit]
    Description=Display resolution
    After=local-fs.target
    DefaultDependencies=no
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/fbset mymode
    
    [Install]
    WantedBy=multi-user.target
    

    After that, you need to enable the unit:

    # systemctl enable display.service

That's it. Now, at every boot, your Banana Pro board will set the required display resolution automatically.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.