USB OTG Resetting

Post Reply
jpboucher
Posts: 3
Joined: Thu Jan 14, 2021 6:00 am
languages_spoken: english
ODROIDs: ODROID N2+
Has thanked: 4 times
Been thanked: 1 time
Contact:

USB OTG Resetting

Post by jpboucher »

Hello, I'm trying to plug an OTG device (DJI Mavic Mini RC) on my ODROID N2+ running Android Pie (64bit-20201105) but for some reason it keeps disconnecting/reconnecting.

Here's what dmesg gives me:

Code: Select all

[  709.448837]  709.448837@0] USB RESET
[  709.459929]  709.459929@0] usb device plug out, stop pcd!!!
[  709.459957]  709.459957@0] android_work: did not send uevent (0 0           (null))
[  712.080747]  712.080747@4] binder: release 6457:6495 transaction 155666 out, still active
[  713.639931]  713.639931@0] usb device plug out, stop pcd!!!
[  713.639961]  713.639961@0] android_work: did not send uevent (0 0           (null))
[  715.171646]  715.171646@0] USB RESET
[  715.419931]  715.419931@0] usb device plug out, stop pcd!!!
[  715.419960]  715.419960@0] android_work: did not send uevent (0 0           (null))
[  715.606297]  715.606297@0] USB RESET
[  715.724198]  715.724198@0] android_work: sent uevent USB_STATE=CONNECTED
[  715.726018]  715.726018@0] type=1400 audit(1610036586.399:337): avc: denied { getattr } for pid=2982 comm="memtrack@1.0-se" path="/sys/kernel/debug/ion/heaps/cma_ion" dev="debugfs" ino=12591 scontext=u:r:hal_memtrack_default:s0 tcontext=u:object_r:debugfs:s0 tclass=file permissive=1
[  715.726057]  715.726057@0] type=1400 audit(1610036671.331:338): avc: denied { read } for pid=2964 comm="HwBinder:2964_2" scontext=u:r:hdmicecd:s0 tcontext=u:r:hdmicecd:s0 tclass=netlink_kobject_uevent_socket permissive=1
[  715.727645]  715.727645@0] USB RESET
[  715.842738]  715.842738@4] type=1400 audit(1610036671.331:338): avc: denied { read } for pid=2964 comm="HwBinder:2964_2" scontext=u:r:hdmicecd:s0 tcontext=u:r:hdmicecd:s0 tclass=netlink_kobject_uevent_socket permissive=1
[  715.842771]  715.842771@4] type=1400 audit(1610036671.447:339): avc: denied { call } for pid=2992 comm="surfaceflinger" scontext=u:r:surfaceflinger:s0 tcontext=u:r:mediacodec:s0 tclass=binder permissive=1 b/77924251
[  715.864733]  715.864733@0] configfs-gadget gadget: high-speed config #1: b
[  715.865480]  715.865480@0] android_work: sent uevent USB_STATE=CONFIGURED
[  715.903631]  715.903631@5] mtp_open
[  715.906626]  715.906626@3] acc_open
[  715.906688]  715.906688@3] acc_release
[  715.906709]  715.906709@3] acc_open
[  715.906714]  715.906714@3] acc_release
[  715.911211]  715.911211@4] android_work: sent uevent USB_STATE=DISCONNECTED
[  715.911585]  715.911585@0] mtp_release
[  715.955573]  715.955573@1] binder: undelivered transaction 162772, process died.
[  716.028361]  716.028361@1] read descriptors
[  716.028375]  716.028375@1] read strings
[  716.030018]  716.030018@1] acc_alloc
[  716.057084]  716.057084@2] avc release, wq:ffffffc08e300800
[  716.057091]  716.057091@2] remove  encode_work_queue ffffffc08e300800 success, _destroy_encode_work_queue line 3724.
[  716.057302]  716.057302@1] the vdec            clock off, ref cnt: 0
[  716.057321]  716.057321@1] power off encode.
[  716.156640]  716.156640@0] USB RESET
[  716.276310]  716.276310@0] android_work: sent uevent USB_STATE=CONNECTED
[  716.279639]  716.279639@0] USB RESET
[  716.416654]  716.416654@0] configfs-gadget gadget: high-speed config #1: b
[  716.417035]  716.417035@0] android_work: sent uevent USB_STATE=CONFIGURED
[  716.464152]  716.464152@2] acc_open
[  716.464204]  716.464204@2] acc_release
[  716.464216]  716.464216@2] acc_open
[  716.464220]  716.464220@2] acc_release
[  716.505290]  716.505290@0] type=1400 audit(1610036671.447:339): avc: denied { call } for pid=2992 comm="surfaceflinger" scontext=u:r:surfaceflinger:s0 tcontext=u:r:mediacodec:s0 tclass=binder permissive=1 b/77924251
[  716.505329]  716.505329@0] type=1400 audit(1610036672.111:340): avc: denied { read } for pid=2992 comm="Binder:2992_4" name="gralloc.odroidn2.so" dev="mmcblk1p12" ino=549 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
[  716.505524]  716.505524@0] type=1400 audit(1610036672.111:340): avc: denied { read } for pid=2992 comm="Binder:2992_4" name="gralloc.odroidn2.so" dev="mmcblk1p12" ino=549 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
[  716.505545]  716.505545@0] type=1400 audit(1610036672.111:341): avc: denied { open } for pid=2992 comm="Binder:2992_4" path="/vendor/lib/hw/gralloc.odroidn2.so" dev="mmcblk1p12" ino=549 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
[  716.505728]  716.505728@0] type=1400 audit(1610036672.111:341): avc: denied { open } for pid=2992 comm="Binder:2992_4" path="/vendor/lib/hw/gralloc.odroidn2.so" dev="mmcblk1p12" ino=549 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
[  716.505751]  716.505751@0] type=1400 audit(1610036672.111:342): avc: denied { getattr } for pid=2992 comm="Binder:2992_4" path="/vendor/lib/hw/gralloc.odroidn2.so" dev="mmcblk1p12" ino=549 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
[  718.076125]  718.076125@0] usb device plug out, stop pcd!!!
[  718.076380]  718.076380@0] android_work: sent uevent USB_STATE=DISCONNECTED
[  718.299669]  718.299669@0] USB RESET
One thing I find curious is; Following https://dn.odroid.com/S922X/ODROID-N2/S ... 190117.pdf, I measured the "USBOTG_B_VBUS" pin on the "S905D2" USB Controller and it periodically goes down to 0V even though I have a constant 5V on VBUS when my device is connected.

I also verified that the the PWREN pin on the ODROID's RT9715EGB remained at 0V to make sure it wasn't sourcing any current (making sure it's not being turned into a Host by the device).

User avatar
odroid
Site Admin
Posts: 36468
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1451 times
Been thanked: 990 times
Contact:

Re: USB OTG Resetting

Post by odroid »

What happens if you connect the N2+ to your host PC via OTG interface?

jpboucher
Posts: 3
Joined: Thu Jan 14, 2021 6:00 am
languages_spoken: english
ODROIDs: ODROID N2+
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: USB OTG Resetting

Post by jpboucher »

Thanks for following this,

My PC doesn't have OTG support and the issue only seem to occur because two OTG devices are talking to eachother. I don't have any issue connecting the ODROID's OTG to the PC and then send ADB commands/debug/upload apps to the ODROID.
I bought a male OTG to male OTG cable that I will receive soon so I will be able to test it with my cellphone and see what happens.

User avatar
odroid
Site Admin
Posts: 36468
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1451 times
Been thanked: 990 times
Contact:

Re: USB OTG Resetting

Post by odroid »

If you already used the ADB interface with a micro-USB cable, the N2+ OTG port works fine.
N2+ OTG port <- micro-USB cable -> PC USB host.

Since we don't have the DJI device, it is hard to know what's wrong.
But, a couple of users reported the DJI devices worked after we implemented the AOAv1 protocol on C2 and N2 series.
viewtopic.php?p=265173#p265173
These users thanked the author odroid for the post:
jpboucher (Sat Jan 16, 2021 3:22 am)

jpboucher
Posts: 3
Joined: Thu Jan 14, 2021 6:00 am
languages_spoken: english
ODROIDs: ODROID N2+
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: USB OTG Resetting

Post by jpboucher »

Thanks a bunch! It works! I simply added these lines to /vendor/etc/init/hw/init.odroid.usb.rc and a reboot
on property:sys.usb.config=accessory && property:sys.usb.configfs=1
write /config/usb_gadget/g1/idProduct 0x2d00

on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/idProduct 0x2d01
It still does a few resets before hooking properly but I suspect that's because it tries the other configs in the file first (for mtp, adb, etc..) and resets after each of them fails.

Now all that's left is to figure out a way to automatically launch my .apk on boot and automatically accept permissions for access to the usb accessory... hmm..

Thanks again! :D
These users thanked the author jpboucher for the post:
odroid (Mon Jan 18, 2021 12:05 pm)

User avatar
odroid
Site Admin
Posts: 36468
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1451 times
Been thanked: 990 times
Contact:

Re: USB OTG Resetting

Post by odroid »

Thank you for the confirmation.
We will add it to the next Android updates for the N2 and C4.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 1 guest