FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[Q] USB Masst Storage ? UMS ...

255 posts
Thanks Meter: 45
 
By doublehp, Senior Member on 28th June 2014, 04:54 PM
Post Reply Email Thread
3rd July 2014, 01:54 AM |#11  
Captain_Throwback's Avatar
Senior Member
Flag Bensalem, PA
Thanks Meter: 22,616
 
10
Donate to Me
More
Quote:
Originally Posted by doublehp

Ah !!! VALUES !!!
Andro 4.4.2, same.
kernel 3.4.0-g0c47a10, root@abm022 #1, SMP PREEMPT, you probably forgot the last part, or used a tool that does not provide it.
I don't have HW version in my phone (this is probably my ROM) - I know what it looks like, I had it on my previous phone. The thing that most looks like your HW version has for me the value "002"
ROM 1.54.1020.10 CL325784

Before update, I had ROM 1.54.1020.5

So, we do not have the same hardware (my HW is ver 01 or 002), and ... completely different ROM.

Would need you exact kernel version. If we have the same kernel, and your phone can do UMS, then, it's just a matter of messing stuff in /system (the two guilines I wuoted above may work). If we do not have the same kernel ... I won't even try those tricks: my kernel probably can't do it.

If TWRP is available from sources ... I will ask a friend to rebuild it for me ... including the stuff required for UMS (he can do it, 100% certain). Once he does the kernel, the rest is peace of cake in a recovery ROM.

Don't flash again. Just give me your kernel version. If the kernel is the same for your two ROMs, then, your two roms can have UMS; just a matter of tweaking the right things at the right place; in short, find the APK or system script that handles it, and copy it to the other ROM.

I would be interessed in downloading your two ROMs. Especially if one can do UMS, but not the other one. Whether they share the same kernel or not. I just don't know if I would have the patience to push them in my phone to see things by myself; but if I took the time, I may be able to extract the relevant bit of code, and try to copy it to my ROM. Issue is that I have only one phone; and it would mean ... spending 2 days on it, and not be able to use GSM at all for 2 or 3 days (no phone, no SMS). It would be interesting, but I am not sure I would really take time and efforts to do it.



---------- Post added at 07:54 PM ---------- Previous post was at 07:37 PM ----------

The kernel source for this is available on HTCDev, as it is with all the M8 variants. None of the kernels (as-is) will get UMS working in recovery, though.

The Sprint variant uses a different defconfig than the GSM version, so perhaps whatever is different between the two is what is making the difference. It's also possibly a userspace difference, since the CDMA carriers like/need to customize the ROM a bit more for everything to work.

I'm just surprised that not all of the M8 Sense ROMs include the Disk Drive option.
 
 
3rd July 2014, 01:58 AM |#12  
OP Senior Member
Thanks Meter: 45
 
More
Quote:
Originally Posted by DeathmonkeyGTX

Sir, if you can figure out how to get ums on gpe m8 I'll give you twenty bucks, maybe more depending on my mood.

Sent from my HTC One_M8 using XDA Premium 4 mobile app

I have asked Galoula ( https://play.google.com/store/apps/developer?id=Galoula ) if he can help us. Explaind him what I think about the topic. The easiest way, to me, is to take TWRP from sources, and rebuild kernel, adding the required symbols; TWRP being a recovery, the rest should be peace of cake. It's small, and actions have low impact; in a recovery, if things break, you see it at once; there are no 32th level side effects you discover 6 months later. Yes, requires reboot; that's acceptable to me. I prefer fixing this in few days of work, and keep my ROM as is, rather than spending weeks or months tracking side effects of messing MTP in /system.

Galoula is busy for now; may take 2 or 3 weeks before he rebuilds TWRP.

The aim of recovery is to flash /system. I can't see how re-adding UMS to TWRP could possibly break flashing /system; it may break other things; but I really don't mind. It would break more things if we try to fix /system. So, if I bring you a new TWRP, it's Galoula you shall thank. He is going to do the dirty work.
3rd July 2014, 02:08 AM |#13  
OP Senior Member
Thanks Meter: 45
 
More
Quote:
Originally Posted by Captain_Throwback

The kernel source for this is available on HTCDev, as it is with all the M8 variants. None of the kernels will get UMS working in recovery, though.

The Sprint variant uses a different defconfig than the GSM version, so perhaps whatever is different between the two is what is making the difference. It's also possibly a userspace difference, since the CDMA carriers like/need to customize the ROM a bit more for everything to work.

I'm just surprised that not all of the M8 Sense ROMs include the Disk Drive option.

UMS used to work in recovery in my previous phone (htc sensation, stock with android 2.2). Why do you think it could not work in recovery for M8 ?

Very interesting screens; mine is completely different. I don't think any one is interessed in detailed screenshots from a non working phone.

If you say that both yours, and my kernels can be downloaded from HTC ... *with the conf*, then I will have a look. But build will be done by Galoula anyway.
3rd July 2014, 02:09 AM |#14  
Captain_Throwback's Avatar
Senior Member
Flag Bensalem, PA
Thanks Meter: 22,616
 
10
Donate to Me
More
P.S. The reason UMS works on one of my ROMs and not the other is because one is Sense and the other is not. The AOSP code got rid of UMS a while ago, but HTC preserved it (at least for Sprint) in Sense.
3rd July 2014, 04:01 AM |#15  
DeathmonkeyGTX's Avatar
Senior Member
Flag Little Rock, AR
Thanks Meter: 597
 
More
Gpe isn't aosp so I had some hope. My m8 is a gpe from the play store, not a rom or ruu. Even if it just worked in a version of twrp that would be fine, it's rare when I need ums but often enough to where I'd gleefully spend $20 on it.

Sent from my HTC One_M8 using XDA Premium 4 mobile app
3rd July 2014, 09:25 AM |#16  
Senior Member
Flag Bristol
Thanks Meter: 59
 
More
In case any of you is interested taking a look, I think the apk which is responsible for MTP and UMS is MediaProvider.apk

Sent from my HTC One_M8 using XDA Premium 4 mobile app
10th July 2014, 01:27 AM |#17  
OP Senior Member
Thanks Meter: 45
 
More
Hello. I have a semi good news.

My view of the world changed tonight.

I received a message from andreasyeah telling me to try https://play.google.com/store/apps/d...ivedroid&hl=en ... and it's amazing. He also recommends to use ElementalX kernel.

First, what UMS was for me untill yesterday ? Use my phone as SD to USB card adapter, and, make my PC able to read and write on SD, as if SD was in a legacy USB card reader. Plug phone, android unmounts sd, and pushes SD to USB, and PC can mount the SD, and do whatever it wants to it.

Whatever used to include .. repartition, reformat, and, some some of my friends like Galoula ... install a MBR on SD, so that, when any PC is broken, he can boot the PC by just plugging the phone. His phone became a classic external disk. Android could partly read the SD, with limitations (legacy android can only read first partition in FAT; having fat on non first part, and, reading non FAT partitions requires ... manual operations).

This app does things a completely differen way. To make the story short ... it downloads an ISO over internen, store it in your phone (at any place you like, any folder), and, presents this ISO as a USB-CD. Emulates the USB-CD, and provides the media inside. App let you choose amongst large choice of distributions, install CD, and live CDs. The last option is to ask the app to create an empty drive, and, eventually, format it in FAT.

Negs:
- phone is no more a SD adapter
- copying files from phone to PC requires to manually mount the FAT block, copy, unmount; then, the app will show it as a CD
- copying from PC to phone requires a CD burning soft, and will erease the whole block
- the process can fail at many places. Phone can fail to emulate the CD. PC can fail to detect it. But, in most case, PC will fail to see partitions inside the CD. Also, for me, boot failed on two computers (BIOS could see the USB CD drive, but boot failed without reason)
- apps only emulates a CD; so, in short, the volume is READ ONLY. Except for CDRW softs.

Advantages:
- can work for phones that do not have SD slot
- can store as many boot sections as you want.
- include a large pannel of distributions, live CD, and other similar stuff
- provides partial workaround for people like us who are limited to MTP by default.
- UMS independant from SD
- images can be stored at any place in the phone (or even over network for me ^^ my phone mounts NFS, Samba, CIFS, SSHFS ... )

Apps has good design, and offers a variety of UMS implementations, and a blacklist for phones known to not work.

Success is heavily ROM and kernel dependant.

So, depending on the reasons why you want UMS ... this could be an alternative. Or not

I am going to test related apps over night; first needed to make my report for this one.
The Following User Says Thank You to doublehp For This Useful Post: [ View ] Gift doublehp Ad-Free
10th July 2014, 03:28 AM |#18  
OP Senior Member
Thanks Meter: 45
 
More
https://play.google.com/store/apps/d...xtersoft.myusb

For Mac people who just want to transfer a few files. Free version is limited to 5MB/ day. It's a webserver with integrated upload service. Apk file is small. Nothing to setup. Start app on phone, open browser on PC. Does the job. Pro version is only $1 ... On phone side, it works in folder /mnt/sdcard/myusb/ .

There are other ways to do this. There are free webservers in which you can setup upload. This app does it all in one for you. At home, I do everything via NFS, sshfs, cifs, rsync, scp ... but ... when I am not home ... this app provides an EASY solution for file exchange. Especially when you just need to copy 2 or 3 files. It's fully compatible with just any network device. Did not try it, but I guess it shall work over wifi AP mode. Can be used as proxy, or temp host space between two other devices.

It could be done other ways, more efficiently, and for free. But, what I like in this app is ... works easily, defaults are fine, all in one, does the job, ultra easy upload (compared to other web-upload solutions I have seen). Not to be used daily for regular work; but very good rescue method when you need 100% compliance with exotic stuff. So, dispite the fact it looks completely off topic regarding ... UMS ... I still consider this as a relevant alternative. Previous post was about helping a PC to boot. This one is about "hell, my MAC does not stand MTP". The companion you need with this app is probably a zip archive software, when you need to work on large number of files.
31st August 2014, 02:33 AM |#19  
OP Senior Member
Thanks Meter: 45
 
More
Here is a quick tuto from a friend:

echo 0 > /sys/class/android_usb/android0/enable
echo 22D9 > /sys/class/android_usb/android0/idVendor
echo 2767 > /sys/class/android_usb/android0/idProduct
echo adb,mass_storage > /sys/class/android_usb/android0/functions
echo /storage/sdcard1/debian.iso > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
echo 1 > /sys/class/android_usb/android0/enable

Here is the interesting part:
root@htc_m8:/storage/emulated/legacy # cat /sys/class/android_usb/android0/functions
mtp,adb,mass_storage

This means ... my kernel can do UMS. I will dig this later.

Sounds like this method can be used to simulate several devices at the same time: several HDD, several CDs ...
The Following User Says Thank You to doublehp For This Useful Post: [ View ] Gift doublehp Ad-Free
20th September 2014, 01:44 AM |#20  
Captain_Throwback's Avatar
Senior Member
Flag Bensalem, PA
Thanks Meter: 22,616
 
10
Donate to Me
More
Not sure if you're still trying to figure this out, but I got UMS working in TWRP . Link is in my sig.
The Following User Says Thank You to Captain_Throwback For This Useful Post: [ View ] Gift Captain_Throwback Ad-Free
20th September 2014, 04:32 AM |#21  
Captain_Throwback's Avatar
Senior Member
Flag Bensalem, PA
Thanks Meter: 22,616
 
10
Donate to Me
More
Quote:
Originally Posted by DeathmonkeyGTX

Gpe isn't aosp so I had some hope. My m8 is a gpe from the play store, not a rom or ruu. Even if it just worked in a version of twrp that would be fine, it's rare when I need ums but often enough to where I'd gleefully spend $20 on it.

Sent from my HTC One_M8 using XDA Premium 4 mobile app

Where's my $20?

Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes