Jump to content

[Development][ROM] Stock FROYO + 2.6.32 kernel


Recommended Posts

Posted (edited)

Wow, now that was difficult. I took Term.apk from CM6. Installs fine but could not create file on sdcard, permission denied. So I tried rooting the device with z4root. Works. Maybe we'll need this later on...

dmesg here on pastebin or on mediafire

some lines thereof - it says normal mode but chooses pid index 21


<6>[1, swapper] [	0.263520] 15 scaling frequencies supported.

<3>[1, swapper] [	0.263541] < proc_usb_para

<3>[1, swapper] [	0.263563] vendor:hw,country:default

<3>[1, swapper] [	0.263585] USB setting is NORMAL

<3>[1, swapper] [	0.263610] smem usb_serial=74677D282F32B64F, usb_pid_index=21

<3>[1, swapper] [	0.263636] pid_index_to_pid, pid_index=21, usb_pid=0x1031

<3>[1, swapper] [	0.263660] set pid=0x1031, sn=

<3>[1, swapper] [	0.263683] curr_usb_pid_ptr: 0x1031, 0x1035, 0x1005, 0x1033, 0x1038

<3>[1, swapper] [	0.263706] usb_para_info: usb_pid_index=21, usb_pid = 0x1031>

<4>[1, swapper] [	0.339746] bio: create slab <bio-0> at 0

<6>[1, swapper] [	0.344548] msm_i2c_probe

<6>[1, swapper] [	0.344746] msm_i2c_probe: clk_ctl 35d, 100000 Hz

I don't have sys/devices/platform/msm_hsusb_periphera/fixusb, just sys/devices/platform/msm_hsusb

Edited by dr.flo
Posted (edited)

#define CDROM_INDEX 					21

#define NORM_INDEX                  	22
it read usb_pid_index from phone's shared memory (from baseband processor area somewhere) and declared it in logs as: smem usb_serial=74677D282F32B64F, usb_pid_index=21 which is cdrom. And used it thereafter. I don't have access to either of pastebin or mediafire from work... EDIT: "USB setting is NORMAL" indicates just set of pids are like this. Alternative is customized for t-mobile set of pids. EDIT2: may be for regular user this cdrom mode is just as designed? Because in this mode, as I understand, when plugged to Windows PC,phone exposes virtual cdrom device with PC drivers on it. To sort of help user. No average user is supposed to dive into adb right at this moment :) Now we need to figure how to switch or enable adb... EDIT3: if judge from the article referenced in EDIT2 above in this post, WIndows expect pid=1038, which is:
#define PID_GOOGLE                  	0x1038
which in turns in adb-enabled mode actually enables adb, contrary to plain cdrom mode, which even in adb-enabled mode doesn't enable adb:
		.adb_product_id 	= PID_GOOGLE,

		.adb_functions		= 0x12,


		.adb_product_id 	= PID_ONLY_CDROM,

		.adb_functions		= 0x2,
I'd guess Ideos (u8150) holds in that shared memory:
#define GOOGLE_INDEX                	25

Edited by pier11
Posted (edited)

I'd guess Ideos (u8150) holds in that shared memory:

#define GOOGLE_INDEX                	25
Maybe our phones never were meant to use this, there maybe nonsense it the memory location. Would it cause negative side effects to hardcode the initiial usb_pid_index to something that works, 25 maybe, or your initial pid? (or try reading from mem, but if it reads 21, force it to s.th. else...) dmesg also has

<3>[1, swapper] [    0.938939] current usb composition including CDROM, curr_pid=0x1031

<3>[1, swapper] [    0.938968] store_file, buf=/data/cdrom/autorun.iso, count=23, pid_index=21

<3>[1, swapper] [    0.938993] ui_state=0, ui_usb_state=2

<3>[1, swapper] [    0.939013] curlun=c7a11860

<6>[1, swapper] [    0.939081]  lun0: unable to open backing file: /data/cdrom/autorun.iso

it fails opening cdrom image... possibly it would be present on full rom and you just removed it? Anyways, as long as it's not present, enabling cdrom mode wont help anyone :)

for now I reverted to current compat-kernel from cm7.2-thread.

Tested neocore. 3.x fps with audio disabled, software rendering.

If I add libGLES_qcom.so and egl.cfg (libEGL.so not replaced!) ---> 27.4 fps (audio off), all objects (city, lights, vehicles, explosions,...) rendered like it used on CMx

(Audio would also work, I just turned it off to be quiet...)

Edited by dr.flo
Posted (edited)

yes,

/data/cdrom/autorun.iso
was there, I just assembled minimalistic rom to fit into 100MB system partition for tests. Didn't mean to port it as is at that point of time. Cool Neocore results with full rendering! EDIT: 26.1 FPS on cm6.1 - twrock's basic. Alan Orth (dev for u8150) also refered to 1038 pid here: http://mjanja.co.ke/...e-huawei-u8150/
# Huawei IDEOS in adb mode

SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1038", MODE="0666"
EDIT2: This dmesg snippet confirms that u8150 reads usb_pid_index=25 from shared memory
<3>[1, swapper] [	2.101101] < proc_usb_para

<3>[1, swapper] [	2.101123] vendor:safaricom,country:ke

<3>[1, swapper] [	2.101141] USB setting is NORMAL

<3>[1, swapper] [	2.101161] smem usb_serial=285FDB333736, usb_pid_index=25

<3>[1, swapper] [	2.101184] pid_index_to_pid, pid_index=25, usb_pid=0x1038

<3>[1, swapper] [	2.101204] set pid=0x1037, sn=285FDB333736

Edited by pier11
Posted (edited)

I told you it's an interesting topic - auto pid.

Here is comment from kernel source explaining:

/* ...

 * pid_index is kept in NV(4526). 

 * At power up, pid_index is read in modem and transfer to app in share memory.

 * pid_index can be modified through write file fixusb ...

*/
I.e. usb mode is stored in NVRAM (kinda small ROM). Then modem (baseband processor) reads from there and exposes it to our linux via shared memory. This is where we are reading it from. On the other hand kernel has means to read and write to that particular NV register. Because specifically for that it exposes /sys filesystem entry named fixusb. Full path is
/sys/devices/platform/msm_hsusb/gadget/fixusb
So it can be read, it can be written. As a side note, Android switches usb modes via neighboring /sys file:
/sys/devices/platform/msm_hsusb/gadget/switchusb
So to fix your problem, executing single commant could be enough:
echo 22 > /sys/devices/platform/msm_hsusb/gadget/fixusb
I've even found confirmation of it on the Internet http://www.ryanium.c...under-gnulinux/ EDIT: tried myself:
echo 22 > /sys/devices/platform/msm_hsusb/gadget/fixusb
and also Ideos-style:
echo 25 > /sys/devices/platform/msm_hsusb/gadget/fixusb

Works as expected, adb is present in both cases. Reboot might required.

Edited by pier11
Posted

Updated rom on the first post with:

- OpenGL lib as per dr.flo findings

- Now usb_pid_index=25 (Ideos style) is set in kernel, no matter what in shared memory. This should care of enabling adb.

Posted

Updated rom on the first post with:

- OpenGL lib as per dr.flo findings

- Now usb_pid_index=25 (Ideos style) is set in kernel, no matter what in shared memory. This should care of enabling adb.

cool this does the trick for me! Many thanks for investigating this!

Posted (edited)

@dr.flo,

tried your Ascend rom again, and yes - keypad leds work. But lights.msm7k.so in both roms is exactly the same (by md5 comparison).

Can't think what else is needed to change to fix the leds on u8150 rom...

EDIT:

- flashed boot image from u8150 port, leds still working :)

- even flashed lights.msm7k.so from u8150 to Ascend rom - still works.

Edited by pier11
Posted

- flashed boot image from u8150 port, leds still working :)

should always work on non-compat-branch kernels? At least that's what I believe...

You know where to toggle compat of leds since you have done it... maybe you also know which function name / devices / whatever the kernel exposes to user space for controlling leds. Possibly some /dev/xxx ? Then why not grep everything inside system/lib to see which lib accesses that device?

Posted (edited)

copy-paste all libs from u8150 (except libdvm.so which prevented system to load). Still lights work...

EDIT:

completely replaced /system/lib directory from u8150 (but mentioned libdvm.so). Still lights work... So it's not an issue with libs.

(Power button stopped to work, but that's different issue)

Edited by pier11
Posted (edited)

completely replaced /system/lib directory from u8150 (but mentioned libdvm.so). Still lights work... So it's not an issue with libs.

nice experiment... and same with system/bin?

Other thing:

we might want to make a list of all libs present in system/lib and what functions they are used for.

this is to help future RIL experiments.

I think of s.th. like

libdvm.so -> dalvik vm related

libloc_api.so -> location api (gps related)

... and so on.. also it would be helpful to mark which of these libs are built from source (in cm6) and which are closed source vendor specific files

Edited by dr.flo
Posted

nice experiment... and same with system/bin?

not tested /bin,

only /lib

Posted

just noticed this in logcat (rom 03)

E/lights ( 1265): write_int failed to open /sys/class/leds/red/brightness

E/Sensors ( 1265): Couldn't open /dev/light (No such file or directory)

might be related to light issue

Posted (edited)

Wi-Fi address = Bluetooth MAC address + 1 (or -1 don't remember)

CM knows how to get the latter.

Looks like BT MAC is somewhere in NV ram according to the below. Now need to figure address somehow...

$ strings system/bin/hci_qcomm_init | grep -ri "BD.ADDR"

BD_addr

BD_addr_string

bt_hci_qcomm_init Failed to read BD Address from NV default to %02X:%02X:%02X:%02X:%02X:%02X

This version attempts NV read of BD_ADDR, refclock, clock-sharing via RPC.

nv_cmd_remote failed to get BD_ADDR from NV, code %d
EDIT: Write a wrapper atop of libnv.so?.. EDIT2: must be it:
-b  --board-address   NV447 or rand Bluetooth MAC address to use

Edited by pier11
Posted (edited)

I've found this device - Huawei UM840 - it's like Ascend (msm7225, 480*320), but with front camera, as my research's figuring. It should have Froyo rom issued just recently. So chances are it have froyo camera app supporting front camera. Worth to investigate.

link

It has front camera switch according to this:

snap20111231_011859.png

Edited by pier11
Guest lloco73
Posted

I've found this device - Huawei UM840 - it's like Ascend (msm7225, 480*320), but with front camera, as I my research's figuring. It should have Froyo rom issued just recently. So chances are it have froyo camera app supporting front camera. Worth to investigate.

The Huawei UM840 (for Venezuela mobile operator Movilnet) is the Huawei U8500.

Posted

The Huawei UM840 (for Venezuela mobile operator Movilnet) is the Huawei U8500.

Close, but not exactly. U8500 does not have front camera, as I understand...

Posted

nice find.

I tried pushing Camera.apk + Camera.odex into CM6 - camera application does not show up.

I don't know - is it possible to mix odexed and deodexed system apps or do I have to deodex Camera.apk first?

Another way would be trying to boot that rom unmodified like with ascend and u8150 roms...

Posted

Another way would be trying to boot that rom unmodified like with ascend and u8150 roms...

This is what I did.

Even though I'm having "froyo (frozen yogurt)" - frozen picture in camera with acidic yogurt colors, as before, I can see the front camera switch.

I didn't succeed to add Camera.app in original odexed form to u8150 rom. Deodexed version helped.

Posted

nice find.

I tried pushing Camera.apk + Camera.odex into CM6 - camera application does not show up.

I don't know - is it possible to mix odexed and deodexed system apps or do I have to deodex Camera.apk first?

Another way would be trying to boot that rom unmodified like with ascend and u8150 roms...

I've never been able to work with odexed apk's in modified roms.

Posted (edited)

um840 for Pulse (Froyo 2.2.2)

- front camera switch

- can be usb-tethered

- only minimum necessary changes to rom

- deodexed

- our 2.6.32 kernel from normal branch.

- (no radio, no wifi yet - please help if you can)

Do Wipe Data/Factory Reset before installation.

u8220 users: Install after TRE or CHT8000 roms.

It is a GSM phone btw, contrary to Ascend.

Edited by pier11
Guest lloco73
Posted

- (no radio, no wifi yet - please help if you can)

it's due to, maybe, different baseband?

Posted (edited)

it's due to, maybe, different baseband?

definitely.

I know in that region our phone is named u8220-6 and if they flash traditional for Europe/Asia GSM roms, like TRE, it breaks the phone...

Edited by pier11
Guest lloco73
Posted (edited)

allready googled but no info about retrieving baseband from phone. Does anyone know how?

For info forum with UM840 firmwares. There they have a cm7 rom and the secondary camera does not work either.

Edited by lloco73

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.