Skip to content
Snippets Groups Projects

feedbackd: Configure haptic feedback per device

Merged Imported Administrator requested to merge feedbackd-config into master

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!

Edited by Administrator

Merge request reports

Approval is optional

Merged by AdministratorAdministrator 4 years ago (Feb 3, 2021 6:41am UTC)

Merge details

  • Changes merged into with aa77b10c.
  • Deleted the source branch.

Pipeline #200616 passed

Pipeline passed for aa77b10c on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator added 1 commit · Imported

    added 1 commit

    • e112e86e - device-pine64-pinephone: Configure haptic feedback

    Compare with previous version

    By Dylan Van Assche on 2020-11-23T18:18:33

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2020-11-23T18:27:44

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2020-11-23T18:28:36

    • Author Owner
      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
    • Author Owner
      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
  • Administrator
  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2020-11-28T17:25:34

  • Administrator added 13 commits · Imported

    added 13 commits

    Compare with previous version

    By Dylan Van Assche on 2020-11-28T17:41:36

  • Administrator resolved all threads · Imported

    resolved all threads

    By Dylan Van Assche on 2020-11-28T17:43:21

  • Administrator added 1 commit · Imported

    added 1 commit

    • c64ab8bc - temp/feedbackd: device-specific feedbackd themes

    Compare with previous version

    By Dylan Van Assche on 2020-11-28T17:44:30

  • Author Owner

    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 Administrator
  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2020-11-28T17:50:47

  • Administrator marked this merge request as draft · Imported

    marked this merge request as draft

    By Dylan Van Assche on 2020-11-28T20:12:35

  • Administrator added 1 commit · Imported

    added 1 commit

    • 8e4523ea - temp/feedbackd: device-specific feedbackd themes

    Compare with previous version

    By Dylan Van Assche on 2020-11-29T07:12:04

  • Administrator marked this merge request as ready · Imported

    marked this merge request as ready

    By Dylan Van Assche on 2020-11-29T07:12:20

  • Administrator added 1 commit · Imported

    added 1 commit

    • eeddfbdb - temp/feedbackd: device-specific feedbackd themes

    Compare with previous version

    By Dylan Van Assche on 2020-11-29T07:17:08

  • Administrator added 1 commit · Imported

    added 1 commit

    • 1c9e333d - temp/feedbackd: device-specific feedbackd themes

    Compare with previous version

    By Dylan Van Assche on 2020-11-29T07:19:51

  • Administrator marked this merge request as draft · Imported

    marked this merge request as draft

    By Dylan Van Assche on 2020-12-03T06:41:53

  • Administrator added 95 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-24T20:19:04

  • Administrator added 4 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-24T20:19:45

  • Administrator added 1 commit · Imported

    added 1 commit

    • ea351b8a - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list

    Compare with previous version

    By Dylan Van Assche on 2020-12-24T20:29:46

  • Administrator added 2 commits · Imported

    added 2 commits

    • 24da3cda - temp/feedbackd: device-specific feedbackd themes
    • 2cbcc043 - main/linux-postmarketos-allwinner: add 'pine64,pinephone' to the DTS compatible list

    Compare with previous version

    By Dylan Van Assche on 2020-12-24T20:35:00

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2020-12-24T20:49:43

  • Administrator added 1 commit · Imported

    added 1 commit

    • 4b652d71 - temp/feedbackd-device-themes

    Compare with previous version

    By Dylan Van Assche on 2020-12-25T09:49:30

  • Administrator added 1 commit · Imported

    added 1 commit

    • 0091c265 - temp/feedbackd: Depend on feedbackd-device-themes

    Compare with previous version

    By Dylan Van Assche on 2020-12-25T09:51:38

  • Administrator added 2 commits · Imported

    added 2 commits

    • 6bca23e5 - temp/feedbackd-device-themes: new package
    • 0f942b1c - temp/feedbackd: Depend on feedbackd-device-themes

    Compare with previous version

    By Dylan Van Assche on 2020-12-25T09:53:39

  • Administrator added 4 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-25T09:56:22

  • Author Owner

    This MR is now ready for review! There might be some nitpick adjustments to the read config patch depending on upstream, but that's all.

    Tested on my PinePhone 1.2a pmOS convergence edition with pmOS edge.

    Happy holidays!

    By Dylan Van Assche on 2020-12-25T10:03:17

  • Administrator marked this merge request as ready · Imported

    marked this merge request as ready

    By Dylan Van Assche on 2020-12-25T10:03:21

  • Administrator
  • Administrator
  • Administrator added 5 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-26T14:07:21

  • Administrator added 1 commit · Imported

    added 1 commit

    • ba0fc855 - temp/feedbackd: Upgrade to 0.0.0+git20201114

    Compare with previous version

    By Dylan Van Assche on 2020-12-26T14:09:44

  • Administrator changed title from device-pine64-pinephone: Configure haptic feedback to feedbackd: Configure haptic feedback per device · Imported

    changed title from device-pine64-pinephone: Configure haptic feedback to feedbackd: Configure haptic feedback per device

    By Dylan Van Assche on 2020-12-26T14:10:14

  • Administrator added 9 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-27T08:26:44

  • Administrator resolved all threads · Imported

    resolved all threads

    By Dylan Van Assche on 2020-12-27T08:29:35

  • Administrator mentioned in merge request !1838 (closed) · Imported

    mentioned in merge request !1838 (closed)

    By Oliver Smith on 2020-12-28T19:15:06

  • Administrator
  • Administrator
  • Administrator
  • Administrator
  • Administrator
    • Author Owner
      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! :tada: :rocket:

      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
  • Administrator added 3 commits · Imported

    added 3 commits

    • 265760da - temp/feedbackd-device-themes: new package
    • a5d378cd - temp/feedbackd: Depend on feedbackd-device-themes
    • 0adb0993 - temp/feedbackd: Upgrade to 0.0.0+git20201114

    Compare with previous version

    By Dylan Van Assche on 2020-12-31T15:42:14

  • Administrator added 22 commits · Imported

    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

    Compare with previous version

    By Dylan Van Assche on 2020-12-31T15:49:51

  • Administrator added 5 commits · Imported

    added 5 commits

    • a8b2e1f8...0558e650 - 5 commits from branch postmarketOS:master

    Compare with previous version

    By Dylan Van Assche on 2020-12-31T16:28:30

  • Author Owner

    I noticed a regression from upgrading to the latest release. A new group is used to access the LED indicator called feedbackd instead of video. I looked up the APKBUILD reference and this should be solved by adding this group + users to this group with a pre-install script: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#.24pkgname.pre-install

    I 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
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading