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

Controller not detected on macOS since Godot 4.3-dev4 #93260

Closed
mandykoh opened this issue Jun 17, 2024 · 9 comments
Closed

Controller not detected on macOS since Godot 4.3-dev4 #93260

mandykoh opened this issue Jun 17, 2024 · 9 comments

Comments

@mandykoh
Copy link

mandykoh commented Jun 17, 2024

Tested versions

  • Reproducible in:
    • 4.3-dev4 (macOS 14.5, on M1 Pro and Intel, both with Rosetta and without)
    • 4.3-beta1 (macOS 14.5)
  • Not reproducible in:
    • 4.3-beta1 (Windows 10)
    • 4.3-dev3 (macOS 14.5)
    • 4.2.2 (macOS 14.5)

System information

Godot v4.3.beta1 - macOS 14.5.0 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (10 Threads)

Issue description

Controllers aren't detected and do not register any input when using macOS with 4.3 builds from 4.3-dev4 to 4.3-beta1 (inclusive). Tested with Xbox Wireless Controller over Bluetooth and connected via USB, and Switch Pro Controller over Bluetooth.

Steps to reproduce

  1. Pair controller with OS, and verify in System Settings -> Game Controllers that the controller appears and is active.
  2. Start Godot and create new, empty project.
  3. Go to Project Settings -> Input Map and add a new action.
  4. Add a new event for the action (attempting to press a controller button when Listening for Input).
  5. Add a node with an event handler to an empty scene: func _input(event: InputEvent) -> void: print(event)
  6. Run the scene.
  7. Press the mapped controller button.

Expected:

  • For Step 4, the controller button is automatically detected and bound.
  • For Step 7, the event is logged to the output pane.

Actual:

  • For Step 4, nothing happens.
  • For Step 7, no event is logged for the controller input.
  • In addition, Input.get_connected_joypads() returns an empty array.

Minimal reproduction project (MRP)

N/A

@mandykoh mandykoh changed the title Controller not detected on macOS since Godot 4.3 (dev4) Controller not detected on macOS since Godot 4.3-dev4 Jun 17, 2024
@passivestar
Copy link
Contributor

Works on macOS 14.4.1, Godot 4.3beta1, Xbox Wireless Controller

@bruvzg
Copy link
Member

bruvzg commented Jun 17, 2024

Can't reproduce on macOS 14.5 (23F79), with DualSense and Xbox controllers. Current master and beta1 seems to work fine.

@mandykoh
Copy link
Author

mandykoh commented Jun 17, 2024

It's consistently reproducible for me if I switch between dev3 (fine) and dev4 (no controller detected). What can I look into to help debug?

@akien-mga akien-mga added this to the 4.3 milestone Jun 17, 2024
@akien-mga
Copy link
Member

Dev4 included this PR which sounds related: #80709.

@bruvzg
Copy link
Member

bruvzg commented Jun 17, 2024

This PR switched controller handling to the new API, before it, only some old (360 and xbone) wired xbox controllers were usable with a custom driver (https://github.com/360Controller/360Controller, which is not maintained anymore and almost completely broken). New API support both BT and wired but only for new controllers:

  • Xbox Wireless Controller with Bluetooth (Model 1708)
  • Xbox Wireless Controller Series S
  • Xbox Wireless Controller Series X
  • Xbox Elite Wireless Controller Series 2
  • Xbox Adaptive Controller

Old wired controllers are not supported (generic BT controllers should work), but since a custom driver is unusable it should not be an issue.

@mandykoh
Copy link
Author

Confirming that my Xbox controller is a model 1708. I can also reproduce the problem with a PS4 controller connected via USB and Bluetooth. (At this point, it doesn't seem like the type of controller is relevant to this problem.)

@shakesoda
Copy link

likely related to this (also affected by #80709 i believe), my stadia controller isn't marked as known/mapped now. SDL gamepad mappings and GUIDs seem totally screwy. it still works, but it Input.is_joy_known returns false (i was relying on this previously to know if i could expect mappings to make any sense - worked fine in 4.2.2, although maybe i shouldn't have been relying on it).

@mandykoh
Copy link
Author

Some more info: debugging with a master build, I can see that the controller gets registered in joypad_macos.mm and that controller.extendedGamepad.valueChangedHandler gets set, but the handler never appears to be called. (I would expect it to be called whenever there is input on the controller.)

This is my first time poking into Godot source (or touching macOS Game Controller API, for that matter), so I'm not sure what would be helpful to investigate next. Suggestions welcome.

@mandykoh
Copy link
Author

After going down a rabbit hole, rebooting fixed it. >.< macOS problem, not Godot. Please feel free to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants