pelya / android-keyboard-gadget

Convert your Android device into USB keyboard/mouse, control your PC from your Android device remotely, including BIOS/bootloader.
Apache License 2.0
1.22k stars 308 forks source link

kernel-3.4-patch for lollypop-kernel doesn't work fine #16

Closed ajmtrz closed 9 years ago

ajmtrz commented 9 years ago

when connect usb sometimes to windows pc android-lollypop-kernel crash forever, don't fix it when android reboot. in kitkat works fine... :S

pelya commented 9 years ago

I cannot fix that without your kernel and your device. What does /proc/last_kmsg say? On Nov 17, 2014 3:08 AM, "Antonio Jesús" notifications@github.com wrote:

when connect usb sometimes to windows pc android-lollypop-kernel crash forever, don't fix it when android reboot. in kitkat works fine... :S

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/16.

ajmtrz commented 9 years ago

As soon as i can i upload you my kmsg log

ajmtrz commented 9 years ago

kmsg:

<4>[ 171.458092] type=1400 audit(1416595314.284:101): avc: denied { read write } for pid=4660 comm="GLThread" name="hidg0" dev="tmpfs" ino=24242 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:device:s0 tclass=chr_file <4>[ 171.458481] type=1400 audit(1416595314.284:102): avc: denied { open } for pid=4660 comm="GLThread" name="hidg0" dev="tmpfs" ino=24242 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:device:s0 tclass=chr_file With Supersu 2.17 installed. I have tried it to work with /dev/hidg\* root:root chown and system:system and nothing, with both this kernel message.
pelya commented 9 years ago

So, the kernel crashes, or USB Keyboard app crashes? The app does not work with Lollipop yet, I am working on a fix.

On Fri, Nov 21, 2014 at 8:46 PM, Antonio Jesús notifications@github.com wrote:

kmsg:

[ 171.458092] type=1400 audit(1416595314.284:101): avc: denied { read write } for pid=4660 comm="GLThread" name="hidg0" dev="tmpfs" ino=24242 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:device:s0 tclass=chr_file [ 171.458481] type=1400 audit(1416595314.284:102): avc: denied { open } for pid=4660 comm="GLThread" name="hidg0" dev="tmpfs" ino=24242 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:device:s0 tclass=chr_file

But i have installed supersu 2.17 and work fine. I have tried it to work with /dev/hidg* root:root chown and system:system and nothing, with both this kernel message.

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/16#issuecomment-64017442 .

ajmtrz commented 9 years ago

When I plug in Linux the app and /dev/hidg* devices works fine, but when I plug in Windows:

First: Previous error

Second: Kernel Crash with this message:

<4>[ 1067.599186] ------------[ cut here ]------------ <4>[ 1067.599261] WARNING: at drivers/usb/dwc3/gadget.c:726 dwc3_gadget_ep_disable+0xf0/0x130() <4>[ 1067.599375] Device dwc3 <4>[ 1067.599377] ep2in is already disabled <4>[ 1067.599556] Modules linked in: <4>[ 1067.599693] [](unwind_backtrace+0x0/0x140) from [](dump_stack+0x20/0x24) <4>[ 1067.599822] [](dump_stack+0x20/0x24) from [](warn_slowpath_common+0x64/0x74) <4>[ 1067.599944] [](warn_slowpath_common+0x64/0x74) from [](warn_slowpath_fmt+0x40/0x48) <4>[ 1067.600015] [](warn_slowpath_fmt+0x40/0x48) from [](dwc3_gadget_ep_disable+0xf0/0x130) <4>[ 1067.600164] [](dwc3_gadget_ep_disable+0xf0/0x130) from [](hidg_unbind+0xac/0x118) <4>[ 1067.600311] [](hidg_unbind+0xac/0x118) from [](unbind_config+0xbc/0x11c) <4>[ 1067.600452] [](unbind_config+0xbc/0x11c) from [](usb_remove_config+0x84/0xb8) <4>[ 1067.600574] [](usb_remove_config+0x84/0xb8) from [](android_disable+0x7c/0x90) <4>[ 1067.600695] [](android_disable+0x7c/0x90) from [](enable_store+0x1b8/0x26c) <4>[ 1067.600774] [](enable_store+0x1b8/0x26c) from [](dev_attr_store+0x28/0x34) <4>[ 1067.600901] [](dev_attr_store+0x28/0x34) from [](sysfs_write_file+0x170/0x1a0) <4>[ 1067.601028] [](sysfs_write_file+0x170/0x1a0) from [](vfs_write+0xac/0x158) <4>[ 1067.601150] [](vfs_write+0xac/0x158) from [](sys_write+0x48/0x88) <4>[ 1067.601224] [](sys_write+0x48/0x88) from [](ret_fast_syscall+0x0/0x30) <4>[ 1067.601343] ---[ end trace 94dc221dd068b59a ]--- <6>[ 1067.601463] hidg_unbind: destroying device de15d300
pelya commented 9 years ago

