PDA

View Full Version : LZX Compression


ivanmmj
21st April 2009, 08:43 AM
I made a kitchen for the Herald that creates ROMs in both XPR and LZX compressions and I was wondering if you guys wanted it ported to your phones?

If you want it, I need a few things. This ROM is compatible with Bepe's Extended ROM kitchen. It won't come with OEM, ROM or XIP folders as you can get those yourselves.

The way the kitchen work is:
Run "RunMe.bat"
Choose compression algorithm. (XPR or LZX)
Follow the normal Bepe's kitchen process.
Wait as the kitchen creates the ROM (like Bepe's kitchen, but with whatever compression you chose.)
The kitchen will automatically open up the imgfs.bin in a hex editor and automatically adjust it for the wanted compression before it builds the ROM.
It automatically inserts the proper XIP drivers.
It will automatically set the Pagepool to 4MB but give you the option to change it to something else as it does.
It then automatically creates the NBH and then finally launches whatever flasher (CustomerRUU, FlashCenter, or whatever your devices use) to flash the ROM.


For those who don't know what LZX compression is:
It's a compression algorithm that, although slower (by 1-4% in real life use) gives a good amount of free storage space. In some case (like in the Herald) it makes the ROM so small that it has to be flashed through an SD card due to the Herald's flashing size requirements. On an average 50mb ROM, it takes off about 10mb. The actual cooking itself does take a LOT more CPU and RAM to do in your PC, though. Especially the RAM. (It's because the tools that actually do the compression weren't really optimized for the job.)

Anyhow, let me know if you want it.

mac_es
21st April 2009, 08:58 AM
I would like to view it :)

thanks

tomme45i
21st April 2009, 10:00 AM
Oh yeah I would really love to try it! :)

chanvi93
21st April 2009, 12:26 PM
Oh great , i would really like and need it to cook WM 6.5 rom , please tell us what you need .

ivanmmj
21st April 2009, 07:42 PM
I need to know the following:
What RUU/FlashCenter/Whatever you guys use and a link to it.
What the name of your NBH has to be when flashing through SD card (just an added bonus, not really needed.)
I need to understand what the hex editing is for in this (http://forum.xda-developers.com/showthread.php?t=399779) thread.
I need a cook to volunteer a working ROM's kitchen files.
Lastely, I need two beta testers to test said ROM built in my kitchen. They'll be testing both the algorithms by testing two ROMs and reporting back to me.


EDIT: A few minutes later and I've modified the kitchen. I just need the info that I asked for above to finish it.

mac_es
22nd April 2009, 09:00 AM
I need to know the following:
What RUU/FlashCenter/Whatever you guys use and a link to it.

ROMUpdateUtility.exe, in the forum you can find it. I will search for it, but if you download any radio for trinity (in the wiki) you will have all needed files.

I said radio because of the size (smaller download)


What the name of your NBH has to be when flashing through SD card (just an added bonus, not really needed.)

TRINIMG.NBH (I think)

I need to understand what the hex editing is for in this (http://forum.xda-developers.com/showthread.php?t=399779) thread.

It is for changing the id of the os partition. In the trinity standard is 0x400 (the same in most htc devices), for P3600i the id is 0x401. You will have to make in the bat a choice, and modify the line of inserting os.nb whith nbhutils

I need a cook to volunteer a working ROM's kitchen files.
Lastely, I need two beta testers to test said ROM built in my kitchen. They'll be testing both the algorithms by testing two ROMs and reporting back to me.


Sorry but the trinity is my work phone, and I can't flash it frequently

ivanmmj
22nd April 2009, 07:16 PM
ROMUpdateUtility.exe, in the forum you can find it. I will search for it, but if you download any radio for trinity (in the wiki) you will have all needed files.

I said radio because of the size (smaller download)
Awesome.

TRINIMG.NBH (I think)Thank you.

It is for changing the id of the os partition. In the trinity standard is 0x400 (the same in most htc devices), for P3600i the id is 0x401. You will have to make in the bat a choice, and modify the line of inserting os.nb whith nbhutilsIf this is not already a feature of your kitchen, I can EASILY make it so that if you choose trinity standard you get 0x400 and if you choose P3600i you get 0x401. So I guess this kitchen will have a dual purpose. Out of curiousity, what's the difference between the two devices? And this is done to an NBH file? Wouldn't it be easier to just create the NBH with the proper OS partition address in the first place?


Sorry but the trinity is my work phone, and I can't flash it frequently
That's quite alright. ^_^ I appreciate the knowledge you have volunteered already.

mac_es
23rd April 2009, 12:09 PM
If this is not already a feature of your kitchen, I can EASILY make it so that if you choose trinity standard you get 0x400 and if you choose P3600i you get 0x401.


Thanks, I cook for me so I don't need it.

So I guess this kitchen will have a dual purpose. Out of curiousity, what's the difference between the two devices? And this is done to an NBH file? Wouldn't it be easier to just create the NBH with the proper OS partition address in the first place?


The diffs are a more powerfull CPU (500 MHz) and more ram. Most cookers build for P3600 so the hex edit is for trying a rom cooked for P3600. Yeah, it is more clean to generate a new nbh but you will have to convince the cookers.

FYI, you should make a separate device in the xip section, in the OEMXIPKernel. The nk.exe for P3600i should be at least rev3, and most of cookers of P3600 use nk.exe rev0

ivanmmj
24th April 2009, 06:47 AM
Kitchen finished but before I upload it, I think I'm going to add a script to allow both P3600 and P3600i creation. If you can get me nk.exe rev3 and it works on all trinity's, I can go ahead and make it so that it automatically updates the nk.exe on all ROMs cooked in the kitchen. Make sure it's in module form.

mac_es
24th April 2009, 11:51 AM
If you can get me nk.exe rev3 and it works on all trinity's, I can go ahead and make it so that it automatically updates the nk.exe on all ROMs cooked in the kitchen


nk.exe rev3 works on all trinitys but it has an issue whith saving DPAPI keys in the file system. As result, after some resets you have lost all the passwords stored in the device.

To avoid this you should add a key in boot.rgu. (Take a look to the thread of P3600i or to chanvi's wm6.5 rom) Chanvi stated that even whith that key there are some issues (though it is working fine for me).

Also I prefer nk.exe rev0 to rev3. The device is better in response time (at least for me).
Also it has been appeared a "new" nk.exe, which chanvi use in his rom that should work in any trinity. I don't know if it is better or not than rev0...

ivanmmj
24th April 2009, 05:48 PM
Hmm... I now have to decide if it's worth the time, seeing as I'm making kitchens for EACH device and working on two Herald ROMs (while working full time). I've got two options, make it so that the right rev and registry keys go with the right device automatically, or let people do it themselves. Does anyone by any chance have both files already ready along with the registry keys? It would help a lot (since I'm already downloading kitchens and ROMs from EVERY device, it's a lot more work to research and download even more kitchens.

tomme45i
4th May 2009, 04:56 PM
Here is info (ONLY FOR COOKS), how to make LZX compression work on our kitchen. This method is tested by myself and everything works fine.
Short step by step instruction:
1. Download fixed version of cecompr_nt.dll from HERE (http://forum.xda-developers.com/showthread.php?p=3462665)
2. Replace cecompr_nt.dll from kitchen to downloaded file.
3. Download from attachement cecompr.dll and replace it in your XIP section.
4. Open os.nb.payload in HEXeditor and find beginning of imgfs. Here is how it looks in my case (ULDR removed):
00280000 F8 AC 2C 9D E3 D4 2B 4D BD 30 91 6E D8 4F 31 DC ř¬,ťăÔ+M˝0‘nŘO1Ü
00280010 01 00 00 00 01 00 00 00 01 00 00 00 34 00 00 00 ............4...
00280020 08 00 00 00 00 02 00 00 00 10 00 00 58 50 52 00 ............XPR.
5. Replace XPR to LZX, and save this file.
6. Now you can cook with LZX compression = about 9-10 MB more free space on storage :cool:

chanvi93
5th May 2009, 02:41 PM
Hi Tomme45i
Don't boot for me , what mean (ULDR removed) , i have he same HEWEditor that you but my os.nb.payload is a "reducer" , may be it's the error ?

tomme45i
5th May 2009, 09:15 PM
what mean (ULDR removed)

Hi chanvi93
You can read something more about ULDR HERE (http://forum.xda-developers.com/showpost.php?p=2916649&postcount=7). Removing ULDR partition gives you about 3 MB more free space on internal storage. You can edit it by yourself manually, or you can use XipporterEx by Ervius & udK (it is implemented in visual kitchen by ervius (http://forum.xda-developers.com/showthread.php?t=469420)). Ervius kitchen have also payload_reducer, so after removing ULDR and reducing size, my os.nb.payload have size 2.6 MB :) You must remember to change start insert address for XIP section, otherwise your device will hang on the second splashscreen.

nosedive
5th May 2009, 09:31 PM
Hi chanvi93
You can read something more about ULDR HERE (http://forum.xda-developers.com/showpost.php?p=2916649&postcount=7). Removing ULDR partition gives you about 3 MB more free space on internal storage. You can edit it by yourself manually, or you can use XipporterEx by Ervius & udK (it is implemented in visual kitchen by ervius (http://forum.xda-developers.com/showthread.php?t=469420)). Ervius kitchen have also payload_reducer, so after removing ULDR and reducing size, my os.nb.payload have size 2.6 MB :) You must remember to change start insert address for XIP section, otherwise your device will hang on the second splashscreenie.

finally some great news..
i will try that on my kitchen - thx ivan thx tommi

chanvi93
13th May 2009, 10:51 AM
Thanks Tommi45i ,
Finaly , i use visual Ervius-Bepe kitchen and shared it with all .

ivanmmj
13th May 2009, 09:35 PM
Yea, sorry, I got somewhat swamped with xda "work."
I worked with Ervius to add LZX compression to his visual kitchen, so anyone using it can now enjoy LZX compression.

tonio94
6th June 2009, 11:37 PM
Hi ivanmmj,

I have a strange result trying to add LZX to my kitchen :

It seems to be partly working as building is much much slower while adding file but the resulting os.nb is 10Mo bigger than with XPR compression and storage at first boot falls from 20Mo.

Any idea on why it's not working as expected ?