Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(packaging): ensure that uhid is loaded automatically #2906

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gschintgen
Copy link
Contributor

@gschintgen gschintgen commented Jul 23, 2024

Description

There have been at least two reports of non-working DualSense5 emulation due to uhid not being loaded.

With this PR we'll configure systemd to automatically load uhid. (I suppose that currently it depends on the distribution and on which other devices the user may have connected to the host. I'm not sure.)

Do note that I'm rather new to CMake.

I did a few local tests (mainly a brief test that the uhid config is put in place correctly and that the module is loaded). I did not test rpm but since it shares the postinst with the .deb it should be fine.

  • .deb
  • .rpm
  • Arch
  • AppImage
  • Flatpak

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@gschintgen
Copy link
Contributor Author

Somehow I can no longer run the CI in my fork. It always fails at the Setup Release step:

ERROR: Squash and merge is not enabled for this repository. Please ensure ONLY squash and merge is enabled. DO NOT re-run this job after changing the repository settings. Wait until a new commit is made.

I then modified the settings in my repository according to the message but that did not work. (Probably because on my fork it's a branch and not a pull request.)

I don't know how to proceed to get this tested.

@ReenigneArcher
Copy link
Member

Somehow I can no longer run the CI in my fork. It always fails at the Setup Release step:

ERROR: Squash and merge is not enabled for this repository. Please ensure ONLY squash and merge is enabled. DO NOT re-run this job after changing the repository settings. Wait until a new commit is made.

I then modified the settings in my repository according to the message but that did not work. (Probably because on my fork it's a branch and not a pull request.)

I don't know how to proceed to get this tested.

My suggestion is to create a PR into your master branch and run the CI that way.

@gschintgen
Copy link
Contributor Author

My suggestion is to create a PR into your master branch and run the CI that way.

Ah, in hindsight that's kind of obvious. Thanks!

@gschintgen gschintgen marked this pull request as ready for review July 24, 2024 10:24
@ReenigneArcher
Copy link
Member

There are some comments here we may want to investigate: #1720 (comment)

Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good. I think rpm will be fine since it uses the same postinst as deb (excluding rpm-ostree OSes).

This could probably be merged once these few things are addressed, and rebased.

@@ -235,6 +235,12 @@ Install
Sunshine needs access to `uinput` to create mouse and gamepad virtual devices and (optionally) to `uhid`
in order to emulate a PS5 DualSense joypad with Gyro, Acceleration and Touchpad support.

#. Ensure that `uhid` is loaded at boottime.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this section out of the new docs, as all of our provided packages were taking care of this.

Maybe we should re-add it, but to the "building" section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should re-add it, but to the "building" section?

Yes, I think that's a good idea. Also, in the new docs, there is still the setcap step left, which could also be moved to the building section as it's taken care of by the regular (i.e. not flatpak or appimage) packages.

cmake/FindSystemd.cmake Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Aug 15, 2024

@gschintgen gschintgen changed the title packaging/Linux: ensure that uhid is loaded automatically fix(packaging): ensure that uhid is loaded automatically Aug 15, 2024
@ReenigneArcher
Copy link
Member

FYI: #3041

@ReenigneArcher
Copy link
Member

There were some updates related to this recently, I'm not sure if any of this is still needed?

@gschintgen
Copy link
Contributor Author

There were some updates related to this recently, I'm not sure if any of this is still needed?

I'll have to (double) check but I'm unfortunately short on time. Yesterday, after distro-upgrading, I installed the latest published pre-release and quickly checked lsmod | grep uhid and uhid did show up. I planned on just leaving a comment here and closing my PR, but with the AMD PR still checked out I now don't have uhid loaded (and Sunshine is complaining about missing ds5 support).

@ReenigneArcher
Copy link
Member

Okay, no problem. I'll mark this as draft for now.

@ReenigneArcher ReenigneArcher marked this pull request as draft September 1, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants