Re: [PATCH v5 09/12] HID: pidff: Stop all effects before enabling actuators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 21 Jan 2025 at 11:10, Oliver Neukum <oneukum@xxxxxxxx> wrote:
>
> On 19.01.25 14:13, Tomasz Pakuła wrote:
> > Some PID compliant devices automatically play effects after boot (i.e.
> > autocenter spring) that prevent the rendering of other effects since
> > it is done outside the kernel driver.
> >
> > This makes sure all the effects currently played are stopped after
> > resetting the device.
> > It brings compatibility to the Brunner CLS-P joystick and others
>
> Hi,
>
> it seems to me that the same thing would happen upon resumption
> from S4. Will this be handled?
>
>         Regards
>                 Oliver
>

(Terribly sorry for double mailing, I mistakenly hit reply instead of reply all)

I just tested this with my devices and it sadly doesn't handle sleep properly.
If a device is powered off then back on during sleep, the driver seems to be
unaware of it and keeps on chugging along like nothing happened.

This causes two things to happen:
1. FFB breaks in programs that have been running when going to sleep
2. Possible auto centering forces are back on and won't go away without a
   power cycle or a disconnect/connect.

Moreover, I noticed that the PID reset routine is only called upon during
device initialisation, while most other PID driver implementations don't do it
during device init and only call:
1. reset + enable actuators if an application initialises force feedback.
2. reset + stop all effects + disable actuators if there aren't any more
   effects left on the device after effect removal.

I'll update the reset function and access it differently, to better manage
device state and maybe hook up .suspend, .resume and .reset_resume
in the universal driver.

Managing this in the generic way will necessitate more extensive changes in the
hid-core but resetting every time when an application actually takes control
should be enough for now.

This driver is very old and I plan on chipping away at it more in the future
to make it less strict and work even better with all sorts of USB PID devices.

Tomasz





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux