Bug 1473064

Summary: Sony DUALSHOCK 3 (SIXAXIS) controllers do no completely pair over Bluetooth
Product: [Fedora] Fedora Reporter: Kyle Marek <psppsn96>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: gansalmon, ichavero, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab, psppsn96
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-28 21:57:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kyle Marek 2017-07-20 00:35:37 UTC
Description of problem:
While the controllers communicate with the host enough to see the devices as "connected" in interfaces like blueberry or bluetoothctl, they never pair.

Version-Release number of selected component (if applicable):
kernel-4.11.10-300.fc26.x86_64
bluez-5.45-1.fc26.x86_64

Additional info:

DUALSHOCK 4 pairs and functions (verifying Bluetooth controller works).

Purchased item page:
https://www.newegg.com/Product/Product.aspx?Item=9SIAAWT4D87817
https://web.archive.org/web/20170720002954/https://www.newegg.com/Product/Product.aspx?Item=9SIAAWT4D87817
Model number: CECHZC2U.

Initial entry of bluetooth quirks for DUALSHOCK 3 into kernel.
https://marc.info/?l=linux-bluetooth&m=126477490905978&w=2
https://www.spinics.net/lists/linux-bluetooth/msg04327.html

Possibly relevant commits to Linux kernel:
f9ce7c283c16538955d5d094101889792bcde109 HID: Enable Sixaxis controller over Bluetooth
2078b9bb240ea31ff3ea715881d1ec03d83e6de4 HID: sony: Set the quriks flag for Bluetooth controllers

Gentoo page on DualShock 3
https://wiki.gentoo.org/wiki/Sony_DualShock#Bluetooth
https://web.archive.org/web/20170719233554/https://wiki.gentoo.org/wiki/Sony_DualShock#Bluetooth

Supposedly, my WLAN devices is doing Bluetooth
kmarek ~
$ lspci -nnks 03:00
03:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b1] (rev bb)
	Subsystem: Intel Corporation Dual Band Wireless-AC 7260 [8086:4170]
	Kernel driver in use: iwlwifi
	Kernel modules: iwlwifi

However, my Bluetooth appears to be USB
kmarek ~
$ realpath /sys/class/bluetooth/hci0/device
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0

kmarek ~
$ cat /sys/bus/usb/devices/1-6/idVendor
8087

kmarek ~
$ cat /sys/bus/usb/devices/1-6/idProduct
07dc

kmarek ~
$ lsusb -vd 8087:07dc

Bus 001 Device 003: ID 8087:07dc Intel Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x8087 Intel Corp.
  idProduct          0x07dc 
  bcdDevice            0.01
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          177
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1


Relevant kernel output regarding my bluetooth hardware
[   24.467985] Bluetooth: hci0: read Intel version: 3707100180012d0d27
[   24.467987] Bluetooth: hci0: Intel device is already patched. patch num: 27


Log of my own attempt to pair

kmarek ~
$ journalctl -b -f -l --no-pager -u bluetooth.service &
<initial output omitted>

kmarek ~
$ dmesg -w &
<initial output omitted>

kmarek ~
$ bluetoothctl
[NEW] Controller 7C:5C:F8:41:42:D0 localhost.localdomain [default]
Agent registered
[bluetooth]# agent on
Agent is already registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# discoverable on
Changing discoverable on succeeded
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# devices
[bluetooth]# 
[127747.142929] usb 1-3: new full-speed USB device number 35 using xhci_hcd
[127747.312292] usb 1-3: New USB device found, idVendor=054c, idProduct=0268
[127747.312298] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[127747.312301] usb 1-3: Product: PLAYSTATION(R)3 Controller
[127747.312304] usb 1-3: Manufacturer: SZMY-POWER CO.,LTD.
[127747.371078] input: SZMY-POWER CO.,LTD. PLAYSTATION(R)3 Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:054C:0268.0022/input/input66
[127747.372247] sony 0003:054C:0268.0022: input,hiddev0,hidraw0: USB HID v1.11 Joystick [SZMY-POWER CO.,LTD. PLAYSTATION(R)3 Controller] on usb-0000:00:14.0-3/input0
[NEW] Device 00:26:5C:C2:8B:91 PLAYSTATION(R)3 Controller
Jul 19 19:22:41 localhost.localdomain bluetoothd[1185]: sixaxis: compatible device connected: PLAYSTATION(R)3 Controller (054C:0268)
Jul 19 19:22:41 localhost.localdomain bluetoothd[1185]: sixaxis: setting up new device
[127768.970412] usb 1-3: USB disconnect, device number 35
[CHG] Device 00:26:5C:C2:8B:91 Class: 0x000540
[CHG] Device 00:26:5C:C2:8B:91 Icon: input-keyboard
[CHG] Device 00:26:5C:C2:8B:91 Connected: yes
[PLAYSTATION(R)3 Controller]# info
Device 00:26:5C:C2:8B:91
	Name: PLAYSTATION(R)3 Controller
	Alias: PLAYSTATION(R)3 Controller
	Class: 0x000540
	Icon: input-keyboard
	Paired: no
	Trusted: no
	Blocked: no
	Connected: yes
	LegacyPairing: no
	Modalias: usb:v054Cp0268d0000
[PLAYSTATION(R)3 Controller]# trust
[CHG] Device 00:26:5C:C2:8B:91 Trusted: yes
Changing  trust succeeded
[PLAYSTATION(R)3 Controller]# info
Device 00:26:5C:C2:8B:91
	Name: PLAYSTATION(R)3 Controller
	Alias: PLAYSTATION(R)3 Controller
	Class: 0x000540
	Icon: input-keyboard
	Paired: no
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no
	Modalias: usb:v054Cp0268d0000
[PLAYSTATION(R)3 Controller]#  
[CHG] Device 00:26:5C:C2:8B:91 Connected: no
[bluetooth]# 
Jul 19 19:23:45 localhost.localdomain bluetoothd[1185]: 00:26:5C:C2:8B:91: error updating services: Permission denied (13)
Jul 19 19:23:45 localhost.localdomain bluetoothd[1185]: HUP or ERR on socket: Permission denied (13)

<powered controller back on to try something else>

[CHG] Device 00:26:5C:C2:8B:91 Connected: yes
[PLAYSTATION(R)3 Controller]# pair
Attempting to pair with 
[agent] PIN code: 058458
[PLAYSTATION(R)3 Controller]# Jul 19 19:24:14 localhost.localdomain bluetoothd[1185]: vendor 0x54C product: 0x268
[PLAYSTATION(R)3 Controller]# Jul 19 19:24:28 localhost.localdomain bluetoothd[1185]: vendor 0x54C product: 0x268
Jul 19 19:24:28 localhost.localdomain bluetoothd[1185]: Authentication already requested for 00:26:5C:C2:8B:91
Jul 19 19:24:28 localhost.localdomain bluetoothd[1185]: device_notify_pin: Operation not permitted
Failed to pair: org.bluez.Error.AuthenticationFailed
[PLAYSTATION(R)3 Controller]# Jul 19 19:24:31 localhost.localdomain bluetoothd[1185]: vendor 0x54C product: 0x268
Jul 19 19:24:31 localhost.localdomain bluetoothd[1185]: Authentication already requested for 00:26:5C:C2:8B:91
Jul 19 19:24:31 localhost.localdomain bluetoothd[1185]: device_request_pin: Operation not permitted
[CHG] Device 00:26:5C:C2:8B:91 ServicesResolved: yes
[PLAYSTATION(R)3 Controller]# Jul 19 19:24:55 localhost.localdomain bluetoothd[1185]: 00:26:5C:C2:8B:91: error updating services: Connection timed out (110)
[CHG] Device 00:26:5C:C2:8B:91 ServicesResolved: no
[CHG] Device 00:26:5C:C2:8B:91 Connected: no

Comment 1 Laura Abbott 2018-02-28 03:49:42 UTC
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale. The kernel moves very fast so bugs may get fixed as part of a kernel update. Due to this, we are doing a mass bug update across all of the Fedora 26 kernel bugs.
 
Fedora 26 has now been rebased to 4.15.4-200.fc26.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 27, and are still experiencing this issue, please change the version to Fedora 27.
 
If you experience different issues, please open a new bug report for those.

Comment 2 Kyle Marek 2018-02-28 21:57:39 UTC
Update to kernel-4.15.4-300.fc27.x86_64 allows controller to connect successfully. However, beyond bluetooth, the kernel is still not communicating/understanding the controller enough to make the /dev/input/jsX device report any input.

I have opened a separate bug for this. See: https://bugzilla.redhat.com/show_bug.cgi?id=1550273