From: Peter Hutterer <peter.hutterer@who-t.net>
To: Angela Czubak <acz@semihalf.com>
Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
seobrien@chromium.org, jikos@kernel.org,
Dmitry Torokhov <dtor@chromium.org>
Subject: Re: Forcepad interface design proposal
Date: Fri, 3 Dec 2021 12:57:12 +1000 [thread overview]
Message-ID: <YamHiBW8nI8Lxeef@quokka> (raw)
In-Reply-To: <CAB4aORVm7hFDVE_zekZZxTEkXgBJD=HzEekMWNAZs3kV05JU7w@mail.gmail.com>
Hi Angela,
On Tue, Nov 30, 2021 at 02:51:48PM +0100, Angela Czubak wrote:
> Hi Benjamin and Peter,
>
> I am refreshing this old thread in order to clarify some things
> discussed here :)
> I specifically got lost when reading about virtual IDs for effects.
> Asking more inline.
[...]
> > > > > > > So, the solution we came to this morning, while talking to Peter, was
> > > > > > > that the HID driver for a simple haptic HID device would allocate a
> > > > > > > virtual device memory to store the effects and the parameters.
> > > > > > >
> > > > > > > This way, we can:
> > > > > > > - upload effect WAVEFORM_RELEASE with its parameters in id 0 of the
> > > > > > > drvdata of the device
> > > > > > > - upload effect WAVEFORM_PRESS with its parameters in id 1 of the
> > > > > > > drvdata of the device
> > > > > > > - ...
> > > > > > > - upload effect WAVEFORM_VENDOR_ZZZ_ZZZ with its parameters in id N of
> > > > > > > the drvdata of the device -> userspace will use it while scrolling for
> > > > > > > instance
> > > > > > > - ...
> > > > > > >
> > > > > > > Then the kernel on BTN_LEFT press can automatically trigger the effect
> > > > > > > with id 1 and the one with id 0 on release in the case of the
> > > > > > > autonomous mode mentioned below.
> > > > > > >
> > > > > > > To solve the question of knowing which effect should be loaded in
> > > > > > > which slot, I think we should rely on a userspace helper (udev?).
> > > > > > > We definitively not want the kernel to keep a list of devices to
> > > > > > > effects matches, but having a udev database (hwdb and intrinsic?)
> > > > > > > would nicely solve the issue as we do not need to update the kernel
> > > > > > > for each new device coming in.
> > > > > > >
> > > > > > > From the kernel driver, we can populate the WAVEFORM_PRESS and
> > > > > > > WAVEFORM_RELEASE with some sensible parameters, but userspace should
> > > > > > > be allowed to override them.
> > > > > > >
> > > > > > > The advantage of having this virtual memory of device effects, is that
> > > > > > > each userspace implementation could use its own matching for effects.
> > > > > > > For example, libinput might want to say:
> > > > > > > - id 0 -> BTN_LEFT released
> > > > > > > - id 1 -> BTN_LEFT pressed
> > > > > > > - id 0x1000 -> scrolling up
> > > > > > > - id 0x1001 -> scrolling down
> > > > > > > - id 0x2042 -> hard press
> > > > > > >
> Was there some idea up then to implement virtual effect IDs? Right now
> it seems that
> the number of possible FF effects is limited to FF_MAX_EFFECTS and
> that it is the kernel
> and not the user space that assigns the ID when an effect is uploaded.
> Or was it more of a suggestion for the future than a requirement
> regarding the simple haptic feedback implementation?
I have to admit I barely remember any of this, it happend around a very busy
time and i have little recollection beyond re-reading this thread. The above
was an idea on how to handle custom waveforms, we never went past what was
suggested in this thread.
Cheers,
Peter
next prev parent reply other threads:[~2021-12-03 2:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 13:51 Forcepad interface design proposal Angela Czubak
2021-12-03 2:57 ` Peter Hutterer [this message]
2021-12-20 20:41 ` Roderick Colenbrander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YamHiBW8nI8Lxeef@quokka \
--to=peter.hutterer@who-t.net \
--cc=acz@semihalf.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dtor@chromium.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=seobrien@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox