-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phone crashes (RESTARTS) After changing to keyboard and plugging in #4
Comments
How to replicate ? (Version 0.2 (latest))
|
I have the same issue. I am running on a Pixel 2; I have experienced this with (rooted) stock 10 and Lineage 17.1 I would be very interested in actively helping resolve this issue but I don't really know where to start. Here is the log; I just open the app, deactivate, and add the kb&m. `ROOT - Execute command: for dir in /config/usb_gadget//; do echo GADGET_PATH=$dir; cd $dir; if [ "$?" -ne "0" ]; then echo "Error - not able to change dir to $dir... exit"; exit 1; fi; echo UDC=$(cat UDC); find ./configs/ -type l -exec sh -c 'echo FUNCTIONS_ACTIVE=$(basename $(readlink "$@"))' _ {} ;; for f in ./functions//; do echo FUNCTIONS=$(basename ROOT (stdout) - GADGET_PATH=/config/usb_gadget/g1/
|
Thanks a lot! I will have a look into it later today. |
Do you have a terminal app (like termux) installed on your phone? If yes, can you execute following command and provide the output? Thanks
|
|
@kstuddard @yoyo00xx |
The keyboard gadget never appears for me to click "activate." There is only the /config/usb_gadget/g1/ gadget which I can activate or deactivate. I have tried selecting "mouse+keyboard.sh" with g1 already activated and deactivated, with no difference in outcome. Nothing I can do from the app seems to create the new gadgets appear in the app or make a difference in the outcome of |
@kstuddard What will happen if you do the same without deactivating the standard gadget? Will the phone freeze again? And can you try to create a folder "/config/usb_gadget/keyboard" manually (e.g. over a root shell) and check if there is any error (e.g. selinux) in logcat/dmesg due to this? Thanks a lot for your help to debug this issue! |
from shell in the phone, running mkdir /config/usb_gadget/keyboard returns I was working on a flowchart/table of sorts to see exactly when the crash occurs. My next set to test was having DG enabled already, having ran KB+M, and then plugging the phone in. After plugging the phone in the phone did not crash, but then I deactivated DG and the phone did crash. At this point it appeared to also fry the USB port on my laptop, so I am not going to continue this line of testing . I did save logcats from this testing, but some of the earlier ones were done over USB before I realized how much more practical ADB over wifi would be while testing USB stuff. I also don't spend a lot of time in logcat so I am unsure how safe it is to just publish the contents. In the latter files I also tried to run
I failed to get any useful dmesg's at all. |
Hi, I am also using the same methods in a rooted Cubot King Kong Mini phone and the mkdir keyboard command fails with Out of Memory and the phone resets! Looking for a solution to this problem I came up with your project (good) and this discussion. Seriously if you want I can give you access to a station with the phone connected and an adb shell for a debug session (but not a pizza ... Sorry!) |
|
Currently I see two issues which I need to verify if they are related or not:
@yoyo00xx @SV133U @kstuddard |
Hi! No LineageOS. To root the phone I followed the XDA guide and installed the AOSP 9 SU version already rooted. The kernel is version 4.9.117+ |
Hi @tejado, i'm working with @SV133U with the Cubot king kong mini. Here's a detailed explanation of what i did on the device and also the kernel log attached: following this guide: https://forum.xda-developers.com/general/rooting-roms/installing-custom-rom-cubot-kingkong-t4050815 -Unlocked oem (in device setting) Everything is fine, device is rooted, recovery is still there and working (twrp) and aosp 9 works fine. When i try to create a folder inside /config/usb_gadget/ i receive: If i disable the g1 gadget (utilising the usb_gadget app) and then plug in the phone nothing happends (no freeze). Kernel log attached [UPDATE] I installed various versions of lineage os (16 and 17), they both work fine but i couln't root them in any way. I installed AOSP 10 and rooted it, but i have the same "out of memory" problem as for AOSP 9. |
Same for me. LineageOS 17.1 Samsung A40. "Out of memory" problem, also tried applying kernel patch, no good, no hdg device created. Upd: Just do not create another gadget. Add a hid function to an existing one, add some directories, echo some numbers and bam, it works, no need to create another if you can not. Please, add this feature to an app. |
@freeman1216 If anyone would like to still debug the "out of memory" issue, maybe it will help to strace the directory creation (strace bins can be found on the internet, e.g. https://github.com/ipduh/strace/tree/master/binaries ) By the way: My kernel is 4.9 and there it is working. |
In v0.3 you can add functions to existing gadgets. |
Additionally: I had some time to analyze the issue. It seems that on specific kernel versions, the internal device is created by configfs always as "android0". Adding further gadgets is not possible as android0 already exists. So please try to add Mouse/Keyboard functions to the existing gadget, as @freeman1216 described. This is now possible with android-usb-gadget v0.3. References: |
it did not crash and it added the functions but i was not able to test it. For example Rucky does not detect USB gadget. If you could provide me with the linux commands I can test in the shell if I can send keystrokes it would be great @tejado |
Same here, adding the functions is working, no crashes. Another point is: how should the hid-gadget-test be used? Because the "usage print" in the terminal says one way of utilizing it and the README in the github page says another way. |
I have the same issue and currently check what options are there. The issue is basically inside the kernel... few are working well but a lot of other vendor kernels are not. Depending on the patch level... :/ @Jollastro |
The tool i'm talking about is linked in your use-cases (https://github.com/pelya/android-keyboard-gadget). I'm trying to use it to send keystrokes to the pc with the smartphone but i can't find the device path inside the /dev folder. |
If /dev/hid* devices are not present, the function is not active. See dmesg (e.g. run dmesg -w parallel) during adding the function, activating the gadget and so on for more information. There you see the kernel messages which gives some information why it fails. |
|
Doesn't work for me, usb keyboard app still doesn't work after this, also, after reboot, these folders are getting deleted |
What happened after creating directory... |
My kernal is linage kernal: 4.4
My phone is: HTC U11
I am rooted
Android 10
The text was updated successfully, but these errors were encountered: