feedbackd: Configure haptic feedback per device
The default configuration of feedbackd
is fine for the Librem5's vibrator but not for the PinePhone's vibrator.
I wasn't aware of this problem until I tried out Arch Linux a while back.
They use the following config: https://github.com/dreemurrs-embedded/Pine64-Arch/blob/master/PKGBUILDS/phosh/danctnix-phosh-ui-meta/danctnix_feedbackd.json
I ported the configuration over to pmOS and typing is really improved since you get haptic feedback when pressing a key.
As suggested by https://source.puri.sm/Librem5/feedbackd/-/issues/27 and @ollieparanoid, using the device tree to match the right profile is preferred. In case that fails, the environment variable FEEDBACK_THEME
is read by feedbackd
. This variable contains the patch to the feedback theme to use. If that also fails, the default.json
config is used.
As requested by upstream, adding pine64,pinephone
to the compatible list in the kernel DTS file. This allows us to use a single configuration file for all hardware revisions of the PinePhone. Furthermore, the device configurations are now packaged separately as feedbackd-device-themes
to match upstream.
Upstreaming at https://source.puri.sm/Librem5/feedbackd/-/merge_requests/44 but providing this branch for testing purposes. If all goes well, upstreaming to Alpine!
Merge request reports
Activity
added 1 commit
- e112e86e - device-pine64-pinephone: Configure haptic feedback
By Dylan Van Assche on 2020-11-23T18:18:33
added category::device type::feature labels
- Resolved by Administrator
Is there a way to disable this in the UI? (IIRC not seeing any way to turn it off on the librem5 running pureos)
I find haptic feedback kinda annoying, so it would be great if there's an easy way for users to toggle it off if this is merged.
By clayton craft on 2020-11-24T06:46:23
Edited by Ghost User
- Resolved by Administrator
I just tried this out and find the haptic feedback to be subtle, so it is noticeable, but not annoying. (On my android phone, I don't have haptic feedback enabled.)
Regarding how to package this, I think the effort to produce a good feedbackd config for the pinephone should be shared between all projects that run phosh on the pinephone. And not just for the pinephone, a central place to store feedbackd configs for all devices would be best.
I asked in the phosh chat, and there is already an open issue to add per-device profiles and have them automatically selected by the DT model (just like megapixels does it!).
https://source.puri.sm/Librem5/feedbackd/-/issues/27
So this seems to be the ideal solution. We wouldn't need to package device specific feedbackd configs, they would just get all installed together with feedbackd and automatically selected. And we'd have a central place where they could be improved and made consistent.
@dylanvanassche, do you want to implement this upstream?
- override the config based on the device tree (see megapixels commit, megapixels is also GPLv3)
- add the config for the pinephone to the feedbackd source tree
- (possibly create symlinks so you only need one file for pine64,pinephone-1.2.json,pine64, pine64,pinephone-1.1.json, pine64,pinephone-1.0.json)
Thanks for making this, @dylanvanassche!
CC: @danct12
@craftyguy, I thought how we could provide an easy way to disable this once it is implemented, and I came up with creating a package that sets
FEEDBACK_THEME=/dev/null
(or a minimal config). So when this is all implemented and you find it annoying, maybe create that package, then one could simply install it and have the vibration disabled until there's a config setting. But let's really do this solution only on demand.By Oliver Smith on 2020-11-25T18:09:27
Edited by Ghost User
- Resolved by Administrator
added 13 commits
-
e112e86e...15a07ac7 - 11 commits from branch
postmarketOS:master
- bf2ecd81 - Upgrade to 0_git20201114
- 4ac63e24 - temp/feedbackd: device-specific feedbackd themes
By Dylan Van Assche on 2020-11-28T17:41:36
-
e112e86e...15a07ac7 - 11 commits from branch
added 1 commit
- c64ab8bc - temp/feedbackd: device-specific feedbackd themes
By Dylan Van Assche on 2020-11-28T17:44:30
Reworked this patch to follow upstream's issue and submitted it upstream as well. I also upgraded feedbackd to the latest git version.
Supports PP 1.0, 1.1, 1.2, but I only could test 1.2.
By Dylan Van Assche on 2020-11-28T17:46:11
Edited by Administratoradded 1 commit
- 8e4523ea - temp/feedbackd: device-specific feedbackd themes
By Dylan Van Assche on 2020-11-29T07:12:04
added 1 commit
- eeddfbdb - temp/feedbackd: device-specific feedbackd themes
By Dylan Van Assche on 2020-11-29T07:17:08
added 1 commit
- 1c9e333d - temp/feedbackd: device-specific feedbackd themes
By Dylan Van Assche on 2020-11-29T07:19:51
added 95 commits
-
1c9e333d...42c0d5be - 93 commits from branch
postmarketOS:master
- a220b571 - temp/feedbackd: device-specific feedbackd themes
- db93f74b - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
By Dylan Van Assche on 2020-12-24T20:19:04
-
1c9e333d...42c0d5be - 93 commits from branch
added 4 commits
-
db93f74b...3ee2cec7 - 2 commits from branch
postmarketOS:master
- 0c8dfb60 - temp/feedbackd: device-specific feedbackd themes
- 9dddbd80 - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
By Dylan Van Assche on 2020-12-24T20:19:45
-
db93f74b...3ee2cec7 - 2 commits from branch
added 1 commit
- ea351b8a - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
By Dylan Van Assche on 2020-12-24T20:29:46
added 1 commit
- 0091c265 - temp/feedbackd: Depend on feedbackd-device-themes
By Dylan Van Assche on 2020-12-25T09:51:38
added 4 commits
- 64534bc4 - temp/feedbackd: device-specific feedbackd themes
- 0a689ae8 - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
- fa16d241 - temp/feedbackd-device-themes: new package
- a4b82ae0 - temp/feedbackd: Depend on feedbackd-device-themes
By Dylan Van Assche on 2020-12-25T09:56:22
Toggle commit list- Resolved by Administrator
another forked purism package
By Alexey Min on 2020-12-26T07:18:45
Edited by Ghost User
- Resolved by Administrator
- Resolved by Administrator
added 5 commits
- e52101e9 - temp/feedbackd: device-specific feedbackd themes
- a708b8d5 - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
- f0804bca - temp/feedbackd-device-themes: new package
- 3464e1e8 - temp/feedbackd: Depend on feedbackd-device-themes
- 60912bd6 - temp/feedbackd: Upgrade to 0.0.0+git20201114
By Dylan Van Assche on 2020-12-26T14:07:21
Toggle commit listadded 1 commit
- ba0fc855 - temp/feedbackd: Upgrade to 0.0.0+git20201114
By Dylan Van Assche on 2020-12-26T14:09:44
added 9 commits
-
ba0fc855...d135ba54 - 4 commits from branch
postmarketOS:master
- ebc8a44d - temp/feedbackd: device-specific feedbackd themes
- 8da37402 - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list
- abc398d8 - temp/feedbackd-device-themes: new package
- 54329b83 - temp/feedbackd: Depend on feedbackd-device-themes
- a8b2e1f8 - temp/feedbackd: Upgrade to 0.0.0+git20201114
By Dylan Van Assche on 2020-12-27T08:26:44
Toggle commit list-
ba0fc855...d135ba54 - 4 commits from branch
mentioned in merge request !1838 (closed)
By Oliver Smith on 2020-12-28T19:15:06
- Resolved by Administrator
Add 'pine64,pinephone' to DTS compatible list
This patch looks reasonable, I've added it to !1838 (closed).
@dylanvanassche: can you upstream it?
By Oliver Smith on 2020-12-28T19:18:56
Edited by Ghost User
- Resolved by Administrator
- Resolved by Administrator
- Resolved by Administrator
- Resolved by Administrator
- Resolved by Administrator
- Resolved by Administrator
I just tried it out on the pinephone, and it works as expected. As described earlier, the haptic feedback is a nice addition without being annoying. Well done, @dylanvanassche!
Here are some nitpicks, besides that, it got my approval.
@minlexx: do you want to give it a second review?
By Oliver Smith on 2020-12-31T15:48:01
Edited by Ghost User
added 22 commits
-
0adb0993...4929c227 - 18 commits from branch
postmarketOS:master
- 86914894 - temp/feedbackd: device-specific feedbackd themes
- 279fd0ee - temp/feedbackd-device-themes: new package
- 7ee3ea0f - temp/feedbackd: Depend on feedbackd-device-themes
- 54e488a1 - temp/feedbackd: Upgrade to 0.0.0+git20201114
By Dylan Van Assche on 2020-12-31T15:49:51
Toggle commit list-
0adb0993...4929c227 - 18 commits from branch
added 5 commits
-
a8b2e1f8...0558e650 - 5 commits from branch
postmarketOS:master
By Dylan Van Assche on 2020-12-31T16:28:30
-
a8b2e1f8...0558e650 - 5 commits from branch
I noticed a regression from upgrading to the latest release. A new group is used to access the LED indicator called
feedbackd
instead ofvideo
. I looked up the APKBUILD reference and this should be solved by adding this group + users to this group with apre-install
script: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#.24pkgname.pre-installI tried to achieve this, but the LED indicator still won't work for some reason on the upgraded version. Since this patch works fine on the current version, I would suggest to drop the upgrade for now and solve this later (maybe when a new release with this patch included is made)?Should work now!
By Dylan Van Assche on 2021-01-01T18:44:38
Edited by Administrator