Warning: there may be occasional oddness due to css and blog edits. **Active remodel of blog posts - mostly starting with most recent** 70/86
Showing posts with label 4K. Show all posts
Showing posts with label 4K. Show all posts

Saturday, May 30, 2026

Adjusted look at 4k

Right as I was getting ready to write this blog post, I decided to look at the post I made about 6 years ago about High DPI.  I saw a line pertaining to firefox which I wanted to check and test, and then mistyped.  I made the fonts for firefox (librewolf) 85 instead of .85 which meant I had to do some new magic to reduce it back to normal so I could undo the change I just made.  What I did was to adjust one environment variable down to 0.05 and then restart my X session to be sure it took effect.  When I started up my browser, everything was still much too large, but a single F from the File menu item did not fill nearly the whole screen.  So much unexpected fun, as a prelude to writing about the mess that is DPI related settings in the realm of Linux.

Click image to enlarge

We all know that there are multiple standards and multiple methods, and more variation on everything than we can name, which is all crying out for a standard that does not exist or is unheeded.  Some weeks ago I chose to look for any and all environment variables which had any bearing on dpi or dimensionality of applications, their GUI, or how they were sized on the desktop.  Using FVWM means that there is no integrated method that is nearly universal for my entire desktop or apps specifically written for use within it.  KDE has its method primarily involving Qt, and GNOME primarily uses GTK, and there is also SDL which mostly relates to games but could affect multimedia applications.  There is a decently capable configurator for Qt in ports at misc/qt5ct or misc/qt6ct that can be used to adjust font sizes and more.  Firefox, Luanti, Bluefish and likely many other applications have settings for font sizes easily visible, firefox has one more buried in its about:config.

If you are wondering which method is likely to govern how dpi or font sizes might be set, all that is necessary is to check the pkg info for the application, such as pkg info www/librewolf which results with plenty of useful details, but note libgdk.

pkg info
librewolf-151.0.1
Name           : librewolf
Version        : 151.0.1
Installed on   : Fri May 29 00:33:55 2026 CDT
Origin         : www/librewolf
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : wayland www
Licenses       : MPL20
Maintainer     : freebsd@sysctl.cz
WWW            : https://librewolf.net/
Comment        : Custom version of Firefox, focused on privacy, security and freedom
Options        :
	ALSA           : off
	CANBERRA       : off
	DBUS           : on
	DEBUG          : off
	FFMPEG         : on
	JACK           : on
	LIBPROXY       : off
	LTO            : off
	OPTIMIZED_CFLAGS: on
	PROFILE        : on
	PULSEAUDIO     : on
	SNDIO          : on
	TEST           : off
Shared Libs required:
	libX11-xcb.so.1
	libX11.so.6
	libXcomposite.so.1
	libXdamage.so.1
	libXext.so.6
	libXfixes.so.3
	libXrandr.so.2
	libatk-1.0.so.0
	libc++.so.1
	libc.so.7
	libcairo-gobject.so.2
	libcairo.so.2
	libcxxrt.so.1
	libdbus-1.so.3
	libdl.so.1
	libevent-2.1.so.7
	libffi.so.8
	libfontconfig.so.1
	libfreetype.so.6
	libgcc_s.so.1
	libgdk-3.so.0
	libgdk_pixbuf-2.0.so.0
	libgio-2.0.so.0
	libglib-2.0.so.0
	libgobject-2.0.so.0
	libgtk-3.so.0
	libharfbuzz.so.0
	libjpeg.so.8
	libm.so.5
	libnspr4.so
	libnss3.so
	libnssutil3.so
	libpango-1.0.so.0
	libpixman-1.so.0
	libplc4.so
	libpng16.so.16
	libsmime3.so
	libssl3.so
	libthr.so.3
	libutil.so.10
	libvpx.so.12
	libwebp.so.7
	libwebpdemux.so.2
	libxcb-shm.so.0
	libxcb.so.1
	libz.so.6
Annotations    :
	FreeBSD_version: 1500068
	build_timestamp: 2026-05-26T22:04:59+0000
	built_by       : poudriere-git-3.4.8
	cpe            : cpe:2.3:a:mozilla:librewolf:151.0.1:::::freebsd15:x64
	no_provide_shlib: yes
	port_checkout_unclean: no
	port_git_hash  : b8257e1e1598db33ed01c9850a7218d07ba3fcd7
	ports_top_checkout_unclean: no
	ports_top_git_hash: 04e1cd789391e25aa7c4687d407d2abbdd992286
	repo_type      : binary
	repository     : FreeBSD-ports
Flat size      : 339MiB
Description    :
LibreWolf is a free and open source web browser descended from the
Mozilla Application Suite. It is small, fast and easy to use, and offers
many advanced features:

 o Popup Blocking
 o Tabbed Browsing
 o Live Bookmarks (ie.  RSS)
 o Extensions
 o Themes
 o FastFind
 o Improved Security

As I mentioned before, firefox and librewolf determine their scaling with a GDK variable and the same output for mudlet verifies that its a Qt application.

pkg info
Mudlet-dev-g20260525
Name           : Mudlet-dev
Version        : g20260525
Installed on   : Fri May 29 02:01:23 2026 CDT
Origin         : games/Mudlet-dev
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : games
Licenses       : GPLv2+
Maintainer     : nope@nothere
WWW            : https://mudlet.org/
Comment        : Cross-platform, open source, super fast MUD client with lua scripting
Shared Libs required:
	libGLU.so.1
	libGLX.so.0
	libOpenGL.so.0
	libQt6Concurrent.so.6
	libQt6Core.so.6
	libQt6Core5Compat.so.6
	libQt6DBus.so.6
	libQt6Gui.so.6
	libQt6Multimedia.so.6
	libQt6MultimediaWidgets.so.6
	libQt6Network.so.6
	libQt6OpenGL.so.6
	libQt6OpenGLWidgets.so.6
	libQt6TextToSpeech.so.6
	libQt6UiTools.so.6
	libQt6Widgets.so.6
	libassimp.so.6
	libc++.so.1
	libc.so.7
	libcxxrt.so.1
	libdl.so.1
	libexecinfo.so.1
	libgcc_s.so.1
	libhunspell-1.7.so.0
	libkvm.so.7
	liblua-5.1.so
	libm.so.5
	libonig.so.5
	libpcre2-8.so.0
	libpugixml.so.1
	libqt6keychain.so.1
	librt.so.1
	libsqlite3.so.0
	libsysinfo.so.0
	libthr.so.3
	libyajl.so.2
	libz.so.6
	libzip.so.5
Annotations    :
	FreeBSD_version: 1501500
Flat size      : 60.9MiB
Description    :
Mudlet is a platform for gaming and enhancing game-play primarily with MUDs.
Mudlet provides a toolkit and supports a wide variety of protocols for players
and creators to tailor an immersive game-playing experience. MUD creators can
use Mudlet to add visual flair or build features into their text games. MUD
players can utilize the Mudlet toolkit to script and automate parts of their
gameplay or add their own visual customization for game data.

Outside the realm of MUD games, Mudlet has even been used to provide
automation and features in 3D games which support in-game chat and a Telnet or
similar server-console protocols.

The group of environment variables that have a bearing upon various UI elements or dimensionality are easily set, but finding a group of settings that is most appealing or mostly comparable may take some fiddling.  I have begun to prefer small favicons on my browser tabs and relatively small font.  What I have configured as a group of settings works fairly nice.  I have read that antialiasing on 4k or above is not so pertinent.  I choose to let Qt control the dpi automatically, mostly, some applications might not follow it or only use it for some portions or only use the qt scale factor method.  These settings attempt to have as much uniformity as possible.  The settings are good for a 4k screen.

csh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv FC_ANTIALIAS false
setenv FC_SCALE 2.0
setenv GDK_BACKEND x11
setenv GDK_DPI_SCALE 1.0
setenv GDK_SCALE 1.5 
setenv GDK_USE_XFT 1
setenv PLASMA_USE_QT_SCALING 1
setenv QT_AUTO_SCREEN_SCALE_FACTOR 1
setenv QT_ENABLE_HIGHDPI_SCALING 1
setenv QT_QPA_PLATFORM xcb
setenv QT_QPA_PLATFORMTHEME qt6ct
setenv QT_SCALE_FACTOR 2.0
setenv QT_XFT 1
setenv SDL_RENDER_DRIVER opengl
setenv SDL_RENDER_VSYNC 1
setenv SDL_VIDEODRIVER x11
setenv SDL_VIDEO_FULLSCREEN_DISPLAY 0
setenv SDL_VIDEO_X11_SCALING_FACTOR 2.0
setenv SDL_VIDEO_X11_XRANDR 1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Firefox and librewolf have an about:config setting, layout.css.devPixelsPerPx which I have set to 0.85, and within the browser settings I have fonts set to 14 with minimum of 12, and allow sites to choose their own fonts ticked.  The UI font in bluefish I set to 9, the Editor settings font is set for 9 with a cursor/font ratio% of 20.  Mudlet I have the main display font size set at 9 with antialias ticked.  The qt6ct has General and Fixed width font size 9, with no fonts.conf file kept.  Sometimes fonts get scaled or fail to be scaled, while other parts or the UI fit a high dpi screen decently using one variable or another.

In addition to these environment variables and individual application configurations, I have also added to my .Xdefaults or .Xresources file, Xft.dpi: 150 which affects some of the other things like xterm font size.

The settings as a whole works well for me.  Aside from trying to search for environment variables generally, a large chunk of the HiDPI information is from Arch. We can dream of a day when everything on Linux can handle scaling identically across GTK/GDK and Qt and every other toolkit, with at most an evironment variable to select the system or toolkit, and the two or three for that system or toolkit that determine the scale or dpi of fonts and objects.  Until that day arrives, but it may never arrive, we will have to periodically monitor to see what has changed among all the many methods, so we can get a coherent mostly consistent UI.

Note about minimum font size in firefox
This is a useful feature to force all websites to display a larger font at all times, if their smallest becomes unreadable.  However, this will hide all other attempts to adjust font size such as when developing a web page or changing the appearance of a blog using CSS.  This is something I learned later, when I cleaned up the blog a second time.

Monday, September 15, 2025

Stuck with scfb

What an unusual change, that once I did my best to keep the scfb driver uninstalled and now I have to use it.  I recently upgraded my system from 14-stable to the newly available 15-stable.  The usual process of updating src via git had a small hiccup due to a missing update to the blog post I perused.  The minor detail I missed was that git switched to using https and that was what stopped the /usr/src update.  All my blog posts now mention that git change where I had described the old method.  The update was quick and building kernel and world went smoothly as expected.

When I was booted into the 15-stable kernel with world, I knew I had a lot of adjusting to do with regard to installed software or any other changes.  I had saw an easy way to handle the task somewhere online.  What I did was pkg upgrade -f right after I used gitup ports to update the ports tree.  What I didn't know was that pkg was missing or not in a working state, so I had to do pkg bootstrap -f and after I did the pkg upgrade -f, I expected most things to just work.

You can make an educated guess that of course things did not work as expected or hoped.  When I tried to start the X server so I could get back to using my pc as normal, it failed, some errors that seemed to be related to a mismatch with the kernel.  I figured I could get past this issue by being certain to build locally with my updated ports tree.  I rebuilt graphics/mesa-dri which pulled in graphics/libdrm (and I believe graphics/mesa-libs which makes sense), next I rebuilt graphics/drm-kmod which also provided gpu-firmware-kmod, after that was x11-drivers/xf86-video-amdgpu, next was x11-servers/xorg-server, and finally x11/xinit.  I believed I had everything remade compatible with 15-stable and so I tried to start X again.

I must have assumed that I needed to reboot to have everything load properly, but this simply made me reboot a second time into single user so I could remove all the graphics stuff.  Only after the graphics drivers were not trying to load could I boot into text only.

With all that I rebuilt, it gave an error that seemed to be a conflict between drivers?  In the /var/log/Xorg.0.log file it seemed to load a raven driver and then picasso, but it couldn't find the amdgpu_picasso_gpu_info_bin file.  No matter how many times I repeated the rebuild process to be sure I hadn't made any mistakes, I got the same result.  The only way I could succeed to boot was to make sure the graphics was uninstalled, and usually I had to do that via single user.

With too many attempts already made, I remembered that there was the vesa driver which could work, and also the scfb driver I could try.  I installed vesa first and tested it to see an unusable former 4k desktop squeezed into 640 x 480, everything huge on my 4k monitor.  I didn't have mouse, so I couldn't exit fvwm or use an xterm to do anything, but I believe an alternate virtual tty was accessible, and I killed it from there.  Next was the scfb driver which had always wanted to get in the way of the amdgpu driver in the past.  When I got into X again, it was still quite large but much more usable.  I also cured the mouse issue by building the mouse driver which was mysteriously missing.

I have during and since been searching for any recent reports or information about this issue.  Most of the results are rather old, like 2019, or (of course) very Linux specific which does me no good, since their solutions are purely for that distro and its install methods.  I did see mention somewhere about a change to driver naming or something, I am very unclear on that.  That was in Linuxland, so if there was a change in that realm, we need to wait for it to be propagated into FreeBSD before maybe I will see a fix and get back to my amdgpu driver with 4k.  I don't believe there is anything more I can do besides wait, but I will likely keep trying to get away from scfb.

UPDATE:
That was pleasantly fast.  I suffered with graphics being broken and forced into second class scfb for my driver for only two or three days.  Moments after posting the above, I went to /usr/local/etc/pkg/repos to edit the FreeBSD.conf file to disable FreeBSD-ports-kmods, and then upgraded pkg and updated, and after all the drivers were reinstalled, I have my 4k back.  While I watched the update listing, it showed those graphics drivers did indeed all get updated to a more recent version.  I cannot say whether there was a problem in the drivers or if any file was missing, or if strangely those kmod files were not pulled from FreeBSD-ports-kmods repo if that happened before.  All that I can say right now is that my experience with the situation and my suffering scfb for a short time was documented above.  How ever things got corrected, I am grateful for the work by those involved.

Tuesday, September 1, 2020

Goin High Def

I recently made a significant upgrade to the monitor my primary system uses.  I knew there would be a bit of adjustment to make, but when I unplugged the HDMI cable from the retired Samsung TV and attached it to the new Samsung 4k monitor, everything seemed to be about the same.  There was nothing to adjust, no issues with the display that I could see.  This all changed when I decided to reboot my pc.

There didn't seem to be anything I could do to make my GUI behave the same as it once had, to fill the whole of my new monitor without first having black bars on the left and right, then later it was all simply a horribly bad dpi on a formerly HD monitor.  One of the first things I tried, was in hopes that the solution was simple, that for whatever dumb reason my video card couldn't see the proper screen size and by extension wasn't reporting this to the OS.

My interim solution prior to this was to temporarily power up my old monitor, attach it by HDMI to my pc, then reboot and let the software set things up as they had been.  After X was up on the old monitor, I could plug the HDMI cable into the new display which would then retain the better dpi until a reboot.

I bought a new DisplayPort cable because it has more capability than even my supposedly HD capable HDMI cable which I bought because an older cable began to fail.  I plugged in the new cable, rebooted to get the graphics card to use the proper port, and nothing, things were no better.

The next change was in many ways a fluke, because it was an adjustment I made which had been working just fine so I had no idea that it could be the one detail to begin to get everything working right, finally.  Before this change, I tried variations on two lines for the kldload of the correct driver, first radeon and then amdgpu and back again.  When that was eliminated as the reason (and it was working though still bad resolution etc.) I removed the comments from what ultimately cured nearly everything.

	#WITHOUT_DRM_MODULE="YES"
	#WITHOUT_DRM2_MODULE="YES"

And now we both see why I am baffled.  I swear I had enabled those two lines which lead to the solution, but to write this blog post I just went to the /etc/rc.conf file to discover them commented out!  Did I not do as I believed I did?  Or maybe somehow something automatically recommented them out?  I have no idea, so I guess I will have to continue with the other issues which I solved and assume that I must have forgot, that the driver was the issue perhaps.

I regretfully do not have any screenshots to show, which would describe the remaining issues.

Nearly everything about firefox was extremely tiny.  Most webpages rendered with what appeared to be maybe an 8px font instead of a more legible 12px.  It took a bit of time to finally stumble upon the solution because we all know how easy it is to find technical answers with google.

What I discovered is that yet again firefox does things itself rather than abide by the host or its environment.  The fix is done by adjusting an about:config setting.  I discovered that mine had been set to .9 which may be default and this could be reason for some oddness in how firefox is different than other browsers.  The setting below seems pretty close to perfect.
layout.css.devPixelsPerPx 1.50

That was the first adjustment for firefox, as it still insisted upon using a second set of mouse cursors and at much larger size than my fvwm desktop UI, which was distracting and annoying.

It seems that at least for the *nix/*bsd world that gtk3 is used by firefox and this is what is overriding the mouse cursor settings.  So to fix this, or get rid of the gtk choice, I edit a file to remove one line.

Edit ~/.config/gtk-3.0/settings.ini to remove the line which defines it:
gtk-cursor-theme-name=whiteglass

So now that my firefox was looking almost normal again, I could work on the remaining GUI issues.  One is to adjust fvwm to have a larger mouse cursor as it is just barely usable size.  I figured out how to make whiteglass mouse cursor theme as an overall default on my desktop as I've always liked its style.  These changes were made for X and fvwm honors them.

Edit ~/.Xdefaults or ~/.Xresources to include lines:
Xcursor.theme: whiteglass
Xcursor.size: 22

My default font size for xterm was also modified by adding the line below to ~/.Xdefaults which may still be a little small but it is much better than what it would otherwise be.
XTerm*Font:-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1

Update
Either things changed or I was not entirely accurate in all of my adjustments described here.  I wrote about this a second time in 2026, an Adjusted look at 4k, with more environment variables mentioned.

Frequently viewed this week