robinpaulson / SimpleRT

Simple Reverse Tethering utility for Android
GNU General Public License v3.0
905 stars 101 forks source link

Device 18d1:4ee1 is not support accessory! Reason: Resource busy #15

Closed tannercollin closed 7 years ago

tannercollin commented 7 years ago

My device is the LG Nexus 5 (Hammerhead). I'm using the APK from the Readme file. Nothing happens on the phone.

This is a log of plugging the device in, and then removing it:

└─► sudo ./simple-rt -d
debug mode enabled
libusb callback registered!
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.001514] [00004cf3] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.001535] [00004cf3] libusb: debug [handle_events] poll fds modified, reallocating
[ 0.001541] [00004cf3] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[ 6.282009] [00004cf4] libusb: debug [linux_get_device_address] getting address for device: 2-1 detached: 0
[ 6.282023] [00004cf4] libusb: debug [linux_get_device_address] scan 2-1
[ 6.282178] [00004cf4] libusb: debug [linux_get_device_address] bus=2 dev=94
[ 6.282191] [00004cf4] libusb: debug [udev_hotplug_event] udev hotplug event. action: add.
[ 6.282199] [00004cf4] libusb: debug [linux_enumerate_device] busnum 2 devaddr 94 session_id 606
[ 6.282207] [00004cf4] libusb: debug [linux_enumerate_device] allocating new device for 2/94 (session 606)
[ 6.282242] [00004cf4] libusb: debug [linux_get_parent_info] Dev 0x7f139c0014a0 (2-1) has parent 0x559c7b91f4d0 (usb2) port 1
[ 6.282269] [00004cf3] libusb: debug [handle_events] poll() returned 1
[ 6.282278] [00004cf3] libusb: debug [handle_events] caught a fish on the event pipe
[ 6.282284] [00004cf3] libusb: debug [handle_events] hotplug message received
[ 6.282295] [00004cf3] libusb: debug [libusb_get_device_descriptor] 
[ 6.282305] [00004cf3] libusb: debug [libusb_get_device_list] 
[ 6.282318] [00004cf3] libusb: debug [libusb_get_device_descriptor] 
[ 6.282325] [00004cf3] libusb: debug [libusb_open] open 2.94
[ 6.282354] [00004cf3] libusb: debug [usbi_add_pollfd] add fd 9 events 4
[ 6.282366] [00004cf3] libusb: debug [libusb_kernel_driver_active] interface 0
Kernel driver is not active!
Device 18d1:4ee1 is not support accessory! Reason: Resource busy
[ 6.282393] [00004cf3] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms
[ 6.282399] [00004cf3] libusb: debug [handle_events] poll() returned 1
[ 6.282404] [00004cf3] libusb: debug [handle_events] caught a fish on the event pipe
[ 6.282408] [00004cf3] libusb: debug [handle_events] someone updated the poll fds
[ 7.282553] [00004cf3] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 7.282571] [00004cf3] libusb: debug [handle_events] poll fds modified, reallocating
[ 7.282581] [00004cf3] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[15.203224] [00004cf3] libusb: debug [handle_events] poll() returned 1
[15.203325] [00004cf3] libusb: debug [usbi_remove_pollfd] remove fd 9
[15.203344] [00004cf3] libusb: debug [usbi_handle_disconnect] device 2.94
[15.207538] [00004cf4] libusb: debug [linux_get_device_address] getting address for device: 2-1 detached: 1
[15.207863] [00004cf4] libusb: debug [udev_hotplug_event] udev hotplug event. action: remove.
[15.207872] [00004cf4] libusb: debug [linux_device_disconnected] device not found for session 25e
[16.203499] [00004cf3] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[16.203518] [00004cf3] libusb: debug [handle_events] poll fds modified, reallocating
[16.203523] [00004cf3] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[16.203528] [00004cf3] libusb: debug [handle_events] poll() returned 1
[16.203530] [00004cf3] libusb: debug [handle_events] caught a fish on the event pipe
[16.203532] [00004cf3] libusb: debug [handle_events] hotplug message received
[16.203539] [00004cf3] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms
[16.203544] [00004cf3] libusb: debug [handle_events] poll() returned 0
[17.203689] [00004cf3] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[17.203706] [00004cf3] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
aleksander0m commented 7 years ago

The device addition callback seems to be the culprit here. If the libusb device is opened with a specific vid/pid without using notifications from libusb, the setup works. Another option is to use udev to get events of device additions, and then match those to libusb devices; which is what I did myself.

vvviperrr commented 7 years ago

seems like i fixed this issue. sorry for delay :)