Find Your Device:
Or Continue to Thread: [APP][v1.8 (+US)] SGS3 Easy UM…
14th October 2012, 03:42 PM |#510  
Thanks Meter: 259
I was having the issues reported here with i9300 CM10 latest nightly (20121013), so I decided to find what's wrong with it.
Note: this post is a bit technical; there's a tl;dr section at the bottom.

SGS3 Easy UMS is issuing "setprop persist.sys.usb.config mass_storage,adb" in order to make Android (specifically, the Android gadget driver) go into UMS mode.
The process which listens on such events is actually init. The "init.smdk4x12.usb.rc" file defines the USB-related properties to listen at.
However, apparently the CM10 file doesn't support mass_storage. Therefore, setting sys.usb.config to mass_storage doesn't do anything.

In order to fix the problem, I've added the following line to the "on boot" section:
write /sys/class/android_usb/f_mass_storage/inquiry_string "Samsung"
And the following lines to the bottom of the file:
on property:sys.usb.config=mass_storage
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 04e8
    write /sys/class/android_usb/android0/idProduct 685b
    write /sys/class/android_usb/android0/functions $sys.usb.config
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state $sys.usb.config

on property:sys.usb.config=mass_storage,adb
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 04e8
    write /sys/class/android_usb/android0/idProduct 685e
    write /sys/class/android_usb/android0/functions $sys.usb.config
    write /sys/class/android_usb/android0/enable 1
    start adbd
    setprop sys.usb.state $sys.usb.config
The problem is, you must update your initramfs in order to edit this file by yourself. This means a new boot.img, and practically "flashing a new kernel".
I've edited Siyah Kernel 1.7b6 with the updated file, and attached it to this post. It works fine for me, but I obviously TAKE NO RESPONSIBILITY WHATSOEVER.

The proper way to fix this would be submitting a patch to CM's gerrit; I'll do it later.
Another temporary hack that would work is to modify Easy SGS3 UMS so it sets the f_mass_storage inquiry_string on boot, and issues the commands under the "on property:sys.usb.config=mass_storage,adb" section every time the user clicks on "UMS mode".

The attached kernel is a modified Siyah Kernel v1.7b6 that should fix the problem. It does work for me. Flash it with Mobile Odin.
I TAKE NO RESPONSIBILITY for it, don't blame me if it bricks your device or starts a thermonuclear war.
Attached Files
File Type: tar Siyah-s3-v1.7b6-UMSfix.tar - [Click for QR Code] (6.03 MB, 291 views)
The Following 3 Users Say Thank You to Oranav For This Useful Post: [ View ]