I see. What device is that? On Nov 21, 2014 9:07 PM, "Antonio Jesús" notifications@github.com wrote:

When I plug in Linux the app and /dev/hidg* devices works fine, but when I plug in Windows:

First: Previous error

Second: Kernel Crash with this message:

[ 1067.599186] ------------[ cut here ]------------ [ 1067.599261] WARNING: at drivers/usb/dwc3/gadget.c:726 dwc3_gadget_ep_disable+0xf0/0x130() [ 1067.599375] Device dwc3 [ 1067.599377] ep2in is already disabled [ 1067.599556] Modules linked in: [ 1067.599693] http://unwind_backtrace+0x0/0x140 from http://dump_stack+0x20/0x24 [ 1067.599822] http://dump_stack+0x20/0x24 from http://warn_slowpath_common+0x64/0x74 [ 1067.599944] http://warn_slowpath_common+0x64/0x74 from http://warn_slowpath_fmt+0x40/0x48 [ 1067.600015] http://warn_slowpath_fmt+0x40/0x48 from http://dwc3_gadget_ep_disable+0xf0/0x130 [ 1067.600164] http://dwc3_gadget_ep_disable+0xf0/0x130 from http://hidg_unbind+0xac/0x118 [ 1067.600311] http://hidg_unbind+0xac/0x118 from http://unbind_config+0xbc/0x11c [ 1067.600452] http://unbind_config+0xbc/0x11c from http://usb_remove_config+0x84/0xb8 [ 1067.600574] http://usb_remove_config+0x84/0xb8 from http://android_disable+0x7c/0x90 [ 1067.600695] http://android_disable+0x7c/0x90 from http://enable_store+0x1b8/0x26c [ 1067.600774] http://enable_store+0x1b8/0x26c from http://dev_attr_store+0x28/0x34 [ 1067.600901] http://dev_attr_store+0x28/0x34 from http://sysfs_write_file+0x170/0x1a0 [ 1067.601028] http://sysfs_write_file+0x170/0x1a0 from http://vfs_write+0xac/0x158 [ 1067.601150] http://vfs_write+0xac/0x158 from http://sys_write+0x48/0x88 [ 1067.601224] http://sys_write+0x48/0x88 from http://ret_fast_syscall+0x0/0x30 [ 1067.601343] ---[ end trace 94dc221dd068b59a ]--- [ 1067.601463] hidg_unbind: destroying device de15d300

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/16#issuecomment-64021545 .

ajmtrz commented 9 years ago

Nexus 5 with Android 5.0 (lollipop) with this kernel https://github.com/binkybear/kernel_msm.git android-msm-hammerhead-3.4-lollipop-release branch with your patch

pelya commented 9 years ago

I will test my patch on Nexus 7 2012 with Lollipop, but most probably it will work on Nexus 7. And I don't have Nexus 5.

On Fri, Nov 21, 2014 at 9:13 PM, Antonio Jesús notifications@github.com wrote:

Nexus 5 with this kernel https://github.com/binkybear/kernel_msm.git android-msm-hammerhead-3.4-lollipop-release with your patch

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-keyboard-gadget/issues/16#issuecomment-64022308 .

ajmtrz commented 9 years ago

Ok. I waitting for you.

binkybear commented 9 years ago

@discipuloosho - I can confirm the hid patch still works on the Nexus 5 (with updated hid-keyboard). Unsure if you've tested.

ajmtrz commented 9 years ago

No @Binkybear , when plug in windows, kernel crash, in Linux no problem. Tested several times with many windows (7).

binkybear commented 9 years ago

@discipuloosho - I just saw your email. I only tested on OSX so that's good to know about the Windows problem. Sorry for clogging up this issue!

pelya commented 9 years ago

I've updated Nexus 7 2012 kernel to Lollipop version, and it works fine with Windows. So I don't know how to reproduce or fix this crash.

ajmtrz commented 9 years ago

Thanks Pelya, i don't know too, something happens. i will investigate ... :)

ajmtrz commented 9 years ago

For this problem does not appear is necessary connect nexus device as mtp or ptp usb mode, else kernel crash and disappear /dev/hidg* interfaces.