DualSense Wireless Controller not working via Bluetooth [SOLVED]

Hello,

I’m test driving Defold and while doing the “Walking Astronaut Tutorial” I decided to test my PS5 wireless controller. The controller works fine while plugged but not while using Bluetooth. I get the following message in the console:

WARNING:INPUT: No gamepad map found for gamepad 0 (DualSense Wireless Controller). The raw gamepad map will be used.

Keep in mind that I get the same error while the controller is plugged via USB C but at least it works.

How do I go about adding support for this controller?

I have tried doing a few things but none have worked yet. I tried copying another PS controller and renaming it to match the DualSense name but that didn’t work. I also tried running the utility that helps map controllers but it does not run under Monterey.

Could you please show (copy/paste) what exactly you see in console?

What is OS you are using?

Please see info below:

INFO:DLIB: Log server started on port 57623
INFO:ENGINE: Target listening with name: computername - 192.168.86.37 - Darwin
INFO:ENGINE: Engine service started on port 57624
INFO:ENGINE: Defold Engine 1.2.188 (6bfeea3)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
WARNING:INPUT: No gamepad map found for gamepad 0 (DualSense Wireless Controller). The raw gamepad map will be used.
INFO:DLIB: SSDP: Started on address 192.168.0.18
INFO:DLIB: SSDP: Started on address 192.168.86.37

Let me know if you need any more information.

Thank you!

MacOS Monterey.

You need to add mappings for you gamepad. The simplest way to do so is using gdc tool

Then in terminal:

chmod +x gdc
./gdc

and follow instructions.

Here I tried to copy/paste DualShok 4 mappings and setup it for DualSense:
dualsense-osx.gamepads.zip (7.0 KB)
put this file into your project folder and then setup path to this file in game.project file (pls, pay attention, you can’t change files in builtins! Only copy/paste these files into your project folder and use it from there):

Awesome! That worked. I guess I did something wrong when I tried the same. I will take a look into the file and see where my mistake was. The download for the gdc tool is not working for me but I did try that approach and the tool wouldn’t work. Do you have another link?

The gdc tool is available here Defold Downloads
I glad it works for you!

1 Like

I tried running this version and I get this ouput:

 ❯ ./gdc 

DualSense Wireless Controller will be added to default.gamepads

* Don't press anything on the gamepad...
[1]    18617 segmentation fault  ./gdc

Let me know if I should report this somewhere if I could provide anything to help debug the issue.

Thank you again for the help!

The dualsense-osx.gamepads.zip worked for me as well!

I also get a segmentation fault when running the gdc tool. I am on an M1 macOS 12.0.1.

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x0000000304e7b1e0
Exception Codes:       0x0000000000000002, 0x0000000304e7b1e0
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [35109]

VM Region Info: 0x304e7b1e0 is in 0x304680000-0x304e7c000;  bytes after start: 8368608  bytes before end: 3615
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      Stack Guard                 300e7c000-304680000    [ 56.0M] ---/rwx SM=NUL  
--->  Stack                       304680000-304e7c000    [ 8176K] rw-/rwx SM=PRV  
      Stack Guard                 304e7c000-304e7d000    [    4K] ---/rwx SM=NUL  

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   ???                           	       0x304e7b1e0 ???
1   gdc                           	       0x10061cbe0 dmGraphics::OnWindowFocus(int) + 32
2   CoreFoundation                	    0x7ff80da65b35 ___CFXRegistrationPost_block_invoke + 49
3   CoreFoundation                	    0x7ff80da65aa6 _CFXRegistrationPost + 496
4   CoreFoundation                	    0x7ff80d99adfa _CFXNotificationPost + 803
5   Foundation                    	    0x7ff80e709996 -[NSNotificationCenter postNotificationName:object:userInfo:] + 82
6   AppKit                        	    0x7ff8104c63ab -[NSWindow becomeKeyWindow] + 1380
7   AppKit                        	    0x7ff8104c50a5 _NXShowKeyAndMain + 155
8   AppKit                        	    0x7ff8104c3227 -[NSApplication _handleActivatedEvent:] + 1479
9   AppKit                        	    0x7ff81049426e -[NSApplication(NSEvent) sendEvent:] + 2962
10  gdc                           	       0x1006122f2 -[GLFWApplication sendEvent:] + 98
11  gdc                           	       0x100616032 _glfwPlatformPollEvents + 130
12  gdc                           	       0x1005fa7aa dmHID::Update(dmHID::Context*) + 42
13  gdc                           	       0x1005f9087 main + 935
14  gdc                           	       0x1005f8cb4 start + 52
1 Like

Hmm, that segfault is indeed annoying.
We should really get M1 support going soon :confused:

4 Likes

I’m also getting a segfault error with the gdc tool on an Intel machine running macOS 11.6.1

2 Likes

I just want to point out that in my case I’m under Intel machine not M1. I hope that helps.

I can influence this error by having another program write to files that are within the defold project while the project is opened in defold.

For instance, if I run the ts-defold file watcher that regenerates scripts on save, I can crash defold rather quickly.

Not sure how the gdc tool is connected to your error?

Dang it posted in the wrong thread… My bad.

1 Like

I have the same issue -

No gamepad map found for gamepad 0 (DUALSHOCK 4 Wireless Controller). The raw gamepad map will be used.

macOS Monterey 12.6.2, Defold 1.5.0
gdc can’t see gamepad -(No connected gamepads message)

Any suggestions?

1 Like

Ok, my solution - copy default.gamepads, copy DualSense Wireless Controller section and rename it to “DUALSHOCK 4 Wireless Controller”

Interesting. What is the name reported by thge gdc tool? Or does it not detect the controller?

Yes, gdc can’t detect it.