Skip to main content
Topic: Decrease virtual console framebuffer resolution without losing startx (Read 1645 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Decrease virtual console framebuffer resolution without losing startx


Hello everybody,

I've just installed Artix for the first time, and it looks like everything works really very well by default (base system ISO, with runit, currently updated).

I have only just a major problem (or annoyance) as of now:

My laptop integrated monitor is quite small (12.5"), and the default (and optimal) screen resolution is 1920 x 1080, correctly detected by Artix.

But the text looks too small for me (readability issues, e.g. with st maximized I strike almost 8-9 Ctrl+Shift+PageUp), and so I'd like to decrease the screen resolution.

Since the system boots in text mode, and I run X only when I need it (startx + dwm, and I'm happy with it), I need to properly configure:

  • the virtual consoles
  • the X server
  • GRUB (its text is also too small)

About the X server, I've found a working solution:
Code: [Select]
X -configure
generated /etc/X11/xorg.conf via xorg.conf.new ; below the part of interest I edited by hand (with the help of xrandr)

Code: [Select]
SubSection "Display"
Viewport   0 0
Depth     24
Modes     "1368x768"
EndSubSection

GRUB too is ok:

/etc/default/grub
Code: [Select]
#GRUB_GFXMODE=auto
GRUB_GFXMODE=800x600x32
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=800x600

Code: [Select]
grub-mkconfig -o /boot/grub/grub.cfg

The problem is the virtual consoles (I'd like to have 800x600 like in GRUB): I'm not able to configure them: I've done several trial and errors about them; below I write only the commands that (I hope) changed something:

/etc/grub.d/10_linux

Original:
Code: [Select]
linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args}

Edited:
Code: [Select]
linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args} nomodeset i915.modeset=0

Code: [Select]
grub-mkconfig -o /boot/grub/grub.cfg

With the original configuration startx works correctly (but the text in the virtual console is too small).

With the edited configuration the text on the virtual console (after GRUB and before startx) looks big (as I want), but startx doesn't work anymore.

My ~/.xinitrc contains:
Code: [Select]
exec dwm

startx (launched in the not-working mode (edited configurtion), as a normal user)
Code: [Select]
...
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Oct 27 08:12:47 2020
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory: "/usr/share/X11/xorg.conf.d"
 for additional information.(EE) (EE) Server terminated with error (1). Closing log file.Xorg.0.log
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

Some other lines from the error file mentioned above:

Code: [Select]
[    91.339] (WW) Failed to open protocol names file lib/xorg/protocol.txt
...
[    91.349] Current Operating System: Linux rtx 5.9.1-artix1-1 #1 SMP PREEMPT Sat, 17 Oct 2020 18:30:26 +0000 x86_64
[    91.349] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=a8a19bcc-e563-4cc8-9bd5-4fb6f9f980fb rw vga=0x002 loglevel=3 quiet
...
[    91.372] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    91.373] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    91.375] (==) ServerLayout "X.org Configured"
[    91.375] (**) |-->Screen "Screen0" (0)
[    91.375] (**) |   |-->Monitor "Monitor0"
[    91.375] (**) |   |-->Device "Card0"
[    91.375] (**) |-->Input Device "Mouse0"
[    91.375] (**) |-->Input Device "Keyboard0"
[    91.375] (==) Automatically adding devices
[    91.375] (==) Automatically enabling devices
...
[    91.382] (**) FontPath set to:
/usr/share/fonts/100dpi,
/usr/share/fonts/75dpi,
/usr/share/fonts/100dpi,
/usr/share/fonts/75dpi
...
[    91.382] X.Org ANSI C Emulation: 0.4
[    91.382] X.Org Video Driver: 24.1
[    91.382] X.Org XInput driver : 24.1
[    91.382] X.Org Server Extension : 10.0
[    91.383] (++) using VT number 1
...
[    91.384] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
...
[    92.116] (II) event5  - DELL Wireless hotkeys: device is a keyboard
[  7296.409] (EE)
Fatal server error:
[  7296.481] (EE) systemd-logind disappeared (stopped/restarted?)
[  7296.481] (EE)
[  7296.481] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
 for help.
[  7296.481] (EE) Please also check the log file at "/home/user/.local/share/xorg/Xorg.0.log" for additional information.
[  7296.481] (EE)
[  7296.483] (II) AIGLX: Suspending AIGLX clients for VT switch
[  7296.484] (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
[  7296.484] (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
[  7296.484] (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
[  7296.484] (EE) systemd-logind: ReleaseControl failed: Connection was disconnected before a reply was received
[  7296.484] (EE) Server terminated with error (1). Closing log file.

If I revert to the original configuration (without nomodeset i915.modeset=0) startx works again (wih text too small).

Some other details about GRUB...

Code: [Select]
grub> videoinfo
List of supported video modes:
Legend: mask/position=red/green/blue/reserved
Adapter: `Cirrus CLGD 5446 PCI Video Driver':
  No info available
Adapter: `Bochs PCI Video Driver':
  No info available
Adapter: `EFI GOP Driver':
  0x000 1920 x 1080 x 32 (7680)  Direct color, mask: 8/8/8/8  pos: 16/8/0/24
  0x001  640 x  480 x 32 (2560)  Direct color, mask: 8/8/8/8  pos: 16/8/0/24
* 0x002  800 x  600 x 32 (3200)  Direct color, mask: 8/8/8/8  pos: 16/8/0/24
  0x003 1024 x  768 x 32 (4096)  Direct color, mask: 8/8/8/8  pos: 16/8/0/24
  0x004 1280 x 1024 x 32 (5120)  Direct color, mask: 8/8/8/8  pos: 16/8/0/24
  EDID version: 1.4
     Preferred mode: 1920x1080
grub>

... about my video card...

lspci -v | egrep -i --color "vga|3d|2d"
Code: [Select]
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07) (prog-if 00 [VGA controller])

lspci -v -s 00:02.0
Code: [Select]
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07) (prog-if 00 [VGA controller])
        DeviceName:  Onboard IGD
        Subsystem: Dell Device 06db
        Flags: bus master, fast devsel, latency 0, IRQ 131
        Memory at e0000000 (64-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: i915
        Kernel modules: i915

... and about the framebuffer (without nomodeset i915.modeset=0, when startx works and with resolution too high and text too small):

grep buffer /var/log/dmesg.log
Code: [Select]
[    0.142264] TAA: Mitigation: Clear CPU buffers
[    0.142268] MDS: Mitigation: Clear CPU buffers
[    0.324070] e820: reserve RAM buffer [mem 0x00058000-0x0005ffff]
[    0.324072] e820: reserve RAM buffer [mem 0x0009e000-0x0009ffff]
[    0.324073] e820: reserve RAM buffer [mem 0x9d5fc000-0x9fffffff]
[    0.324074] e820: reserve RAM buffer [mem 0xa8e77000-0xabffffff]
[    0.324075] e820: reserve RAM buffer [mem 0xab414000-0xabffffff]
[    0.324076] e820: reserve RAM buffer [mem 0xac500000-0xafffffff]
[    0.324077] e820: reserve RAM buffer [mem 0x44e000000-0x44fffffff]
[    0.447378] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.461982] efifb: framebuffer at 0xd0000000, using 1920k, total 1920k
[    0.462035] fb0: EFI VGA frame buffer device
[    1.717538] Console: switching to colour frame buffer device 100x37
[    5.520098] Console: switching to colour frame buffer device 240x67
[    5.544038] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device

How can I achieve my goals?

Also, if anyone thinks there are better ways to achieve my goals, please feel free to suggest other solutions.

And if you think I provided too little information, please feel free to ask me to submit more.

Many thanks in advance.


Re: Decrease virtual console framebuffer resolution without losing startx

Reply #2
These settings might help:
https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks
GRUB_GFXMODE=1024x768x32,auto
GRUB_GFXPAYLOAD_LINUX=keep

Although when I was trying to do something with those settings a few years ago on another distro it didn't work as I had hoped, my problem then was the first boot messages were one size then later it switched to another, but it could be different for you now.

Re: Decrease virtual console framebuffer resolution without losing startx

Reply #3

Hello,

first of all, thanks everybody for the quick responses.

@alium:

Quote
For xserver can you not just scale font size, or  maybe can help if you increase dpi ... Maybe can help some setting from hidpi ...

I feel quite satisfied with my X configuration, the problem lies in the virtual consoles. But I'll keep your suggested articles for later reading, to eventually improve the X server configuration.

Quote
Modesetting should be stay enabled.

You mean no nomodeset i915.modeset=0 , right? I'd like to agree, but without those parameters set I don't see any real change.

Also, without nomodeset i915.modeset=0 , if I launch a virtual console from within X (e.g. Ctrl+Alt+F3) and call fbset directly, on the fly, (e.g. fbset -xres 1024 ; fbset -yres 600 ... -vxres ... -vyres ... etc.), the font size stays small, but the whole "console screen" becomes less than half of the "real display" (placed starting from top left; the bottom and right parts of the display are black, without text, not usable).

@#######:

I've applied the following changes...

/etc/X11/xorg.conf (a second resolution as a fallback)
Code: [Select]
...
SubSection "Display"
Viewport   0 0
Depth     24
Modes     "1368x768" "1024x768"
EndSubSection
...

/etc/default/grub
Code: [Select]
...
GRUB_GFXMODE=1024x768x32,auto
GRUB_GFXPAYLOAD_LINUX=keep
...

grub-mkconfig -o /boot/grub/grub.cfg

... but unfortunately nothing changed:

/etc/grub.d/10_linux

Code: [Select]
linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args}

like before, too small text in virtual console and startx working

Instead,

Code: [Select]
linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args} nomodeset i915.modeset=0

means big text in the virtual consoles (smaller than before, since we moved from 800x600 to 1024x768) but startx still not working.

In my opinion, there are still two kind of errors I'm not able to diagnose: the first is about permissions (?) , see my first post ...

Code: [Select]
[  7296.484] (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
[  7296.484] (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
[  7296.484] (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
[  7296.484] (EE) systemd-logind: ReleaseControl failed: Connection was disconnected before a reply was received
[  7296.484] (EE) Server terminated with error (1). Closing log file.

... and the second one is "new" (/dev/dri/card0: No such file or directory)?

Code: [Select]
[    12.780] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    12.780] (EE) open /dev/dri/card0: No such file or directory
[    12.780] (WW) Falling back to old probe method for modesetting
[    12.780] (EE) open /dev/dri/card0: No such file or directory
[    12.780] (EE) Screen 0 deleted because of no matching config section.
[    12.780] (II) UnloadModule: "modesetting"
[    12.780] (EE) Device(s) detected, but none match those in the config file.
[    12.780] (EE)
Fatal server error:
[    12.780] (EE) no screens found(EE)
[    12.780] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    12.780] (EE)
[    12.784] (EE) Server terminated with error (1). Closing log file.

In the next days I'll be at work, so I won't be able to answer quickly, but thanks in advance for any other kind of feedback.

Re: Decrease virtual console framebuffer resolution without losing startx

Reply #4
Code: [Select]
You mean no nomodeset i915.modeset=0 , right? I'd like to agree, but without those parameters set I don't see any real change.

NO! Kernel mode setting (KMS) is supported by Intel chipsets that use the i915 DRM driver and is mandatory and enabled by default. So, you should use modesetting (not disable it as you did)

Re: Decrease virtual console framebuffer resolution without losing startx

Reply #5
Hi,

ok, I leave KMS enabled (here another reason not to disable it).

But I'm not able to proceed furthermore because:

  • I lack the knowledge regarding the framebuffer and all its related tools;
  • I don't know if the correct driver (or fb-support) for my integrated video card has been installed or not (anyway, I believe Artix did it).

I can provide other information, hoping it can help somehow:

  • I've added the unprivileged user I currently use to the video group

# chmod o+r /dev/fb0
Code: [Select]
mode of '/dev/fb0' changed from 0660 (rw-rw----) to 0664 (rw-rw-r--)

# fbset --info
Code: [Select]
mode "1920x1080"
    geometry 1920 1080 1920 1080 32
    timings 0 0 0 0 0 0 0
    accel true
    rgba 8/16,8/8,8/0,0/0
endmode

Frame buffer device information:
    Name        : i915drmfb
    Address     : (nil)
    Size        : 8294400
    Type        : PACKED PIXELS
    Visual      : TRUECOLOR
    XPanStep    : 1
    YPanStep    : 1
    YWrapStep   : 0
    LineLength  : 7680
    Accelerator : No

# 915resolution -l
Code: [Select]
Intel 800/900 Series VBIOS Hack : version 0.5.3

Unknown chipset type and unrecognized bios.
915resolution only works with Intel 800/900 series graphic chipsets.
Chipset Id: 19048086

# hwinfo --framebuffer (doesn't produce any output, but below some output from hwinfo launched without parameters):
Code: [Select]
...
 efi-framebuffer: /devices/platform/efi-framebuffer.0
...
  <6>[    5.932184] i915 0000:00:02.0: [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.
  <6>[    5.948744] Console: switching to colour frame buffer device 240x67
  <6>[    5.973548] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device

$ cat /etc/fb.modes (several resolutions are present, maybe by default, not necessary related to my video card)
Code: [Select]
...
mode "1024x768-43-lace"
...
mode "1024x768-60"
...
mode "1024x768-70"
...
mode "1024x768-72"
...
mode "1024x768-75"
...
mode "1024x768-90"
...
mode "1024x768-100"
...

$ cat /sys/class/graphics/fb0/modes (maybe the first line was introduced by me during trial and error by mistake?)
Code: [Select]
U:1024x768p-0
U:1920x1080p-0

$ cat /sys/class/graphics/fb0/mode (empty file)

$ cat /sys/class/display/mode (file doesn't exist)

$ cat /sys/class/display/modes (file doesn't exist)

@alium:
Quote
For xserver can you not just scale font size, or  maybe can help if you increase dpi

I have a feeling like:

  • X server configuration is not related to my issue;
  • I believe the solution is related to the resolution, not to make KMS use the whole screen and setfont to adjust the console font size.

Another (maybe?) approach could be install and configure Uvesafb (here and here)?

 

Re: Decrease virtual console framebuffer resolution without losing startx

Reply #6
keeping native resolution your TFT panel and just enlarging the font in the console can't help solve your problem?

why do you actually need to change the resolution in the terminal? you normally boot into DE, don't you? working a few hours in the base console seems a bit "impractical" to me...