-
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
Not working on Samsung S10 5G HID gadget #36
Comments
Hi @himekifee, In regard to further information: have a look into the system log (run logcat under root) during the time of enabling the gadget manually and auto-disabling. We might see there something related to it which helps to debug that. I tried to understand that behaviour on an old Samsung phone few years ago but never came to any conclusion as it was very very time consuming and my lack of knowledge about the gadget system in the kernel. |
I was also able to add the |
From what I can see there is no 0x409 dir in strings
There is one under normal gadget
Could it be the kernel thing that is fixed later as the above one? |
I'm able to progress till I write
However, there are dirs under
|
Here is the line of code which is reporting this error: https://github.com/corsicanu/android_kernel_samsung_universal9820/blob/7c38bfbe048f6b894b3f68d9bc7495399f0b0c87/drivers/usb/gadget/udc/core.c#L1353 EDIT: The return code also matches -EINVAL (-22). I remember that I was 1-2 years ago at the same step but were not able to figure out the cause. |
This happens with exynos versions with 4.x kernels and up, as far as i know the cause of this problem is a device blobs, which prevents the creation of hidg* functions in the system. to solve this problem we need to create a config with usb controller model used on current device, we can use it as magisk module or so but sadly i don't know the method, i can only get the init file from device tree, This information was taken from a friend of mine @Tkpointz. |
What does this mean? |
a config like the normal init config |
A config or a gadget? So you are saying it needs to like the default one (g1)? And if it is a config, should it be in a separate gadget or in the default one? |
Nah i meant init config like nethunter.blabla |
Sorry, dont understand what you mean. The USB init config (init.usb.rc) which basically configures the USB Gadget according to the system settings writes to configFS like android-usb-gadget does. |
You are absolutely right, but the difference here is that modified config will be based on device init config like samsung a30s |
Thanks, I will try it - but currently, it is no priority and I general recommend Pixel phones for this. |
Actually this is not a solution because i said earlier that i don't know how to create a custom config based on stock one, just got info about it. About this problem, the only solution right now is to get an Exynos device with 3.x kernel version or snapragon version which works without problems, i have two samsung devices with snap chipset a70 and note 20 ultra and hid working like a charm |
I've used this lovely tool on another more recent Samsung device and that did work. However, on this relatively old device, it does not work due to #12 at first. It did not create the HID gadget profile as that out of memory popped out. Fortunately, following your discussion on how later android kernel source fixed that issue also works for me. I added
static int gadget_index
in the beginning and changeddevice = device_create(android_class, NULL, MKDEV(0, 0), NULL, "android0");
todevice = device_create(android_class, NULL, MKDEV(0, 0), NULL, "android%d", gadget_index++);
. After that, I'm able to create a gadget as shown.However, when I click on that enable button, it goes back to the disabled state automatically within 2 secs and no hidg endpoints get created. I didn't really find useful info in logs.
May you give me some advice, please? I kinda need a solution as my machine is still down, and I don't have a keyboard...
The text was updated successfully, but these errors were encountered: