Testers for inxi/pinxi redone -C CPU logic... huge internal changes
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That kde is a good sample, thanks. I'm puzzled as to why kwin_wayland is the compositor but it failed to set the WAYLAND_DISPLAY value. I hope gnome and kde aren't doing something clever there. The compositor logic was revised to show 1 or more compositors instead of the old 'the first that is found', just in case that situation arises.
The ports output was a nice touch, luckily fairly early on a guy testing it was running a laptop using an external monitor with his lid closed, which switched off the laptop screen, and he tripped the 'disabled' but 'connected' status, which I hadn't realized was a thing. So 'off:' means it's connected but disabled, for whatever reason, at least, that's how the kernel sees it. Before he came up with that case, it only had the 'active:' and 'empty:' options for ports.
Testing this stuff is hard because for some of the stuff, it has to be connected to hardware, not virtual machines, as you found, for example a virtual machine 'monitor' is virtual, and has no edid, at least not in my tests.
One of the nastier surprises I got during this process was discovering that xorg xrandr would randomly alter the internal monitor port ids, which are stable and consistent in the /sys/class/drm data, but are unstable and random in xorg data, but we did find some patterns, which allow a good guess to be made to map the internal port ID to the xorg monitor id. As usual, on all my test systems, these were the same in both cases, so I had not found that bug until testers exposed it, then I had to create a mapping function to try to map the xorg id to the kernel sys id.
Then there came the further nasty surprise that Xwayland further abstracted the monitor ids, and gave them totally random XWAYLAND[number] ids, which there was no way to reliably map to the /sys monitor ids. Basically, for 1 monitor, it will be right, for 2 monitors, it will be right if and only if the two /sys monitor ids sort to the same result as sorting the XWAYLAND[number] sorts, if not, they will be reversed, to unknown results. > 2 monitors make this worse, and more likely the matches will be wrong. The only hope is that xrandr synthesizes these ids based on an alpha numeric sort of the discovered real monitor ids in /sys, but there's nothing I can do about that beyond probably adding more tests, or dumping the xrandr data in such cases.
So far, fingers crossed, wayland tools do not appear to do this mapping, but I am not optimistic that they won't also end up randomizing these ids when they feel the creative urge to do so. But I hope they don't, otherwise a lot of this logic will just fall apart.
I've upgraded the internal tests for wayland compositors, which will appear in the -S desktop: item, possibly in the wm: item of -Sxx, and in the compositor: item of -G. These were kind of scattered and hard to maintain previously, now it's integrated and easy to maintain, but I may have broken some fringe window manager IDs, but it was worth it I think.
Next step is to take developer human readable weston-info/wayland-info output and turn it into machine usable output, a step that shouldn't be required since this is relatively new software that should have been written to produce clear machine readable output, but they didn't feel that was necessary, sigh... would have taken so little work to do it well and right....
fourtysixandtwo, re the error not showing in earlier slackware's with old kernels, that's because that logic was only called when the /sys/class/drm/card0-[ID]/edid file was found. I don't believe the 2.4/2.6 kernels had that part of the /sys file system, and it's also possible that very old monitors did not have edid files, so far in my limited testing, very old monitors have not had edid data, but that's a sample of 1 so not much to be concluded. I can look up in older datasets to see id the edid file existed in /sys with content, but generally it doesn't matter to inxi if it is there or not, if it is, and it can be read and is not empty, then the user gets bonus monitor data, in or out of x/display.
Next step is to take developer human readable weston-info/wayland-info output and turn it into machine usable output, a step that shouldn't be required since this is relatively new software that should have been written to produce clear machine readable output, but they didn't feel that was necessary, sigh... would have taken so little work to do it well and right....
"But..but...it's new and better" I hear that sigh man.
Fresh output from the -30 version. k53e looks fine, but now missing a lot of data from my main desktop (bottom).
That was a small bug I introduced while trying to 'streamline' some filter rules and functions, cough.. they got streamlined a bit too much, got another report from someone this morning about that failed attempt to be clever on my part, that's now corrected. That would have been a bad one to release in that form.
Moral of the story, don't mess with core cleaners and filters, they are used all over, and some are more dangerous and destructive potentially than others.
The kwin_wayland has xrandr I assume, or xdpyinfo, one of those, that's the only way the 'Screen-1:' line can appear, since that's an X.org concept which Wayland doesn't use.
Someone is bravely trying to resolve the scattered wayland compositor libraries issue, a KDE guy is trying to make a wlroots based compositor, KWinFT, which if it catches on, would leave only Gnome and Enlightenment as the only other large compositor projects outside of wlroots/sway. I doubt he'll be successful in his attempt to replace kwin_wayland (due to organizational inertia and NIH syndrome) but one can always hope. I did also learn that automotive OEMs like weston compositor for some reason, probably because their use case is very limited, so that one is also actually seeing some use in the real world.
Unfortunately this leaves gnome/kde non handled unless they installed weston package for some reason, or if wayland-info, the standalone version of weston-info, gets packaged, there is some murmur that people do actually recognize that having one global tool might be of some utility!! If it took them 10 years to discover that dead obvious thing, I guess we can say better late than never, but that tool was cloned from weston about a year ago and I've seen no activity related to it beyond the initial creation of the repo.
wayland-info 'features' the same machine hostile output as weston-info, so inxi / pinxi is treating them as one or the other can be used for that data collector, but odds are wayland-info / weston-info will change syntax, I'd put very high odds on that happening because with output that clearly raw and dev debugger left in place quality someone must come along and go, hey, this output is not very good, maybe I'll clean it up or change it! At which point the inxi rules will instantly break since they rely on fragile regex which from experience with that type of output I know will break sooner than later.
Unless something comes up, I think I"m going to call it good. I haven't found any data sources for kwin or mutter/gnome-shell wayland, so those will just be left to work if person has wayland-info or weston-info installed, otherwise it will fall back to the new /sys monitor logic, which is decent overall, particularly if you install Parse::EDID perl module.
I went though the pinxi.1 man page (use sudo pinxi -U --man to install the man page) and fixed some priority things today, making for a new progression with -G, -Gx, -Gxx, -Gxxx, -Ga, plus -b, -bx.. And also updated help menu, things changed a lot in terms of what happens where, I think I got most of the stuff right, made sure -x level matches between various features in -G, might have missed one or two things.
This one is just going to need data going through it, I am hoping I didn't make any more mistakes that lead to actual output errors, but it's hard to test this one properly since each Monitor/gfx card setup will have different results, particularly for EDID.
But the main goal, to finally build out the Wayland support from the initial basic stub it was previously, and to integrate all the logic so that it's one main engine that fires off various components depending if it's Xvesa, X.org, or Wayland, that all seems to be working nicely now.
Wish I could somehow pull in Parse::EDID automatically but that's well out of inxi's program scope, so that one I'll have to leave up to distro packagers, it will be quite obvious when it's been added as a dependency since there will be better quality monitor data overall.
Thanks for checking for, and finding, heh, issues and bugs, always appreciated.
I anticipate, or at least, hope for, some more data and data sources to come along at some point for other wayland compositors that currently have no direct support support yet. I may do one more wlr-randr tweak to try to grab some data from it, monitor model, but they have mixed several items in one random string (vendor, model, and serial number), where it can be missing any one or more or all of those, which makes parsing it somewhat silly since it's going to be super fragile and prone to error. I left it undone since I've been down that road before and don't really want to go down it again, but I will see.
Updating the docs/man/help actually took a long time, and I fixed/changed/tweaked pinxi as I went along to make sure all the things matched. Probably missed one or two, but it's closer now than before.
Here's the -G levels now, it flows decently from least to most I think, ok anyway. The best improvement, aside from finally having real wayland support, which was probably inxi's #1 internal issue in my mind, not having that, that is, is now instead of requiring -Ga to see the Screen/Monitor stuff, you see it at -Gxx, then it adds data to it progressively until it's complete, and -Ga is more in tune with other -a features where it's more or less just advanced data, not just a trigger to show the full rows in -G.
Thanks, those Intel Processor family items are loose, and hard to nail down, intel used those more as marketing items than engineering from what I can see, sometimes the same cpu family/model id will refer to 2 different possible architecture marketing names. Even the same stepping sometimes has that issue. cpu-world agrees, and when I searched for yorkfield in it, I found other family 6, model 17h ID'ed as yorkfield, so that's been changed in pinxi now, thanks.
Technically, inxi shouldn't even be reporting these Core sub family names, but Core lasted so long that it's useful to distinguish them by sub family, similar to P6 II and III
The skylake family is by far the worst, those had several architecture names that can only be ID'ed by stepping. It's actually easy to see where Intel's current woes come from when you look at their family/model IDs, for example, while AMD is moving through Family IDs steadily as Zen progresses, Intel refuses to stop using Family 6, which becomes even more surreal when they introduce an entirely new architecture type, Alder Lake, which is obviously an entirely new cpu family, yet they leave it stuck on family 6.
These kinds of little internal glitches to me are like little windows that expose significant issues within the organization, since if it was a company being run by engineers, those errors wouldn't have happened. Apparently with the new shakeups going on there to avoid total failure, engineering is again being put to the fore, but 5 years or so is a long time to try to catch up in the chip fab business...
I'm only aware of 1 ambiguous Zen ID, that was the sequence between Zen and Zen+, there was one intermediate ambiguous family/model/stepping when they switched to the zen+ family, but I believe that was just a small tweak to the design.
rokytnji, perfect timing, I literally a few minutes ago removed the fallback attempt to do a string parse of the binary edid file in system:
Code:
model: UV�(PTZP00 6� �AUO
and that's why I decided to remove it, too unreliable. Annoyingly, on all my test monitors i have it gave quite good string output, but apparently mine are not very representative. I could in theory reject such results if they contained non printing characters, like yours, but overall, that data just seems too unreliable, though it's my strong preference to show something as fallback if something usable was found since not many people will install Parse::EDID unless their distros did it in the packaging of inxi.
Now pinxi will only look for advanced monitor data if Parse::EDID or one other fallback which I don't recommend because it's got quite weak output. However,
Basically the Wayland compositor output/display tools do one thing that xrandr doesn't, they show either very complete, or partial, monitor EDID data if it was there. swaymsg does it best of all of them, there is not much difference beyond a few extra fields for positions and scale between swaymsg and Parse::EDID, but that only helps the relatively few users of sway, nobody else.
I am adding a --force edid / --edid flag to force the parsing of the binary which can be useful to test or check a remote system or whatever, but I think it shouldn't be a default fallback action since it's wrong so often.
The new filters I added however would have prevented your corrupt string from showing I believe since it contained non printing characters, which I had forgotten to test against. If all is working as hoped, now:
I modified an existing slackbuild to make it easier to install/uninstall perl-Parse-EDID on several machines. I thought I'd add it here to save anyone else the trouble. I left the maintainer info blank.
README
Code:
Parse::EDID - Extended display identification data (EDID) parser
This module provides some function to parse Extended Display Identification
Data binary data structures.
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
perl-Parse-RecDescent: Parse::EDID - Extended display identification data (EDID) parser
perl-Parse-RecDescent:
perl-Parse-RecDescent: This module provides some function to parse Extended Display
perl-Parse-RecDescent: Identification Data binary data structures.
perl-Parse-RecDescent:
perl-Parse-RecDescent: Homepage:
perl-Parse-RecDescent: https://metacpan.org/release/GROUSSE/Parse-EDID-1.0.7
perl-Parse-RecDescent:
perl-Parse-RecDescent:
perl-Parse-RecDescent:
perl-Parse-RecDescent:
perl-Parse-EDID.SlackBuild
Code:
#!/bin/bash
# Slackware build script for perl-Parse-EDID
# Copyright <year> <you> <where you live>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=perl-Parse-EDID
VERSION=${VERSION:-1.0.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_custom}
PKGTYPE=${PKGTYPE:-tgz}
SRC_PRGNAM=Parse-EDID
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DOCS="Changes README"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRC_PRGNAM-$VERSION
tar xvf $CWD/$SRC_PRGNAM-$VERSION.tar.gz
cd $SRC_PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
perl Makefile.PL INSTALLDIRS=vendor
make
make test
make install DESTDIR=$PKG
mv $PKG/usr/share/man $PKG/usr/
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)
( cd $PKG
find . -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f
find . -depth -type d -empty -delete
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
Interesting, I hadn't looked at the Parse::EDID code before, it's 650 lines. Just a bit long to put into pinxi, but in theory, I could, it would just be another biggish class/package.
The slackpkg build looks nice, easier to understand than the tce package stuff I try to figure out for TinyCore tce packaging.
It's tempting to just pop that code in, it's even GPL 3 so it would be fine to use it. Only thing it is has raw data in it, and if that gets updated, I'd have to track it, which would be a pain, though not hard.
I may do a test build of this just to see how it works, if it's easy or not.
Tested this, and it 'just worked', not a single glitch or bug, now, is 650 lines of code worth it?
This is running in pinxi now, and it's identical, being the same code, it would have to be, but you never know.
I've never directly imported any code before, but I've also never required a Perl Module for standard user actions and output options, just for debugging and data export to xml, json turned out they have a core modules JSON::PP so really there's nothing normal anyone would do not covered by Core Modules.
Hmmmm..... if I leave this included, then monitors will work for almost all linux + edid containing monitors, and Wayland will have out of the box almost full monitor data, except for position, scaling, and a few other things, but not many. Including it in the code is faster than importing an external perl module... hmmm...
The advantages with simply integrating this Parse::EDID code base simply outweigh the disadvantages, the main one being about 500 extra lines of code (after removing everything not needed anymore if no fallbacks were needed), and having to watch the Parse::EDID package for changes, but its changelog indicates virtually no activity, last major work done on it was 2018, and the previous work done was in 2012-13, for the original module creation, and some updates for distros etc, and it's easy to import the code, takes just a minute or two, a few more if I want to remove many empty lines from the code, but essentially no time.
Reading the EDID blob takes roughly 0.001 seconds, give or take, between 0.0008 and 0.0012 or so on my system, it's essentially instant, and supplies almost all the data that the various tools like randr, wlr-randr, swaymsg, weston-info, supply in terms of the monitor data itself, though those also mix in wayland or xorg data about the display size and resolution etc.
While adding 500 lines like this makes me wince a bit, the advantages seem to overcome the disadvantages, first, it's inxi policy, my policy, that is, to never require any module not in perl core modules, and Parse::EDID isn't in core modules, also, it's not in every distro as a package even. Second, in terms of inxi execution time, adding in 500 lines or so makes very little difference, and is certainly significantly faster than having to stop to check and import an external perl module.
The module contains as far as I can tell only a few data structures that will be updated now and then, with different monitor size and configurations, but it's easy to grab those from the cpan source if that is updated ever. I'll contact the module maintainer and let him know it will come into probably wider use than he's used to, but that I also won't change anything in it to make bug and issue handling possible.
With this logic, I can almost, but not quite, dump the various tools inxi uses for graphics, it's too bad in a sense that all I need them for now roughly is the X.org 'Screen' data, or Wayland Display (the respective 'containers' for the monitors, or as wayland calls them, 'outputs', and the monitor positions, and status as primary or not, in that screen, if > 1 monitor, but there's no way to get that data from EDID since that's strictly per monitor. Also, for BSD, they don't have anything like /sys file system, which conveniently exposes the raw edid binary for use, so unless they can come up with something very similar to /sys/class/drm data files, BSD will be out of luck in this case, and will have to fallback to the tools, which themselves seem to contain basic EDID parsing logic already since otherwise things like xrandr wouldn't know the mm dimensions of the monitor. You can tell this is the case because in vm, which do not have edid data, the monitor size data is 0x0mm, and no model names etc are found.
There is one field however in ParseEDID that could be improved, they return a 3 letter vendor ID, but that's only useful if you have a corresponding matching table, which I think wlr-randr has, that would be useful to grab, since otherwise I can't use the vendor ID, which is I believe quite definitive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.