[Q] Edit Android Kernel to speed up charging cable unplug response time - Galaxy Note 10.1 Q&A, Help & Troubleshooting

I can't ask this in the Original Development section, so I'm asking it here in the Q&A part, but if it's in the wrong place, feel free to move it.
I'm developing for the GT-N8010 and currently trying to modify the kernel to increase the time between a USB charging cable being unplugged and the system being notified/turning the screen on. Currently it takes about 2 second for the OS to determine the cable has been unplugged and pass this message to applications to use. I've checked in /sys/class/power_supply and found that it recognizes the USB cable being unplugged almost as soon as it is unplugged, so I'm wondering how I can a) speed up the detection by the OS or b) add the ability for a direct message to be sent to applications.
Thanks!

Related

HDMI and USB at same time

Hi,
Saturday I had some time to open the HDMI dock (for Galaxy Tab 7) and mod it to have alternative power input.
After that I was able to use the HDMI output and USB host at same time. The setup is:
- HDMI out for Samsung TV
- wireless USB keyboard
- external HDD connected with a powered HUB
In this setup I was able to use the keyboard and video files from external HDD while watching on TV screen.
The only problem is that the "MTP Application" notification is still there and the tablet is not full powered from external power supply, it discharges slowly the battery.
After some investigation I've seen that on the original charger there seems to be some resistors between USB lines and Vusb and GND. If I connect the original charger (not inserted on power outlet) the tablet is full powered and the MTP Application is not displayed (when I put the tablet in dock). After that if I remove the cable and insert the USB host cable everything is OK and tablet is full powered with USB host and HDMI working.
The docking is powered with 5V/2A PDA DC adapter.
When I'll open the dock again I will make some picture.
Your are welcome for questions and suggestions.
Emil
HOW MUCH?
Cant believe this is my first post on any message board EVER but what better reason! First i would like to know how much would u charge to make the modification for me? I would provide the dock and any other materials that u need of course. Secondly, since the dock works with ALL tab variants(PERSONALLY ONLY TESTED WITH P1000, P7100, P6200, P6210 BUT 99% CERTAIN), u might want to post your development in every other versions forum. I believe this would generate a LOT more interest in this project because there actually has already been a few threads created in which several attempts were made but no one could find the magic combo(plus it could mean a few extra bucks in your billfold!). I waited to post in hopes that u would update with pictures and/or a tutorial but still would rather you perform the actual surgery. Congratulations on accomplishing what samsung should have done from the start...a TRUE multimedia dock! I guess the only suggestion i could offer is if it were possible to actually add a few usb ports into the base of the hdmi dock itself, which is how i feel samsung should have made it originally...definitely not a priority.
Here are a few reference threads if interested & i've already provided a link in each one pointing to your original post for those interested (hope u dont mind!)
http://forum.xda-developers.com/showthread.php?t=1610832
http://forum.xda-developers.com/showthread.php?t=1155065
http://forum.xda-developers.com/showthread.php?t=1149442
Sorry, but I can't do this for you.... It's complicated.
Now I work to found a solution to put an USB connector on the dock and to put a power connector to.
The big problem is that the tab enters on MTP mod when powered this way. As described on other threads there is a way with USB lines to activate full external power.
When I'll have a full modification dock I'll put some pictures and instruction for that.
waiting for pics and further info please...
Galaxy Tab Dock modified
Now I have a full functional dock, modified.
So, after receiving the Galaxy Tab Plus media dock from ebay I've found that I can change the tab fixing part with the one on the old Galaxy Tab Dock.
So, now I have old Galaxy Tab multimedia dock full compatible with my Galaxy Tab Plus.
Then I modified the dock to include standard power jack and standard miniusb connector for OTG.
The USB Host is powered from the external power supply, this helps to not discharge the battery when using tab and slow charging.
I made some pictures with details for connections and modification.
You can view at:
http://www.flickr.com/photos/buzdumil/sets/72157630734690786
There was some work to do...is not very easy. The best thing that can be done is to make a PCB. That PCB, at in my pictures, could be fixed near metal weight. Also there the clips of the case need to be cut, but there is no problem because at same position exist screws for fixing.
The problem with MTP application started when power connected or tab inserted on dock remains. But now is easier to use external HDD, usb keyboard & mouse and television to watch movies.
That's amazing, Emil! That's the dock accessory Samsung should have sold in the first place. After looking over your pictures, I'm ready to go order a soldering iron and get to work!
Hi emil b just letting you know i was playing around with my dock and found how to get rid of the red x from when power is applyd.
First connect power and get red x....
Then disconect the earth and re connect it again..
This forces AC Charge mode...
No resisters or shorting data lines are needed..
So good for being in host mode...
All you need to do is put a on/off switch inline on the earth
Where you supplied power to the dock.
Doesnt need to be inside the dock..
Give it a try and let me know...
Just have to play with it and hit switch a couple of times...
Im looking at all options concerning the modification of this dock. One question that comes to mind is: If I only use the red and blackwires to send power to the USB connector, will I still be able to use the OEM 30 power connector??
OP, I am going to attempt to make this modification myself. Would you be able to provide any additional instructions/suggestions to the pictures up on Flickr?
Thanks,
cypher
mr_esmit said:
Im looking at all options concerning the modification of this dock. One question that comes to mind is: If I only use the red and blackwires to send power to the USB connector, will I still be able to use the OEM 30 power connector??
Click to expand...
Click to collapse
No because the origonal charger has the resisters on the data lines...
you are better to add just power to pin 7(9) and earth to pin (1)30..
then add a otg dongle..

S2 nable to shut down while connected to power - Unable to Copy From USB Mass Storage

***SOLVED****I have a Samsung Galaxy Skyrocket 2 SGH-I727, rooted on gb 2.3.5. It has been working flawlesly for months. All of a sudden, when I connected the device to power I was UNABLE to shut it down. I would slelect shut down and it would REBOOT itself instead of staying shut down and showing the BATTTERY ICON charging. Also suddenly I could not access the device as a mass storage from windows. Windows would say device not recognized. After researching for hours I came across one idea the did the trick. The problem was simple. The USB connector "tongue" inside the USB adapter in the phone apparently got bent somehow. This precented the USB cable connecting in from making contact with all the wires inside and THAT caused the 2 problems mentioned in the title. I took a very thin micro flat head screwdriver, GENTLY CAREFULLY put a little pressure on the USB tongue inside the phone's USB adapter and voila!...I could shut down the phone while connected to power, Windows again regognized the device. Who wold have thunk it?
For any of you who come across this, and I saw MANY MANY, not only for GS2 but for MANY andriod devices, and many failed "solutions", here is the answer!...
Have fun.
I think I have a similar problem.
Until two weeks phone was working perfectly fine. Then realized that the battery was getting drained in about 4-6 hours even when idle with no apps running, sometimes battery charge dropped like 15% in a moment, it didn’t indicate charging when connected to power though battery got charged and sometimes it indicated as charging when not connected to power. Phone could not be detected when connected to PC. Also, if I connected to PC after shutting it down, it automatically rebooted. This was weird.
Then when battery was fully dead and I connected to power, it tried to boot but immediately shutdown saying ‘low battery’ and again tried to boot… it was stuck in this loop.
I thought it might be android issue so flashed it with UCKK6 Kernel + Rooted System Package ((Thanks to creepyncrawly’s Download Repository)
But now, it still is not detected by the PC. It boots automatically when connected to PC after shutting down, but not when connected to wall power.
Cleaned the micro USB connecter, tried different cables and laptops.
Earlier Android: Version 2.3.6; Baseboard Version I777UCKK6; Kernel Version 2.6.35.7
After Flashing: Version 2.3.6; Baseboard Version I777UCKK6; Kernel Version 2.6.35.7
Pls I I tried to flash cm rom 12.1 on sgh 1727 skyrocket and it stuck on patching system image unconditionally n it stays there forever please what can I do?

[Completed] Charging Problems!

The problem started a few days after flashingMegbyte Kernel r_4 on top of RR 5.5.8 on my 1.5 year old Moto X.
Here's what i did and what happened after that-:
-Kernel Auditor->Battery-> Enabled "Fast Charging over USB"->Apply on boot (Wasn't available in stock Kernel)
- Worked fine for a day or so
-Phone starts to misbehave. I plugged the usb cable, but it used to take a few seconds for actually start charging
-The ROM becomes unstable
-I switched off my phone and plugged the charger. The motorola "Bootloader Unlocked" warning shows up. It shows that big battery indicator, but then switches off automatically.The process repeats and this keeps happening until i don't unplug the charger or force boot.
-Meanwhile, when my phone is turned on, and i plug in the charger, sometimes it shows the charging indication in statues bar, but when i got Settings-> Battery, it shows that it isn't charging.(Can't post any link to screenshot yet ._.)
-Sometimes, when i plugged in the charger, the phone didn't show any indication or charged
(MY CABLE AND CHARGER IS COMPLETELY FINE. USED ON OTHER PHONES)
-I thought it was the ROM's fault, so i flashed CM 12.1
-I am on CM now and still facing the problem
-I've tried callibrating the battery, no luck!
-My computer detects that theres a device when my phone is connected via USB, but cant detect what device it is. I've downloaded Motorola USB drivers. The computer did detect which device i was using but only for a minute or so.
I am in need of help and your help would be appreciated! :]
I_Will_Build_Roms said:
The problem started a few days after flashingMegbyte Kernel r_4 on top of RR 5.5.8 on my 1.5 year old Moto X.
Here's what i did and what happened after that-:
-Kernel Auditor->Battery-> Enabled "Fast Charging over USB"->Apply on boot (Wasn't available in stock Kernel)
- Worked fine for a day or so
-Phone starts to misbehave. I plugged the usb cable, but it used to take a few seconds for actually start charging
-The ROM becomes unstable
-I switched off my phone and plugged the charger. The motorola "Bootloader Unlocked" warning shows up. It shows that big battery indicator, but then switches off automatically.The process repeats and this keeps happening until i don't unplug the charger or force boot.
-Meanwhile, when my phone is turned on, and i plug in the charger, sometimes it shows the charging indication in statues bar, but when i got Settings-> Battery, it shows that it isn't charging.(Can't post any link to screenshot yet ._.)
-Sometimes, when i plugged in the charger, the phone didn't show any indication or charged
(MY CABLE AND CHARGER IS COMPLETELY FINE. USED ON OTHER PHONES)
-I thought it was the ROM's fault, so i flashed CM 12.1
-I am on CM now and still facing the problem
-I've tried callibrating the battery, no luck!
-My computer detects that theres a device when my phone is connected via USB, but cant detect what device it is. I've downloaded Motorola USB drivers. The computer did detect which device i was using but only for a minute or so.
I am in need of help and your help would be appreciated! :]
Click to expand...
Click to collapse
Greetings,
Thank you for using XDA Assist. Please ask in your device's Q&A forum:
X 2014 Q&A, Help & Troubleshooting
Good luck!

Unable to connect to PC in any mode

Hi all, I'm afraid I already know the answer to my question but I'll still ask if there's even a slight chance to get this fixed on my own.
I had this issue on Android 8.1 where my Pixel kept saying "Supplying power to connected device via USB" even without anything connected to it, (it started doing that one day without any reason) tapping the notification allowed me to switch to "Charge this device" and then turn on MTP mode, battery life was terrible but I wasn't that much bothered by it because I am an Android developer so I kept it connected in USB Debugging mode most of the time anyway.
When I got the notification for Android 9 update I decided to update hoping it'd fix the USB issue but after the update it now always says "Charging connected device" and tapping the notification does bring up the "USB Preference" screen and it allows me to switch to "USB Controlled by this device" and it starts charging but there's no way to switch "Charge only" mode to anything else, ADB does not see it, fastboot does not see it and there's no persistent notification on the phone about it being connected via USB at this point (in any mode). My understanding is that this is a hardware issue but Oreo still allowed me to workaround this and get the USB debugging connected.
Is there anyway I can get back to Oreo without using fastboot flash or any other solution to this?
Thanks for reading.
PS. I'm on Ubuntu but I can access a Windows machine if required and bootloader is already unlocked.
I'm curious if you're able to connect to a USB OTG storage device.
I'm having this issue connecting it to my windows 10 laptop.. the cable recognizes it.. starts charging.. shows option on phone to change type of connection.. but not matter which one i change it too, the computer will not pull lit up as a drive to see the files..
Jaws4God said:
I'm having this issue connecting it to my windows 10 laptop.. the cable recognizes it.. starts charging.. shows option on phone to change type of connection.. but not matter which one i change it too, the computer will not pull lit up as a drive to see the files..
Click to expand...
Click to collapse
Same here! I plug the cable into the Windows 10 computer, I even can change the mode from charging to MTP file transfer, but the device won't show up in the Windows Explorer. It appears under connected devices though.
My Pixel 2 XL would not connect to PC for file browsing if USB debugging of Android Apps was enabled in developer settings. Didn't matter which option I chose to connect. IDK if that is expected or not, but it took me a while to figure out. Happened Spring 2018, idk if Google fixed it.
pyro226 said:
My Pixel 2 XL would not connect to PC for file browsing if USB debugging of Android Apps was enabled in developer settings. Didn't matter which option I chose to connect. IDK if that is expected or not, but it took me a while to figure out. Happened Spring 2018, idk if Google fixed it.
Click to expand...
Click to collapse
I don't think i've tried to turn that mode off.. i'm so used to needing it on for the computer to recognize and connect to all my previous Android Devices.. thanks for the recommendation...
post-mortem said:
I'm curious if you're able to connect to a USB OTG storage device.
Click to expand...
Click to collapse
Couldn't find any OTG cable to try that but strangely enough a few days back I connected it to PC for charging and Nautilus popped up, same cable, same USB port and it started working all of sudden. Did verify with a couple of other cables and different ports and everything is working fine since.
"Charging connected device" notification never appeared again, only thing different (when it started working again) was that I was out of the air conditioned room most of those days, might it be moisture or something like that?
I'm back to my normal routine for a few days now and it's still 100% normal, will have to see if it stays that way.
Sorry for late response.
Here's an update in case someone else runs into this situation, I can say this with 99% certainty that is caused by the blackish residue build-up around the USB port over time. It's not too much that it's visible just by looking into the port but it's enough to make the device behave like this.
Here's what I did to get rid of it, took a match stick (don't use anything metal) and broke it in half making a sharp edge on both broken pieces, took the non coated piece and inserted sharp edge in the bottom side of the port and gently wiggled it around while applying some pressure towards the connector (just a little bit, make sure you don't break anything), did this for about 45 seconds then took out the match stick and the part that was touching the connector had turned blackish (I guess this is when you know you have 'cleaned' it enough?), repeated the same process on the top side of the port with a new match stick piece (guess you can use the same one after cleaning it with a tissue), the only difference was that this time applied the pressure in opposite side (other side of connector), device was on during all this time.
It builds up again after a while (~3 months) so I had to repeat the entire process again when it started doing that again at the start of December but it wasn't that annoying this time because I knew exactly what was wrong and how to get rid of it, device is still working fine 100%.
I'm simply sharing my experience and not encouraging anyone to do this but if you do decide to try this be sure not to use anything metal and don't break the connector inside the port (turning the device off would be a good idea too) and you'll be fine and if something does go wrong I won't be responsible.

[CLOSED] Can I disable pop up USB notifications?

Hi all, sorry if this thread is in the wrong place, but not sure where I'd actually put it, so feel free to move it to the correct forum if needed.
Basically I've got an android head unit in my car which claims to be running android 10 (the unit is a PX5 I think), and have multipe USB connections which allow me to plug in a memory stick to transfer MP3's onto the inbuilt storage, plug in a USB DAB radio receiver, or an OBD adapter, TPMS, etc. Problem is these devices are to be left plugged in permanently, and whenever I start the car I get a pop up notification asking if a device should be the default adapter for a specific app, etc. I've attached a photo to show the type of pop up I mean. There's an option to make it the default, which it doesn't want to be otherwise none of the adapters work with their respective apps, but there is no option to say no and never ask again? So it asks every single time I start the car. Is there a simple way I can stop this pop up from appearing? If I cancel the prompt, all works fine with each adapter and app, but I'm sick of having to cancel it every single time. No idea if the stereo is already rooted or not, so not sure if that would hinder me.
Does anyone have any ideas? Thanks.
StuartTheFish said:
Hi all, sorry if this thread is in the wrong place, but not sure where I'd actually put it, so feel free to move it to the correct forum if needed.
Basically I've got an android head unit in my car which claims to be running android 10 (the unit is a PX5 I think), and have multipe USB connections which allow me to plug in a memory stick to transfer MP3's onto the inbuilt storage, plug in a USB DAB radio receiver, or an OBD adapter, TPMS, etc. Problem is these devices are to be left plugged in permanently, and whenever I start the car I get a pop up notification asking if a device should be the default adapter for a specific app, etc. I've attached a photo to show the type of pop up I mean. There's an option to make it the default, which it doesn't want to be otherwise none of the adapters work with their respective apps, but there is no option to say no and never ask again? So it asks every single time I start the car. Is there a simple way I can stopp this pop up from appearing? If I cancel the prompt, all works fine with each adapter and app, but I'm sick of having to cancel it every single time. No idea if the stereo is already rooted or not, so not sure if that would hinder me.
Click to expand...
Click to collapse
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Categories

Resources