You are not logged in.
Greetings, I have some experience running other various distributions across several different computers over the years, and after verifying compatibility, decided to install Arch on my Macbook Pro 13,1 (2016 13" non-touchbar model).
The Problem: When I am greeted with the terminal after boot, I can log in without any issues, but the bottom four lines of text on the terminal are cut off (almost as if the installation believes the laptop's monitor to be larger than it actually is). This issue was present on the installation media as well. I have yet to install X or any WM on this machine yet, as I would like to resolve this issue first.
The display problem is very similar to what was described in this thread: https://bbs.archlinux.org/viewtopic.php?id=258906.
I have looked on https://github.com/Dunedan/mbp-2016-linux which indicates that there are no compatibility issues with either the graphics or the display. The aforementioned site does mention this however:
There is one oddity in the EDID data of the 13" models, as it contains a 2800x1800 mode in addition to the correct 2560x1600 mode. In the end that doesn't matter, as Xorg probes and sets the correct resolution of 2560x1600.
This seems to be the exact issue I am running into, as my investigations have resulted in my discovering the terminal is being displayed as if it were a 15" (2800x1800) screen, and not the 13" (2560x1600) screen that it truly is.
I am not incredibly familiar with how these values are set/read/configured, but after doing some research on the web and various forum posts it does seem that the framebuffer (which I believe is what is directly driving the TTY session, from my research?) is indeed displaying (incorrectly) at 2880x1800
#cat /sys/class/graphics/fb0/modes
U:2880x1800p-0
#cat /sys/class/graphics/fb0/mode
#
Other pages on the web indicated that I could actually change this via "fbset" and then "setterm --resize" so I tried that and it does resolve the issue however this fix does not seem to persist upon a reboot.
#fbset
mode "2880x1800"
geometry 2880 1800 2880 1800 32
timings 0 0 0 0 0 0 0
accel true
rgba 8/16,8/8,8/0,0/0
endmode
#fbset -fb /dev/fb0 -g 2560 1600 2560 1600 32
#fbset
mode "2560x1600"
geometry 2560 1600 2560 1600 32
timings 0 0 0 0 0 0 0
accel true
rgba 8/16,8/8,8/0,0/0
endmode
#cat /sys/class/graphics/fb0/modes
U:2560x1600p-0
U:2880x1800p-0
#setterm --resize
The HiDPI wiki page mentions changing the text size in the systemd boot menu, but doesn't mention anything about display resolutions. I have read things about possibly passing GRUB arguments (however I am using systemd boot) and other posts suggest "nomodeset" or passing "vga=" as a kernel parameter - however the Mac page on the Arch wiki indicates not to do this with Intel graphics, since Intel needs kernel mode-setting.
So then my question is - how do i get the "fbset" settings to survive a reboot? Is there a better way to achieve this same result with a different tool?
Any suggestions of things to try or other things to look into further would be very helpful. Thanks for taking the time to read this.
Last edited by rhus (2022-02-09 01:20:30)
Offline
So I poked around at this some more, and taking a cue from this StackOverflow I was able to write the fbset into a config file (commenting out the rgba line since fbset -db doesn't like that) and then a "fbset -db" command does the same thing as "setterm --resize".
#fbset >>/etc/local.fb.modes
#fbset -db /etc/fb.modes --all "2560x1600"
This updates the resolution of the TTY I am actively in so it no longer cuts off any lines of the terminal.
Then it's just a matter of putting this single command fbset -db /etc/fb.modes --all "2560x1600" into a little script to run at system startup. Figured I'd post this here in case anyone else runs into this issue.
Offline
I'd assume the easiest way would be [link=https://wiki.archlinux.org/title/systemd]a systemd service file.[/link] You'd have to turn it into a script like this:
display-res.sh
#!/bin/sh
#Set Display Size to 2560x1600
fbset -db /etc/fb.modes --all "2560x1600"
Then you can start it with this systemd .service file, at:
/etc/systemd/system/display-resolution.service (you make the file)
[Unit]
Description=Set Correct Display Resolution
[Service]
ExecStart=/path/to/display/script.sh
[Install]
WantedBy=multi-user.target
And then make the script executable by:
chmod u+x /path/to/display-res.sh
And finally, enable the service with:
sudo systemctl enable --now display-resolution
Tell me if this is wrong, or doesn't work.
BTW, this is all very simple, and you can add a lot more if you needed to.
Last edited by thehexagon (2022-02-09 05:35:18)
NZ - UTC+12, or UTC+13 (depends on DST) | HP ENVY x360 2-in-1 Laptop 15-EW0009TX
Offline
Oh, I thought you needed help to start it at boot, never mind my last post, I'll leave it there.
bruh
Last edited by thehexagon (2022-02-09 05:36:31)
NZ - UTC+12, or UTC+13 (depends on DST) | HP ENVY x360 2-in-1 Laptop 15-EW0009TX
Offline
@thehexagon - I did pretty much that after my last post, and thought I had it working, however checking systemctl status reveals that it fails on initial startup.
Here's the output that I'm seeing it fail.
fbset-resolution.service - Runs "fbset -db" to automatically restore the resolution to 2560x1600
Loaded: loaded (/etc/systemd/system/fbset-resolution.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-02-09 13:49:25 CST; 15min ago
Main PID: 287 (code=exited, status=1/FAILURE)
CPU: 5ms
Feb 09 13:49:25 satisfaction systemd[1]: Started Runs "fbset -db" to automatically restore the resolution to 2560x1600.
Feb 09 13:49:25 satisfaction fbset-resolution.sh[290]: open /dev/fb0: No such file or directory
Feb 09 13:49:25 satisfaction systemd[1]: fbset-resolution.service: Main process exited, code=exited, status=1/FAILURE
Feb 09 13:49:25 satisfaction systemd[1]: fbset-resolution.service: Failed with result 'exit-code'.
Here is my script:
#!/bin/sh -e
#
# EDID incorrectly reports screen resolution at 15" (2880x1800) but
# this is a 13" laptop (2560x1600). Script calls the modified config
# and properly sets the resolution for the framebuffer.
fbset -db /etc/fb.modes --all "2560x1600"
And here is my .service file:
[Unit]
Description= Runs "fbset -db" to automatically restore the resolution to 2560x1600
After=systemd-udev-settle.service
[Service]
ExecStart=/usr/sbin/fbset-resolution.sh
User=root
[Install]
WantedBy=multi-user.target
Based on my limited understanding of systemd, I initially thought the error was either because it needed to be ran as root (hence why I added User=root to the Service section) or that it was being run before the system fully initialized all hardware (hence why I added After=system-udev-settle.service to the Unit section). Neither of those things appear to work.
If I manually run "sudo systemctl start fbset-resolution" after I login to the TTY, it works w/o issue. Do you have any ideas? Is this error a permissions or timing based issue?
Offline
.
Last edited by Razek (2024-07-08 17:50:48)
Offline
Hi, I'm really sorry about the necro, but it seems it's better to talk here with all this context than starting fresh.
This post is marked as solved, but I'm not really finding a solution to the whole startup issue. I have the same systemd service set to startup as per @rhus. I'm also getting the
open /dev/fb0: No such file or directory
problem.
Was there a special trick to get this to run as a systemd service?
ps. mods, just nuke this if you don't like the necro and I will start from scratch...
Cheers,
Albert
Offline
You should have made a second post, with a link to this post, but too late now
Anyways sounds like race condition so you'd have to add a dependency, ie the services which initialises /dev/fbX. See https://wiki.archlinux.org/title/systemd#Examples
NZ - UTC+12, or UTC+13 (depends on DST) | HP ENVY x360 2-in-1 Laptop 15-EW0009TX
Offline