yashsingh1/xdaforums huggingface dataset:
[HTC Amaze 4G] ziggy46:
hmm... do you think the code will conflict with the other devices?
[HTC Amaze 4G] snowlin:
the suspense is killing me D:
[HTC Amaze 4G] :
It might or the other device maintainers might not wanna do it that way
[HTC Amaze 4G] dcacklam:
It does boot, and it does work.

I get working ADB, as well as a fully fleshed-out sysfs, with a f_mtp option, and f_mass_storage showing lun0 and lun1

The following files will be absolutely needed from HTC source:

board-ruby.c

board-ruby.h

In board-ruby.c, the following edits are needed:

comment out ".cpu_lock_supported = 1,"

change the amount of PMEM from 16 to 32M, by editing MSM_PMEM_SF_SIZE to 0x2000000 from 0x1000000

Since I was doing this as a test, I then proceeded to copy over the full contents of drivers/usb/gadget/, drivers/char/diag/, and then copied over associated header files.

The following headers were copied from their various include-dirs, to fix fatal-warnings:

htc_usb.h

android_composite.h

composite.h

htc_info.h

diagchar.h

ch9.h

On the sound-driver front, I copied msm and msm_1x over, and replaced msm_1x/Kconfig with a 0-byte file to eliminate the duplicate/conflicting configuration directives.

This kernel DOES boot, however since I am building it outside the Android full-build process, I am without WiFi because I do not have the sources/makefiles/steps/etc to build TI-WLAN the way you guys do, and of course it does not build in the regular make-modules process...

It fixes the KERNEL-LEVEL issues with USB, however Android is still using the wrong mount paths, and still launching two USB Mass Storage mounters.

With this 'correct' Kernel and USB gadget, the paths are:

Internal SD: /sys/devices/virtual/android_usb/android0/f_mass_storage/lun0

External SD: /sys/devices/virtual/android_usb/android0/f_mass_storage/lun1

Android needs to be told that there are 2 SDCards, and to look for them at those paths.

That, is where I pass y'all the hot-potato.

Further testing on whether reverting audio-drivers fixed routing, after work....

P.S. Sporty, might be nice if there was a source-directory/shell-script to build those WLAN drivers in your kernel source, for those of us who are tinkering with the kernel outside of doing full source-builds of the OS.
[HTC Amaze 4G] wolf_7669:
Assuming it works and CM says no, can it be packaged as a separate thing to flash, like gapps, for the time being until a CM approved method is found?
[HTC Amaze 4G] :
OK you mind uploading your source to got and the commit you did to get it working and I'll try to get it merged
[HTC Amaze 4G] dcacklam:
My Kernel's android-gadget directory:

---------- Post added at 09:24 PM ---------- Previous post was at 09:23 PM ----------

Gimme a sec to comment my buildprop edits, make a tarball & I'll put it on googledocs.

I've got to unwind the hairball a bit, since I was doing this as a debugging/quickfix more than clean/responsible coding...
[HTC Amaze 4G] :
All I need is the modified files
[HTC Amaze 4G] dcacklam:
Theoretically, anything is possible (And FAUX did it for Sense, with his kernel-replacements), but this 'flash' would have to include:

boot.img of 'unofficial' kernel

SystemUI.apk re-compiled to use the composite gadget

/system/lib/modules/*

Oh, and I'd need to figure out how to build the wifi modules without a full android build-up, before I could release the 'stuff' for a zip...

Keep in mind that right now I do not have the SystemUI part, so I don't have working USBMS... I just have all of the linux-level stuff required for both SDCards to be visible IF SystemUI is fixed.... Oh, and the MTP/PTP/MS switcher is still borked, in system/settings... So I couldn't make it switch off Mass Storage to MTP even though my kernel supports MTP.

But I have ADB over USB now... And USB tether should theoretically work... And so on....
[HTC Amaze 4G] dcacklam:
DCACKLAM Kernel Files

Attached.

Note:

Of these files, only board-ruby.c is actually EDITED - and it is edited from the HTC, not CM10 version.

The rest are all DIRECT replacements copied over from the HTCDev kernel-source, to satisfy dependencies of the new USB gadget driver.

My edits are commented.

The ruby_defconfig I am using (and that is in this tarball) has some other modifications for power-savings (dealing with the suspend mode, etc)...

It also has the MMAP change for the MTP library (eg, mem(0,4096) error) that has already been rejected from CM commit.

The attached boot.img will boot (proof of concept), however since I don't have wifi modules to go with it, anyone who uses this kernel will have no wifi, for the time being...

If you flash my highly-experimental boot.img, the modules zipfile needs to be manually unzipped in /system/lib/modules, then fix perms... However it doesn't really do much good right now without wl12xx and wl12xx_sdio.
[HTC Amaze 4G] :
How are the other modifications functioning and did your audio changes do anything?
[HTC Amaze 4G] dcacklam:
I have no FCs, and am presently waiting for the phone to idle, then sleep, and come back... We will see on that...

As for the audio changes, I'll know when I get in my car & fire up the bluetooth... I also have the /system/etc/ audio-files 'reverted' manually, since that was part of the issue....

What I did on the power front was:

Suspend sleep mode: power collapse suspend

Idle sleep mode: Ramp down cpu clock and wait for interrupt

I intend to do a little more with power optomization later, but the BT bug and the USB are the ones everyone is complaining about...

So this should get us closer on the USB, if you guys can do the paths part...

I'll report my BT/Audio success or lack thereof when I know...
[HTC Amaze 4G] :
yep i sent the commit to intervigil. Here is is for you too https://github.com/Sportsstar89/and...mmit/96192acee0accca04b5ea6ba0f1e0e512983d624

I'll see what he has to say about it hopefuly we can get it merged.

You said UMS for both cards worked right off the bat?
[HTC Amaze 4G] dcacklam:
The *correct* lunfiles for both cards are there, but getting UMS fully working will require changes to the Android-side code for vold/the mounter-app.

Vold is looking for the SD Cards in the wrong spot for a multi-SDcard phone.

eg:

/sys/class/android_usb/android0/f_mass_storage/lun/file

/sys/class/android_usb/android1/f_mass_storage/lun/file

It needs to look in:

/sys/class/android_usb/android0/f_mass_storage/lun0

/sys/class/android_usb/android0/f_mass_storage/lun1

Without my kernel modifications, the ONLY LUN that is available is:

/sys/class/android_usb/android0/f_mass_storage/lun/file

Which is InternalSD.

WITH my kernel modifications, the lun0/lun1 are there, if only vold was looking in the right place to find them!

ADB worked right off the bat, and unlike the standard kernel, all of the other USB gadget functions OTHER THAN Mass Storage have their f_ entries.

---------- Post added at 10:32 PM ---------- Previous post was at 10:30 PM ----------

Oh, the power modifications are not causing me problems - the phone does sleep properly and come back....
[HTC Amaze 4G] :
awesome unfortunately i hit a compiling error

In file included from drivers/usb/gadget/ci13xxx_msm.c:25:
drivers/usb/gadget/ci13xxx_udc.c: In function '_gadget_stop_activity':
drivers/usb/gadget/ci13xxx_udc.c:1883: error: 'struct usb_gadget_driver' has no member named 'mute_disconnect'
drivers/usb/gadget/ci13xxx_udc.c: In function 'isr_tr_complete_handler':
drivers/usb/gadget/ci13xxx_udc.c:2306: error: 'struct usb_info' has no member named 'chg_stop'
drivers/usb/gadget/ci13xxx_udc.c: At top level:
drivers/usb/gadget/ci13xxx_udc.c:2842: error: unknown field 'req_reset' specified in initializer
drivers/usb/gadget/ci13xxx_udc.c:2842: warning: initialization from incompatible pointer type
error, forbidden warning: ci13xxx_udc.c:2842
CC drivers/usb/host/ehci-hcd.o
make[3]: *** [drivers/usb/gadget/ci13xxx_msm.o] Error 1
make[2]: *** [drivers/usb/gadget] Error 2
make[2]: *** Waiting for unfinished jobs...

anyway changing the default lun path is a simple boardconfig change
[HTC Amaze 4G] dcacklam:
Left a few .h files out...

Fixed & attached...

If this doesn't fix it, I'll start from scratch & document better, so that I can give you a 'cleaner' fix...
[HTC Amaze 4G] :
Thanks btw let us know about battery life
[HTC Amaze 4G] ziggy46:
yeah, especially since it seems you have fixed the "phone on caffeine" issue
[HTC Amaze 4G] :
Also everyone a new test build is up
[HTC Amaze 4G] :
That kernel built fine i'll try making a new build with the kernel changes
[HTC Amaze 4G] dcacklam:
To be fair, since I don't have the WLAN drivers loaded it is not a full, fair test...

BTW, how *do* you build the wifi modules? Without downloading and building CM10-as-a-whole?

make modules skips right over them....

---------- Post added at 11:06 PM ---------- Previous post was at 11:05 PM ----------

Looking forward to it...
[HTC Amaze 4G] :
umm you would have to intergrate the source directly in to the tree. That's probably the only way. The source is located here https://github.com/cyanogenmod/android_hardware_ti_wlan/tree/jellybean
[HTC Amaze 4G] elmerohueso:
What changes were made in this one, since it doesn't have the new kernel yet? Goo.im says "No changelog has been set by the developer for this file."
[HTC Amaze 4G] :
Test out 1080p video recording and I tried to fix echo in call
[HTC Amaze 4G] elmerohueso:
I never had echo (that I know of), so I can't really test it.

Gallery FCs when I try 1080p recording (I did clear app data first). 720p still works.

Recorded video playback is definitely less garbled, though skipping through video still FCs the Gallery.

Anything out specifically I should test out?

Really looking forward to getting USB and MTP fixed with the new kernel.
[HTC Amaze 4G] azcledel:
Downloading test build now these nightly builds don't have much to go for anymore. Sports and the guys on here seem to have way more interest in getting actual things working lol
[HTC Amaze 4G] dcacklam:
Built the TI WLAN source from HTC (copied over from the ICS kernel, no changes) against my current kernel config and...

It works.

The attached zip has the TI-source wlan modules, that work with the stuff provided earlier (bootcm10.img and bootcm10.modules.nonflashable)

wifi.zip has to overwrite the modules from modules.nonflashable...
[HTC Amaze 4G] dcacklam:
The 'fixes' in the nightlies will generally be CM-wide issues, not platform-specific...

Platform specific will happen because of something someone does in this thread....
[HTC Amaze 4G] azcledel:
So installed test build 1080p still crashes ext SD still not working and echo still there

Sent from my manually changed signature woo
[HTC Amaze 4G] :
logcat. please. I can't fix anything without a logcat
[HTC Amaze 4G] dcacklam:
ext SD won't be working until at least 1 more test build...

The one he has up was completed before I gave him a complete set of kernel changes...
[HTC Amaze 4G] elmerohueso:
Logcat of 1080p recording crash: http://pastebin.com/WkYCibp9
[HTC Amaze 4G] azcledel:
Too busy to figure out how to pull logs never did it before luckily someone else did.
[HTC Amaze 4G] dntipwn:
It's easy just download the app catlog from the market and record the log while testing 1080p video then post the txt file

Sent from my HTC_Amaze_4G
[HTC Amaze 4G] dcacklam:
That's the crash right there...

WHY are we using a 720p codec for 1080p recording?
[HTC Amaze 4G] :
I was wondering the same thing....
[HTC Amaze 4G] HumpDdumpD:
Another build up on Sport's goo.im downloading now to try. Anything new I should be looking for? Still testing for 1080 video?
[HTC Amaze 4G] jordin1128:
Is the 12/27/12 build with the new kernel fixes?
[HTC Amaze 4G] :
the 12 27 build is the latest
[HTC Amaze 4G] HumpDdumpD:
multi touch got messed up when I flash 12/27, flashed 12/26 over it & it was fine.
[HTC Amaze 4G] mrgwap:
Yea multi touch is messed up again
[HTC Amaze 4G] dcacklam:
If 12/27 is the one with my USB changes, I don't have anything with multitouch so I can't confirm...

I can report that my first crack at a 'kernel-side' fix for audio & BT failed... No change... There are a few more places to look (apparently the Amaze has a separate 'amplifier' chip), and I am approaching it as a 'What changed from HTC Kernel to AOSP Kernel besides the version of Linux and the PMEM size' task.....

Battery life was better until I started running the 'TI Source' WLAN drivers (since I haven't found how (whoever) prevented the linux-builtin TI-wlan from compiling)... Which appear to wake-lock the device....

The USB LUNs patch should be effective, presuming that we have fixed the '2 separate USB-mounter apps' thing....
[HTC Amaze 4G] :
fixed https://github.com/Sportsstar89/and...mmit/bf2c7102ac3e845478f904f8b5ed610a49ceca4e someone try out usb mass storage
[HTC Amaze 4G] Bling_Diggity:
Man, not checking this thread for 4 days gave me quite a freaking novel to read tonight. Dcacklam I tested your build, everything seemed fine except BT & battery life. It's great having USB working. Not having any multi-touch issues. Great work man, keep it up!

EDIT: FC on 1080p
[HTC Amaze 4G] GuyInDogSuit:
^ This. I had to search in recovery myself, but it was there in the cmupdater folder.
[HTC Amaze 4G] Bling_Diggity:
There's an unofficial CM Updater app in Play called CM10 Downloader. I just use that and flash via 4ext.

EDIT: Also, it will show you the changelog for each build.
[HTC Amaze 4G] dcacklam:
I've got a rather nice double-DIN head-unit in my car & a 2hr each way commute, so BT is one of my priorities, while I wait for someone to backport the fixes developed here to CM9, for Round II with that blasted wifi calling app...

I've given up on Movial/IMS WFC due to the fact that I'd have to develop a complete Sense to AOSP wrapper (And I do NOT like coding, not too good at it - mind you my 'work' on board-ruby.c was like 2 or 3 edits in vi - I really do not like Java) just to make the Phone and MMS apps work, and they (stock apps) are REQUIRED for Movial Wifi Calling.

Good to hear USB mass storage works...

All of you other folks who like to torture your phones through the USB port - USB tethering & so on... Let's hear what works and what does not.

Linux kernel-level support for all that stuff should be back... Only thing I didn't include was support for oodles of old-ass desktop HID stuff (so no, no thrustmaster flightstick, apple magicmouse, or XBox controller on your phone with this build)...

Now, the above statement does NOT ensure that it will work in Android... Just that the Kernel (LINUX) support for it is back, on account of porting the full android-usb gadget driver over from ye-olde-htc-kernel-source... If it doesn't work in android, put a logcat up of the error so we can figure out where the wires are crossed...

Also, if you find some way to crash-to-reboot your phone or similar with USB-related stuff, that might be nice to know too - as this is a 3.0.16 vintage driver running on Linux 3.0.5x

Unless Sport changed it in today's build, also, the MTP/PTP/Mass-Storage picker (under Settings -> Storage -> Menu-Button -> whatever-pops-up) is still borked, making Mass Storage the only option
[HTC Amaze 4G] GuyInDogSuit:
Where, exactly, is this 12/27 build? I checked goo.im AND get.cm, and there's only 12/26 builds.
[HTC Amaze 4G] dntipwn:
http://tinyw.in/OErW right here, Not sure where u looked cuz its there at the bottom of sportsstar89 goo.im
[HTC Amaze 4G] GuyInDogSuit:
I was looking here. Guess I should have been looking here. Kind of odd that Sports' builds aren't listed under the Ruby device filter. Thanks for pointing it out though.
[HTC Amaze 4G] fragler:
Anybody else having an issue with the Facebook app not syncing friends to their contact list? Only asking here because it worked before I loaded up this ROM.
[HTC Amaze 4G] GuyInDogSuit:
Well, Facebook is still pissed at Google, so I'm not surprised.

Sent from my A200
[HTC Amaze 4G] mewzik86:
Mounting USB storage logcat

I was unable to mount usb sorage with the 12-27 build. Here is an extract of my logcat:

I/Vold ( 131): /mnt/secure/staging sucessfully unmounted

I/Vold ( 131): /storage/sdcard1 unmounted sucessfully

D/Vold ( 131): Volume external_sd state changing 5 (Unmounting) -> 1 (Idle-Unmounted)

D/MountService( 331): volume state changed for /storage/sdcard1 (mounted -> unmounted)

D/MountService( 331): sendStorageIntent Intent { act=android.intent.action.MEDIA_UNMOUNTED dat=file:///storage/sdcard1 (has extras) }

I/StorageNotification( 415): Media {/storage/sdcard1} state changed from {mounted} -> {unmounted} (primary = false)

D/VoldCmdListener( 131): volume shared /storage/sdcard0 ums

E/VoldConnector( 331): NDC Command {16 volume unmount /storage/sdcard1 force} took too long (1075ms)

D/VoldCmdListener( 131): volume share /storage/sdcard1 ums

E/Vold ( 131): Unable to open ums lunfile /sys/class/android_usb/android1/f_mass_storage/lun/file (No such file or directory)

E/Vold ( 131): Unable to find ums lunfile for LUN 1

D/MediaScannerReceiver( 462): action: android.intent.action.MEDIA_UNMOUNTED path: /storage/sdcard1

W/Vold ( 131): Returning OperationFailed - no handler for errno 22

E/MountService( 331): Failed to share/unshare

E/MountService( 331): com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '18 volume share /storage/sdcard1 ums' failed with '400 18 volume operation failed (Invalid argument)'

E/MountService( 331):	at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:345)

E/MountService( 331):	at com.android.server.NativeDaemonConnector.executeForList(NativeDaemonConnector.java:282)

E/MountService( 331):	at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:248)

E/MountService( 331):	at com.android.server.MountService.doShareUnshareVolume(MountService.java:595)

E/MountService( 331):	at com.android.server.MountService.access$200(MountService.java:96)

E/MountService( 331):	at com.android.server.MountService$UmsEnableCallBack.handleFinished(MountService.java:340)

E/MountService( 331):	at com.android.server.MountService$MountServiceHandler.handleMessage(MountService.java:451)

E/MountService( 331):	at android.os.Handler.dispatchMessage(Handler.java:99)

E/MountService( 331):	at android.os.Looper.loop(Looper.java:137)

E/MountService( 331):	at android.os.HandlerThread.run(HandlerThread.java:60)

D/VoldCmdListener( 131): volume shared /storage/sdcard1 ums
[HTC Amaze 4G] dcacklam:
USB Storage Issue: 1227 build

While the kernel is now 'right' in this build, the boardfile changes (or whatever) did not take, and Android is STILL trying to mount the wrong paths:

E/Vold ( 132): Unable to open ums lunfile /sys/class/android_usb/android0/f_mass_storage/lun/file (No such file or directory)

E/Vold ( 132): Unable to open ums lunfile /sys/class/android_usb/android1/f_mass_storage/lun/file (No such file or directory)

The correct paths are:

/sys/class/android_usb/android0/f_mass_storage/lun0

/sys/class/android_usb/android0/f_mass_storage/lun1
[HTC Amaze 4G] GuyInDogSuit:
Yeah, mine doesn't mount at all now.
[HTC Amaze 4G] windcan:
new nightly from CM for 27th

3 days in a row, new nightly from cm here

wonder what's new and working? :)
[HTC Amaze 4G] dcacklam:
The kernel I built enables the proper USB driver, however for whatever reason the Android configuration (apparently, Vold) has not changed to use the new paths...

It is still trying to use the old, wrong paths with the new kernel and that is just not going to work....
[HTC Amaze 4G] :
That's strange maybe there's something hidden in the overlay
[HTC Amaze 4G] ziggy46:
could it be as simple as editing the vold.fstab?
[HTC Amaze 4G] elmerohueso:
Stock/Sense HTC Amaze vold.fstab entries:

dev_mount sdcard /mnt/sdcard 36 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard2 /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.3/mmc_host/mmc2

CM10 HTC Amaze vold.fstab entries:

dev_mount sdcard /storage/sdcard0 36 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount external_sd /storage/sdcard1 auto /devices/platform/msm_sdcc.3/mmc_host/mmc2

How many parts of CM10 depend on these mount points (what can we change here without jacking up CM10)?

Can you have multiple mount points (maintain the CM10 mount points but also add the Stock/Sense mount points)?
[HTC Amaze 4G] chevycowboyusa:
Vold

Can we use VOLD.FSTAB from one of the other roms?

Maybe I'll try it!
[HTC Amaze 4G] elmerohueso:
I tried that, using the Stock/Sense vold.fstab (I posted the entries before your post). Caused CM10 to not boot.
[HTC Amaze 4G] snowlin:
NVM, deleted
[HTC Amaze 4G] chevycowboyusa:
your post...

Lol... Your post wasn't there when I posted for some stupid reason.... (I should have hit F5 more often...)

Anyhow...

Did you try to manually change the VOLD ?
[HTC Amaze 4G] dcacklam:
No, no, and it's not the mount points.

fstab is where these things mount IN LINUX.

The problem is what path is being connected to FOR USB MASS STORAGE.

They are separate.

The Sense vold.fstab is WRONG for CM10 because it 'brings back' the old Sense-style /sdcard/ext_sd setup for the external.

This is an issue with the USB MASS STORAGE path to the LUN (Logical Unit Number) file, not the linux mounting path..

---------- Post added at 08:48 PM ---------- Previous post was at 08:47 PM ----------

You can't manually configure it, it relies on the framework and how it was compiled, apparently...

I thought you could, but further research indicates it no longer uses a text-mode config file for anything but local mountpoints.
[HTC Amaze 4G] elmerohueso:
Tried both replacing and changing. Checked file permissions. You can try, too, if you want. Maybe I'm just unlucky
[HTC Amaze 4G] chevycowboyusa:
VOLD

I didn't see a VOLD.CONF file in /system/ect
[HTC Amaze 4G] dcacklam:
Vold.fstab is for LOCAL MOUNTING of the vold-controlled volumes...

Also, apparently, the reason vold.conf is ignored, is that it is completely depricated. Vold now ignores any user-level configuration and relies completely on the framework.

This is a problem that has to be fixed in the BUILD of CM10 for our phone.

Sport has to find where in the source it specifies to look for the LUN files at those wrong paths, and fix it.

---------- Post added at 09:15 PM ---------- Previous post was at 09:10 PM ----------

well, you could always run:

grep /lun/file $(find)

on your source tree... It would find every occurrance of the /lun/file setup

The issue is two-fold:

First, the paths are wrong

Second, Android is launching 2 separate mass-storage mounters (that's why when you tap 'mount' you see another one), and looking for 2 separate USB gadgets (android0 and android1) when there will never be more than 1.

Instead of enumerating as

android0/f_mass_storage/lun/file

android1/f_mass_storage/lun/file

It needs to enumerate as

android0/f_mass_storage/lun0/file

android0/f_mass_storage/lun1/file

---------- Post added at 09:20 PM ---------- Previous post was at 09:15 PM ----------

JACKPOT!

It's in the VOLD BINARY....

running

grep /lun/file vold

returns

/sys/class/android_usb/android%d/f_mass_storage/lun/file

The CORRECT string-literal should be

/sys/class/android_usb/android0/f_mass_storage/lun%d/file

(which means I could fix this with a hex editor, while we wait for Sporty to fix whaever configures/builds vold)
[HTC Amaze 4G] ziggy46:
i love you in a completely straight way.... :p
[HTC Amaze 4G] PowSniffer0110:
Getting sick of this. Why are there no flashing instructions?! Bogus. Not ranting but thats a requirment. Anyway... i flashed recovery, perm rooted, wiped everything twice, flashed nightly and jb gapps. Boot loop. Whats the problem? Kinda weird the OP provides nothing but "message to the haters" lol..
[HTC Amaze 4G] isamaranga:
If you're s-on you probably need to flash using ext4 recovery with smart flash enabled
[HTC Amaze 4G] ziggy46:
well not to piss in your cornflakes or anything.... but by this point of the rom flashing preparation, you should know how to flash a rom... and if for some reason you dont, just ask nicely, we dont bite.

But you probably flashed a too new version of gapps... try re-wiping and try this one http://goo.im/gapps/gapps-jb-20121011-signed.zip