lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEc3jaBELzAnffyE4mzQeNAiH-F5AhQqMGvMKoL6yu4naHBo+w@mail.gmail.com>
Date: Wed, 14 Aug 2024 09:17:46 -0700
From: Roderick Colenbrander <thunderbird2k@...il.com>
To: Max Staudt <max@...as.org>
Cc: Roderick Colenbrander <roderick.colenbrander@...y.com>, Jiri Kosina <jikos@...nel.org>, 
	Benjamin Tissoires <benjamin.tissoires@...hat.com>, linux-input@...r.kernel.org, 
	linux-kernel@...r.kernel.org, nathaniel.lewis@...y.com
Subject: Re: [PATCH v2] hid-playstation: DS4: Update rumble and lightbar together

Hi Max,

That looks like a reasonable workaround. I think it would be fine to
add. We will try to support that with Android as well.

Thanks,
Roderick

On Sun, Aug 11, 2024 at 6:15 AM Max Staudt <max@...as.org> wrote:
>
> Some 3rd party gamepads expect updates to rumble and lightbar together,
> and setting one may cancel the other.
>
> Let's maximise compatibility by always sending rumble and lightbar
> updates together, even when only one has been scheduled.
>
> Further background reading:
>
> - Apparently the PS4 always sends rumble and lightbar updates together:
>
>   https://eleccelerator.com/wiki/index.php?title=DualShock_4#0x11_2
>
> - 3rd party gamepads may not implement lightbar_blink, and may simply
>   ignore updates with 0x07 set, according to:
>
>   https://github.com/Ryochan7/DS4Windows/pull/1839
> ---
> Changes in v1 -> v2:
>  - Simplified the code, comment, and commit message.
> ---
>  drivers/hid/hid-playstation.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index e7c309cfe3a0..0d90d7ee693c 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -2143,6 +2143,26 @@ static void dualshock4_output_worker(struct work_struct *work)
>
>         spin_lock_irqsave(&ds4->base.lock, flags);
>
> +       /*
> +        * Some 3rd party gamepads expect updates to rumble and lightbar
> +        * together, and setting one may cancel the other.
> +        *
> +        * Let's maximise compatibility by always sending rumble and lightbar
> +        * updates together, even when only one has been scheduled, resulting
> +        * in:
> +        *
> +        *   ds4->valid_flag0 >= 0x03
> +        *
> +        * Hopefully this will maximise compatibility with third-party pads.
> +        *
> +        * Any further update bits, such as 0x04 for lightbar blinking, will
> +        * be or'd on top of this like before.
> +        */
> +       if (ds4->update_rumble || ds4->update_lightbar) {
> +               ds4->update_rumble = true; /* 0x01 */
> +               ds4->update_lightbar = true; /* 0x02 */
> +       }
> +
>         if (ds4->update_rumble) {
>                 /* Select classic rumble style haptics and enable it. */
>                 common->valid_flag0 |= DS4_OUTPUT_VALID_FLAG0_MOTOR;
> --
> 2.39.2
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