robinpaulson / SimpleRT

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

Device is not support accessory! #8

Closed vanous closed 7 years ago

vanous commented 7 years ago

sorry, new issue :)

vanous@tc-vanek:/tmp/SimpleRT/simple-rt-cli$ sudo ./simple-rt -d debug mode enabled libusb callback registered!

[timestamp] [threadID] facility level [function call]

[ 0.001947] [00002b19] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 0.001959] [00002b19] libusb: debug [handle_events] poll fds modified, reallocating [ 0.001963] [00002b19] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms [ 4.900710] [00002b1a] libusb: debug [linux_get_device_address] getting address for device: 2-1.2 detached: 0 [ 4.900758] [00002b1a] libusb: debug [linux_get_device_address] scan 2-1.2 [ 4.900913] [00002b1a] libusb: debug [linux_get_device_address] bus=2 dev=16 [ 4.900931] [00002b1a] libusb: debug [udev_hotplug_event] udev hotplug event. action: add. [ 4.900941] [00002b1a] libusb: debug [linux_enumerate_device] busnum 2 devaddr 16 session_id 528 [ 4.900967] [00002b1a] libusb: debug [linux_enumerate_device] allocating new device for 2/16 (session 528) [ 4.901085] [00002b1a] libusb: debug [linux_get_parent_info] Dev 0x7f08200015b0 (2-1.2) has parent 0x7814f0 (2-1) port 2 [ 4.902078] [00002b19] libusb: debug [handle_events] poll() returned 1 [ 4.902111] [00002b19] libusb: debug [handle_events] caught a fish on the event pipe [ 4.902123] [00002b19] libusb: debug [handle_events] hotplug message received [ 4.902151] [00002b19] libusb: debug [libusb_get_device_descriptor] [ 4.902171] [00002b19] libusb: debug [libusb_get_device_list] [ 4.902190] [00002b19] libusb: debug [discovered_devs_append] need to increase capacity [ 4.902211] [00002b19] libusb: debug [libusb_get_device_descriptor] [ 4.902223] [00002b19] libusb: debug [libusb_open] open 2.16 [ 4.902293] [00002b19] libusb: debug [usbi_add_pollfd] add fd 9 events 4 Device is not support accessory! [ 4.902331] [00002b19] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms [ 4.902353] [00002b19] libusb: debug [handle_events] poll() returned 1 [ 4.902366] [00002b19] libusb: debug [handle_events] caught a fish on the event pipe [ 4.902379] [00002b19] libusb: debug [handle_events] someone updated the poll fds [ 5.902537] [00002b19] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 5.902591] [00002b19] libusb: debug [handle_events] poll fds modified, reallocating [ 5.902622] [00002b19] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms [65.905962] [00002b19] libusb: debug [handle_events] poll() returned 0 [66.906124] [00002b19] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [66.906158] [00002b19] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms

on the device: your released provided apk is installed. it is nexus 5 , Android M: 6.0.1 , security patch level August 5th 2016.

No message on the phone at all.

thank you!

vvviperrr commented 7 years ago

yeap, this kind a possible bug. i used hardcoded accessory usb endpoint, but on some devices it differs. will try to fix this asap.

vanous commented 7 years ago

thank you very much. please compile apk too, if possible. i can then test it for you too :)

vvviperrr commented 7 years ago

more precisely output added. can you please provide full debug log? apk reinstalling is not necessary.

vanous commented 7 years ago

thank you, below is the log:

(i have tried all possible (offered by system) USB settings (Use USB for... Charging|File transfers|Photo transfer (PTP)|MIDI) P.

vanous@tc-vanek:/tmp/SimpleRT/simple-rt-cli$ sudo ./simple-rt libusb callback registered! Device 18d1:4ee1 is not support accessory! Reason: Resource busy ^C vanous@tc-vanek:/tmp/SimpleRT/simple-rt-cli$ sudo ./simple-rt -d debug mode enabled libusb callback registered!

[timestamp] [threadID] facility level [function call]

[ 0.003163] [0000052f] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 0.003189] [0000052f] libusb: debug [handle_events] poll fds modified, reallocating [ 0.003201] [0000052f] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms [ 3.665730] [00000530] libusb: debug [linux_get_device_address] getting address for device: 2-1.2 detached: 1 [ 3.665752] [00000530] libusb: debug [udev_hotplug_event] udev hotplug event. action: remove. [ 3.666136] [0000052f] libusb: debug [handle_events] poll() returned 1 [ 3.666146] [0000052f] libusb: debug [handle_events] caught a fish on the event pipe [ 3.666150] [0000052f] libusb: debug [handle_events] hotplug message received [ 3.666158] [0000052f] libusb: debug [libusb_unref_device] destroy device 2.28 [ 3.666167] [0000052f] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms [ 3.666172] [0000052f] libusb: debug [handle_events] poll() returned 0 [ 4.666294] [0000052f] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 4.666353] [0000052f] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms [ 6.769147] [00000530] libusb: debug [linux_get_device_address] getting address for device: 2-1.2 detached: 0 [ 6.769190] [00000530] libusb: debug [linux_get_device_address] scan 2-1.2 [ 6.769320] [00000530] libusb: debug [linux_get_device_address] bus=2 dev=29 [ 6.769334] [00000530] libusb: debug [udev_hotplug_event] udev hotplug event. action: add. [ 6.769342] [00000530] libusb: debug [linux_enumerate_device] busnum 2 devaddr 29 session_id 541 [ 6.769352] [00000530] libusb: debug [linux_enumerate_device] allocating new device for 2/29 (session 541) [ 6.769423] [00000530] libusb: debug [linux_get_parent_info] Dev 0x7fb8ec002160 (2-1.2) has parent 0x9e4600 (2-1) port 2 [ 6.769453] [0000052f] libusb: debug [handle_events] poll() returned 1 [ 6.769475] [0000052f] libusb: debug [handle_events] caught a fish on the event pipe [ 6.769486] [0000052f] libusb: debug [handle_events] hotplug message received [ 6.769506] [0000052f] libusb: debug [libusb_get_device_descriptor] [ 6.769522] [0000052f] libusb: debug [libusb_get_device_list] [ 6.769545] [0000052f] libusb: debug [discovered_devs_append] need to increase capacity [ 6.769561] [0000052f] libusb: debug [libusb_get_device_descriptor] [ 6.769571] [0000052f] libusb: debug [libusb_open] open 2.29 [ 6.769624] [0000052f] libusb: debug [usbi_add_pollfd] add fd 9 events 4 Device 18d1:4ee1 is not support accessory! Reason: Resource busy [ 6.769663] [0000052f] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms [ 6.769673] [0000052f] libusb: debug [handle_events] poll() returned 1 [ 6.769681] [0000052f] libusb: debug [handle_events] caught a fish on the event pipe [ 6.769687] [0000052f] libusb: debug [handle_events] someone updated the poll fds [ 7.769839] [0000052f] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 7.769891] [0000052f] libusb: debug [handle_events] poll fds modified, reallocating [ 7.769920] [0000052f] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms ^C

vvviperrr commented 7 years ago

seems like some software in your system already grabbed your device (some kind of mtpfs maybe, or adb). there is api in libusb which can determine such situations, but i need time to figure out. if it possible, you can try to run it on another machine.

btw

(i have tried all possible (offered by system) USB settings (Use USB for... Charging|File transfers|Photo transfer (PTP)|MIDI)

no need at all. any mode is ok for accessory.

vanous commented 7 years ago

OK, will try tomorrow.

On Aug 17, 2016 00:06, "Konstantin Menyaev" notifications@github.com wrote:

seems like some software in your system already grabbed your device (some kind of mtpfs maybe, or adb). there is api in libusb which can determine such situations, but i need time to figure out. if it possible, you can try to run it on another machine.

btw

(i have tried all possible (offered by system) USB settings (Use USB for... Charging|File transfers|Photo transfer (PTP)|MIDI)

no need at all. any mode is ok for accessory.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vvviperrr/SimpleRT/issues/8#issuecomment-240254571, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgqniomewgapn274pxFLenSAIryGNfTks5qgjRQgaJpZM4Jli0J .

vanous commented 7 years ago

Sorry, don't have another computer to try this on, but i tried to quit gnome-shell and used simple IceWM manager. However, still the same issue. This being on Debian, i looked and don't have mtpfs nor jmtpfs installed (FUSE and libmtp-based filesystem for accessing MTP). Not sure what i can check next... installing python-usb to see if i can list programs using usb devices...

vvviperrr commented 7 years ago

commited, maybe it help.

vanous commented 7 years ago

Thank you, no help yet, but new message: Kernel driver is not active!

see full log below.

vanous@tc-vanek:/tmp/SimpleRT/simple-rt-cli$ sudo ./simple-rt -d debug mode enabled libusb callback registered!

[timestamp] [threadID] facility level [function call]

[ 0.009128] [0000257d] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 0.009176] [0000257d] libusb: debug [handle_events] poll fds modified, reallocating [ 0.009205] [0000257d] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms [ 2.648270] [0000257e] libusb: debug [linux_get_device_address] getting address for device: 2-1.2 detached: 1 [ 2.648291] [0000257e] libusb: debug [udev_hotplug_event] udev hotplug event. action: remove. [ 2.648307] [0000257d] libusb: debug [handle_events] poll() returned 1 [ 2.648317] [0000257d] libusb: debug [handle_events] caught a fish on the event pipe [ 2.648321] [0000257d] libusb: debug [handle_events] hotplug message received [ 2.648328] [0000257d] libusb: debug [libusb_unref_device] destroy device 2.53 [ 2.648337] [0000257d] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms [ 2.648342] [0000257d] libusb: debug [handle_events] poll() returned 0 [ 3.648456] [0000257d] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 3.648496] [0000257d] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms [ 8.521988] [0000257e] libusb: debug [linux_get_device_address] getting address for device: 2-1.2 detached: 0 [ 8.522052] [0000257e] libusb: debug [linux_get_device_address] scan 2-1.2 [ 8.522202] [0000257e] libusb: debug [linux_get_device_address] bus=2 dev=55 [ 8.522218] [0000257e] libusb: debug [udev_hotplug_event] udev hotplug event. action: add. [ 8.522229] [0000257e] libusb: debug [linux_enumerate_device] busnum 2 devaddr 55 session_id 567 [ 8.522241] [0000257e] libusb: debug [linux_enumerate_device] allocating new device for 2/55 (session 567) [ 8.522339] [0000257e] libusb: debug [linux_get_parent_info] Dev 0x7f994c002160 (2-1.2) has parent 0x19ed600 (2-1) port 2 [ 8.522411] [0000257d] libusb: debug [handle_events] poll() returned 1 [ 8.522433] [0000257d] libusb: debug [handle_events] caught a fish on the event pipe [ 8.522443] [0000257d] libusb: debug [handle_events] hotplug message received [ 8.522465] [0000257d] libusb: debug [libusb_get_device_descriptor] [ 8.522483] [0000257d] libusb: debug [libusb_get_device_list] [ 8.522503] [0000257d] libusb: debug [discovered_devs_append] need to increase capacity [ 8.522527] [0000257d] libusb: debug [libusb_get_device_descriptor] [ 8.522536] [0000257d] libusb: debug [libusb_open] open 2.55 [ 8.522587] [0000257d] libusb: debug [usbi_add_pollfd] add fd 9 events 4 [ 8.522605] [0000257d] libusb: debug [libusb_kernel_driver_active] interface 0 Kernel driver is not active! Device 18d1:4ee1 is not support accessory! Reason: Resource busy [ 8.522636] [0000257d] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms [ 8.522645] [0000257d] libusb: debug [handle_events] poll() returned 1 [ 8.522651] [0000257d] libusb: debug [handle_events] caught a fish on the event pipe [ 8.522656] [0000257d] libusb: debug [handle_events] someone updated the poll fds [ 9.522823] [0000257d] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 9.522879] [0000257d] libusb: debug [handle_events] poll fds modified, reallocating [ 9.522928] [0000257d] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms

Edit:

anous@tc-vanek:~$ lsmod Module Size Used by hid_multitouch 20480 0 snd_usb_audio 176128 0 snd_usbmidi_lib 28672 1 snd_usb_audio snd_rawmidi 32768 1 snd_usbmidi_lib snd_seq_device 16384 1 snd_rawmidi ipt_MASQUERADE 16384 4 nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE iptable_nat 16384 1 nf_conntrack_ipv4 20480 1 nf_defrag_ipv4 16384 1 nf_conntrack_ipv4 nf_nat_ipv4 16384 1 iptable_nat nf_nat 24576 2 nf_nat_ipv4,nf_nat_masquerade_ipv4 nf_conntrack 114688 4 nf_nat,nf_nat_ipv4,nf_nat_masquerade_ipv4,nf_conntrack_ipv4 iptable_filter 16384 1 ip_tables 24576 2 iptable_filter,iptable_nat x_tables 36864 3 ip_tables,ipt_MASQUERADE,iptable_filter tun 28672 0 hid_generic 16384 0 rfcomm 69632 2 fuse 98304 2 hmac 16384 1 drbg 24576 1 ansi_cprng 16384 0 ctr 16384 3 ccm 20480 3 bnep 20480 2 uvcvideo 90112 0 videobuf2_vmalloc 16384 1 uvcvideo videobuf2_memops 16384 1 videobuf2_vmalloc videobuf2_v4l2 24576 1 uvcvideo videobuf2_core 36864 2 uvcvideo,videobuf2_v4l2 videodev 176128 3 uvcvideo,videobuf2_core,videobuf2_v4l2 media 36864 2 uvcvideo,videodev rtsx_usb_ms 20480 0 memstick 20480 1 rtsx_usb_ms btusb 45056 0 btrtl 16384 1 btusb btbcm 16384 1 btusb btintel 16384 1 btusb bluetooth 516096 29 bnep,btbcm,btrtl,btusb,rfcomm,btintel binfmt_misc 20480 1 nls_utf8 16384 1 nls_cp437 20480 1 vfat 20480 1 nvram 16384 0 msr 16384 0 iTCO_wdt 16384 0 iTCO_vendor_support 16384 1 iTCO_wdt fat 69632 1 vfat intel_rapl 20480 0 x86_pkg_temp_thermal 16384 0 intel_powerclamp 16384 0 coretemp 16384 0 kvm_intel 188416 0 kvm 577536 1 kvm_intel arc4 16384 2 irqbypass 16384 1 kvm efi_pstore 16384 0 iwldvm 143360 0 crct10dif_pclmul 16384 0 crc32_pclmul 16384 0 mac80211 643072 1 iwldvm ghash_clmulni_intel 16384 0 joydev 20480 0 serio_raw 16384 0 pcspkr 16384 0 efivars 20480 1 efi_pstore snd_hda_codec_hdmi 45056 1 snd_hda_codec_realtek 86016 1 iwlwifi 147456 1 iwldvm sg 32768 0 snd_hda_codec_generic 69632 1 snd_hda_codec_realtek i915 1277952 23 cfg80211 569344 3 iwlwifi,mac80211,iwldvm i2c_i801 20480 0 lpc_ich 24576 0 snd_hda_intel 36864 6 ppp_generic 36864 0 int3403_thermal 16384 0 slhc 16384 1 ppp_generic drm_kms_helper 147456 1 i915 acpi_als 16384 0 snd_hda_codec 135168 4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel battery 16384 0 drm 364544 9 i915,drm_kms_helper kfifo_buf 16384 1 acpi_als mei_me 32768 0 snd_hda_core 81920 5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel asus_wireless 16384 0 mei 94208 1 mei_me snd_hwdep 16384 2 snd_usb_audio,snd_hda_codec int3402_thermal 16384 0 industrialio 61440 2 acpi_als,kfifo_buf int340x_thermal_zone 16384 2 int3402_thermal,int3403_thermal int3400_thermal 16384 0 snd_pcm 110592 5 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core ac 16384 0 acpi_thermal_rel 16384 1 int3400_thermal shpchp 36864 0 button 16384 1 i915 snd_timer 32768 1 snd_pcm snd 81920 24 snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_hda_codec_generic,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device i2c_algo_bit 16384 1 i915 soundcore 16384 1 snd tpm_tis 20480 0 tpm 45056 1 tpm_tis evdev 24576 22 asus_nb_wmi 24576 0 asus_wmi 28672 1 asus_nb_wmi sparse_keymap 16384 1 asus_wmi rfkill 24576 7 cfg80211,bluetooth,asus_wmi wmi 16384 1 asus_wmi video 40960 2 i915,asus_wmi parport_pc 28672 0 ppdev 20480 0 lp 20480 0 parport 49152 3 lp,ppdev,parport_pc efivarfs 16384 1 autofs4 40960 2 rtsx_usb_sdmmc 28672 0 mmc_core 139264 1 rtsx_usb_sdmmc rtsx_usb 24576 2 rtsx_usb_sdmmc,rtsx_usb_ms mfd_core 16384 2 lpc_ich,rtsx_usb usbhid 49152 0 hid 118784 3 hid_multitouch,hid_generic,usbhid ext4 589824 1 ecb 16384 0 crc16 16384 2 ext4,bluetooth jbd2 106496 1 ext4 crc32c_generic 16384 0 mbcache 16384 2 ext4 sd_mod 45056 4 crc32c_intel 24576 0 aesni_intel 167936 6 aes_x86_64 20480 1 aesni_intel glue_helper 16384 1 aesni_intel lrw 16384 1 aesni_intel gf128mul 16384 1 lrw ablk_helper 16384 1 aesni_intel cryptd 20480 3 ghash_clmulni_intel,aesni_intel,ablk_helper ahci 36864 3 libahci 32768 1 ahci psmouse 126976 0 libata 245760 2 ahci,libahci scsi_mod 225280 3 sg,libata,sd_mod ehci_pci 16384 0 ehci_hcd 77824 1 ehci_pci usbcore 241664 9 btusb,snd_usb_audio,uvcvideo,rtsx_usb,snd_usbmidi_lib,ehci_hcd,ehci_pci,usbhid thermal 20480 0 usb_common 16384 1 usbcore fan 16384 0 fjes 28672 0

vanous commented 7 years ago

I have tried booting straight into bash (init=/bin/bash on the linux command line) , then modprobe tun and then run ./simple-rt -d , but usb devices don't get autodetected - the ./simple-rt -d initializes but no device comes up , probably some modules are missing for udev or what not...

vvviperrr commented 7 years ago

thanks for response, im trying to resolve this issue.

fish47 commented 7 years ago

I can reproduce this bug(?). I can turn the device into Accessory Mode with it plugged using the code grabbed from here. Maybe we need a delayed check when USB plug event arrived? Any test code is welcome.

dylanjeffers commented 7 years ago

having same issue as vanous, any updates on a fix?

max600 commented 7 years ago

Encountered the same issue with OSX + Odroid C2 (Android 6.0.1).

vvviperrr commented 7 years ago

seems like something changed in new androids. my device tell same shit now. ill try to resolve asap.

aleksander0m commented 7 years ago

Hey, I skipped the "Resource busy" error by using udev notifications to track device addition and removals; see the GNU/Linux CLI rewrite here: https://github.com/aleksander0m/SimpleRT

vvviperrr commented 7 years ago

hope i fixed this issue. sorry for delay :)

vanous commented 7 years ago

Finally it's working! thank you!

vvviperrr commented 7 years ago

my bad :) really appreciate for patience.