Tablet mode issues still

Hello, I love my framework laptop, but the fact there have been consistent issues and no documentation around how the tablet mode works behind the scenes, has left me very upset and confused.

I am a kde plasma user, and I love drawing on Krita with my framework laptop. That being said, plasma has recently switched to wayland only, and with that “upgrade” - tablet support (along with many other things) are significantly worse/more buggy.

Because of this, I have been learning i3, and it honestly fits my needs wonderfully, and isn’t on wayland. But whenever I go into tablet mode, random keys start getting pressed and I’m not sure the input cover is even completely turned off. How can I fix this?

I also still have to type sudo rmmod soc_button_array and sudo modprobe soc_button_array to get tablet mode to work on plasma/anything at all, every time I restart my computer, and it seems framework support has been quiet on this issue as well since I bought my laptop.

You shouldn’t have to do this, but are you actually typing this in every time? You can make an executable shell script of this, and then add that to your start-up script. Let me know if you want more info!

Forum tip: if you have issues, it is ideal to list them one at a time. That will allow the thread to be given a specific title, and that in turn will help other readers who might have the same problem: it makes things easier to find with the search tool.

(This is not mandatory advice - just for future notes).

sorry yes, I believe I’ve fixed that specific issue by following what this person suggested here:
https://community.frame.work/t/soc-button-array-not-loading-arch/81687/2

The archwiki and official resources say pinctrl_tigerlake but it should be pinctrl_alderlake if you have an alderlake processor, which is not specified anywhere at all.

Also, wrt krita / plasma post wayland switch, I believe switching to sway from i3 actually just fixed my issues, funnily enough. Or it was the config update. Either way, I’m happy now, thanks for the quick response. I hope things continue to go smoothly though because it’s getting a bit tiring. xD

nevermind, palm rejection seems to be completely broken on sway lol (if my palm or any part of my hand is touching the screen, I can’t draw with my pen.)

My own view is that Linux is always going to be for fiddlers, to some degree. It gets compared to OS X a lot, but Apple’s operating system has to be tested on 10 devices. Linux has the challenge that it has to work on millions of different devices.

I love it because it’s not a walled garden and it doesn’t slurp my data for various creepy commercial exploits, but I do have to put a bit of work in. On my new 13 Pro, I’ve already got some shell scripts to make an external monitor behave properly in a VM :cat_with_wry_smile:

sure, but its a selling point that framework supports linux, so like some proper documentation at least so i can write a script would be nice.

good point I never thought about it and actually wouldn’t expect any laptop manufacturer to disclose this but I guess it could be somewhere in FW12 github repo. But I’ll tell you how tablet mode detection works because one day I was bored and was wondering “hmmm how can I check accelerometer values”.

So basically in FW12 there’s one accelerometer in the screen (I’d assume webcam module) and one in the bottom part (I’d assume the motherboard). Then EC, based on those values calculates the angle at which the screen is opened (there’s also a sensor for that) and when it gets above 180 degrees the keyboard gets disabled and it emits tablet mode switch keypress/input. Also the reverse happens when screen angle gets below 180 degrees. There’s slight delay (like 0.5s) to this process too. Since it’s based on accelerometers (or in more layman terms: where is down), if you hold the laptop with it’s side up (the gravity pulls it to it’s side) it can’t calculate the screen angle and won’t switch to/from tablet mode. I don’t know how you hold your laptop when flipping the screen but with you saying that random keys get pressed you could be running into this issue. You can actually turn on caps lock and observe the capslock light to see when tablet mode switch gets enabled (capslock light gets turned off when laptop switches to tablet mode and keyboard gets disabled).

From the OS side I don’t know which module is responsible for that because it always worked I guess but I had tablet mode disabled in settings because I didn’t like how half the buttons become bigger. All I can say is that I could always see it using libinput debug-events or something like that and I’m using Fedora with KDE since day one (now on Fedora Kinoite 44). Although I can say that I don’t really know what tablet mode switch does right now on KDE because I see I have it enabled and it actually doesn’t to anything… so I’d guess it’s a problem on KDE’s side? Personally I hoped it’d switch on screen keyboard at least because right now it’s implemented in a stupid way - keyboard pops up whenever you touch something with active text field regardess of tablet mode switch state so I have on screen keyboard switch in system tray and change it manually.

Another thing is that I’m using Wayland KDE session from day one and knowing how X11 handles (or doesn’t handle) touch when I played with it a bit few years ago (cursor always visible, every touch is registered as click but surprisingly some apps handle multitouch) I can’t imagine now using Wayland with touchscreen. There’s one thing that I remember X11 doing better is rendering mouse cursor on 60Hz screens.

i’m running (a custom build of) fedora sway atomic on the fwl 12 (2nd-gen), and do not have any palm rejection-related issues (tested in rnote). rotation also works perfectly, including virtual keeb (this took some work!).

since you seem to be considering i3, might i suggest going for sway instead and picking either the regular or atomic build of fedora sway?

still here? ok, here’s how i have it all working, basically, perfectly! First, you’ll need a reliable virtual keyboard. wvkbd is a great choice! You can build & install it yourself, or use my copr repo for an easy install.

next up, rotation! rot8 seems to be the most recommended option, but, unfortunately, i couldn’t make it work with the 2nd-gen 12 (axes were messed up, and no amount of mucking around with config fixed it). so, like any sane person would, i wrote swayrot8: a simple script to ingest a monitor-sensor --accel (iio-sensor-proxy) event stream, and integrate it with sway. this package, too, is available through the same copr repo referenced above.

alright, so now all that remains is integrating wvkbd and swayrot8 with sway, and disabling/enabling devices in tablet/regular mode. assuming your sway config lives in ~/.config/sway/, drop a file (mine is called 30-tablet.conf) in ~/.config/sway/config.d/:

# Framework Laptop 12 internal input devices
set $laptop_keyboard "1:1:AT_Translated_Set_2_keyboard"
set $laptop_touchpad "2362:569:PIXA3854:00_093A:0239_Touchpad"
set $laptop_touchscr "8746:21817:ILIT2901:00_222A:5539"
set $laptop_stylus "8746:21817:ILIT2901:00_222A:5539_Stylus"

# Enable/disable keyboard(s) and touchpad based on tablet mode
bindswitch tablet:on \
    input $laptop_keyboard events disabled, \
    input $laptop_touchpad events disabled, \
    exec wvkbd-deskintl --hidden --auto
bindswitch tablet:off \
    input $laptop_keyboard events enabled, \
    input $laptop_touchpad events enabled, \
    exec killall wvkbd-deskintl

# Map touchscreen and stylus to the internal display
input $laptop_touchscr map_to_output eDP-1
input $laptop_stylus map_to_output eDP-1

# Start auto-rotation daemon
exec systemctl --user restart sway-rot8.service

you’ll want to restart, and everything should just work! you might want to double check your input devices and adjust 30-tablet.conf accordingly. here’s how you can get a nicely-formatted list of your input devices:

swaymsg -t get_inputs | jq -r '.[] | [.name, .type, .identifier] | @tsv' | column -t -s $'\t'

based on my testing, palm rejection works flawlessly on rnote. i can test another app if you’d like as long as it’s available as a flatpak.

sorry for the long post, but i hope this is helpful.

I’m using sway on arch and it’s seeming to work fine now lol idk. before it was causing me issues but now it seems great lol. (maybe there was a krita update or something that fixed the issues im having, as im using the officially packaged arch version which does say dev build, so that could be part of why some issues may have been happening idk)

Fedora is supported and all the touch problems I’m having are at the operating systems; so you’re on the right track looking for documentation elsewhere also. My pen’s been working fine out of the box in the Gimp with a Fedora KDE Plasma Mobile Spin.

I know that won’t really help but maybe there’s more documentation there? :slight_smile: