2011-11-12 20:35:38

by Alon Bar-Lev

[permalink] [raw]
Subject: bluez input regression 4.96->master

Hello,

While trying to work on the sixaxis plugin as external plugin, I found
that the same code
that works with 4.96 does not work with trunk.

In 4.96 the hidraw could have been read, in master the read is blocked
until device
disconnects, then it returns with i/o error.

I don't know how to produce more debug information, I appreciate if
someone can help.
I did not find any hint in git log... Maybe something should be
changed in plugin, not sure.

blocked code:
---
fd = open(hidraw_node, O_RDWR);
if (read(fd, &c, 1) != 1)
---

I also think that actually no hid events are gotten at all... cat
/dev/input/js0 produces nothing.

Attached is the same patch that is used for both.

Thanks,
Alon Bar-Lev.

---
bluez-4.96 - working
---
bluetoothd[4399]: Bluetooth daemon 4.96
bluetoothd[4399]: src/main.c:parse_config() parsing main.conf
bluetoothd[4399]: src/main.c:parse_config() discovto=0
bluetoothd[4399]: src/main.c:parse_config() pairto=0
bluetoothd[4399]: src/main.c:parse_config() pageto=8192
bluetoothd[4399]: src/main.c:parse_config() name=%h-%d
bluetoothd[4399]: src/main.c:parse_config() class=0x000100
bluetoothd[4399]: src/main.c:parse_config() discov_interval=30
bluetoothd[4399]: src/main.c:parse_config() Key file does not have key
'DeviceID'
bluetoothd[4399]: Starting SDP server
bluetoothd[4399]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[4399]: src/plugin.c:add_plugin() Loading audio plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading serial plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading service plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading sixaxis plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading hciops plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading mgmtops plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading formfactor plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading storage plugin
bluetoothd[4399]: src/plugin.c:add_plugin() Loading adaptername plugin
bluetoothd[4399]: src/plugin.c:plugin_init() Loading plugins
/usr/lib64/bluetooth/plugins
bluetoothd[4399]: plugins/service.c:register_interface() path
/org/bluez/4399/any
bluetoothd[4399]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/4399/any
bluetoothd[4399]: plugins/sixaxis.c:sixaxis_init() Setup Sixaxis cable plugin
bluetoothd[4399]: network/manager.c:read_config()
/etc/bluetooth/network.conf: Key file does not have key
'DisableSecurity'
bluetoothd[4399]: network/manager.c:read_config() Config options: Security=true
bluetoothd[4399]: input/manager.c:input_manager_init() input.conf: Key
file does not have key 'IdleTimeout'
bluetoothd[4399]: audio/manager.c:audio_manager_init() audio.conf: Key
file does not have key 'AutoConnect'
bluetoothd[4399]: audio/unix.c:unix_init() Unix socket created: 9
bluetoothd[4399]: Unable to start SCO server socket
bluetoothd[4399]: Failed to init audio plugin
bluetoothd[4399]: plugins/hciops.c:hciops_init()
bluetoothd[4399]: plugins/hciops.c:hciops_setup()
bluetoothd[4399]: src/main.c:main() Entering main loop
bluetoothd[4399]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type
2 op 0 soft 0 hard 0
bluetoothd[4399]: src/rfkill.c:rfkill_event() RFKILL event idx 1 type
1 op 0 soft 0 hard 0
bluetoothd[4399]: src/rfkill.c:rfkill_event() RFKILL event idx 11 type
2 op 0 soft 0 hard 0
bluetoothd[4399]: plugins/hciops.c:init_known_adapters()
bluetoothd[4399]: plugins/hciops.c:init_device() hci0
bluetoothd[4399]: Listening for HCI events on hci0
bluetoothd[4399]: plugins/hciops.c:init_conn_list() hci0
bluetoothd[4399]: HCI dev 0 up
bluetoothd[4399]: plugins/hciops.c:device_devup_setup() hci0
bluetoothd[4399]: plugins/hciops.c:read_local_version_complete() Got
version for hci0
bluetoothd[4399]: src/adapter.c:btd_adapter_ref() 0x7f9eca360a10: ref=1
bluetoothd[4399]: plugins/hciops.c:hciops_read_bdaddr() hci0
bluetoothd[4399]: src/sdpd-database.c:sdp_init_services_list()
bluetoothd[4399]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[4399]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[4399]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[4399]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[4399]: plugins/service.c:register_interface() path
/org/bluez/4399/hci0
bluetoothd[4399]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/4399/hci0
bluetoothd[4399]: network/manager.c:network_server_probe() path
/org/bluez/4399/hci0
bluetoothd[4399]: src/adapter.c:btd_adapter_ref() 0x7f9eca360a10: ref=2
bluetoothd[4399]: network/server.c:server_register() Registered
interface org.bluez.NetworkServer on path /org/bluez/4399/hci0
bluetoothd[4399]: serial/manager.c:proxy_probe() path /org/bluez/4399/hci0
bluetoothd[4399]: src/adapter.c:btd_adapter_ref() 0x7f9eca360a10: ref=3
bluetoothd[4399]: serial/proxy.c:proxy_register() Registered interface
org.bluez.SerialProxyManager on path /org/bluez/4399/hci0
bluetoothd[4399]: src/adapter.c:btd_adapter_ref() 0x7f9eca360a10: ref=4
bluetoothd[4399]: plugins/adaptername.c:adaptername_probe() Setting
name 'localhost-0' for device 'hci0'
bluetoothd[4399]: plugins/hciops.c:hciops_set_name() hci0, name localhost-0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: Could not get the contents of DMI chassis type
bluetoothd[4399]: plugins/hciops.c:hciops_unblock_device() hci0 dba
00:00:00:00:00:00
bluetoothd[4399]: src/device.c:device_create() Creating device
/org/bluez/4399/hci0/dev_44_D8_32_A1_39_91
bluetoothd[4399]: src/device.c:btd_device_ref() 0x7f9eca362490: ref=1
bluetoothd[4399]: src/device.c:device_set_temporary() temporary 0
bluetoothd[4399]: src/device.c:device_probe_drivers() Probing drivers
for 44:D8:32:A1:39:91
bluetoothd[4399]: input/manager.c:hid_device_probe() path
/org/bluez/4399/hci0/dev_44_D8_32_A1_39_91
bluetoothd[4399]: src/device.c:btd_device_ref() 0x7f9eca362490: ref=2
bluetoothd[4399]: input/device.c:input_device_new() Registered
interface org.bluez.Input on path
/org/bluez/4399/hci0/dev_44_D8_32_A1_39_91
bluetoothd[4399]: plugins/hciops.c:hciops_load_keys() hci0 keys 0 debug_keys 0
bluetoothd[4399]: plugins/hciops.c:hciops_get_conn_list() hci0
bluetoothd[4399]: src/manager.c:btd_manager_register_adapter() Adapter
/org/bluez/4399/hci0 registered
bluetoothd[4399]: src/adapter.c:btd_adapter_ref() 0x7f9eca360a10: ref=5
bluetoothd[4399]: plugins/hciops.c:hciops_set_name() hci0, name localhost-0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: plugins/hciops.c:hciops_set_dev_class() hci0 major 1 minor 0
bluetoothd[4399]: plugins/hciops.c:hciops_disable_cod_cache() hci0
cache_enable 1
bluetoothd[4399]: plugins/hciops.c:hciops_disable_cod_cache() hci0
current_cod 0x000000 wanted_cod 0x000100
bluetoothd[4399]: plugins/hciops.c:write_class() hci0 class 0x000100
bluetoothd[4399]: Adapter /org/bluez/4399/hci0 has been enabled
bluetoothd[4399]: plugins/hciops.c:hciops_set_discoverable() hci0 discoverable 0
bluetoothd[4399]: plugins/hciops.c:hciops_set_pairable() hci0 pairable 1
bluetoothd[4399]: plugins/hciops.c:hciops_stop_inquiry() hci0
bluetoothd[4399]: src/adapter.c:btd_adapter_unref() 0x7f9eca360a10: ref=4
bluetoothd[4399]: src/adapter.c:register_agent() Agent registered for
hci0 at :1.138:/blueDevil_agent
bluetoothd[4399]: plugins/hciops.c:read_tx_power_complete() hci0 status 0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: Inquiry Cancel Failed with status 0x12
bluetoothd[4399]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: plugins/hciops.c:read_simple_pairing_mode_complete()
hci0 status 0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[4399]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[4399]: plugins/hciops.c:read_scan_complete() hci0 status 0
bluetoothd[4399]: src/adapter.c:adapter_mode_changed() old 0x00 new 0x02
bluetoothd[4399]: src/adapter.c:adapter_set_limited_discoverable() FALSE
bluetoothd[4399]: plugins/hciops.c:hciops_set_limited_discoverable()
hci0 limited 0
bluetoothd[4399]: src/adapter.c:set_mode_complete()
bluetoothd[4399]: plugins/hciops.c:conn_complete() status 0x00
bluetoothd[4399]: src/adapter.c:adapter_get_device() 44:D8:32:A1:39:91
bluetoothd[4399]: input/server.c:connect_event_cb() Incoming
connection from 44:D8:32:A1:39:91 on PSM 17
bluetoothd[4399]: plugins/hciops.c:remote_features_information() hci0 status 0
bluetoothd[4399]: input/server.c:connect_event_cb() Incoming
connection from 44:D8:32:A1:39:91 on PSM 19
bluetoothd[4399]: plugins/hciops.c:remote_name_information() hci0 status 0
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() name:
PLAYSTATION(R)3 Controller
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() Found a Sixaxis device
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() joypad device_num: 1
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() hidraw_node:
/dev/hidraw0
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() driver: btusb
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() opening hidraw
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() waiting for events
bluetoothd[4399]: plugins/sixaxis.c:set_leds() Setting leds
bluetoothd[4399]: plugins/sixaxis.c:handle_device_plug() hidraw closed
---

