21 Feb 2019

feedPlanet KDE

Alternatives to rioting

The KDE Community has just announced the wider integration of Matrix instant messaging into its communications infrastructure. There are instructions on the KDE Community Wiki as well.

So what's the state of modern chat with KDE-FreeBSD?

The web client works pretty well in Falkon, the default browser in a KDE Plasma session on FreeBSD. I don't like leaving browsers open for long periods of time, so I looked at the available desktop clients. Porting Quaternion to FreeBSD was dead simple. No compile warnings, nothing, just an hour of doing some boilerplate-ish things, figuring out which Qt components are needed, and doing a bunch of test builds. So that client is now available from official FreeBSD ports. The GTK-based client Fractal was already ported, so there's choices available for native-desktop applications over the browser or Electron experience.

Screenshot of two Matrix IM clients

Fractal and Quaternion side-by-side

For about twenty years, irssi in screen, accessed via ssh, was my preferred chat method. (Well, irssi didn't exist on SunOS in the mid-90s, so I must have used something else originally). Quassel has replaced it on my desktop, and has a nice phone client (QuasselDroid) too if I need to check IRC while on a train. But now there's Matrix clients as well.

Here in the screenshot, Fractal (on the left, background) looks pretty slick, like a phone-based chat application would. Quaternion reminds me a lot more of .. well, of Quassel. It even has little brutalist buttons to pop up the raw JSON content of messages, I don't know why. I haven't gotten around to porting other Qt-based Matrix clients; it's hard to tell what would be worthwhile to try. For now I'll go back to plain IRC, because for me the lack of stickers is a feature, not a bug. #GetOffMyLawn

21 Feb 2019 11:53pm GMT

Ready to test?

If you followed Kdenlive's activity these last years, you know that we dedicated all our energy into a major code refactoring. During this period, which is not the most exciting since our first goal was to simply restore all the stable version's features, we were extremely lucky to see new people joining the core team, and investing a lot of time in the project.

We are now considering to release the updated version in April, with KDE Applications 19.04. There are still a few rough edges and missing features (with many new ones added as well), but we think it now reached the point where it is possible to start working with it.

Testing day tomorrow

This is why we are organizing a test day event tomorrow, 22nd of February 2019, from 17:00 to 22:00 CET, so you can try it, report the problems you encounter and help us shape the future.

How to join ?

More tech-savy users can alternatively compile it with debug flags following this guide and send backtraces

Give us your feedback

During the event, some team members will be reachable on our #kdenlive channel on irc/freenode or via the kdenlive telegram group, and you can also leave your feedback in this Phabricator task.

Known issues

There are a couple of known problems that will be solved before release:

21 Feb 2019 6:10pm GMT

feedplanet.freedesktop.org

Hans de Goede: Fedora 30 Flicker Free boot is now fully testable

Fedora 30 now contains all changes changes for a fully Flicker Free Boot. Last week a new version of plymouth landed which implements the new theme for this and also includes a much improved offline-updates experience, following this design.

At boot the display will seamlessly transit from the firmware boot-splash into the new plymouth theme, which uses the firmware boot-splash as background:



If you are using full-disk encryption then the unlock dialog will look like this:



Last, but not least the new plymouth theme looks like this in offline-updates mode:



ATM the texts in the offline-updates theme are not translated. They are rendered using pango + cairo, so we have the capability to make this fully translatable into all languages, I just need to add gettext support to plymouth for this. I plan to do this next week.

This all assumes that you are booting your machine with UEFI and your firmware supports the BGRT extension (which almost all firmware does). Otherwise you will get a dark-grey background instead of the firmware boot-splash.

If you are running rawhide and are seeing a totally different boot-theme then you likely have changed your plymouth theme away from the "charge" default at one point in time; and in that case you are not automatically updated to the new plymouth theme. To switch to the new theme run:

sudo plymouth-set-default-theme -R bgrt

If you do not like the firmware-splash being used as background, you can use the new theme on a dark-grey background instead by running:

sudo plymouth-set-default-theme -R spinner

21 Feb 2019 1:07pm GMT

feedPlanet GNOME

Hans de Goede: Fedora 30 Flicker Free boot is now fully testable

Fedora 30 now contains all changes changes for a fully Flicker Free Boot. Last week a new version of plymouth landed which implements the new theme for this and also includes a much improved offline-updates experience, following this design.

At boot the display will seamlessly transit from the firmware boot-splash into the new plymouth theme, which uses the firmware boot-splash as background:



If you are using full-disk encryption then the unlock dialog will look like this:



Last, but not least the new plymouth theme looks like this in offline-updates mode:



ATM the texts in the offline-updates theme are not translated. They are rendered using pango + cairo, so we have the capability to make this fully translatable into all languages, I just need to add gettext support to plymouth for this. I plan to do this next week.

This all assumes that you are booting your machine with UEFI and your firmware supports the BGRT extension (which almost all firmware does). Otherwise you will get a dark-grey background instead of the firmware boot-splash.

If you are running rawhide and are seeing a totally different boot-theme then you likely have changed your plymouth theme away from the "charge" default at one point in time; and in that case you are not automatically updated to the new plymouth theme. To switch to the new theme run:

sudo plymouth-set-default-theme -R bgrt

If you do not like the firmware-splash being used as background, you can use the new theme on a dark-grey background instead by running:

sudo plymouth-set-default-theme -R spinner

21 Feb 2019 1:04pm GMT

feedPlanet KDE

Qt Creator 4.9 Beta released

We are happy to announce the release of Qt Creator 4.9 Beta!

There are many improvements and fixes included in Qt Creator 4.9. I'll just mention some highlights in this blog post. Please refer to our change log for a more thorough overview.

Generic Programming Language Support

In Qt Creator 4.8 we introduced experimental support for the language server protocol. This enables editing support for a wide range of programming languages through a common protocol. In 4.9 we add support for the document outline, find usages, and also for code actions, which allow the language server to suggest fixes or refactoring actions at a specified place in the code. If the language server of your favorite programming language supports these features, they are now available in Qt Creator as well. Enable the LanguageClient plugin in Help > About Plugins (Qt Creator > About Plugins on macOS) and configure your server in Tools > Options > Language Client to check it out.

Highlighting is still provided by the generic highlighter in these cases. We changed our highlighter to be based on the KSyntaxHighlighting library, which is the library used in KDE for this purpose. Many thanks to the maintainers of KSyntaxHighlighting for making it available to a wide range of uses.

C++ Support

The UI for diagnostics from the Clang analyzer tools got many improvements. They are grouped by file now. Diagnostics from the project's headers files are now also included.
Fix-its show details on what they do when applied. We also added a guard against applying Fix-its to files that have changed in the meantime. In the Clazy configuration you can enable or disable individual checks.

If you enabled a diagnostic to be shown inline in the code editor, you can disable individual checks via a button in the diagnostic's tool tip.

QML Support

We updated our QML parser to Qt 5.12, adding support for ECMAScript 7.

Profiling

Perf is a powerful performance profiling tool for software running on a Linux system. Profile your application via perf with Analyze > Performance Analyzer, after enabling the plugin in Help > About Plugins. The integration in Qt Creator is available for applications running on a local Linux system, and also for applications running on a remote Linux system from a Linux or Windows host.

Generic Projects

Similar to our support for deploying files to a remote system for CMake-based projects, you can now add a QtCreatorDeployment.txt file to your generic project, to specify the necessary information about where to deploy which files.

If your project needs some special compiler flags to be correctly handled by the code model, you can now specify these in a .cxxflags or .cflags file.

Other Improvements

For Windows, we added support for MSVC 2019. On macOS we added a Touch Bar if you run Qt Creator on a MacBook.

For remote Linux targets, we exchanged our Botan-based SSH backend by use of OpenSSH tools. You need to install the tools separately (if you have not already) to be able to benefit from a wide range of encryption and authentication features in Qt Creator. We also added a rsync-based deployment method, as well as support for Run in Terminal.

Version control support has also received many fixes and improvements. The Git Branches view has a new Push action and Git tracks detached HEADs.

Get Qt Creator 4.9 Beta

The opensource version is available on the Qt download page under "Pre-releases", and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.9 Beta is also available under Preview > Qt Creator 4.9.0-beta1 in the online installer. Please post issues in our bug tracker. You can also find us on IRC on #qt-creator on chat.freenode.net, and on the Qt Creator mailing list.

The post Qt Creator 4.9 Beta released appeared first on Qt Blog.

21 Feb 2019 12:22pm GMT

20 Feb 2019

feedPlanet GNOME

Tim Janik: GSlice considerations and possible improvements

The paper Mesh: Compacting Memory Management for C/C Applications is about moving memory allocations for compaction, even though the memory pointers are exposed. The idea is to merge allocation blocks from different pages that are not overlapping at page offsets, and then letting multiple virtual…

20 Feb 2019 12:16pm GMT

19 Feb 2019

feedPlanet GNOME

Felipe Borges: DevConf.CZ 2019

Last month I attended DevConf CZ for the third time. The conference has been growing a lot in the last years and it has been attracting a wider variety of people. It is a free-admission conference in the lovely Brno, Czech Republic, the place that I now call home. If you haven't attended it yet, you should definitely consider it for next year.

This year I had a talk titled "Running virtual machines in the Flatpak sandbox", where I described the process of Flatpaking GNOME Boxes. There's a video available on YouTube.

We had a small Desktop track on Friday afternoon with a good amount of talks about Flatpak. The audience was engaged and interested in the topics. Besides of my talk, Owen Taylor spoke about the state of Flatpaks in Fedora and Jiří Janoušek spoke about the Linux fragmentation and how Flatpak can tackle the problem. Last but not least, Kalev Lamber told us what's new in gnome-software.

19 Feb 2019 1:22pm GMT

18 Feb 2019

feedplanet.freedesktop.org

Neil Roberts: VkRunner at FOSDEM

I attended FOSDEM again this year thanks to funding from Igalia. This time I gave a talk about VkRunner in the graphics dev room. It's now available on Igalia's YouTube channel below:

I thought this might be a good opportunity to give a small status update of what has happened since my last blog post nearly a year ago.

Test suite integration

The biggest news is that VkRunner is now integrated into Khronos' Vulkan CTS test suite and Mesa's Piglit test suite. This means that if you work on a feature or a bugfix in your Vulkan driver and you want to make sure it doesn't get regressed, it's now really easy to add a VkRunner test for it and have it collected in one of these test suites. For Piglit all that is needed is to give the test script a .vk_shader_test extension and drop it anywhere under the tests/vulkan folder and it will automatically be picked up by the Piglit framework. As an added bonus, these tests are also run automatically on Intel's CI system, so if your test is related to i965 in Mesa you can be sure it will not be regressed.

On the Khronos CTS side the integration is currently a little less simple. Along with help from Samuel Iglesias, we have merged a branch into master that lays the groundwork for adding VkRunner tests. Currently there are only proof-of-concept tests to show how the tests could work. Adding more tests still requires tweaking the C++ code so it's not quite as simple as we might hope.

API

When VkRunner is built, in now also builds a static library containing a public API. This can be used to integrate VkRunner into a larger test suite. Indeed, the Khronos CTS integration takes advantage of this to execute the tests using the VkDevice created by the test suite itself. This also means it can execute multiple tests quickly without having to fork an external process.

The API is intended to be very highlevel and is as close to possible as just having simple functions to ask VkRunner to execute a test script and return an enum reporting whether the test succeeded or not. There is an example of its usage in the README.

Precompiled shader scripts

One of the concerns raised when integrating VkRunner into CTS is that it's not ideal to have to run glslang as an external process in order to compile the shaders in the scripts to SPIR-V. To work around this, I added the ability to have scripts with binary shaders. In this case the 32-bit integer numbers of the compiled SPIR-V are just listed in ASCII in the shader test instead of the GLSL source. Of course writing this by hand would be a pain, so the VkRunner repo includes a Python script to precompile a bunch of shaders in a batch. This can be really useful to run the tests on an embedded device where installing glslang isn't practical.

However, in the end for the CTS integration we took a different approach. The CTS suite already has a mechanism to precompile all of the shaders for all tests. We wanted to take advantage of this also when compiling the shaders from VkRunner tests. To make this work, Samuel added some functions to the VkRunner API to query the GLSL in a VkRunner shader script and then replace them with binary equivalents. That way the CTS suite can use these functions to replace the shaders with its cached compiled versions.

UBOs, SSBOs and compute shaders

One of the biggest missing features mentioned in my last post was UBO and SSBO support. This has now been fixed with full support for setting values in UBOs and SSBOs and also probing the results of writing to SSBOs. Probing SSBOs is particularily useful alongside another added feature: compute shaders. Thanks to this we can run our shaders as compute shaders to calculate some results into an SSBO and probe the buffer to see whether it worked correctly. Here is an example script to show how that might look:

[compute shader]
#version 450

/* UBO input containing an array of vec3s */
layout(binding = 0) uniform inputs {
        vec3 input_values[4];
};

/* A matrix to apply to these values. This is stored in a push
 * constant. */
layout(push_constant) uniform transforms {
        mat3 transform;
};

/* An SSBO to store the results */
layout(binding = 1) buffer outputs {
        vec3 output_values[];
};

void
main()
{
        uint i = gl_WorkGroupID.x;

        /* Transform one of the inputs */
        output_values[i] = transform * input_values[i];
}

[test]
# Set some input values in the UBO
ubo 0 subdata vec3 0 \
  3 4 5 \
  1 2 3 \
  1.2 3.4 5.6 \
  42 11 9

# Create the SSBO
ssbo 1 1024

# Store a matrix uniform to swap the x and y
# components of the inputs
push mat3 0 \
  0 1 0 \
  1 0 0 \
  0 0 1

# Run the compute shader with one instance
# for each input
compute 4 1 1

# Check that we got the expected results in the SSBO
probe ssbo vec3 1 0 ~= \
  4 3 5 \
  2 1 3 \
  3.4 1.2 5.6 \
  11 42 9

Extensions in the requirements section

The requirements section can now contain the name of any extension. If this is done then VkRunner will check for the availability of the extension when creating the device and enable it. Otherwise it will report that the test was skipped. A lot of the Vulkan extensions also add an extended features struct to be used when creating the device. These features can also be queried and enabled for extentions that VkRunner knows about simply by listing the name of the feature in that struct. For example if shaderFloat16 in listed in the requirements section, VkRunner will check for the VK_KHR_shader_float16_int8 extension and the shaderFloat16 feature within its extended feature struct. This makes it really easy to test optional features.

Cross-platform support

I spent a fair bit of time making sure VkRunner works on Windows including compiling with Visual Studio. The build files have been converted to CMake which makes building on Windows even easier. It also compiles for Android thanks to patches from Jaebaek Seo. The repo contains Android build files to build the library and the vkrunner executable. This can be run directly on a device using adb.

User interface

There is a branch containing the beginnings of a user interface for editing VkRunner scripts. It presents an editor widget via GTK and continuously runs the test script in the background as you are editing it. It then displays the results in an image and reports any errors in a text field. The test is run in a separate process so that if it crashes it doesn't bring down the user interface. I'm not sure whether it makes sense to merge this branch into master, but in the meantime it can be a convenient way to fiddle with a test when it fails and it's not obvious why.

And more…

Lots of other work has been going on in the background. The best way to get to more details on what VkRunner can do is to take a look at the README. This has been kept up-to-date as the source of documentation for writing scripts.

18 Feb 2019 5:23pm GMT

14 Feb 2019

feedplanet.freedesktop.org

Peter Hutterer: Adding entries to the udev hwdb

In this blog post, I'll explain how to update systemd's hwdb for a new device-specific entry. I'll focus on input devices, as usual.

What is the hwdb and why do I need to update it?

The hwdb is a binary database sitting at /etc/udev/hwdb.bin and /usr/lib/udev/hwdb.d. It is usually used to apply udev properties to specific devices, those properties are then picked up by other processes (udev builtins, libinput, ...) to apply device-specific behaviours. So you'll need to update the hwdb if you need a specific behaviour from the device.

One of the use-cases I commonly deal with is that some touchpad announces wrong axis ranges or resolutions. With the correct hwdb entry (see the example later) udev can correct these at device initialisation time and every process sees the right axis ranges.

The database is compiled from the various .hwdb files you have sitting on your system, usually in /etc/udev/hwdb.d and /usr/lib/hwdb.d. The terser format of the hwdb files makes them easier to update than, say, writing a udev rule to set those properties.

The full process goes something like this:

On its own, the hwdb is merely a lookup tool though, it does not modify devices. Think of it as a virtual filing cabinet, something will need to look at it, otherwise it's just dead weight.

An example for such a udev rule from 60-evdev.rules contains:


IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \
RUN{builtin}+="keyboard", GOTO="evdev_end"

The IMPORT statement translates as "look up the hwdb, import the properties". The RUN statement runs the "keyboard" builtin which may change the device based on the various udev properties now set. The GOTO statement goes to skip the rest of the file.

So again, on its own the hwdb doesn't do anything, it merely prints to-be udev properties to stdout, udev captures those and applies them to the device. And then those properties need to be processed by some other process to actually apply changes.

hwdb file format

The basic format of each hwdb file contains two types of entries, match lines and property assignments (indented by one space). The match line defines which device it is applied to.

For example, take this entry from 60-evdev.hwdb:


# Lenovo X230 series
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*X230*
EVDEV_ABS_01=::100
EVDEV_ABS_36=::100

The match line is the one starting with "evdev", the other two lines are property assignments. Property values are strings, any interpretation to numeric values or others is to be done in the process that requires those properties. Noteworthy here: the hwdb can overwrite previously set properties, but it cannot unset them.

The match line is not specified by the hwdb beyond "it's a glob". The format to use is defined by the udev rule that invokes the hwdb builtin. Usually the format is:


someprefix:search criteria:

For example, the udev rule that applies for the match above is this one in 60-evdev.rules:


KERNELS=="input*", \
IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \
RUN{builtin}+="keyboard", GOTO="evdev_end"

What does this rule do? $attr entries get filled in by udev with the sysfs attributes. So on your local device, the actual lookup key will end up looking roughly like this:


evdev:name:Some Device Name:dmi:bvnWhatever:bvR112355:bd02/01/2018:...

If that string matches the glob from the hwdb, you have a match.

Attentive readers will have noticed that the two entries from 60-evdev.rules I posted here differ. You can have multiple match formats in the same hwdb file. The hwdb doesn't care, it's just a matching system.

We keep the hwdb files matching the udev rules names for ease of maintenance so 60-evdev.rules keeps the hwdb files in 60-evdev.hwdb and so on. But this is just for us puny humans, the hwdb will parse all files it finds into one database. If you have a hwdb entry in my-local-overrides.hwdb it will be matched. The file-specific prefixes are just there to not accidentally match against an unrelated entry.

Applying hwdb updates

The hwdb is a compiled format, so the first thing to do after any changes is to run


$ systemd-hwdb update

This command compiles the files down to the binary hwdb that is actually used by udev. Without that update, none of your changes will take effect.

The second thing is: you need to trigger the udev rules for the device you want to modify. Either you do this by physically unplugging and re-plugging the device or by running


$ udevadm trigger

or, better, trigger only the device you care about to avoid accidental side-effects:


$ udevadm trigger /sys/class/input/eventXYZ

In case you also modified the udev rules you should re-load those too. So the full quartet of commands after a hwdb update is:


$ systemd-hwdb update
$ udevadm control --reload-rules
$ udevadm trigger
$ udevadm info /sys/class/input/eventXYZ

That udevadm info command lists all assigned properties, these should now include the modified entries.

Adding new entries

Now let's get down to what you actually want to do, adding a new entry to the hwdb. And this is where it also get's tricky to have a generic guide because every hwdb file has its own custom match rules.

The best approach is to open the .hwdb files and the matching .rules file and figure out what the match formats are and which one is best. For USB devices there's usually a match format that uses the vendor and product ID. For built-in devices like touchpads and keyboards there's usually a dmi-based match format (see /sys/class/dmi/id/modalias). In most cases, you can just take an existing entry and copy and modify it.

My recommendation is: add an extra property that makes it easy to verify the new entry is applied. For example do this:


# Lenovo X230 series
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*ThinkPad*X230*
EVDEV_ABS_01=::100
EVDEV_ABS_36=::100
FOO=1

Now run the update commands from above. If FOO=1 doesn't show up, then you know it's the hwdb entry that's not yet correct. If FOO=1 does show up in the udevadm info output, then you know the hwdb matches correctly and any issues will be in the next layer.

Increase the value with every change so you can tell whether the most recent change is applied. And before your submit a pull request, remove the FOOentry.

Oh, and once it applies correctly, I recommend restarting the system to make sure everything is in order on a freshly booted system.

Troubleshooting

The reason for adding hwdb entries is always because we want the system to handle a device in a custom way. But it's hard to figure out what's wrong when something doesn't work (though 90% of the time it's a typo in the hwdb match).

In almost all cases, the debugging sequence is the following:

If the answer to all these is "yes" and it still doesn't work, you may have found a bug. But 99% of the time, at least one of those is a sound "no. oops.".

Your hwdb match may run into issues with some 'special' characters. If your device has e.g. an ® in its device name (some Microsoft devices have this), a bug in systemd caused the match to fail. That bug is fixed now but until it's available in your distribution, replace with an asterisk ('*') in your match line.

Greybeards who have been around since before 2014 (systemd v219) may remember a different tool to update the hwdb: udevadm hwdb --update. This tool still exists, but it does not have the exact same behaviour as systemd-hwdb update. I won't go into details but the hwdb generated by the udevadm tool can provide unexpected matches if you have multiple matches with globs for the same device. A more generic glob can take precedence over a specific glob and so on. It's a rare and niche case and fixed since systemd v233 but the udevadm behaviour remained the same for backwards-compatibility.

Happy updating and don't forget to add Database Administrator to your CV when your PR gets merged.

14 Feb 2019 1:40am GMT