Compare commits

..
12 Commits
Author SHA1 Message Date
SymbX 45c6265b45 add ability to work with constant-only driver 2026-10-14 22:58:53 +03:00
Guido Günther 047ab2305f Merge branch 'fdo-group' into 'main'
treewide: Move to fdo project group

See merge request agx/feedbackd!212
2026-02-12 17:11:29 +00:00
Guido Günther 49acf146b8 treewide: Move to fdo project group
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-12 17:09:37 +00:00
Guido Günther aff07778e7 Merge branch 'update' into 'main'
Bump meson version to 1.7

See merge request agx/feedbackd!211
2026-02-08 08:36:53 +00:00
Guido Günther d6bf54753d doc: Fix feedbackd spelling
Thanks: Tomi
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-07 22:01:07 +01:00
Guido Günther bbeabb6250 build: Bump meson version to 1.7
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-07 08:38:43 +01:00
Guido Günther c158b3c919 doc: Fix typo
Gbp-Dch: Ignore
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-07 08:38:19 +01:00
Guido Günther 1be162a2e5 Merge branch 'rel-0.8.9' into 'main'
treewide: Document changes and release 0.8.9

See merge request agx/feedbackd!210
2026-02-07 07:31:40 +00:00
Guido Günther 4fe3895a57 treewide: Document changes and release 0.8.9
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-06 22:22:48 +01:00
Guido Günther 0e7e47a0bd ci: Override registry
We only use prebuilt images for the ci-checks so use the registry
we're hosting them on.

This should unbreak the meson ans style check jobs.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-06 22:22:48 +01:00
Guido Günther 3569d140aa Merge branch 'update-url' into 'main'
ci: Update URL to shared repo

See merge request agx/feedbackd!209
2026-02-06 19:20:38 +00:00
Guido Günther cc10f6081f ci: Update URL to shared repo
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-02-02 22:38:40 +01:00
14 changed files with 127 additions and 47 deletions
+4 -2
View File
@@ -1,7 +1,7 @@
--- ---
include: include:
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6a40df92957c8ce9ee741aaccc5daaaf70545b1e/templates/ci-fairy.yml' - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6a40df92957c8ce9ee741aaccc5daaaf70545b1e/templates/ci-fairy.yml'
- remote: 'https://gitlab.gnome.org/guidog/meta-phosh/-/raw/0ed15edd821f8afacbf7a9c0f2a6266873289115/ci/phosh-common-jobs.yml' - remote: 'https://gitlab.gnome.org/World/Phosh/meta-phosh/-/raw/fe94386c4e4f088e96955194cb9d405df0654563/ci/phosh-common-jobs.yml'
stages: stages:
- build - build
@@ -10,7 +10,9 @@ stages:
- deploy - deploy
variables: variables:
FDO_UPSTREAM_REPO: agx/feedbackd FDO_UPSTREAM_REPO: feedbackd/feedbackd
# ci-check image comes from here
CI_REGISTRY: registry.gitlab.gnome.org
workflow: workflow:
rules: rules:
+17 -5
View File
@@ -1,3 +1,15 @@
feedbackd 0.8.9
---------------
Released February 2026
* Improve docs
* Add custom theme example
* udev: Match LED on devices with multiple status LEDs
* Simplify using media roles via build profile
* theme: Fix window-close event name
* Contributors:
* Guido Günther
* stsdc
feedbackd 0.8.8 feedbackd 0.8.8
--------------- ---------------
Released December 2025 Released December 2025
@@ -5,8 +17,8 @@ Released December 2025
* Create uses via systemd-sysusers * Create uses via systemd-sysusers
* Fix max brightness for LED patterns on multicolor LEDs * Fix max brightness for LED patterns on multicolor LEDs
* Issues fixed: * Issues fixed:
* https://gitlab.freedesktop.org/agx/feedbackd/-/issues/83 * https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/83
* https://gitlab.freedesktop.org/agx/feedbackd/-/issues/95 * https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/95
* Contributors: * Contributors:
* Achill Gilgenast * Achill Gilgenast
* Guido Günther * Guido Günther
@@ -33,7 +45,7 @@ Released September 2025
level not the app's feedback level level not the app's feedback level
* Add udev rule for FP5 haptic * Add udev rule for FP5 haptic
* Issues fixed: * Issues fixed:
* https://gitlab.freedesktop.org/agx/feedbackd/-/issues/93 * https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/93
* Contributors: * Contributors:
* Guido Günther * Guido Günther
* Luca Weiss * Luca Weiss
@@ -46,7 +58,7 @@ Released August 2025
* Add `key-pressed` and `key-released` events that e.g. OSKs can * Add `key-pressed` and `key-released` events that e.g. OSKs can
use to emit haptic feedback in silent mode use to emit haptic feedback in silent mode
* Issues fixed: * Issues fixed:
* https://gitlab.freedesktop.org/agx/feedbackd/-/issues/85 * https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/85
* Contributors: * Contributors:
* Guido Günther * Guido Günther
* Sicelo A. Mhlongo * Sicelo A. Mhlongo
@@ -70,7 +82,7 @@ Released May 2025
* vibra: Preserve original feedback value when the user changed * vibra: Preserve original feedback value when the user changed
strength strength
* Issues fixed: * Issues fixed:
* https://gitlab.freedesktop.org/agx/feedbackd/-/issues/89 * https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/89
* Contributors: * Contributors:
* Guido Günther * Guido Günther
* knoppix knoppix * knoppix knoppix
+15 -15
View File
@@ -1,6 +1,6 @@
# Theme based Haptic, Visual and Audio Feedback # Theme based Haptic, Visual and Audio Feedback
feebackd provides a DBus daemon (feebackd) to act on events to provide feedbackd provides a DBus daemon (feedbackd) to act on events to provide
haptic, visual and audio feedback. It offers a library haptic, visual and audio feedback. It offers a library
([libfeedback][libfeedback-api]) and GObject introspection bindings to ([libfeedback][libfeedback-api]) and GObject introspection bindings to
ease using it from applications. ease using it from applications.
@@ -11,13 +11,13 @@ specification][event-spec].
## License ## License
feebackd is licensed under the GPLv3+ while the libfeedback library is feedbackd is licensed under the GPLv3+ while the libfeedback library is
licensed under LGPL 2.1+. licensed under LGPL 2.1+.
## Getting the source ## Getting the source
```sh ```sh
git clone https://gitlab.freedesktop.org/agx/feedbackd git clone https://gitlab.freedesktop.org/feedbackd/feedbackd.git
cd feedbackd cd feedbackd
``` ```
@@ -39,7 +39,7 @@ For an explicit list of dependencies check the `Build-Depends` entry in the
## Building ## Building
We use the meson (and thereby Ninja) build system for feebackd. The quickest We use the meson (and thereby Ninja) build system for feedbackd. The quickest
way to get going is to do the following: way to get going is to do the following:
```sh ```sh
@@ -88,7 +88,7 @@ See `examples/` for a simple python example using GObject introspection.
## Events, Feedbacks and Profiles ## Events, Feedbacks and Profiles
Whenever an event is submitted to the daemon by a client via the DBus Whenever an event is submitted to the daemon by a client via the DBus
API *feebackd* looks up the corresponding feedbacks in the profiles API *feedbackd* looks up the corresponding feedbacks in the profiles
of the currently active feedback theme. Which feedbacks are actually of the currently active feedback theme. Which feedbacks are actually
triggered depends on the daemon's current *feedback* *level*, per triggered depends on the daemon's current *feedback* *level*, per
application settings and hints provided by the client with the event. application settings and hints provided by the client with the event.
@@ -103,7 +103,7 @@ get canceled if the app that triggered them crashes.
Each theme consists of up to three profile sections named `full`, Each theme consists of up to three profile sections named `full`,
`quiet` and `silent` containing event names and their associated `quiet` and `silent` containing event names and their associated
feedback. feebackd's currently selected profile determines which feedback. feedbackd's currently selected profile determines which
profiles of the current theme are being used for event lookup: profiles of the current theme are being used for event lookup:
- `full`: Use events from the `full`, `quiet` and `silent` profiles of - `full`: Use events from the `full`, `quiet` and `silent` profiles of
@@ -131,12 +131,12 @@ are mapped to feedbacks (sound, LED, vibra) via a configurable theme.
There are two types of themes: *custom* themes and *device* themes. There are two types of themes: *custom* themes and *device* themes.
They both use the same format but have different purpose. Custom They both use the same format but have different purpose. Custom
themes are meant to tweak feebackd's output to the users needs while themes are meant to tweak feedbackd's output to the users needs while
device themes are meant to cater for hardware differences. device themes are meant to cater for hardware differences.
#### Custom themes #### Custom themes
feebackd is shipped with a default theme `default.json`. You can feedbackd is shipped with a default theme `default.json`. You can
replace this by your own, custom theme in multiple ways: replace this by your own, custom theme in multiple ways:
1. By exporting an environment variable `FEEDBACK_THEME` with a path to a 1. By exporting an environment variable `FEEDBACK_THEME` with a path to a
@@ -147,7 +147,7 @@ replace this by your own, custom theme in multiple ways:
default to `$HOME/.config` default to `$HOME/.config`
1. By creating a theme file under `$XDG_CONFIG_HOME/feedbackd/themes/custom.json` and 1. By creating a theme file under `$XDG_CONFIG_HOME/feedbackd/themes/custom.json` and
telling feebackd to use that theme. In this custom theme you only telling feedbackd to use that theme. In this custom theme you only
specify the events you want to change. Also add a `parent-name` entry specify the events you want to change. Also add a `parent-name` entry
to chain up to the default theme: to chain up to the default theme:
@@ -167,7 +167,7 @@ replace this by your own, custom theme in multiple ways:
[here](./tests/data/user-config/feedbackd/themes/custom.json) for [here](./tests/data/user-config/feedbackd/themes/custom.json) for
an example. an example.
Once you have the file in place, tell feebackd to use this theme Once you have the file in place, tell feedbackd to use this theme
instead of the default one: instead of the default one:
```sh ```sh
@@ -199,7 +199,7 @@ be used to avoid having to restart the daemon in case of configuration changes.
### Device themes ### Device themes
feebackd has support to pick up device specific themes feedbackd has support to pick up device specific themes
automatically. This allows us to handle device differences like automatically. This allows us to handle device differences like
varying strength of haptic motors or different LED colors in an varying strength of haptic motors or different LED colors in an
automatic way. automatic way.
@@ -332,7 +332,7 @@ gsettings set org.sigxcpu.feedbackd.application:/org/sigxcpu/feedbackd/applicati
## Haptic API ## Haptic API
In order to give applications like browsers and games more control In order to give applications like browsers and games more control
over the haptic motor `Feebackd` implements an interface that allows over the haptic motor `Feedbackd` implements an interface that allows
to set vibra patterns. The vibration pattern is given as a sequence of to set vibra patterns. The vibration pattern is given as a sequence of
rumble magnitude and duration pairs like: rumble magnitude and duration pairs like:
@@ -351,12 +351,12 @@ a haptic device is found.
## Getting in Touch ## Getting in Touch
- Issue tracker: <https://gitlab.freedesktop.org/agx/feedbackd/-/issues> - Issue tracker: <https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues>
- Chat via Matrix: <https://matrix.to/#/#phosh:phosh.mobi> - Chat via Matrix: <https://matrix.to/#/#phosh:phosh.mobi>
## Code of Conduct ## Code of Conduct
Note that since feedbackd is hosted on freedesktop.org, feebackd follows its Note that since feedbackd is hosted on freedesktop.org, feedbackd follows its
[Code of Conduct], based on the Contributor Covenant. Please conduct yourself [Code of Conduct], based on the Contributor Covenant. Please conduct yourself
in a respectful and civilized manner when communicating with community members in a respectful and civilized manner when communicating with community members
on IRC and bug tracker. on IRC and bug tracker.
@@ -369,7 +369,7 @@ on IRC and bug tracker.
- [W3's vibration API draft](https://www.w3.org/TR/vibration/) - [W3's vibration API draft](https://www.w3.org/TR/vibration/)
[debian/control]: ./debian/control#L5 [debian/control]: ./debian/control#L5
[1]: https://gitlab.freedesktop.org/agx/feedbackd-device-themes [1]: https://gitlab.freedesktop.org/feedbackd/feedbackd-device-themes
[feedback-themes]: ./doc/feedback-themes.rst [feedback-themes]: ./doc/feedback-themes.rst
[Code of Conduct]: https://www.freedesktop.org/wiki/CodeOfConduct/ [Code of Conduct]: https://www.freedesktop.org/wiki/CodeOfConduct/
[feedbackd-themes manpage]: ./doc/feedbackd-themes.rst [feedbackd-themes manpage]: ./doc/feedbackd-themes.rst
+43 -6
View File
@@ -1,3 +1,40 @@
feedbackd (0.8.9) experimental; urgency=medium
[ Guido Günther ]
* packaging: Add build profile to build with and install media roles.
We create an wireplumber-xdg-media-roles package that contains the role configuration.
* theme: Fix window-close event name
* doc: Update build instructions.
We use meson and also tweak some other bits for readability
* doc: Better separate custom and device themes
* doc: Document `$device` in device themes.
It identifies the theme as device theme so we should document it.
* feedback-themes: Mention the profiles feedback types are used in
* doc: Clarify event lookup
* doc: Mention what fbcli is
* feedback-themes: Improve manpage.
Explain relation between profiles, events and feedback a bit better.
* feedbackd: Add --verbose option.
Easier to discover than `G_MESSAGES_DEBUG`
* feedbackd: Allow replacement and an option for it.
This brings us in line with e.g. the portals
* feedbackd: Exit with EXIT_FAILURE if we can't get the bus name.
Makes usage in scritps and systemd units more robust.
* feedbackd: Add --version option
* examples: Add a less blinky example.
Uncategorized notifications can be distracting. Add an example that
disable the notification LED for these. Copy to
~/.config/feedbackd/themes/
and enable via
gsettings set org.sigxcpu.feedbackd theme strict
* ci: Update URL to shared repo
[ stsdc ]
* udev: Match on devices with multiple status LEDs
* rules: Update regex for status LED device path
-- Guido Günther <agx@sigxcpu.org> Fri, 06 Feb 2026 20:23:49 +0100
feedbackd (0.8.8) experimental; urgency=medium feedbackd (0.8.8) experimental; urgency=medium
[ Lukas Timmermann ] [ Lukas Timmermann ]
@@ -6,7 +43,7 @@ feedbackd (0.8.8) experimental; urgency=medium
[ Achill Gilgenast ] [ Achill Gilgenast ]
* data: Add sysusers configuration. * data: Add sysusers configuration.
Allows distros to add the feedbackd group by using sd-sysusers. Allows distros to add the feedbackd group by using sd-sysusers.
Closes: https://gitlab.freedesktop.org/agx/feedbackd/-/issues/83 Closes: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/83
[ Guido Günther ] [ Guido Günther ]
* packaging: Use dh-sysuser. * packaging: Use dh-sysuser.
@@ -19,7 +56,7 @@ feedbackd (0.8.8) experimental; urgency=medium
Otherwise we might exceed max brightness and get -EINVAL. Otherwise we might exceed max brightness and get -EINVAL.
Tested-by: Chris Vogel <chris@ween.de> Tested-by: Chris Vogel <chris@ween.de>
Reported-by: Chris Vogel <chris@ween.de> Reported-by: Chris Vogel <chris@ween.de>
Closes: https://gitlab.freedesktop.org/agx/feedbackd/-/issues/95 Closes: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/95
-- Guido Günther <agx@sigxcpu.org> Tue, 30 Dec 2025 10:49:55 +0100 -- Guido Günther <agx@sigxcpu.org> Tue, 30 Dec 2025 10:49:55 +0100
@@ -76,7 +113,7 @@ feedbackd (0.8.5) experimental; urgency=medium
the global feedback level not any per app level the user the global feedback level not any per app level the user
might have configured as otherwise there's no way to override might have configured as otherwise there's no way to override
this. this.
Closes: https://gitlab.freedesktop.org/agx/feedbackd/-/issues/93 Closes: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/93
* treewide: Clarify that `important` affects the global level. * treewide: Clarify that `important` affects the global level.
The DBus spec had it right but the other places weren't clear The DBus spec had it right but the other places weren't clear
on that. on that.
@@ -110,7 +147,7 @@ feedbackd (0.8.4) experimental; urgency=medium
This allows us to e.g. add a particular sound for OSK key presses and This allows us to e.g. add a particular sound for OSK key presses and
OSKs can send this with an `important` hint so they're also usable OSKs can send this with an `important` hint so they're also usable
in silent mode. in silent mode.
Closes: https://gitlab.freedesktop.org/agx/feedbackd/-/issues/85 Closes: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/85
* schema: Allow Stevia OSK to override the globla feedback level * schema: Allow Stevia OSK to override the globla feedback level
* schema: Allow all OSK to use important hint. * schema: Allow all OSK to use important hint.
OSK use the common OSK app-id so allow that too. OSK use the common OSK app-id so allow that too.
@@ -161,7 +198,7 @@ feedbackd (0.8.2) experimental; urgency=medium
* doc: Reference manpage. * doc: Reference manpage.
Refer to manpage rather than to the classes in the source code. Refer to manpage rather than to the classes in the source code.
* doc: Fix parent-name reference. * doc: Fix parent-name reference.
Closes: https://gitlab.freedesktop.org/agx/feedbackd/-/issues/89 Closes: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/issues/89
* doc: Clarify theme use * doc: Clarify theme use
* packaging: Fix inverted Breaks * packaging: Fix inverted Breaks
* fbd-dev-led-multicolor: Ignore LEDs that don't have three values. * fbd-dev-led-multicolor: Ignore LEDs that don't have three values.
@@ -1265,7 +1302,7 @@ feedbackd (0.0.0+git20200420) amber; urgency=medium
feedbackd (0.0.0+git20200305) amber-phone; urgency=medium feedbackd (0.0.0+git20200305) amber-phone; urgency=medium
* feedbackd-common: Add proper Breaks/Replaces. * feedbackd-common: Add proper Breaks/Replaces.
This handles partial upgrades with newer schema but old feebackd. This handles partial upgrades with newer schema but old feedbackd.
-- Guido Günther <agx@sigxcpu.org> Mon, 23 Mar 2020 10:21:14 +0100 -- Guido Günther <agx@sigxcpu.org> Mon, 23 Mar 2020 10:21:14 +0100
+1 -1
View File
@@ -25,7 +25,7 @@ Build-Depends:
umockdev, umockdev,
valac, valac,
Standards-Version: 4.6.2 Standards-Version: 4.6.2
Homepage: https://gitlab.freedesktop.org/agx/feedbackd Homepage: https://gitlab.freedesktop.org/feedbackd/feedbackd
Rules-Requires-Root: no Rules-Requires-Root: no
Package: feedbackd Package: feedbackd
+1 -1
View File
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: feedbackd Upstream-Name: feedbackd
Upstream-Contact: Guido Günther <agx@debian.org> Upstream-Contact: Guido Günther <agx@debian.org>
Source: https://gitlab.freedesktop.org/agx/feedbackd Source: https://gitlab.freedesktop.org/feedbackd/feedbackd
Files: * Files: *
Copyright: 2020 Purism SPC Copyright: 2020 Purism SPC
+2 -2
View File
@@ -67,7 +67,7 @@ silent:
``` ```
At the time of writing the theme format is daemon dependent. E.g. feedbackd At the time of writing the theme format is daemon dependent. E.g. feedbackd
uses a format [similar to the above in JSON](https://gitlab.freedesktop.org/agx/feedbackd/-/blob/main/data/default.json) uses a format [similar to the above in JSON](https://gitlab.freedesktop.org/feedbackd/feedbackd/-/blob/main/data/default.json)
# Recommendations # Recommendations
@@ -77,4 +77,4 @@ uses a format [similar to the above in JSON](https://gitlab.freedesktop.org/agx/
be used. be used.
- The full feedback theme can use any available feedback mechanisms - The full feedback theme can use any available feedback mechanisms
[Event naming spec]: https://gitlab.freedesktop.org/agx/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md [Event naming spec]: https://gitlab.freedesktop.org/feedbackd/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md
+2 -2
View File
@@ -4,7 +4,7 @@ Slug: building
# Compiling with libfeedback # Compiling with libfeedback
If you need to build libfeedback, get the source from If you need to build libfeedback, get the source from
[here](https://gitlab.freedesktop.org/agx/feedbackd) and see the `README.md` file. [here](https://gitlab.freedesktop.org/feedbackd/feedbackd) and see the `README.md` file.
## Using `pkg-config` ## Using `pkg-config`
@@ -27,7 +27,7 @@ Libfeedback can be used as a Meson subproject. Create a
```ini ```ini
[wrap-git] [wrap-git]
directory=libfeedback directory=libfeedback
url=https://gitlab.freedesktop.org/agx/feedbackd.git url=https://gitlab.freedesktop.org/feedbackd/feedbackd.git
revision=main revision=main
depth=1 depth=1
``` ```
+1 -1
View File
@@ -28,7 +28,7 @@ OPTIONS
``-E=EVENT``, ``--event=EVENT`` ``-E=EVENT``, ``--event=EVENT``
Submit the given event to ``feedbackd``. Valid events are listes in Submit the given event to ``feedbackd``. Valid events are listes in
the event naming spec at the event naming spec at
https://gitlab.freedesktop.org/agx/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md https://gitlab.freedesktop.org/feedbackd/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md
``-I``, ``--important`` ``-I``, ``--important``
Whether to set the important hint Whether to set the important hint
+3 -3
View File
@@ -24,17 +24,17 @@ ignored.
Each event maps to at most one feedback in each profile. The events Each event maps to at most one feedback in each profile. The events
in the theme are named according to the in the theme are named according to the
`Event Naming Specifiaction `Event Naming Specifiaction
<https://gitlab.freedesktop.org/agx/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md>`_. <https://gitlab.freedesktop.org/feedbackd/feedbackd/-/blob/main/doc/Event-naming-spec-0.0.0.md>`_.
There are two types of themes: *custom* themes and *device* themes. There are two types of themes: *custom* themes and *device* themes.
They both use the same format but have different purpose. Custom They both use the same format but have different purpose. Custom
themes are meant to tweak feebackd's output to the user's needs while themes are meant to tweak feedbackd's output to the user's needs while
device themes are meant to cater for hardware differences. Feedback device themes are meant to cater for hardware differences. Feedback
themes use a JSON format that can be validated with themes use a JSON format that can be validated with
``fbd-theme-validate(1)``. ``fbd-theme-validate(1)``.
For details on how to create or modify feedback themes see For details on how to create or modify feedback themes see
``feedbackd's documentation`` at https://gitlab.freedesktop.org/agx/feedbackd#feedback-theme. ``feedbackd's documentation`` at https://gitlab.freedesktop.org/feedbackd/feedbackd#feedback-theme.
Feedback types Feedback types
-------------- --------------
+1 -1
View File
@@ -28,7 +28,7 @@ client disconnects from DBus. This makes sure all feedbacks get canceled if the
app that triggered it crashes. app that triggered it crashes.
For details refer to the event and feedback theme specs at For details refer to the event and feedback theme specs at
`<https://gitlab.freedesktop.org/agx/feedbackd/>`__. `<https://gitlab.freedesktop.org/feedbackd/feedbackd/>`__.
Feedbackd reloads the feedback theme on `SIGHUP` (i.e. `pkill -HUP feedbackd`). Feedbackd reloads the feedback theme on `SIGHUP` (i.e. `pkill -HUP feedbackd`).
+4 -4
View File
@@ -3,9 +3,9 @@ version = "@VERSION@"
description = "A library to trigger feedback (such as haptic feedback) via events sent by your application." description = "A library to trigger feedback (such as haptic feedback) via events sent by your application."
authors = "Purism SPC" authors = "Purism SPC"
license = "LGPL-2.1-or-later" license = "LGPL-2.1-or-later"
browse_url = "https://gitlab.freedesktop.org/agx/feedbackd/" browse_url = "https://gitlab.freedesktop.org/feedbackd/feedbackd/"
repository_url = "https://gitlab.freedesktop.org/agx/feedbackd.git" repository_url = "https://gitlab.freedesktop.org/feedbackd/feedbackd.git"
website_url = "https://gitlab.freedesktop.org/agx/feedbackd/" website_url = "https://gitlab.freedesktop.org/feedbackd/feedbackd/"
dependencies = [ dependencies = [
"Gio-2.0", "Gio-2.0",
"GLib-2.0", "GLib-2.0",
@@ -30,7 +30,7 @@ show_class_hierarchy = true
[source-location] [source-location]
# The base URL for the web UI # The base URL for the web UI
base_url = "https://gitlab.freedesktop.org/agx/feedbackd/-/blob/main/" base_url = "https://gitlab.freedesktop.org/feedbackd/feedbackd/-/blob/main/"
# The format for links, using "filename" and "line" for the format # The format for links, using "filename" and "line" for the format
file_format = "{filename}#L{line}" file_format = "{filename}#L{line}"
+2 -2
View File
@@ -1,9 +1,9 @@
project( project(
'feedbackd', 'feedbackd',
'c', 'c',
version: '0.8.8', version: '0.8.9',
license: 'LGPLv3+', license: 'LGPLv3+',
meson_version: '>= 1.1.0', meson_version: '>= 1.7.0',
default_options: ['warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11'], default_options: ['warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11'],
) )
+31 -2
View File
@@ -48,6 +48,9 @@ typedef struct _FbdDevVibra {
GUdevDevice *device; GUdevDevice *device;
gint fd; gint fd;
gint id; /* currently used id */ gint id; /* currently used id */
/* The driver advertises rumble or periodic effects but rejects them (Qualcomm qti-haptics) */
gboolean constant_only;
gboolean has_constant;
FbdDevVibraFeatureFlags features; FbdDevVibraFeatureFlags features;
} FbdDevVibra; } FbdDevVibra;
@@ -142,6 +145,8 @@ initable_init (GInitable *initable,
return FALSE; return FALSE;
} }
self->has_constant = HAS_FEATURE (FF_CONSTANT, features);
/* Set gain to 75% if supported */ /* Set gain to 75% if supported */
if (HAS_FEATURE(FF_GAIN, features)) { if (HAS_FEATURE(FF_GAIN, features)) {
self->features |= FBD_DEV_VIBRA_FEATURE_GAIN; self->features |= FBD_DEV_VIBRA_FEATURE_GAIN;
@@ -232,6 +237,30 @@ fbd_dev_vibra_new (GUdevDevice *device, GError **error)
NULL)); NULL));
} }
static gboolean
upload_effect (FbdDevVibra *self, struct ff_effect *effect, double magnitude)
{
struct ff_effect constant = { 0 };
if (!self->constant_only) {
if (ioctl (self->fd, EVIOCSFF, effect) != -1)
return TRUE;
if (errno != EINVAL || !self->has_constant)
return FALSE;
g_debug ("Effect type %u rejected, using constant effects", effect->type);
self->constant_only = TRUE;
}
constant.type = FF_CONSTANT;
constant.id = -1;
constant.u.constant.level = 0x7FFF * magnitude;
constant.replay = effect->replay;
if (ioctl (self->fd, EVIOCSFF, &constant) == -1)
return FALSE;
effect->id = constant.id;
return TRUE;
}
gboolean gboolean
fbd_dev_vibra_rumble (FbdDevVibra *self, double magnitude, guint duration, gboolean upload) fbd_dev_vibra_rumble (FbdDevVibra *self, double magnitude, guint duration, gboolean upload)
{ {
@@ -250,7 +279,7 @@ fbd_dev_vibra_rumble (FbdDevVibra *self, double magnitude, guint duration, gbool
if (upload) { if (upload) {
g_debug("Uploading rumbling vibra effect (%d)", self->fd); g_debug("Uploading rumbling vibra effect (%d)", self->fd);
if (ioctl(self->fd, EVIOCSFF, &effect) == -1) { if (!upload_effect (self, &effect, magnitude)) {
g_warning ("Failed to upload rumbling vibra effect: %s", g_strerror (errno)); g_warning ("Failed to upload rumbling vibra effect: %s", g_strerror (errno));
return FALSE; return FALSE;
} }
@@ -301,7 +330,7 @@ fbd_dev_vibra_periodic (FbdDevVibra *self,
effect.replay.delay = 200; effect.replay.delay = 200;
g_debug("Uploading periodic effect (%d)", self->fd); g_debug("Uploading periodic effect (%d)", self->fd);
if (ioctl(self->fd, EVIOCSFF, &effect) == -1) { if (!upload_effect (self, &effect, magnitude)) {
g_warning ("Failed to upload periodic vibra effect: %s", g_strerror (errno)); g_warning ("Failed to upload periodic vibra effect: %s", g_strerror (errno));
return FALSE; return FALSE;
} }