---
master
---
bluetoothd[11731]: Bluetooth daemon 4.96
bluetoothd[11731]: src/main.c:parse_config() parsing main.conf
bluetoothd[11731]: src/main.c:parse_config() discovto=0
bluetoothd[11731]: src/main.c:parse_config() pairto=0
bluetoothd[11731]: src/main.c:parse_config() pageto=8192
bluetoothd[11731]: src/main.c:parse_config() auto_to=60
bluetoothd[11731]: src/main.c:parse_config() name=%h-%d
bluetoothd[11731]: src/main.c:parse_config() class=0x000100
bluetoothd[11731]: src/main.c:parse_config() discov_interval=30
bluetoothd[11731]: src/main.c:parse_config() Key file does not have
key 'DeviceID'
bluetoothd[11731]: Starting SDP server
bluetoothd[11731]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[11731]: src/plugin.c:add_plugin() Loading audio plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading serial plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading service plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading sixaxis plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading hciops plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading mgmtops plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading formfactor plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading storage plugin
bluetoothd[11731]: src/plugin.c:add_plugin() Loading adaptername plugin
bluetoothd[11731]: src/plugin.c:plugin_init() Loading plugins
/usr/lib64/bluetooth/plugins
bluetoothd[11731]: plugins/service.c:register_interface() path
/org/bluez/11731/any
bluetoothd[11731]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/11731/any
bluetoothd[11731]: plugins/sixaxis.c:sixaxis_init() Setup Sixaxis cable plugin
bluetoothd[11731]: network/manager.c:read_config()
/etc/bluetooth/network.conf: Key file does not have key
'DisableSecurity'
bluetoothd[11731]: network/manager.c:read_config() Config options: Security=true
bluetoothd[11731]: input/manager.c:input_manager_init() input.conf:
Key file does not have key 'IdleTimeout'
bluetoothd[11731]: audio/manager.c:audio_manager_init() audio.conf:
Key file does not have key 'AutoConnect'
bluetoothd[11731]: audio/unix.c:unix_init() Unix socket created: 10
bluetoothd[11731]: Unable to start SCO server socket
bluetoothd[11731]: Failed to init audio plugin
bluetoothd[11731]: plugins/hciops.c:hciops_init()
bluetoothd[11731]: plugins/hciops.c:hciops_setup()
bluetoothd[11731]: src/main.c:main() Entering main loop
bluetoothd[11731]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type
2 op 0 soft 0 hard 0
bluetoothd[11731]: src/rfkill.c:rfkill_event() RFKILL event idx 1 type
1 op 0 soft 0 hard 0
bluetoothd[11731]: src/rfkill.c:rfkill_event() RFKILL event idx 11
type 2 op 0 soft 0 hard 0
bluetoothd[11731]: plugins/hciops.c:init_known_adapters()
bluetoothd[11731]: plugins/hciops.c:init_device() hci0
bluetoothd[11731]: Listening for HCI events on hci0
bluetoothd[11731]: plugins/hciops.c:init_conn_list() hci0
bluetoothd[11731]: HCI dev 0 up
bluetoothd[11731]: plugins/hciops.c:device_devup_setup() hci0
bluetoothd[11731]: plugins/hciops.c:read_local_version_complete() Got
version for hci0
bluetoothd[11731]: src/adapter.c:btd_adapter_ref() 0x7fc4b75d4cf0: ref=1
bluetoothd[11731]: plugins/hciops.c:hciops_read_bdaddr() hci0
bluetoothd[11731]: src/sdpd-database.c:sdp_init_services_list()
bluetoothd[11731]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[11731]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[11731]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[11731]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[11731]: plugins/service.c:register_interface() path
/org/bluez/11731/hci0
bluetoothd[11731]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/11731/hci0
bluetoothd[11731]: network/manager.c:network_server_probe() path
/org/bluez/11731/hci0
bluetoothd[11731]: src/adapter.c:btd_adapter_ref() 0x7fc4b75d4cf0: ref=2
bluetoothd[11731]: network/server.c:server_register() Registered
interface org.bluez.NetworkServer on path /org/bluez/11731/hci0
bluetoothd[11731]: serial/manager.c:proxy_probe() path /org/bluez/11731/hci0
bluetoothd[11731]: src/adapter.c:btd_adapter_ref() 0x7fc4b75d4cf0: ref=3
bluetoothd[11731]: serial/proxy.c:proxy_register() Registered
interface org.bluez.SerialProxyManager on path /org/bluez/11731/hci0
bluetoothd[11731]: src/adapter.c:btd_adapter_ref() 0x7fc4b75d4cf0: ref=4
bluetoothd[11731]: plugins/adaptername.c:adaptername_probe() Setting
name 'localhost-0' for device 'hci0'
bluetoothd[11731]: plugins/hciops.c:hciops_set_name() hci0, name localhost-0
bluetoothd[11731]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[11731]: Could not get the contents of DMI chassis type
bluetoothd[11731]: plugins/hciops.c:hciops_unblock_device() hci0 dba
00:00:00:00:00:00
bluetoothd[11731]: src/device.c:device_create() Creating device
/org/bluez/11731/hci0/dev_44_D8_32_A1_39_91
bluetoothd[11731]: src/device.c:btd_device_ref() 0x7fc4b75d6510: ref=1
bluetoothd[11731]: src/device.c:device_set_temporary() temporary 0
bluetoothd[11731]: src/device.c:device_probe_drivers() Probing drivers
for 44:D8:32:A1:39:91
bluetoothd[11731]: input/manager.c:hid_device_probe() path
/org/bluez/11731/hci0/dev_44_D8_32_A1_39_91
bluetoothd[11731]: src/device.c:btd_device_ref() 0x7fc4b75d6510: ref=2
bluetoothd[11731]: input/device.c:input_device_new() Registered
interface org.bluez.Input on path
/org/bluez/11731/hci0/dev_44_D8_32_A1_39_91
bluetoothd[11731]: plugins/hciops.c:hciops_load_keys() hci0 keys 0 debug_keys 0
bluetoothd[11731]: plugins/hciops.c:hciops_get_conn_list() hci0
bluetoothd[11731]: src/manager.c:btd_manager_register_adapter()
Adapter /org/bluez/11731/hci0 registered
bluetoothd[11731]: src/adapter.c:btd_adapter_ref() 0x7fc4b75d4cf0: ref=5
bluetoothd[11731]: plugins/hciops.c:hciops_set_dev_class() hci0 major 1 minor 0
bluetoothd[11731]: plugins/hciops.c:hciops_disable_cod_cache() hci0
cache_enable 1
bluetoothd[11731]: plugins/hciops.c:hciops_disable_cod_cache() hci0
current_cod 0x000000 wanted_cod 0x000100
bluetoothd[11731]: plugins/hciops.c:write_class() hci0 class 0x000100
bluetoothd[11731]: Adapter /org/bluez/11731/hci0 has been enabled
bluetoothd[11731]: plugins/hciops.c:hciops_set_discoverable() hci0
discoverable 0
bluetoothd[11731]: plugins/hciops.c:hciops_set_pairable() hci0 pairable 1
bluetoothd[11731]: plugins/hciops.c:hciops_stop_inquiry() hci0
bluetoothd[11731]: src/adapter.c:btd_adapter_unref() 0x7fc4b75d4cf0: ref=4
bluetoothd[11731]: plugins/hciops.c:read_local_ext_features_complete()
hci0 status 0
bluetoothd[11731]: src/adapter.c:register_agent() Agent registered for
hci0 at :1.138:/blueDevil_agent
bluetoothd[11731]: plugins/hciops.c:read_tx_power_complete() hci0 status 0
bluetoothd[11731]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[11731]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[11731]: Inquiry Cancel Failed with status 0x12
bluetoothd[11731]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[11731]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[11731]:
plugins/hciops.c:read_simple_pairing_mode_complete() hci0 status 0
bluetoothd[11731]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[11731]: plugins/hciops.c:read_scan_complete() hci0 status 0
bluetoothd[11731]: src/adapter.c:adapter_mode_changed() old 0x00 new 0x02
bluetoothd[11731]: src/adapter.c:adapter_set_limited_discoverable() FALSE
bluetoothd[11731]: plugins/hciops.c:hciops_set_limited_discoverable()
hci0 limited 0
bluetoothd[11731]: src/adapter.c:set_mode_complete()
bluetoothd[11731]: plugins/hciops.c:conn_complete() status 0x00
bluetoothd[11731]: src/adapter.c:adapter_get_device() 44:D8:32:A1:39:91
bluetoothd[11731]: input/server.c:connect_event_cb() Incoming
connection from 44:D8:32:A1:39:91 on PSM 17
bluetoothd[11731]: plugins/hciops.c:remote_features_information() hci0 status 0
bluetoothd[11731]: plugins/hciops.c:remote_name_information() hci0 status 0
bluetoothd[11731]: input/server.c:connect_event_cb() Incoming
connection from 44:D8:32:A1:39:91 on PSM 19
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() name:
PLAYSTATION(R)3 Controller
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() Found a Sixaxis device
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() joypad device_num: 1
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() hidraw_node:
/dev/hidraw0
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() driver: btusb
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() opening hidraw
bluetoothd[11731]: plugins/sixaxis.c:handle_device_plug() waiting for events
---


Attachments:
bluez-9999-sixaxis.patch (18.71 kB)