Skip to contentSkip to conversation

Can't connect a Xbox one controller

DISCUSSION Anthony Bourguignon 4 participants 15 messages Aug 18, 2016 – Nov 13, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I've recently bought a new xbox one controller as the 2016 version has bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes to sleep, because of the lack of a remote connection.

Any idea ?

# hcitool info C8:3F:26:0F:48:E2
Requesting information ...
	BD Address:  C8:3F:26:0F:48:E2
	OUI Company: Microsoft Corporation (C8-3F-26)
	Device Name: Xbox Wireless Controller
	LMP Version: 4.2 (0x8) LMP Subversion: 0x0
	Manufacturer: MediaTek, Inc. (70)
	Features page 0: 0xbf 0x3e 0x8d 0xfe 0xdb 0xfd 0x7b 0x87
		<3-slot packets> <5-slot packets> <encryption> <slot offset> 
		<timing accuracy> <role switch> <sniff mode> <RSSI> 
		<channel quality> <SCO link> <HV2 packets> <HV3 packets> 
		<CVSD> <power control> <transparent SCO> <broadcast encrypt> 
		<EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan> 
		<interlaced iscan> <interlaced pscan> <inquiry with RSSI> 
		<extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave> 
		<AFH class. slave> <LE support> <3-slot EDR ACL> 
		<5-slot EDR ACL> <pause encryption> <AFH cap. master> 
		<AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps> 
		<3-slot EDR eSCO> <extended inquiry> <LE and BR/EDR> 
		<simple pairing> <encapsulated PDU> <err. data report> 
		<non-flush flag> <LSTO> <inquiry TX power> <EPC> 
		<extended features> 
	Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	Features page 2: 0x25 0x0b 0x00 0x00 0x00 0x00 0x00 0x00
	Features page 3: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
# hcidump 
HCI sniffer - Bluetooth packet analyzer ver 5.40
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
< HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 256 reason 0x13
    Reason: Remote User Terminated Connection
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Disconnect (0x01|0x0006) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Disconn Complete (0x05) plen 4

status 0x00 handle 256 reason 0x16
Reason: Connection Terminated by Local Host
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
enable 2

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

    Write Scan Enable (0x03|0x001a) ncmd 2
    status 0x00
Quoted 3 lines

HCI Event: Vendor (0xff) plen 2
HCI Event: Vendor (0xff) plen 2
HCI Event: Connect Request (0x04) plen 10

    bdaddr C8:3F:26:0F:48:E2 class 0x000508 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr C8:3F:26:0F:48:E2 role 0x00
    Role: Master
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Role Change (0x12) plen 8

    status 0x00 bdaddr C8:3F:26:0F:48:E2 role 0x00
    Role: Master
Quoted 2 lines

HCI Event: Vendor (0xff) plen 4
HCI Event: Connect Complete (0x03) plen 11

    status 0x00 handle 256 bdaddr C8:3F:26:0F:48:E2 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 256
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1

< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
enable 0

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

    Write Scan Enable (0x03|0x001a) ncmd 2
    status 0x00
Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

handle 256 slots 5

Quoted 1 line

HCI Event: Read Remote Supported Features (0x0b) plen 11

    status 0x00 handle 256
    Features: 0xbf 0x3e 0x8d 0xfe 0xdb 0xfd 0x7b 0x87

< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
handle 256 page 1

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Link Key Request (0x17) plen 6

    bdaddr C8:3F:26:0F:48:E2
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr C8:3F:26:0F:48:E2 key DC6AD6B5BD80110AE5016E3FE834F2CA
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 10

    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr C8:3F:26:0F:48:E2
Quoted 1 line

HCI Event: Read Remote Extended Features (0x23) plen 13

    status 0x00 handle 256 page 1 max 3
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr C8:3F:26:0F:48:E2 mode 2 clkoffset 0x0000

< ACL data: handle 256 flags 0x00 dlen 10
L2CAP(s): Info req: type 2

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Encrypt Change (0x08) plen 4

    status 0x00 handle 256 encrypt 0x01

< HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 7

    Read Encryption Key Size (0x05|0x0008) ncmd 1
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 12

    L2CAP(s): Connect req: psm 17 scid 0x0040

< ACL data: handle 256 flags 0x00 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 256 flags 0x00 dlen 10
L2CAP(s): Info req: type 2

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0010
Streaming mode

Quoted 1 line

HCI Event: Remote Name Req Complete (0x07) plen 255

    status 0x00 bdaddr C8:3F:26:0F:48:E2 name 'Xbox Wireless Controller'
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0010
Streaming mode
< ACL data: handle 256 flags 0x00 dlen 16

    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
< ACL data: handle 256 flags 0x00 dlen 23
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
      RFC 0x00 (Basic) 
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 1480 
< ACL data: handle 256 flags 0x00 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 1480 
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
Failure - unknown options
RFC
< ACL data: handle 256 flags 0x00 dlen 12

    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 12

    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040

< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 256 reason 0x13
Reason: Remote User Terminated Connection

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Disconnect (0x01|0x0006) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Disconn Complete (0x05) plen 4

status 0x00 handle 256 reason 0x16
Reason: Connection Terminated by Local Host
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
enable 2

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

    Write Scan Enable (0x03|0x001a) ncmd 2
    status 0x00
Quoted 3 lines

HCI Event: Vendor (0xff) plen 2
HCI Event: Vendor (0xff) plen 2
HCI Event: Connect Request (0x04) plen 10

    bdaddr C8:3F:26:0F:48:E2 class 0x000508 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr C8:3F:26:0F:48:E2 role 0x00
    Role: Master
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Role Change (0x12) plen 8

    status 0x00 bdaddr C8:3F:26:0F:48:E2 role 0x00
    Role: Master
Quoted 2 lines

HCI Event: Vendor (0xff) plen 4
HCI Event: Connect Complete (0x03) plen 11

    status 0x00 handle 256 bdaddr C8:3F:26:0F:48:E2 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 256
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1

< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
enable 0

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

    Write Scan Enable (0x03|0x001a) ncmd 2
    status 0x00
Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

handle 256 slots 5

Quoted 1 line

HCI Event: Read Remote Supported Features (0x0b) plen 11

    status 0x00 handle 256
    Features: 0xbf 0x3e 0x8d 0xfe 0xdb 0xfd 0x7b 0x87

< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
handle 256 page 1

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Link Key Request (0x17) plen 6

    bdaddr C8:3F:26:0F:48:E2
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr C8:3F:26:0F:48:E2 key DC6AD6B5BD80110AE5016E3FE834F2CA
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 10

    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr C8:3F:26:0F:48:E2
Quoted 1 line

HCI Event: Read Remote Extended Features (0x23) plen 13

    status 0x00 handle 256 page 1 max 3
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr C8:3F:26:0F:48:E2 mode 2 clkoffset 0x0000

< ACL data: handle 256 flags 0x00 dlen 10
L2CAP(s): Info req: type 2

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Encrypt Change (0x08) plen 4

    status 0x00 handle 256 encrypt 0x01

< HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 7

    Read Encryption Key Size (0x05|0x0008) ncmd 1
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 12

    L2CAP(s): Connect req: psm 17 scid 0x0040

< ACL data: handle 256 flags 0x00 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 256 flags 0x00 dlen 10
L2CAP(s): Info req: type 2

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0010
Streaming mode

Quoted 1 line

HCI Event: Remote Name Req Complete (0x07) plen 255

    status 0x00 bdaddr C8:3F:26:0F:48:E2 name 'Xbox Wireless Controller'
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0010
Streaming mode

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1
< ACL data: handle 256 flags 0x00 dlen 16

    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
< ACL data: handle 256 flags 0x00 dlen 23
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
      RFC 0x00 (Basic) 
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 16

    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 1480 
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1
< ACL data: handle 256 flags 0x00 dlen 18

    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 1480 
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
Failure - unknown options
RFC
< ACL data: handle 256 flags 0x00 dlen 12

    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

handle 256 packets 1

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 12

    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
# bluetoothd -d -n
bluetoothd[3715]: Bluetooth daemon 5.40
bluetoothd[3715]: src/main.c:parse_config() parsing main.conf
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'DiscoverableTimeout' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'PairableTimeout' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'AutoConnectTimeout' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'Name' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'Class' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'DeviceID' in group 'General'
bluetoothd[3715]: src/main.c:parse_config() Key file does not have key 'ReverseServiceDiscovery' in group 'General'
bluetoothd[3715]: src/adapter.c:adapter_init() sending read version command
bluetoothd[3715]: Starting SDP server
bluetoothd[3715]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0528
bluetoothd[3715]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[3715]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading neard plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading sap plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading a2dp plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading avrcp plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading hog plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading health plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading gap plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[3715]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[3715]: src/plugin.c:plugin_init() Loading plugins /usr/lib/x86_64-linux-gnu/bluetooth/plugins
bluetoothd[3715]: Version mismatch for sixaxis
bluetoothd[3715]: profiles/health/hdp.c:hdp_manager_start() Starting Health manager
bluetoothd[3715]: profiles/input/suspend-none.c:suspend_init() 
bluetoothd[3715]: profiles/network/manager.c:read_config() /etc/bluetooth/network.conf: Key file does not have key 'DisableSecurity' in group 'General'
bluetoothd[3715]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[3715]: plugins/neard.c:neard_init() Setup neard plugin
bluetoothd[3715]: plugins/hostname.c:read_dmi_fallback() chassis: desktop
bluetoothd[3715]: plugins/hostname.c:read_dmi_fallback() major: 0x01 minor: 0x01
bluetoothd[3715]: src/main.c:main() Entering main loop
bluetoothd[3715]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 2 op 0 soft 0 hard 0
bluetoothd[3715]: Bluetooth management interface 1.12 initialized
bluetoothd[3715]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[3715]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[3715]: src/adapter.c:read_commands_complete() Number of commands: 63
bluetoothd[3715]: src/adapter.c:read_commands_complete() Number of events: 34
bluetoothd[3715]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
bluetoothd[3715]: src/adapter.c:read_index_list_complete() Number of controllers: 1
bluetoothd[3715]: src/adapter.c:read_index_list_complete() Found index 0
bluetoothd[3715]: src/adapter.c:index_added() index 0
bluetoothd[3715]: src/adapter.c:btd_adapter_new() System name: BlueZ 5.40
bluetoothd[3715]: src/adapter.c:btd_adapter_new() Major class: 0
bluetoothd[3715]: src/adapter.c:btd_adapter_new() Minor class: 0
bluetoothd[3715]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d0528
bluetoothd[3715]: src/adapter.c:btd_adapter_new() Discoverable timeout: 180 seconds
bluetoothd[3715]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds
bluetoothd[3715]: src/adapter.c:index_added() sending read info command for index 0
bluetoothd[3715]: src/adapter.c:read_info_complete() index 0 status 0x00
bluetoothd[3715]: src/adapter.c:clear_uuids() sending clear uuids command for index 0
bluetoothd[3715]: src/adapter.c:clear_devices() sending clear devices command for index 0
bluetoothd[3715]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001800-0000-1000-8000-00805f9
bluetoothd[3715]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[3715]: src/gatt-database.c:gatt_db_service_added() GATT Service added to local database
bluetoothd[3715]: Failed to obtain handles for "Service Changed" characteristic
bluetoothd[3715]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10002
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001801-0000-1000-8000-00805f9
bluetoothd[3715]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[3715]: src/gatt-database.c:gatt_db_service_added() GATT Service added to local database
bluetoothd[3715]: profiles/audio/a2dp.c:media_server_probe() path /org/bluez/hci0
bluetoothd[3715]: plugins/hostname.c:hostname_probe() 
bluetoothd[3715]: plugins/hostname.c:update_class() major: 0x01 minor: 0x01
bluetoothd[3715]: src/adapter.c:btd_adapter_set_class() class: major 1 minor 1
bluetoothd[3715]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[3715]: profiles/network/manager.c:panu_server_probe() path /org/bluez/hci0
bluetoothd[3715]: profiles/network/server.c:server_register() Registered interface org.bluez.NetworkServer1 on path /org/bluez/hci0
bluetoothd[3715]: profiles/network/manager.c:gn_server_probe() path /org/bluez/hci0
bluetoothd[3715]: profiles/network/manager.c:nap_server_probe() path /org/bluez/hci0
bluetoothd[3715]: profiles/audio/avrcp.c:avrcp_controller_server_probe() path /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10003
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110f-0000-1000-8000-00805f9
bluetoothd[3715]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[3715]: profiles/audio/avrcp.c:avrcp_target_server_probe() path /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10004
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[3715]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[3715]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[3715]: profiles/audio/a2dp.c:a2dp_sink_server_probe() path /org/bluez/hci0
bluetoothd[3715]: profiles/audio/a2dp.c:a2dp_source_server_probe() path /org/bluez/hci0
bluetoothd[3715]: profiles/sap/manager.c:sap_server_probe() path /org/bluez/hci0
bluetoothd[3715]: Sap driver initialization failed.
bluetoothd[3715]: sap-server: Operation not permitted (1)
bluetoothd[3715]: src/adapter.c:btd_adapter_unblock_address() hci0 00:00:00:00:00:00
bluetoothd[3715]: src/adapter.c:get_ltk_info() C8:3F:26:0F:48:E2
bluetoothd[3715]: src/device.c:device_create_from_storage() address C8:3F:26:0F:48:E2
bluetoothd[3715]: src/device.c:device_new() address C8:3F:26:0F:48:E2
bluetoothd[3715]: src/device.c:device_new() Creating device /org/bluez/hci0/dev_C8_3F_26_0F_48_E2
bluetoothd[3715]: src/device.c:btd_device_set_temporary() temporary 0
bluetoothd[3715]: src/device.c:device_set_bonded() 
bluetoothd[3715]: src/adapter.c:load_link_keys() hci0 keys 1 debug_keys 0
bluetoothd[3715]: src/adapter.c:load_ltks() hci0 keys 0
bluetoothd[3715]: src/adapter.c:load_irks() hci0 irks 0
bluetoothd[3715]: src/adapter.c:load_conn_params() hci0 conn params 0
bluetoothd[3715]: src/device.c:device_probe_profiles() Probing profiles for device C8:3F:26:0F:48:E2
bluetoothd[3715]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[3715]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[3715]: src/adapter.c:set_did() hci0 source 2 vendor 1d6b product 246 version 528
bluetoothd[3715]: src/adapter.c:adapter_register() Adapter /org/bluez/hci0 registered
bluetoothd[3715]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[3715]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[3715]: src/adapter.c:add_whitelist_complete() C8:3F:26:0F:48:E2 added to kernel whitelist
bluetoothd[3715]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0
bluetoothd[3715]: src/adapter.c:load_ltks_complete() LTKs loaded for hci0
bluetoothd[3715]: src/adapter.c:load_irks_complete() IRKs loaded for hci0
bluetoothd[3715]: src/adapter.c:load_conn_params_complete() Connection Parameters loaded for hci0
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Name: BlueZ 5.40
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Short name: 
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Current alias: BlueZ 5.40
bluetoothd[3715]: plugins/hostname.c:property_changed() static hostname: april
bluetoothd[3715]: plugins/hostname.c:property_changed() pretty hostname: 
bluetoothd[3715]: plugins/hostname.c:update_name() name: april
bluetoothd[3715]: src/adapter.c:adapter_set_name() name: april
bluetoothd[3715]: src/adapter.c:adapter_set_name() alias: april
bluetoothd[3715]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[3715]: plugins/hostname.c:property_changed() chassis: desktop
bluetoothd[3715]: plugins/hostname.c:update_class() major: 0x01 minor: 0x01
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Name: april
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Short name: 
bluetoothd[3715]: src/adapter.c:local_name_changed_callback() Current alias: april
bluetoothd[3715]: src/adapter.c:property_set_mode() sending Set Powered command for index 0
bluetoothd[3715]: src/adapter.c:property_set_mode_complete() Success (0x00)
bluetoothd[3715]: src/adapter.c:new_settings_callback() Settings: 0x00000ad1
bluetoothd[3715]: src/adapter.c:settings_changed() Changed settings: 0x00000001
bluetoothd[3715]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled
bluetoothd[3715]: src/adapter.c:trigger_passive_scanning() 
bluetoothd[3715]: src/adapter.c:connected_callback() hci0 device C8:3F:26:0F:48:E2 connected eir_len 5
bluetoothd[3715]: src/adapter.c:dev_disconnected() Device C8:3F:26:0F:48:E2 disconnected, reason 2
bluetoothd[3715]: src/adapter.c:adapter_remove_connection() 
bluetoothd[3715]: plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3715]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:0F:48:E2 type 0 status 0xe
bluetoothd[3715]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[3715]: src/device.c:device_bonding_failed() status 14
bluetoothd[3715]: src/adapter.c:resume_discovery() 
bluetoothd[3715]: src/adapter.c:connected_callback() hci0 device C8:3F:26:0F:48:E2 connected eir_len 5
bluetoothd[3715]: src/adapter.c:dev_disconnected() Device C8:3F:26:0F:48:E2 disconnected, reason 2
bluetoothd[3715]: src/adapter.c:adapter_remove_connection() 
bluetoothd[3715]: plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3715]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:0F:48:E2 type 0 status 0xe
bluetoothd[3715]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[3715]: src/device.c:device_bonding_failed() status 14
bluetoothd[3715]: src/adapter.c:resume_discovery() 
bluetoothd[3715]: src/adapter.c:connected_callback() hci0 device C8:3F:26:0F:48:E2 connected eir_len 5
bluetoothd[3715]: src/adapter.c:dev_disconnected() Device C8:3F:26:0F:48:E2 disconnected, reason 2
bluetoothd[3715]: src/adapter.c:adapter_remove_connection() 
bluetoothd[3715]: plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3715]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:0F:48:E2 type 0 status 0xe
bluetoothd[3715]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[3715]: src/device.c:device_bonding_failed() status 14
bluetoothd[3715]: src/adapter.c:resume_discovery() 
bluetoothd[3715]: src/adapter.c:connected_callback() hci0 device C8:3F:26:0F:48:E2 connected eir_len 5
bluetoothd[3715]: src/adapter.c:dev_disconnected() Device C8:3F:26:0F:48:E2 disconnected, reason 2
bluetoothd[3715]: src/adapter.c:adapter_remove_connection() 
bluetoothd[3715]: plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3715]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:0F:48:E2 type 0 status 0xe
bluetoothd[3715]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[3715]: src/device.c:device_bonding_failed() status 14
bluetoothd[3715]: src/adapter.c:resume_discovery() 
bluetoothd[3715]: src/adapter.c:connected_callback() hci0 device C8:3F:26:0F:48:E2 connected eir_len 5
bluetoothd[3715]: src/adapter.c:dev_disconnected() Device C8:3F:26:0F:48:E2 disconnected, reason 2
bluetoothd[3715]: src/adapter.c:adapter_remove_connection() 
bluetoothd[3715]: plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3715]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:0F:48:E2 type 0 status 0xe
bluetoothd[3715]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[3715]: src/device.c:device_bonding_failed() status 14
bluetoothd[3715]: src/adapter.c:resume_discovery() 
#1 lore raw

