Bug 200009 - PS3 gamepad clone (Gasia Co.,Ltd PS(R) Gamepad) not pairing
Summary: PS3 gamepad clone (Gasia Co.,Ltd PS(R) Gamepad) not pairing
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Bluetooth (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: linux-bluetooth@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-09 11:38 UTC by Lucas Ribeiro
Modified: 2019-05-25 16:21 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.9.95
Subsystem:
Regression: No
Bisected commit-id:


Attachments
hcidump (24.02 KB, text/plain)
2018-06-09 11:38 UTC, Lucas Ribeiro
Details
bluetoothd (33.06 KB, text/plain)
2018-06-09 14:33 UTC, Lucas Ribeiro
Details

Description Lucas Ribeiro 2018-06-09 11:38:41 UTC
Created attachment 276421 [details]
hcidump

I would like to report that this gasia clone does not pair successfully. I'm using Linux 4.9 and default BlueZ 5.49 on Gentoo. The device works just normally via USB cable, but it doesn't pair with any bluetooth controller.

Here's the sequence of commands on bluetoothctl. I made sure to delete the device prior to any attempts.
power on
agent on
default-agent
discoverable on
pairable on
scan on

Then connecting the device via USB, the message asking for authorization appears:
Authorize service
[blue1m[agent] Authorize service 00001124-0000-1000-8000-00805f9b34fb (yes/no): yes

After removing the cable and pressing the power button, the device connects, but then nothing happens after that and the device shuts down. Even attempting to pair manually during this sequence doesn't work.
Comment 1 Bastien Nocera 2018-06-09 12:52:53 UTC
You didn't include a lot of the details I requested. Also make sure to start bluetoothd with "bluetoothd -n -d" and attach the output here.
Comment 2 Lucas Ribeiro 2018-06-09 13:01:20 UTC
Sorry, bluez is not compiled with systemd support. Any other way to get the desired output?

USE=alsa cups mesh obex python_targets_python2_7 readline udev
Comment 3 Bastien Nocera 2018-06-09 13:09:34 UTC
(In reply to Lucas Ribeiro from comment #2)
> Sorry, bluez is not compiled with systemd support. Any other way to get the
> desired output?

Stop the old bluetoothd, and run this as root, on the command-line.
Comment 4 Lucas Ribeiro 2018-06-09 14:33:11 UTC
Created attachment 276423 [details]
bluetoothd
Comment 5 Bastien Nocera 2018-06-09 18:03:44 UTC
> bluetoothd[6914]: plugins/sixaxis.c:agent_auth_cb() remote 00:26:5C:49:A4:AF
> old_master 00:15:83:0C:BF:EB new_master 00:1A:7D:DA:71:13

This means that the device was correctly setup by the sixaxis plugin, ready to be connected via Bluetooth.

> bluetoothd[6914]: src/adapter.c:dev_disconnected() Device 00:26:5C:49:A4:AF
> disconnected, reason 1
> bluetoothd[6914]: src/adapter.c:adapter_remove_connection() 
> bluetoothd[6914]: plugins/policy.c:disconnect_cb() reason 1
> bluetoothd[6914]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr
> 00:26:5C:49:A4:AF type 0 status 0xe

This means that it attempted to bond/pair. Was bluetoothctl still running? Did you see the question about pairing?
Comment 6 Lucas Ribeiro 2018-06-09 18:06:33 UTC
Yes, bluetoothctl was still running. After the device shuts down, the message shows up:

[CHG] Device 00:26:5C:49:A4:AF Connected: no

There was nothing regarding pairing after the auth request.
Comment 7 Marcelo 2018-07-24 22:16:31 UTC
Nice to see a fresh bug about this.

I've managed to track down the problem with mine.
It is in sony-hid.c file.

It sends a hw_raw_request to controller, but this controller expects a hw_output_report on for sixaxis_output_report function.

I got this from scp toolkit for Windows where the guy changed the first byte sent to this controller. He sent 0xA2 (HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT).

So event though Bluez stack is ok now, it still needs some kernel work.
Comment 8 Marcelo 2018-07-24 22:18:00 UTC
BTW, I've also tested with a original dualshock, but it caused lights to blink, so maybe a if/else is needed for the fake vs the original
Comment 9 Marcelo 2018-07-25 10:56:10 UTC
Links for code and bug of Windows project with same problem


Hid Output report written originally:

https://github.com/nefarius/ScpToolkit/blob/master/ScpControl/Bluetooth/Ds3/BthDs3.cs#L302


Workaround (not implemented for some reason)

https://github.com/nefarius/ScpToolkit/blob/c082de827fb6ec3efdff0a7a632977fbdff898e1/ScpControl/Bluetooth/Ds3/BthDs3.cs#L232


Issue where the guy tells that uncommenting the workaround make things work

https://github.com/nefarius/ScpToolkit/issues/652
Comment 10 Marcelo 2019-05-25 16:21:07 UTC
Guys from retrofit did a really nice fix for this.

It keeps already existent behavior and fixes gasia (at least for the model I have here). Change is really neat.


https://github.com/RetroPie/RetroPie-Setup/pull/2263/commits/017f00f6e15f04b3272ff1abae8742dc4c47b608#diff-293af5b19ba1d1f50c86e8b9b0b1feaf

Note You need to log in before you can comment on or make changes to this bug.