mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-27 00:36:00 +03:00
[PR #2532] [MERGED] Fix SDL gyro and acceleration sensor handling #2808
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2808
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2532
Author: @kalaposfos13
Created: 2/24/2025
Status: ✅ Merged
Merged: 2/24/2025
Merged by: @georgemoralis
Base:
main← Head:orientation-fix📝 Commits (2)
b884ae6Fix sensor handling if they are enabled but an error was thrown regardlessf46cc9bInitialise orientation to a default value + clang📊 Changes
4 files changed (+17 additions, -11 deletions)
View changed files
📝
src/core/libraries/pad/pad.cpp(+8 -6)📝
src/input/controller.cpp(+1 -1)📝
src/sdl_window.cpp(+6 -2)📝
src/sdl_window.h(+2 -2)📄 Description
Fixes the blackscreen in GRR upon trying to float
The issue comes from the fact that for some reason enabling the gyro both works and throws an operation not permitted error, so the emulator assumes that the function is unavailable, so it logs the error, but it's still enabled nevertheless, and it gets read anyway, but when it's time to convert it to orientation values, the deltatime is still an uninitialized zero, which messes up the calculations and outputs garbage orientation data that's so out of expected ranges (the quaternion should be normalized to length 1, and this makes some coordinates to be in the thousands), that the camera position calculation in the game just gives up, and that's why the game turns black apart from the HUD
This has the side effect of orientation not being available to users who had this issue, but for Arch users, I found this "fix" (might work for other distros too):
Add the following text:
Reload this config:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.