Hi Anthony,

Quoted 13 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version has bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection (probably for SDP):

Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
Failure - unknown options
RFC
< ACL data: handle 256 flags 0x00 dlen 12

    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

Le jeudi 18 août 2016 à 16:56 +0300, Luiz Augusto von Dentz a écrit :

Quoted 27 lines

Hi Anthony,

Quoted 17 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version has
bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes
to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection (probably for SDP):

Quoted 1 line
Quoted 6 lines
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1 Failure - unknown options
      RFC
< ACL data: handle 256 flags 0x00 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

So, is it a bug of bluez or of the controller firmware ? Why is it possible to make a connection with an android tablet ?

Is there something more I can do to help ?

#3 lore raw

Hi Anthony,

On Thu, Aug 18, 2016 at 5:52 PM, Anthony Bourguignon <[email protected]> w= rote:

Quoted 1 line

Le jeudi 18 ao=C3=BBt 2016 =C3=A0 16:56 +0300, Luiz Augusto von Dentz a =

=C3=A9crit :

Quoted 34 lines
Quoted 27 lines

Hi Anthony,

Quoted 17 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version has
bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes
to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection (probably for SDP):

Quoted 1 line
Quoted 6 lines
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
Failure - unknown options
RFC
< ACL data: handle 256 flags 0x00 dlen 12

    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
Quoted 4 lines

So, is it a bug of bluez or of the controller firmware ? Why is it possible to make a connection with an android tablet ?

Is there something more I can do to help ?

Well perhaps we can compare to what other stacks are responding, but this seem quite weird given L2CAP_Config request is an essential part of setting up L2CAP connections so a response with unknown options sounds kind broken, but perhaps other stacks are ignoring it.

--=20
Luiz Augusto von Dentz

#4 lore raw

Le jeudi 18 août 2016 à 19:20 +0300, Luiz Augusto von Dentz a écrit :

Quoted 51 lines

Hi Anthony,

Quoted 47 lines · Anthony Bourguignon

Le jeudi 18 août 2016 à 16:56 +0300, Luiz Augusto von Dentz a écrit :

Quoted 34 lines

Hi Anthony,

Quoted 21 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version
has
bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux
(Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller
goes
to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection (probably for SDP):

Quoted 2 lines
Quoted 6 lines
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1 Failure - unknown options
      RFC
< ACL data: handle 256 flags 0x00 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

So, is it a bug of bluez or of the controller firmware ? Why is it possible to make a connection with an android tablet ?

Quoted 6 lines
Quoted 1 line

Is there something more I can do to help ?

Well perhaps we can compare to what other stacks are responding, but this seem quite weird given L2CAP_Config request is an essential part of setting up L2CAP connections so a response with unknown options sounds kind broken, but perhaps other stacks are ignoring it.

I've juste made a capture with my android tablet. Maybe it'll help. Association failed two times and succeded on the third one.

Thanks

btsnoop� �u) �}q ��� �� ��O ��� ���3��
��n�"\�/�A+l.�<�� ��� [TV] UE40JU6400 
 =L�L �K�/���2��Z�P�

	Nokia 302��D ��i ��-3 ��5� ��:����� ���% ���^ ���� ��������		����3��

������ /�A+l.�<��� %/��H&?�'%�� N�/�A+l.�<�� ��� [TV] UE40JU6400 
 =L�L
�(ry�(t��(wb �(�� �(� �(�� �(�� �H&?� �(� �(��
�H&?�'��(���zg���H&?� �zv\ �H&?� �zp ���@ �H&?� ��� ��9
�H&?�'��� l� �^=�H&?�� �E��H&?�Xbox Wireless Controller� �h �H&?��'�� �>�[yM  �H&?� �[�� �H&?� �[�. ��/s �H&?� ��7� ��:j
�H&?�'���CI���==�H&?������H&?�Xbox Wireless Controller��ԫ �H&?��'����Z��>K �H&?���A  ��C� 
��E���H�   ��K  ��M�7  @ ��O�7 ��w�  F��y� ��|n���M ��: �>����{���� ����� # ��!� ��$+    � �� �H&?� � �: � � � � � e � ��H&?�

� �3 �H&?� � ��
 �H&?� � �|1�H&?� � �+ �H&?� � ��
+�H&?� � �[�2 �H&?� � ���3
�H&?�%�

� ���,�H&?� � ���
,�H&?�

� ���6�H&?�� �'g�H&?�V2�u;L,'��� �++ � �2�
�H&?�'�� �5y� �S���H&?�Xbox Wireless Controller� �X{ G� �d � �g  @G� �i�  @� �lk  G�� �o 
@� �rh � �uM 
G� �x� @5�5
��� �|� � ��b ��� ��~ ��G{w5�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � � ��( @5�5
��� ���  � ��� G  (  � ��V @G� �� � ��� @G� ��� H� ��� � ���  @H� ���  @� ��  H�� ��� 
@� ��= � ��� 
H� �ϐ @5�5
��� �� � ��� ��� ��F ��H{w6�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � � ��� @5�5
��� �� ��� ��� ��H{w  (  67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 � ��` @5�5
���
 ���
q ��H{w%Xbox Bluetooth Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 ���

 @5�5
���
E5 ���
J6 ��H{w � 0 1'���u�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu��
L� @5�5
���
U� ���
\� ��H{w%5Ee� )
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU�
_� @5�5
���
i< �
p� zvHqn&�u�� �&�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�
sP @H�
|� �
? @H�
/  I�
g� �
j�   @I�
mO  
@�
x�  I��
{� �
~a 

I�
�� 
@�
�  @5�
�� �
�� �
�W I �
�� @�5
���
 I ���
� ��I{w5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  �  �
 @�5
���
� �
�O I  (  �
�m  @I�
  �
U  @I�
�  J�
` �
�   @J�
�   @�
�  J��
� 
@�
!  �
#r 
 J�
%�  @5$�
'P �
/� �
2c J �
4� @�5
���
>p ���
E� ��J{w67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 %Xbox Bluetooth�
G� @�5
���
Q� ���
Y� ��J{w Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 �� � 0 1'��� �
[� @�5
�� �
�j ���
�h ��J{wu�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu�%5Ee� 
�
� @�5
��
�
�t ���
�� ��J{w)
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU&�u�� �& �
� @�5
�� �
� oo�
 V jfJa^�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�
  @J�
| �
^ @J�
, �
��
p� �
sa K�
|> �
�~  @K�
�X  @K�
��  @��
��  K��
�@ 
@�
�| �
�I 
K�
�! L�
�| �
� �
�9  AL�
��  AL�
�  A��
��  L��
�L 
A�
�� �
�x 
L�
�D �
�� �
�! L���}��ځ

#5 lore raw

Hi Anthony,

On Thu, Aug 18, 2016 at 8:46 PM, Anthony Bourguignon <[email protected]> w= rote:

Quoted 1 line

Le jeudi 18 ao=C3=BBt 2016 =C3=A0 19:20 +0300, Luiz Augusto von Dentz a =

=C3=A9crit :

Quoted 6 lines
Quoted 6 lines

Hi Anthony,

Quoted 2 lines · Anthony Bourguignon

Le jeudi 18 ao=C3=BBt 2016 =C3=A0 16:56 +0300, Luiz Augusto von Dentz =

a =C3=A9crit

Quoted 47 lines
Quoted 47 lines
Quoted 46 lines

:

Quoted 34 lines

Hi Anthony,

Quoted 21 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version
has
bluetooth connectivity.

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux
(Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller
goes
to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection (probably for SDP):

Quoted 2 lines
Quoted 6 lines
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
Failure - unknown options
RFC
< ACL data: handle 256 flags 0x00 dlen 12

    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

So, is it a bug of bluez or of the controller firmware ? Why is it possible to make a connection with an android tablet ?

Is there something more I can do to help ?

Quoted 7 lines
Quoted 4 lines

Well perhaps we can compare to what other stacks are responding, but this seem quite weird given L2CAP_Config request is an essential part of setting up L2CAP connections so a response with unknown options sounds kind broken, but perhaps other stacks are ignoring it.

I've juste made a capture with my android tablet. Maybe it'll help. Association failed two times and succeded on the third one.

It seems the configuration request works just fine here:

< ACL Data TX: Handle 13 flags 0x02 dlen 12

                                                           83.379233
      L2CAP: Connection Request (0x02) ident 15 len 4
        PSM: 17 (0x0011)
        Source CID: 75
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 =

                                                                           =
                                                   83.381502
        Num handles: 1
        Handle: 13
        Count: 1
Quoted 1 line

ACL Data RX: Handle 13 flags 0x02 dlen 16 =

                                                                           =
                                                   83.383358
      L2CAP: Connection Response (0x03) ident 15 len 8
        Destination CID: 64
        Source CID: 75
        Result: Connection pending (0x0001)
        Status: No further information available (0x0000)
Quoted 1 line

ACL Data RX: Handle 13 flags 0x02 dlen 16 =

                                                                           =
                                                   83.384600
      L2CAP: Connection Response (0x03) ident 15 len 8
        Destination CID: 64
        Source CID: 75
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)

< ACL Data TX: Handle 13 flags 0x02 dlen 16

                                                           83.385274
      L2CAP: Configure Request (0x04) ident 16 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 640
Quoted 1 line

ACL Data RX: Handle 13 flags 0x02 dlen 16 =

                                                                           =
                                                   83.385939
      L2CAP: Configure Request (0x04) ident 5 len 8
        Destination CID: 75
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 1480

< ACL Data TX: Handle 13 flags 0x02 dlen 14

                                                           83.386624
      L2CAP: Configure Response (0x05) ident 5 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5 =

                                                                           =
                                                   83.387708
        Num handles: 1
        Handle: 13
        Count: 1
Quoted 1 line

ACL Data RX: Handle 13 flags 0x02 dlen 14 =

                                                                           =
                                                   83.388425
      L2CAP: Configure Response (0x05) ident 16 len 6
        Source CID: 75
        Flags: 0x0000
        Result: Success (0x0000)

There is another difference here is that the connection to PSM 17 is started by the Android device while in our case it is started by the controller without doing any SDP(?) which sounds like the controller has been connected before or it is not behaving like a HID device. Is there a way to reset the controller to a state that it clears the paired devices?

--=20
Luiz Augusto von Dentz

#6 lore raw

Hi,

Le vendredi 19 août 2016 à 11:43 +0300, Luiz Augusto von Dentz a écrit :

Quoted 165 lines

Hi Anthony,

Quoted 79 lines · Anthony Bourguignon

Le jeudi 18 août 2016 à 19:20 +0300, Luiz Augusto von Dentz a écrit :

Quoted 68 lines

Hi Anthony,

Quoted 56 lines · Anthony Bourguignon

Le jeudi 18 août 2016 à 16:56 +0300, Luiz Augusto von Dentz a écrit
:

Quoted 43 lines

Hi Anthony,

On Thu, Aug 18, 2016 at 1:11 PM, Anthony Bourguignon <contact @ton
iob.

Quoted 26 lines · net> wrote:

Hi,

I've recently bought a new xbox one controller as the 2016 version
has
bluetooth connectivity.

The controller is pairing and connecting well on a windows 10
computer
and an android 4.4 tablet. But I can"t make it connect under
linux
(Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to
controller, it stays connected for less than one second, then
disconnects, then connects again and so one until the controller
goes
to sleep, because of the lack of a remote connection.

Quoted 1 line

Any idea ?

It seems there is some problem configuring the L2CAP connection
(probably for SDP):

Quoted 3 lines
Quoted 7 lines
Quoted 1 line

ACL data: handle 256 flags 0x02 dlen 15

    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 1
      Failure - unknown options
      RFC
< ACL data: handle 256 flags 0x00 dlen 12 L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

Quoted 5 lines

So, is it a bug of bluez or of the controller firmware ? Why is it
possible to make a connection with an android tablet ?

Is there something more I can do to help ?

Quoted 7 lines

Well perhaps we can compare to what other stacks are responding, but
this seem quite weird given L2CAP_Config request is an essential part
of setting up L2CAP connections so a response with unknown options
sounds kind broken, but perhaps other stacks are ignoring it.

Quoted 2 lines

I've juste made a capture with my android tablet. Maybe it'll help. Association failed two times and succeded on the third one.

It seems the configuration request works just fine here:

< ACL Data TX: Handle 13 flags 0x02 dlen 12

                                                           83.379233
      L2CAP: Connection Request (0x02) ident 15 len 4
        PSM: 17 (0x0011)
        Source CID: 75

Quoted 5 lines

HCI Event: Number of Completed Packets (0x13) plen 5

              83.381502

        Num handles: 1
        Handle: 13
        Count: 1

Quoted 5 lines

ACL Data RX: Handle 13 flags 0x02 dlen
16

                          83.383358

      L2CAP: Connection Response (0x03) ident 15 len 8 Destination CID: 64
        Source CID: 75
        Result: Connection pending (0x0001)
        Status: No further information available (0x0000)

Quoted 5 lines

ACL Data RX: Handle 13 flags 0x02 dlen
16

                          83.384600

      L2CAP: Connection Response (0x03) ident 15 len 8 Destination CID: 64
        Source CID: 75
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000) < ACL Data TX: Handle 13 flags 0x02 dlen 16

                                                           83.385274
      L2CAP: Configure Request (0x04) ident 16 len 8 Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 640

Quoted 5 lines

ACL Data RX: Handle 13 flags 0x02 dlen
16

                          83.385939

      L2CAP: Configure Request (0x04) ident 5 len 8 Destination CID: 75
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 1480
< ACL Data TX: Handle 13 flags 0x02 dlen 14

                                                           83.386624
      L2CAP: Configure Response (0x05) ident 5 len 6 Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)

Quoted 5 lines

HCI Event: Number of Completed Packets (0x13) plen 5

              83.387708

        Num handles: 1
        Handle: 13
        Count: 1

Quoted 5 lines

ACL Data RX: Handle 13 flags 0x02 dlen
14

                          83.388425

      L2CAP: Configure Response (0x05) ident 16 len 6 Source CID: 75
        Flags: 0x0000
        Result: Success (0x0000)

Quoted 6 lines

There is another difference here is that the connection to PSM 17 is started by the Android device while in our case it is started by the controller without doing any SDP(?) which sounds like the controller has been connected before or it is not behaving like a HID device. Is there a way to reset the controller to a state that it clears the paired devices?

Here is a new dump from the android device. I've paired the xbox controller to another device before for it to change its bluetooth pair (I hope it worked).

btsnoop� �>�f� �>�ol �>�rY �>��� �>��� �>��  �>���3��
�>����??��/���2��ZO>�

	Nokia 302�?�6 �?�] �?�� �?�!� �?�ߧ/��H&?��9��?�.��?�I�

�H&?����?�SJ�?�Dy=�H&?��?����H&?�Xbox Wireless Controller �?�v� �H&?� �?�zM �?�|0 �H&?�����?��?�d� �H&?��?�g��?�j�

�?�m�?�p  �?�rg �?�t�7 @ �?�w�7  �?� F�?� �?��?�Q�?��� �>����{��?��2�?�ɴ�?��m# �?��;�?���    �B)Q �H&?� �B)SP �B)W�B)YG �B)[��H&?�

�B)^� �H&?� �B)a�
 �H&?� �B)d�1�H&?� �B)g�+ �H&?� �B)on
+�H&?� �B)�}2 �H&?� �B+�:3
�H&?�OE

�B+��,�H&?� �B+�
,�H&?�

�B,��6�H&?��B,�?�H&?�`�R�_���g*��!�z�B,˙�B,�� L�B-] �B-_�  @L�B-b�  @�B-d�  L��B-h:  @�B-o��B-rl 
L�B-t��B-wf @5�5
���B-~w���B-�� ��L{w5�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �B-� @5�5
���B-�� �B-�p L  (  �B-�, @L�B-���B-� @L�B-� M�B.F��B.I�  @M�B.L3  @�B.N�  M��B.Q� 
@�B.W��B.Z�B.]: 
M�B._� @5�5
���B.i���B.� ��M{w6�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �B.�� @5�5
���B/(<���B/�T ��M{w  (  67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 �B/�� @5�5
���B/�R���B/�, ��M{w%Xbox Bluetooth Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 ���B/�� @5�5
���B/�%���B/�8 ��M{w � 0 1'���u�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu��B/�� @5�5
���B/�����B0� ��M{w%5Ee� )
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU�B0L @5�5
���B0�B08 zvMqn&�u�� �&�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�B0� @M�B0%��B0(c @M�B0�;  N�B1 �B1�   @N�B1  N��B1s  
@�B1� 
@�B1��B1# 

N�B1&.�B1)�  @5�B13�B16; N �B19� @�5
���B1E����B1N� ��N{w5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  �  �B1QC @�5
���B1^d�B1`� N  (  �B1e  @N�B1q��B1u(  @N�B1w�  O�B1���B1��   @O�B1�3   @�B1�n   O��B1�� 
 @�B2�B2� 
 O�B2��B2
n  @5$�B2��B2� O �B2� @�5
���B2!����B2(� ��O{w67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 %Xbox Bluetooth �B2*� @�5
�� �B24����B2;� ��O{w Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 �� � 0 1'���
�B2=� @�5
��
�B2H9���B2Os ��O{wu�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu�%5Ee�  �B2Qq @�5
�� �B2[����B2b� ��O{w)
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU&�u�� �& �B2d� @�5
�� �B2o_oo�B2v� jfOa^�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�B2x� @O�B2���B2�� @O�B2��B2���B2��B2�� @�B2���B2�/  @@�B3  @@�B3+  @��B3�  
@��B3  

@�B3t�B3 
@�B3��B3� A�B3&�  AA�B3)L�B3+�  AA�B3.  A��B30*   A��B32�   A�B37s�B3;� 
A�B3>[�B4C��B4K� A�����ځ

#7 lore raw
In reply to Anthony Bourguignon

Hi Anthony,

Quoted 5 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version has bluetooth connectivity.

Quoted 7 lines

The controller is pairing and connecting well on a windows 10 computer and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes to sleep, because of the lack of a remote connection.

Can you produce the logs with L2CAP ERTM/Streaming mode disabled, doing something like this before connecting this should work:

$ echo 1 > /sys/module/bluetooth/parameters/disable_ertm

Cheers,
--
Vinicius

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Hi,

Quoted 25 lines · Anthony Bourguignon

Le vendredi 19 août 2016 à 15:02 -0300, Vinicius Costa Gomes a écrit :

Quoted 24 lines

Hi Anthony,

Quoted 7 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version has
bluetooth connectivity.

Quoted 9 lines

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux (Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller goes
to sleep, because of the lack of a remote connection.

Can you produce the logs with L2CAP ERTM/Streaming mode disabled, doing something like this before connecting this should work:

Quoted 6 lines
Quoted 1 line
$ echo 1 > /sys/module/bluetooth/parameters/disable_ertm

The connection worked with ertm disabled, the controller is fully usable.

Is that normal that we have to disable it ?

No. It could be a bug in the xbox controller. But I need to take a closer look at the specification to be really sure.

Thinking out loud: this seems too basic a mistake for an end product (but I wouldn't be too surprised if this is the case), perhaps something that we are assuming and is incorrect?

But glad that we found a workaround.

Cheers,
--
Vinicius

#10 lore raw

Le vendredi 19 août 2016 à 20:34 -0300, Vinicius Costa Gomes a écrit :

Quoted 38 lines

Hi,

Quoted 34 lines · Anthony Bourguignon

Le vendredi 19 août 2016 à 15:02 -0300, Vinicius Costa Gomes a écrit :

Quoted 30 lines

Hi Anthony,

Quoted 9 lines · Anthony Bourguignon

Hi,

I've recently bought a new xbox one controller as the 2016 version
has
bluetooth connectivity.

Quoted 11 lines

The controller is pairing and connecting well on a windows 10 computer
and an android 4.4 tablet. But I can"t make it connect under linux
(Debian unstable, kernel 4.6 and 4.7-rc7, bluez 5.40 from experimental). The pairing is ok but when I try to connect to controller, it stays connected for less than one second, then disconnects, then connects again and so one until the controller
goes
to sleep, because of the lack of a remote connection.

Can you produce the logs with L2CAP ERTM/Streaming mode disabled, doing something like this before connecting this should work:

$ echo 1 > /sys/module/bluetooth/parameters/disable_ertm
Quoted 7 lines
Quoted 4 lines

The connection worked with ertm disabled, the controller is fully usable.

Is that normal that we have to disable it ?

No. It could be a bug in the xbox controller. But I need to take a closer look at the specification to be really sure.

Can I be of any help ?

Thanks a lot again

#11 lore raw

Hi,

Quoted 5 lines · Anthony Bourguignon
Quoted 3 lines

No. It could be a bug in the xbox controller. But I need to take a closer look at the specification to be really sure.

Can I be of any help ?

Attached is a patch that disables negotiating Flow Control and Retransmission parameters for the SDP channel only. This is a shot in the dark, as I could find nothing in the specification that advises against the current BlueZ behaviour.

Could you give it a try? (but I don't have high hopes for it)

This is looking more like a bug in the controller.

Quoted 6 lines

Thanks a lot again
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Cheers,
--
Vinicius

net/bluetooth/l2cap_core.c +3 -0
index 54ceb1f..aa078b9 100644
@@ -3216,6 +3216,9 @@ done:
 		if (disable_ertm)
 			break;
 
+		if (chan->psm == cpu_to_le16(L2CAP_PSM_SDP))
+			break;
+
 		if (!(chan->conn->feat_mask & L2CAP_FEAT_ERTM) &&
 		    !(chan->conn->feat_mask & L2CAP_FEAT_STREAMING))
 			break;
#12 lore raw
Quoted 10 lines · Vinicius Costa Gomes

Hi,

Quoted 6 lines · Anthony Bourguignon
Quoted 4 lines

No. It could be a bug in the xbox controller. But I need to take a
closer look at the specification to be really sure.

Can I be of any help ?

Quoted 8 lines

Attached is a patch that disables negotiating Flow Control and Retransmission parameters for the SDP channel only. This is a shot in the dark, as I could find nothing in the specification that advises against the current BlueZ behaviour.

Could you give it a try? (but I don't have high hopes for it)

This is looking more like a bug in the controller.

Hi,

It's getting hit during pairing, but this isn't enough to get it working.

I also combined it with vudentz' patch in the "Continuing the Xbox One Bluetooth controller debugging" thread (called "Bluetooth: L2CAP:
Ignore Unknown option error for basic mode") and that wasn't enough to get it working either.

I think that the fix would be to not try and upgrade the connection to ERTM at all on this device, but I don't know how I could pass this information down the stack to the l2cap code. Any ideas?

Cheers

#13 lore raw
Quoted 34 lines · Bastien Nocera
Quoted 17 lines · Vinicius Costa Gomes

Hi,

Quoted 7 lines · Anthony Bourguignon
Quoted 5 lines

No. It could be a bug in the xbox controller. But I need to take
a
closer look at the specification to be really sure.

Can I be of any help ?

Attached is a patch that disables negotiating Flow Control and Retransmission parameters for the SDP channel only. This is a shot in
the dark, as I could find nothing in the specification that advises against the current BlueZ behaviour.

Quoted 3 lines

Could you give it a try? (but I don't have high hopes for it)

This is looking more like a bug in the controller.

Hi,

It's getting hit during pairing, but this isn't enough to get it working.

I also combined it with vudentz' patch in the "Continuing the Xbox One
Bluetooth controller debugging" thread (called "Bluetooth: L2CAP:
Ignore Unknown option error for basic mode") and that wasn't enough to
get it working either.

Quoted 4 lines

I think that the fix would be to not try and upgrade the connection to
ERTM at all on this device, but I don't know how I could pass this information down the stack to the l2cap code. Any ideas?

Here's the btmon output of a pairing attempt.

Cheers

btsnoop�;;�� �;@��bLinux version 4.14.0-0.rc8.git1.1.bt2.fc28.x86_64 (x86_64)!!�� �;@��eBluetooth subsystem version 2.22�;@��f���Dhci0�;@��g
�;@��g���D���;@��hmemcheck-amd64-���;@��jmemcheck-amd64-���;@���btmonAA�� �;@�=
" bluetoothdsrc/device.c:btd_device_set_temporary() temporary 066�� �;@�=4 bluetoothdsrc/agent.c:agent_ref() 0x85db170: ref=2YY�� �;@�="v bluetoothdsrc/device.c:bonding_request_new() Requesting bonding for C8:3F:26:80:BA:7166�� �;@�=' bluetoothdsrc/agent.c:agent_ref() 0x85db170: ref=388�� �;@�=* bluetoothdsrc/agent.c:agent_unref() 0x85db170: ref=200�� �;@�=/> bluetoothdsrc/adapter.c:suspend_discovery() ff�� �;@�=2� bluetoothdsrc/adapter.c:adapter_bonding_attempt() hci0 bdaddr C8:3F:26:80:BA:71 type 0 io_cap 0x04�;@�=;{3q��&?��;@�=;�q��&?��;@�=;�q��&?��;@�=;�3q��&?��� �;@�=B1 bluetoothdsrc/adapter.c:add_whitelist_complete() C8:3F:26:80:BA:71 added to kernel whitelist�;@�=D�q��&?��;@�=EK q��&?���;@�=G��;@�TB��& �;@�TNv q��&?��;@�TO��;@�TU��;@�Ti� �;@�Ty! �>����{��;@�Ty��;@�T}�;@�T�j#  �;@�T��
q��&?��;@�T�B�;@�U0��q��&?�Xbox Wireless Controller22�;@�U1- q��&?� Xbox Wireless Controller 22�;@�U1- q��&?� Xbox Wireless Controller 22�;@�U1- q��&?� Xbox Wireless Controller �;@�U1R�;@�U4�cc�� �;@�U7{ bluetoothdsrc/adapter.c:connected_callback() hci0 device C8:3F:26:80:BA:71 connected eir_len 31�;@�U8vq��&?� �;@�U8� q��&?� �;@�U<a
 q��&?��;@�U@?1q��&?� �;@�U@a+ q��&?� �;@�UD3
+q��&?� �;@�U��2 q��&?� �;@�Yz�3
q��&?�� �;@�Y{�,q��&?� �;@�Y~J
,q��&?� �;@�_�6q��&?��;@�_��q��&?�J]�\�����#m� �;@�_� q��&?�J]�\�����#m� �;@�_� q��&?�J]�\�����#m� �;@�_� q��&?�J]�\�����#m��;@�_�g�;@�_ϛ�;@�_�Itt�� �;@�_Ӽ bluetoothdsrc/adapter.c:new_link_key_callback() hci0 new key for C8:3F:26:80:BA:71 type 4 pin_len 0 store_hint 1�;@�%X�;@�%�//�� �;@�'� bluetoothdsrc/device.c:device_set_bonded() �;@�)7�;@�)|q��&?��;@�)�

RR�� �;@�-& bluetoothdsrc/device.c:device_bonding_complete() bonding 0x8db8c90 status 0x00VV�� �;@�1? bluetoothdsrc/device.c:device_bonding_complete() Proceeding with service discovery�;@�4�88�� �;@�M6 bluetoothdsrc/agent.c:agent_unref() 0x85db170: ref=1//�� �;@�O� bluetoothdsrc/adapter.c:resume_discovery() AA�� �;@�U6 bluetoothdsrc/adapter.c:pair_device_complete() Success (0x00)ff�� �;@�Y� bluetoothdsrc/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:80:BA:71 type 0 status 0x0NN�� �;@�_; bluetoothdsrc/device.c:device_bonding_complete() bonding (nil) status 0x00//�� �;@�``� bluetoothdsrc/adapter.c:resume_discovery() �;@���!  �;@��< @�;@�`ю�;@�a��! @@�;@�a�Y @�;@�a�u! @��;@�a�� @��;@�a��;@�a�!
@�;@�a���;@�a�i@5��5
���;@�a�1���;@�b!��@{w6�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �;@�b�@5��5
���;@�bg����;@�b��!��@{w  (  67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 �;@�b��@5��5
���;@�b����;@�b��!��@{w%Xbox Bluetooth Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 ���;@�b��@5��5
���;@�b�����;@�b�j!��@{w � 0 1'���u�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu��;@�b¡@5��5
���;@�b�8���;@�b��!��@{w%5Ee� )
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU�;@�bۃ@5��5
���;@�b�~~�;@�b� !zv@qn&�u�� �&�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�;@�c�_@5��5
���;@�d_f���;@�d��!��@{w5�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �;@�d�[@5��5
���;@�d�B�;@�d��!@  (  �� �;@�e,5 bluetoothdsrc/device.c:device_probe_profiles() Probing profiles for device C8:3F:26:80:BA:71cc�� �;@�e2u bluetoothdprofiles/input/device.c:input_device_register() /org/bluez/hci0/dev_C8_3F_26_80_BA_71>>�� �;@�e4| bluetoothdsrc/service.c:btd_service_ref() 0x8e88a50: ref=2���� �;@�e6� bluetoothdsrc/service.c:change_state() 0x8e88a50: device C8:3F:26:80:BA:71 profile input-hid state changed: unavailable -> disconnected (0)\\�� �;@�eDO bluetoothdsrc/device.c:device_svc_resolved() /org/bluez/hci0/dev_C8_3F_26_80_BA_71 err 0�;@��� @@�;@���\�;@���7! @@�;@��X��;@��_>�;@���B�;@��Ɖ q��&?��;@��Ɖ q��&?��;@��Ɖ q��&?� �;@��Ƨq��&?� �;@��Ƨq��&?� �;@��Ƨq��&?��;@��ƺ����q��&?�^^�� �;@���� bluetoothdsrc/adapter.c:dev_disconnected() Device C8:3F:26:80:BA:71 disconnected, reason 288�� �;@���� bluetoothdsrc/adapter.c:adapter_remove_connection() 77�� �;@���� bluetoothdplugins/policy.c:disconnect_cb() reason 2ff�� �;@���a bluetoothdsrc/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:80:BA:71 type 0 status 0xeNN�� �;@��� bluetoothdsrc/device.c:device_bonding_complete() bonding (nil) status 0x0e<<�� �;@���Q bluetoothdsrc/device.c:device_bonding_failed() status 14//�� �;@���+ bluetoothdsrc/adapter.c:resume_discovery() KK�� �;@��� bluetoothdsrc/adapter.c:unpaired_callback() hci0 addr C8:3F:26:80:BA:71AA�� �;@��Y� bluetoothdsrc/device.c:btd_device_set_temporary() temporary 1�� �;@��d� bluetoothdsrc/device.c:device_remove() Removing device /org/bluez/hci0/dev_C8_3F_26_80_BA_71���� �;@��i� bluetoothdsrc/service.c:change_state() 0x8e88a50: device C8:3F:26:80:BA:71 profile input-hid state changed: disconnected -> unavailable (0)ee�� �;@��n� bluetoothdprofiles/input/device.c:input_device_unregister() /org/bluez/hci0/dev_C8_3F_26_80_BA_71@@�� �;@��ws bluetoothdsrc/service.c:btd_service_unref() 0x8e88a50: ref=1@@�� �;@��| bluetoothdsrc/service.c:btd_service_unref() 0x8e88a50: ref=0bb�� �;@���� bluetoothdsrc/device.c:btd_device_unref() Freeing device /org/bluez/hci0/dev_C8_3F_26_80_BA_7122�� �;@��� bluetoothdsrc/device.c:device_free() 0x8d4c8e0 �;@����4q��&?� �;@����q��&?� �;@����q��&?��;@����4q��&?�gg�� �;@��  bluetoothdsrc/adapter.c:remove_whitelist_complete() C8:3F:26:80:BA:71 removed from kernel whitelist�;@��fq��&?��;@��qq��&?� �;@��tq��&?� �;@��tq��&?�

#14 lore raw
Quoted 1 line · Bastien Nocera

<snip>

Quoted 1 line

Here's the btmon output of a pairing attempt.

And this is a pairing attempt with disable_ertm set to 1.

You will see a gap of about a minute between 2 events:
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 12.103542

        BR/EDR Address: C8:3F:26:80:BA:71 (Microsoft Corporation)
        Reason: Connection terminated by local host (0x02)
Quoted 1 line

HCI Event: Connect Request (0x04) plen 10 #77 [hci0] 81.172351

        Address: C8:3F:26:80:BA:71 (Microsoft Corporation)
        Class: 0x000508
          Major class: Peripheral (mouse, joystick, keyboards)
          Minor class: 0x02
        Link type: ACL (0x01)

The pad carried on blinking expecting "something". I turned the pad off by long pressing on the "XBox" button, and turned it on again. I got a service authentication request:
[CHG] Device C8:3F:26:80:BA:71 Connected: yes
Authorize service
[agent] Authorize service 00001124-0000-1000-8000-00805f9b34fb (yes/no): yes

And it's now connected and working.

btsnoop�;;�� �;A3�-�Linux version 4.14.0-0.rc8.git1.1.bt2.fc28.x86_64 (x86_64)!!�� �;A3�-�Bluetooth subsystem version 2.22�;A3�-����Dhci0�;A3�-�
�;A3�-����D���;A3�-�memcheck-amd64-���;A3�-�memcheck-amd64-���;A3�.�btmonAA�� �;A3��[ bluetoothdsrc/device.c:btd_device_set_temporary() temporary 066�� �;A3��� bluetoothdsrc/agent.c:agent_ref() 0x8588ed0: ref=2YY�� �;A3��S bluetoothdsrc/device.c:bonding_request_new() Requesting bonding for C8:3F:26:80:BA:7166�� �;A3�ݦ bluetoothdsrc/agent.c:agent_ref() 0x8588ed0: ref=388�� �;A3�߸ bluetoothdsrc/agent.c:agent_unref() 0x8588ed0: ref=200�� �;A3��# bluetoothdsrc/adapter.c:suspend_discovery() ff�� �;A3��� bluetoothdsrc/adapter.c:adapter_bonding_attempt() hci0 bdaddr C8:3F:26:80:BA:71 type 0 io_cap 0x04�;A3���3q��&?��;A3��q��&?��;A3��q��&?��;A3��*3q��&?��� �;A3��� bluetoothdsrc/adapter.c:add_whitelist_complete() C8:3F:26:80:BA:71 added to kernel whitelist�;A3���q��&?��;A3��, q��&?���;A3���;A4'V1�& �;A4'a� q��&?��;A4'c+�;A4'e~�;A4'�� �;A4'�� �>����{��;A4'���;A4'�d�;A4'��#  �;A4'�G
q��&?��;A4'���;A4(HB�q��&?�Xbox Wireless Controller22�;A4(H� q��&?� Xbox Wireless Controller 22�;A4(H� q��&?� Xbox Wireless Controller 22�;A4(H� q��&?� Xbox Wireless Controller �;A4(H��;A4(K�cc�� �;A4(M bluetoothdsrc/adapter.c:connected_callback() hci0 device C8:3F:26:80:BA:71 connected eir_len 31�;A4(O�q��&?� �;A4(O� q��&?� �;A4(S�
 q��&?��;A4(W�1q��&?� �;A4(W�+ q��&?� �;A4([�
+q��&?� �;A4(v�2 q��&?� �;A4,�p3
q��&?Ȅ? �;A4-,q��&?� �;A4-
,q��&?� �;A42bR6q��&?��;A43%�q��&?ș�}�Ū����m�h A� �;A43%� q��&?���}�Ū����m�h A� �;A43%� q��&?���}�Ū����m�h A� �;A43%� q��&?���}�Ū����m�h A�tt�� �;A43) bluetoothdsrc/adapter.c:new_link_key_callback() hci0 new key for C8:3F:26:80:BA:71 type 4 pin_len 0 store_hint 1�;A43)�;A43)Z�;A43-//�� �;A43k� bluetoothdsrc/device.c:device_set_bonded() RR�� �;A43m bluetoothdsrc/device.c:device_bonding_complete() bonding 0x9177360 status 0x00VV�� �;A43n bluetoothdsrc/device.c:device_bonding_complete() Proceeding with service discovery88�� �;A43q+ bluetoothdsrc/agent.c:agent_unref() 0x8588ed0: ref=1//�� �;A43r bluetoothdsrc/adapter.c:resume_discovery() �;A43Z�;A43� �;A43�C�;A43��q��&?��;A43��

AA�� �;A43� bluetoothdsrc/adapter.c:pair_device_complete() Success (0x00)ff�� �;A43�� bluetoothdsrc/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:80:BA:71 type 0 status 0x0NN�� �;A43�* bluetoothdsrc/device.c:device_bonding_complete() bonding (nil) status 0x00//�� �;A43�K bluetoothdsrc/adapter.c:resume_discovery() �;A44RP�;A44U�!  �;A44U� @�;A44e��;A44i! @@�;A44ik @�;A44n%! @��;A44n]
@��;A44y7�;A44��!
@�;A44��@5��5
���;A44���;A45 ����;A45�!��@{w6�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �;A45�@5��5
���;A45)-���;A45-2!��@{w  (  67
 5$ 
 5 5 5 5 5 en j  55$  55 5 5 �;A452Y@5��5
���;A45@V���;A45Ej!��@{w%Xbox Bluetooth Gamepad %Gamepad %Microsoft Corporation     @ ! ( ( 6:67"&2 ���;A45KE@5��5
���;A45W����;A45]�!��@{w � 0 1'���u�� � 3 4'���u�� 2&��u
�%u�� 5&��u
�%u�� 9%5F;fu��Bu��;A45c�@5��5
���;A45�]���;A45�!��@{w%5Ee� )
%u�
�%u�� ��� �%�u�%u��� !�� �%u��%u�� p%du�� PfU�;A46�@5��5
���;A46�~~�;A46�!zv@qn&�u�� �&�u��eU |&�u���� &�u��� 55   (  ( 
(    �  ( (�;A46��@5��5
���;A46ֆ���;A46�t!��@{w5�5�
 5 
 5 5 5 5 5 en j  55  % % %    ^  � �;A47%�@5��5
���;A474H�;A475|!@  (  �� �;A47~z bluetoothdsrc/device.c:device_probe_profiles() Probing profiles for device C8:3F:26:80:BA:71cc�� �;A47�� bluetoothdprofiles/input/device.c:input_device_register() /org/bluez/hci0/dev_C8_3F_26_80_BA_71>>�� �;A47�' bluetoothdsrc/service.c:btd_service_ref() 0x9247600: ref=2���� �;A47�p bluetoothdsrc/service.c:change_state() 0x9247600: device C8:3F:26:80:BA:71 profile input-hid state changed: unavailable -> disconnected (0)\\�� �;A47�� bluetoothdsrc/device.c:device_svc_resolved() /org/bluez/hci0/dev_C8_3F_26_80_BA_71 err 0�;A4[V� @@�;A4[fK�;A4[� ! @@�;A4{:�;A4{C�;A4|�$�;A4|�v q��&?��;A4|�v q��&?��;A4|�v q��&?�^^�� �;A4|�) bluetoothdsrc/adapter.c:dev_disconnected() Device C8:3F:26:80:BA:71 disconnected, reason 288�� �;A4|�� bluetoothdsrc/adapter.c:adapter_remove_connection() 77�� �;A4|�, bluetoothdplugins/policy.c:disconnect_cb() reason 2ff�� �;A4|�N bluetoothdsrc/adapter.c:bonding_attempt_complete() hci0 bdaddr C8:3F:26:80:BA:71 type 0 status 0xeNN�� �;A4|�I bluetoothdsrc/device.c:device_bonding_complete() bonding (nil) status 0x0e<<�� �;A4|�t bluetoothdsrc/device.c:device_bonding_failed() status 14//�� �;A4|�� bluetoothdsrc/adapter.c:resume_discovery() �;A8��
q��&?�

�;A8��9 q��&?��;A8��  

�;A8�h�q��&?��;A8�;�& �;A8��� q��&?��;A8����;A8����;A8�� �;A8�ü �>����{��;A8���;A8�Ǿ�;A8���q��&?��;A8��� q��&?ș�}�Ū����m�h A� �;A8���
 q��&?��;A8��#  �;A8�e
q��&?��;A8�{

�;A8���;A8�XI�q��&?�Xbox Wireless Controller22�;A8�Xy q��&?� Xbox Wireless Controller 22�;A8�Xy q��&?� Xbox Wireless Controller 22�;A8�Xy q��&?� Xbox Wireless Controller cc�� �;A8�[ bluetoothdsrc/adapter.c:connected_callback() hci0 device C8:3F:26:80:BA:71 connected eir_len 31�;A8���;A8��[�;A8��R! @�;A8�ܢ @@�;A8�ܯ

 �;A8����;A8��. @@�;A8����;A8��  @�;A8���!  �;A8���;A8���;A8���;A8��s�;A8���!  �;A8���! @��;A8���
@��;A8�?!
@mm�� �;A8�\ bluetoothdprofiles/input/server.c:connect_event_cb() Incoming connection from C8:3F:26:80:BA:71 on PSM 17VV�� �;A8�� bluetoothdprofiles/input/device.c:input_device_set_channel() idev 0x9249ef0 psm 17�;A8� ��;A8�m�! A�;A8�n2 AA99�� �;A8�p� bluetoothdprofiles/input/server.c:confirm_event_cb() 66�� �;A8�tA bluetoothdsrc/agent.c:agent_ref() 0x8588ed0: ref=2���� �;A8�}� bluetoothdsrc/agent.c:agent_authorize_service() authorize service request was sent for /org/bluez/hci0/dev_C8_3F_26_80_BA_71�;A8��v66�� �;A8�� bluetoothdsrc/agent.c:agent_ref() 0x8588ed0: ref=3�;A8��: AA�;A8��o A88�� �;A8�ӏ bluetoothdsrc/agent.c:agent_unref() 0x8588ed0: ref=288�� �;A8��� bluetoothdsrc/agent.c:agent_unref() 0x8588ed0: ref=1�;A8��B�;A8�ޜ! A��;A8���
A��;A8����;A8��/!
Amm�� �;A8��� bluetoothdprofiles/input/server.c:connect_event_cb() Incoming connection from C8:3F:26:80:BA:71 on PSM 19VV�� �;A8��^ bluetoothdprofiles/input/device.c:input_device_set_channel() idev 0x9249ef0 psm 19�;A8������ �;A8�� bluetoothdsrc/service.c:change_state() 0x9247600: device C8:3F:26:80:BA:71 profile input-hid state changed: disconnected -> connected (0)>>�� �;A8��� bluetoothdsrc/service.c:btd_service_ref() 0x9247600: ref=3GG�� �;A8��G bluetoothdplugins/policy.c:service_cb() Added input-hid reconnect 077�� �;A8��E bluetoothdprofiles/input/device.c:encrypt_notify() �;A8��Q�;A8�X-!A����|oy2��;A8�`�!A����|oy2��;A8�c� �;A8��.!A�� �;A:#e!A��

#15 lore raw

Hey,

I'm still working on getting some interesting information out of this. The first thing is:

Quoted 1 line

ACL Data RX: Handle 256 flags 0x02 dlen 15 #38 [hci0] 7.314671

      L2CAP: Configure Response (0x05) ident 3 len 7
        Source CID: 64
        Flags: 0x0000
        Result: Failure - unknown options (0x0003)
        04                                               .   

This tells us that the pad doesn't like the RFC request (Retransmit and Flow Control, not Request For Configuration, as I thought it might mean).

The specification says[1]:

Quoted 7 lines

The remote device proposes Basic L2CAP mode in a Configuration Request
and the local device proposes Enhanced Retransmission mode or Streaming mode. The remote device rejects the local device's Configuration
Request by sending a negative Configuration Response proposing Basic mode. The local device will send a second Configuration Request

Quoted 8 lines

proposing
Basic L2CAP mode or disconnect the channel. If the local device sends a
second Configuration Request that does not propose Basic L2CAP mode then the remote device will disconnect the channel. If the local device rejects
the remote device's Configuration Request then the remote device will disconnect the channel.

And[2]:

Quoted 6 lines

The Basic L2CAP mode is the default. If Basic L2CAP mode is requested then all other parameters shall be ignored.
Enhanced Retransmission mode should be enabled if a reliable channel has
been requested. Enhanced Retransmission mode shall only be sent to an L2CAP entity that has previously advertised support for the mode in

Quoted 8 lines

its
Extended Feature Mask (see Section 4.12).
Streaming mode should be enabled if a finite L2CAP Flush Time-Out is set
on an L2CAP connection. Streaming mode shall only be sent to a device that has previously advertised support for the mode in the Extended Feature
Mask (see Section 4.12).

But the code only ever sets the mode to BASIC if it was basic before, never trying to upgrade the mode:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/bluetooth/l2cap_core.c#n3230

I'm also unclear on whether the current code checks whether the L2CAP Flush Time-Out is set, which is required for Streaming Mode to be enabled.

So I think that we should try to set a non-BASIC mode in when setting the RFC config request in l2cap_build_conf_req() [3], and if the mode is streaming, but only if L2CAP_CONF_FLUSH_TO is non-zero. Break out if the remote device doesn't support ERTM or has a 0 flush timeout.

Am I on the right track?

[1]: BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part A page 1790
[2]: BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part A page 1785
[3]: How do I get the remote feature mask? I couldn't figure it out

Quoted 37 lines · Bastien Nocera
Quoted 1 line · Bastien Nocera

<snip>

Quoted 1 line

Here's the btmon output of a pairing attempt.

And this is a pairing attempt with disable_ertm set to 1.

You will see a gap of about a minute between 2 events:
@ MGMT Event: Device Disconnected (0x000c) plen 8

                                                                    {
0x0001} [hci0] 12.103542
        BR/EDR Address: C8:3F:26:80:BA:71 (Microsoft Corporation)
        Reason: Connection terminated by local host (0x02)
Quoted 4 lines

HCI Event: Connect Request (0x04) plen
10

               #77 [hci0] 81.172351
        Address: C8:3F:26:80:BA:71 (Microsoft Corporation)
        Class: 0x000508
          Major class: Peripheral (mouse, joystick, keyboards)
          Minor class: 0x02
        Link type: ACL (0x01)

The pad carried on blinking expecting "something". I turned the pad off
by long pressing on the "XBox" button, and turned it on again. I got a
service authentication request:
[CHG] Device C8:3F:26:80:BA:71 Connected: yes
Authorize service
[agent] Authorize service 00001124-0000-1000-8000-00805f9b34fb (yes/no): yes

And it's now connected and working.