xppen_{3,4}: init at {3.4.9-240607,4.0.7-250117}; nixos/xppen: init#351647
xppen_{3,4}: init at {3.4.9-240607,4.0.7-250117}; nixos/xppen: init#351647drupol merged 3 commits intoNixOS:masterfrom
Conversation
|
Hi @gepbird, Here is a general summary: Working
Issues
"/var/lib/pentablet/conf/xppen/config.xml"
"PenTableLists"
"1.5"
"PenTableLists"
"1.5"Here is the exported settings that I created with the app then tried to reimport after setting everything back to default: PenTablet_Config_2024-10-27.pcfg.pcfg.zip
I can also see the following messages when interacting with the monitor options in this section: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
QPixmap::scaled: Pixmap is a null pixmapSo I guess this might be a Wayland issue?
Notes
|
|
Just rebuilt with the |
|
Hey! I wrote a commend encouraging you to pick my work up in my PR but got distracted and didn't send it :D So, thanks for picking it up! Glad my work was at least somewhat valuable, really hope you can get it through! :) |
|
Thanks for your detailed testing @damiankorcz! I'm happy most of the features work for you.
Sad that the app disables default window decorations for their custom design. On a window manager like dwm there are no default decorations and I'm used to using keyboard shortcuts to move a window. However on the first "plug in your tablet" screen I can move the window without the keyboard, by starting to drag it on the top (eg. next to the close button). I think that should work on Plasma, can you check that? Otherwise I'm pretty sure it's an upstream bug.
I'll try to do some research on the data you sent, but I think an strace output would also help. To minimize the output of strace, please attach it right before you click on the export/import button, and detach it with Ctrl+C after you observe the issue. sudo strace -p $(pidof PenTablet | cut -f2) -ff 2> xppen-straceI'll help with addressing the other issues later, I'm just short on time. |
|
Hi @gepbird, I've clicked on the Settings cog -> Export config -> Navigated to my desktop and saved the file. Then I again clicked on the Settings cog -> Import config -> Selected the file I just exported. |
|
@damiankorcz Sorry for the late response, I've been busy this week and hopefully have more time next week. From the strace (system call trace) you sent, I see a lot of access to ~/.config/PenTabletrc file, it seems like the currently loaded configuration. Can you also send that? I'm curious whether it has the same format as the exported .pcfg file. If it does, then we can find out whether the issue is with the exporting or the importing part of a .pcfg file checking how much it differs to the PenTabletrc file.
If it saves the config between app restarts, then it must save the modified config in your home folder and not in the priviliged /var/lib/pentablet directory. From the strace, when you import the config, it reads the config then tries to delete /var/lib/pentablet/conf/xppen/config.xml which fails due to permission denied: @damiankorcz can you test again if after restarting the app/machine, does the modified config get loaded, or it reverts back to the default? If it works, then I assume they messed up the import config code and only that tries to modify the installed config, in that case try running it as a superuser and check if importing works. |
Seems like a Wayland issue. I'm not familiar with that, but my guess it xppen is running inside an Xwayland session, so the application doesn't see all your monitors but only the area it takes up on the screen.
Weird issue, I have no clue how something like that happens.
Looks like another Wayland issue.
Interesting, I'll look into this later. If anyone has some suggestions about these (presumably) Wayland issues, please comment it. And reproduction attempts of these issues on X11 could also help. |
|
Hi @gepbird, Here's the PenTabletrc file: It seems that the file keeps a reference to the last imported (or exported?) file here so just to be sure it wasn't somehow loading from it I deleted them and when I restarted the app and system, the app seems to keep the settings saved correctly regardless. As far as I can tell, it is successfully saving and loading the config file to
When trying to run the app as sudo from the terminal I get the following and the app doesn't start: [damian@nixos-desktop:~]$ sudo PenTablet
[sudo] password for damian:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QtLockedFile::lock(): file is not opened
QtLockedFile::lock(): file is not openedLooks like the app is actually running under Wayland not Xwayland. I did a simple test with When I have a chance I'll try getting X11 on my system and see how much of this can be replicated so we know if Wayland is to blame. |
7b5930a to
1bcff45
Compare
You're right, your config differs from the default. At first I thought only root can edit this file then I checked its permissions: ~ ❯ stat /var/lib/pentablet/conf/xppen/config.xml
File: /var/lib/pentablet/conf/xppen/config.xml
Size: 191313 Blocks: 376 IO Block: 4096 regular file
Device: 0,30 Inode: 350807306 Links: 1
Access: (0666/-rw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root)
...
~ ❯ stat /var/lib/pentablet/conf/xppen
File: /var/lib/pentablet/conf/xppen
Size: 74 Blocks: 0 IO Block: 4096 directory
Device: 0,30 Inode: 350807305 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
...From this, other people can write to the file (that's why the app modifying this config works), but can't delete it (that's why importing doesn't work, it tries to delete the old config and put there the new one): ~ ❯ echo foo >> /var/lib/pentablet/conf/xppen/config.xml
~ ❯ rm /var/lib/pentablet/conf/xppen/config.xml
rm: cannot remove '/var/lib/pentablet/conf/xppen/config.xml': Permission deniedI've updated the PR to set the permissions correctly. I know 777 looks insecure, but our other options are putting these files in the user's home (this should be done in home-manager, not in nixpkgs) or creating a user for xppen which seems like unnecessary complexity. @damiankorcz Please either
Then try importing a config and see if it works. |
|
Hi @gepbird, |
|
@damiankorcz I checked some documentation related to OpenGL and Wayland in nixpkgs and added some dependencies. Can you check if it fixes any of the previous issues, for example the "screen identifier" or the "rotation labels" issue? If it does, would you mind narrowing it down to the specific dependency(ies) that fixed it? |
|
Hi @gepbird, I've checked and at least on Wayland it didn't seem to make a difference to any of those issues. I've also just switched to X11 to test and it looks like:
Everything else seems to work fine like it does on Wayland. |
|
Worth pointing out that the issues on Wayland are mostly visual in the app but the options still work correctly. Just slightly inconvenient when selecting which monitor you want the tablet to map to. But the dropdown lists all monitors correctly and it works. Same with the rotation indicators. You can just click off the app and see which one you want and select it. For both cases (for me with 4 screens) I just have to trial and error 4 options. You will likely do this once and be set. Perfectly serviceable if we can't find a solution. |
a982cff to
1bcff45
Compare
|
Thanks a lot for testing, so apart from a few minor visual issues, the v3 driver seems to work well. I don't think we have people who have time to test the v4 driver, a previous iteration of it was tested and worked with a few issues that the NixOS module solves.
|
|
Fixed merge conflicts. @damiankorcz I really appreciate your testing feedback, but unfortunately I don't have the time, skills and tablets to debug and resolve it. I think most of the driver is usable without that and it's not a blocker. Anyone knowledgeable feel free to open a PR to my branch or later a follow-up :) @PlushIrony thanks for the ping, I kinda forgot about this. As an alternative until it's not merged, you have a some options to use it:
# file: flake.nix
{
inputs.nixpkgs-patch-add-xppen = {
url = "https://github.com/NixOS/nixpkgs/pull/351647.diff";
flake = false;
};
# your other inputs like nixpkgs, nixpkgs-patcher
# your nixos config output
}# file: configuration.nix
{ pkgs, lib, ... }:
{
programs.xppen = {
enable = true;
# by default you get the version 4 driver, if you want the version 3:
# package = pkgs.xppen_3;
};
# your other configuration
}
# file: /etc/nixos/configuration.nix
{ pkgs, lib, ... }:
let
nixpkgs-xppen = builtins.fetchTarball {
url = "https://github.com/gepbird/nixpkgs/archive/xppen-init-v3-v4-nixos-module.tar.gz";
sha256 = ""; # you will get an error message with wrong hash, insert that hash here
};
pkgs-xppen = import nixpkgs-xppen {
system = "x86_64-linux";
config.allowUnfree = true;
};
in
{
imports = [
"${nixpkgs-xppen}/nixos/modules/programs/xppen.nix"
];
programs.xppen = {
enable = true;
# by default you get the version 4 driver, if you want the version 3:
# package = pkgs-xppen.xppen_3;
};
# your other configuration
} |
Co-authored-by: yakrobat <yakrobat@protonmail.com>
Co-authored-by: yakrobat <yakrobat@protonmail.com>
9e075a5 to
c29545b
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5752 |
|
@gepbird
|
|
@PlushIrony apologies, I only tested setting when I set the package, turns out it is necessary, try this: {
programs.xppen = {
enable = true;
package = pkgs-xppen.xppen_4;
};
}(The reason is, by default it tries |
|
@gepbird
This is what I get in the terminal |
|
@PlushIrony It's how I had it setup. I'm no longer using NixOS so I can't test going forward. |
|
@PlushIrony interesting, IIRC that should be fixed by adding it as a udev package, which is already done. Maybe it only applies after a system restart? On last resort run it as root with |
|
@gepbird @damiankorcz Now that I have it working (nothing seems immediately off) I am going to head off for a bit. However tomorrow I will comprehensively test the driver and report any issues I find. |
|
I believe I have pretty comprehensively tested everything and so here are the issues I have found. I will include my opinion on how important of an issue this is and my (amateur) take on whether this problem is due to packaging, the upstream application itself, or any other external factors. Tested on: NixOS Hyprland (wayland) - Artist Pro (Gen2) - driver version 4.07
All in all, pretty good. Very few problems and the ones I found were either easy to work around or caused by my specific setup (*cough* *cough*, hyprland). So, as far as I can tell with my setup, their are no issue with the v4 package. |
|
It is insane that this still hasn't been merged upstream; this pr was opened a year ago. That being said, I just wanted to report that after about 2 or 3 months of using this I still haven't encountered any issues (minus the things unrelated to the package that I documented earlier) |
Yeah, unfortunately there are not many mergers, and new packages and especially new NixOS modules are slower to get merged, because it introduces maintainance burden and it requires a more extensive review. I'll try pining a few more people.
I'm happy it works for you after a more extensive testing, and thanks for reporting it :) |
|
Let's stop wasting time and move on. 1 year waiting for a PR to be merged is unrealistic. Thanks for your contribution, hope you're not demotivated to contribute again ! |








Summary
Add the official XP Pen tablet drivers:
xppen_3,xppen_4packages andxppenNixOS module.Prior work
This PR is based on #285660, thanks for @nasrally's, the reviewers' and the testers' work!
Closes #285660, closes #347984.
Related: #213263, #277176
Testing
I belive this was sufficiently tested by @damiankorcz, many thanks!
I don't have any XP Pen tablets, the most I can do is check whether the GUI opens. If you own a tablet, please test whether this works for you, feel free to ask for help if you're unsure how to do it.
cc @damiankorcz and @misumisumi for testing the version 3 driver
cc @HangedFool for testing the version 4 driver
To test it, you can build your system with this PR and with this extra config and you should see the
xppentabletdesktop entry orPenTabletbinary:Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.