yashsingh1/xdaforums huggingface dataset:
[myTouch 3G, Magic Android Development] dferreira:
I haven't released it, because it failed to boot for some weird reason (I suspect the kernel, as it had suffered some recent changes) and I didn't manage to get it fixed before I sold the HTC Magic :(

I can leave here the system.img that I generated and you can test to see if it boots. The problem will be the wifi, which won't work with the matching kernel. I'll redo the compiling, maybe the kernel has been fixed in the meanwhile and post it later. I've added a lot of new AOSP features, such as the live wallpapers, support for all languages, etc.
[myTouch 3G, Magic Android Development] slimatic:
I succeeded with compiling but several things are not working. I would like a walk through on how to proceed with adding features and making fixes to the AOSP. For starters in would like to learn the steps to fixing the following :

sound, APN(won't save my apns), wifi, camera.

eventually I would like to also learn how to add new features like live wallpapers etc. so I can slowly build my ROM.

I was also hoping to get someone insight into where and what to find in the source folders under magicdroid - like vendors, devices, and build etc.

I have really learnt a lot from your post and would like to learn more so I can be better at this.

thanks. good stuff
[myTouch 3G, Magic Android Development] dferreira:
v3 is up.

I've just uploaded the latest. I can't test to see if it is actually booting and working. Try it at your own risk! Unless I get/buy/donated an HTC Magic, I can't really continue contributing for porting Froyo AOSP 2.2 to Magic.

In case you only use the system.img, you need a matching kernel (with the camera fixes) + wlan.ko for wifi and camera to work.

What's new:

- Live wallpapers support.

- Sound recorder is now visible to the user to use.

- All available languages are included.

- Fixed missing sound files.

- Cyanogen's camera fixes are included. Really a pleasure to learn from what he has done!
[myTouch 3G, Magic Android Development] dferreira:
Another update, it wasn't booting but Jack helped me by testing and debugging.

v3.1

v3.1 - thanks to Jack for debugging it!

- Bootanimation is working!

- Wifi + Kernel from Cyanogen, as mine went boggus and I can't test it if it works without a device.

- Full APN list

- Known bugs: camera onscreen controls do FC sometimes. Switching from camera to camcorder works, but fc when reverting back.
[myTouch 3G, Magic Android Development] JackMagic:
General FYI: The above v3.1 is flashable from recovery, you don't extract and flash the .img files via fastboot.

If you encounter any troubles with it (you shouldn't but for some reason I think it went bump along the way before df uploaded it), then download this one instead:

http://drop.io/dffroyo

On further testing it appears the camcorder isn't quite working - maybe it will be fixed some time, but df doesn't have a Magic to compile for anymore! Personally I never use it, but still, now you know.
[myTouch 3G, Magic Android Development] ckale82:
After installing this rom on my device, loop rebooting...

Doh! :/
[myTouch 3G, Magic Android Development] ckale82:
...retry and now work correctly... but... it's slow, very very slow.

Swap isn't active?!?!

# cat /proc/meminfo

MemTotal: 97640 kB

MemFree: 2572 kB

Buffers: 5724 kB

Cached: 20400 kB

SwapCached: 0 kB

Active: 43868 kB

Inactive: 36480 kB

Active(anon): 27648 kB

Inactive(anon): 27164 kB

Active(file): 16220 kB

Inactive(file): 9316 kB

Unevictable: 292 kB

Mlocked: 0 kB

SwapTotal: 0 kB

SwapFree: 0 kB

Dirty: 0 kB

Writeback: 0 kB

AnonPages: 54540 kB

Mapped: 17700 kB

Shmem: 280 kB

Slab: 5240 kB

SReclaimable: 1828 kB

SUnreclaim: 3412 kB

KernelStack: 1960 kB

PageTables: 5040 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

WritebackTmp: 0 kB

CommitLimit: 48820 kB

Committed_AS: 1312488 kB

VmallocTotal: 811008 kB

VmallocUsed: 65528 kB

VmallocChunk: 720892 kB
[myTouch 3G, Magic Android Development] JackMagic:
This doesn't have swap or Apps2SD etc. Did you wipe data/dalvik-cache before you updated?
[myTouch 3G, Magic Android Development] lodewj:
@dferreira

What is the actual difference between the 32b and 32a kernel?

essntially it's the same hardware but with other memory mappings because of the increased memory I guess? I was doing a make menuconfig (to choose the slub alocater instead of slab and stuff like that), when I realised that I have a 32a ... :(

So I would like to work with a kernel 'source' for the 32a offcourse. or is there a patchfile floating around to patch the std ion kernel? Can we use the kernel for the hero as well on a 32a (I'm using the 3.55 radio). Or is it just the same kernel with other options selected?

does someone btw know where the "amss modem firmware version" refers to?

available options are: 6.2.10, 6.2.20, 6.2.20 + NEW ADSP (default), 6.3.50

I'm not new to linux nor kernel compiling but I'm a complete n00b regarding compiling a kernel for a god damn addictive phone (to toy with till late at night and look like a zombie @ work) ;)

I know, a lot of questions but that's what the os community makes worth living for ;)

P.s. please don't mind the spelling mistakes or sentence constructions wich might look like insults addressed to your beloved ones. It's already late here and my braind already went to sleep ;)

cudos and hope to read and fool around some more after I managed to survive @ work tommorrow ;)

edit:

ahh, after some sleepwalking trough google I found some interesting things. So I want to share them for other people who might got interested:

http://androidspin.com/forum/showthread.php?t=2207
[myTouch 3G, Magic Android Development] dferreira:
This is an engineering build, so dexopt only runs once the phone has booted. The first time you run the application, dex files are generated for JIT, taking a little bit longer to load an app the first time, but once its generated, it's much faster.

One advantage of having eng build is that you can run adb as root, without any problems what so ever.

I thought swap is kernel related, not OS, so I assumed that would be taken care off with cyanogen's kernel.

Anyway, I think the problem with the camera app is because we are using hacked drivers, causing problems when requesting some new features that are not on the drivers... unless HTC releases the source for the camera drivers, there isn't much we can do rather than disabling those buttons on the source of the camera app. I did see on kernel 2.6.35 changes that give us support for the donut camera drivers, but I didn't get to compile it on time before selling the phone.

So enjoy this clean AOSP build, this is straight from official source, the only thing that was non official are camera drivers and cyanogens kernel.
[myTouch 3G, Magic Android Development] InTr4nceWeTrust:
thanks for your work. this should suffice until t-mobile drops an official update.
[myTouch 3G, Magic Android Development] sharpt71:
First of all, thanks for writing up such a nice tutorial. Like many others, I really like to build the images and add required packages by myslef. However, I have some problems needed to be solved. The easy one first, when I did "make -j2" after lunch, I got error message like "libGLES_qcom.so is missing". By taking look at unzip-files.sh and sapphire_update.zip, I did notice there is NO libGLES_qcom.so. So, what should I do?
[myTouch 3G, Magic Android Development] JackMagic:
See here:

http://xdaforums.com/showthread.php?p=7001718&highlight=qualcomm#post7001718
[myTouch 3G, Magic Android Development] sharpt71:
Thanks, JackMagic. Now, after I got those missing .so files from CM6-RC1 and rebuild, I got the following errors. Is there anything I did wrong?

Install: out/host/linux-x86/lib/libneo_util.so

host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)

Copying: out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar

Install: out/host/linux-x86/framework/dx.jar

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz

/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz

/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz

/usr/bin/ld: cannot find -lz

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

make: *** Waiting for unfinished jobs....
[myTouch 3G, Magic Android Development] dferreira:
Hi slimatic,

Regarding your questions:

Audio - for MSM boards, you need to disable the prelinkage of that library. You can see how on the first post.

APN - the APN's syntax has changed in Froyo, so you'll need to see how they are done now, and update your APN list accordingly.

WiFi - you need to compile the Kernel + the WiFi module so that they match. If they don't match, bye bye WiFi. You can see how to do it looking at the script on the first post, where it says Kernel and WiFi.

Regarding add/remove packages. All you need to do is change the "device blobs" file inside the vendor's folder. To see how that is done, you can see inside the folder build/target and you'll find generic.mk, sdk.mk and open them and you'll see something about "PRODUCT_PACKAGES". It's just a matter of adding them to the the device blobs.

By the way, if you are interested in having root on the OS by default, it's as easy as: lunch full_xxxx-eng instead of userdebug.
[myTouch 3G, Magic Android Development] dferreira:
Hum... I can't see what went wrong with only that snippet. You need to look for where it says "error", and I don't see that line on that short snippet of output. What I usually do is copy paste the output from the terminal into gedit and search for the work error. That should take you to exactly what is failing.

Hope it helps!
[myTouch 3G, Magic Android Development] JackMagic:
In my non existent knowledge of all things linux, I'd hazard a guess at it either being related to the OS version you're compiling in (x86 or 64), or a linking problem with the lib files (did you read df's bit on fixing prelink issues?).

That is merely a shot in the dark, and could be wrong, but there you go! Sorry I can't be of more help.

Edit: Ninja'd ^^ Told you I don't know what I'm talking about :P
[myTouch 3G, Magic Android Development] hyperion32:
Hello ... check if lib32z-dev (or libz-dev whatever appropriate for your system) is installed
[myTouch 3G, Magic Android Development] sharpt71:
Thanks for your help. First of all, I have to apologize that I made some errors when twittering the whole build thing. It turned out that I havd java5 installed on one VM and java6 on another VM.

Now back to the problems I have. Now I have java5 on both VM (one at home and one at work). The VM at home built the "whole" thing last night. But, system.img was NOT created and a complain about something libaudio.so is missing. Since it was late (about 3~4am), I didn't take note. Now, I am building the same thing again on the VM at office. However, I got the following errors. OK, if I screwed up really bad, I will remove the whole build tree and repo sync again. Thanks!

============================================

PLATFORM_VERSION_CODENAME=AOSP

PLATFORM_VERSION=AOSP

TARGET_PRODUCT=full_sapphire

TARGET_BUILD_VARIANT=userdebug

TARGET_SIMULATOR=false

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

HOST_ARCH=x86

HOST_OS=linux

HOST_BUILD_TYPE=release

BUILD_ID=OPENMASTER

============================================

Checking build tools versions...

************************************************************

You are attempting to build with the incorrect version

of java.

Your version is: java version "1.5.0_18".

The correct version is: 1.6.

Please follow the machine setup instructions at

http://source.android.com/source/download.html
[myTouch 3G, Magic Android Development] hyperion32:
@sharpt71

Hi ... I had the same problem ... so I edit the file build/core/main.mk at around line 114 ... and I commented out the line $(error stop). The same thing for line 130

(use vim +114 /path_to_the_file/ to get you to the right line). Then type make -jx. You will see the errors again ... but it will carry on.

It happens only the first time ... If you let it finish the build ... you can then re-edit the lines 114, 130 and put them back to normal ... re-run make -jx (or make installclean, or make clean) and there are no errors any more.

Please excuse my English ... not my native lang ...
[myTouch 3G, Magic Android Development] anwoo:
anyone has problems downloading from repo using ubuntu under vmware player?

It keeps stopping after a few seconds
[myTouch 3G, Magic Android Development] sharpt71:
The link may help: http://android.amberfog.com/?p=230
[myTouch 3G, Magic Android Development] sharpt71:
Thanks hyperion32. It's going again. Hopefully, I am not messing up something else AGAIN. :p

BTW, have you successfully built up images? In my home VM, system.img was not created. Do you have a clue?
[myTouch 3G, Magic Android Development] hyperion32:
@sharpt71

No ... I am still trying ... but if you do not have the system.img that means that

there is a problem ... So you should be able to find an error somewhere there.

If it is libaudio related then there is a solution on this forum page 6 ... can you check

what is the error ?
[myTouch 3G, Magic Android Development] sharpt71:
I seached this thread and thought I found the solution. Man, it is really hard to track.

Building the images again. Hopefully, this time it will finally work.

In addition to comment out libaudio.so in build/core/prelink-linux-arm.map, one also needed to (which was not mentioned in the 1st post)

as posted by OP

---------------------------------------------------------------------------------

changed hardware/msm7k/libaudio/Android.mk to not prelink that module (around line 28, after default(clear vars)).

---------------------------------------------------------------------------------

that is, one should add SKIP... between include and LOCAL_MODULE

include $(CLEAR_VARS)

# skip libaudio

SKIP_PRELINK_LIBAUDIO := true

LOCAL_MODULE := libaudio
[myTouch 3G, Magic Android Development] hyperion32:
Good news ... this sounds like an alternative solution to what aremcee

proposed on page 6 (in this forum) ... but he was using LOCAL_PRELINK_MODULE := false

I will give it a try ...
[myTouch 3G, Magic Android Development] hyperion32:
@sharpt71

My build stopped at the libaudio error .. I followed the instructions

so I did the modifications in hardware/msm7k/libaudio/Android.mk ...

then I used mmm -B hardware/msm7k/libaudio to build. When done ... I typed

make -jx again. Now ... I am having the following error:

"Install: out/target/product/sapphire/system/bin/audioloop

target Executable: mediaserver (out/target/product/sapphire/obj/EXECUTABLES/mediaserver_intermediates/LINKED/mediaserver)

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Mutex::Mutex()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Mutex::~Mutex()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Condition::~Condition()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Mutex::unlock()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Condition::wait(android::Mutex&)'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Condition::signal()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Mutex::lock()'

out/target/product/sapphire/obj/lib/libcamera.so: undefined reference to `android::Condition::Condition()'

collect2: ld returned 1 exit status

make: *** [out/target/product/sapphire/obj/EXECUTABLES/mediaserver_intermediates/LINKED/mediaserver] Error 1

make: *** Waiting for unfinished jobs...."

Do you get the same ???
[myTouch 3G, Magic Android Development] dferreira:
That error is due to the camera drivers. Get libcamera2 from cyanogens repositories and change the android.mk to use libcamera2 instead of libcamera :)
[myTouch 3G, Magic Android Development] dferreira:
There used to be some problems on the master branch. You needed java6 for master but you also needed 64bit Ubuntu for it to compile. So my advice to all is to install 64bit + java6 as that's what Google has on their machines.

I don't know if they fixed it recently tho.
[myTouch 3G, Magic Android Development] sharpt71:
@dferreira, I got all three files in libcamera2 from cyanogens. Then, I'm lost. Which android.mk should I change? I looked around and did find some android.mk files. But they don't have libcamera defined inside. BTW, is there a rule that I can follow to find the right android.mk? Thanks!
[myTouch 3G, Magic Android Development] sharpt71:
Can it be THE android.mk in libcamera2? If so, I really need to know the rules!! It's different from what I had done in building Linux kernel in the old days.
[myTouch 3G, Magic Android Development] hyperion32:
Thanks for your response ... I will move to ubuntu 64bit now and check ...

BTW ... if you have some time .. can you please provide more info regarding the libcamera2 issue ???
[myTouch 3G, Magic Android Development] dferreira:
No, don't change the Android.mk inside the libcamera2 folder.

Copy the libcamera2 folder from Cyanogen's github to hardware/msm7k. Then you need to change the Android.mk that's inside hardware/msm7k to mention libcamera2 instead of libcamera (technically, you just add a "2" after libcamera :))

There also another thing that I forgot to mention: you need also to edit the file: vendor/htc/sapphire/BoardConfigVendor.mk and add this line:

USE_CAMERA_STUB := false
BOARD_USES_OLD_CAMERA_HACK := true

And comment/remove these lines on vendor/htc/sapphire/device_sapphire-vendor-blobs.mk as we are now creating the libraries from source.

# vendor/htc/sapphire/proprietary/libcamera.so:obj/lib/libcamera.so \
# vendor/htc/sapphire/proprietary/libcamera.so:system/lib/libcamera.so \

Add this line, after you put liboemcamera.so from Cyanogen's Froyo (that's libqcamera.so from Google ION, just with a different name, as it is now standard as liboemcamera.so instead of libqcamera.so).

vendor/htc/sapphire/proprietary/liboemcamera.so:system/lib/liboemcamera.so \

and comment/remove

# vendor/htc/sapphire/proprietary/libqcamera.so:system/lib/libqcamera.so \

That fixes the camera drivers issues. Now all that remains is the kernel to be changed to support the old camera drivers. For that you can just follow what I put on post 1.

If only Qualcomm would release the source code for the camera drivers or an updated Froyo version of them, none of this would be an issue...

I've also updated the prelink map on the first post, so that everything runs smoothly. I've looked into the overlapping libraries that were giving problems with isprelinked *.so and moved them around in the memory mappings when overlapped.
[myTouch 3G, Magic Android Development] InTr4nceWeTrust:
hm....i tried to flash v3.1 zip file with amon-ra's recover image but i can't get past the boot animation that says ANDROID. is it supposed to take long and Im just being impatient?
[myTouch 3G, Magic Android Development] jubeh:
I'm building on Dream. I'm having a problem with Video Camera freezing frame when I switch to it. I left the copy camera.so to /obj/lib and system/lib, plus I didn't add BOARD_USES_BLAH, do you think those would have contributed to my Video Camera problem?

Please say yes... This is taking me longer than it should have.

Also, are any of you having problems with the Gallery 3D when changing orientation, getting weird broken scanlines?

I tried to add Cyanogen's patch: http://github.com/CyanogenMod/andro...mmit/866e4b779917f7584173b4c7e54eb42703eb0e1b

but it didn't seem to do anything. Maybe the patch was for something else.

Do you have that problem?

Have you fixed it?

---edit---

also, if we're not using libcamera.so for anything (from reading the makefiles, the only apparent reason it's being pulled is to direct-copy it to /obj/lib and /system/lib and nothing else), and since we're compiling from source, is there any point at all to pull that camera lib in the first place? Otherwise we could just edit the unzip files script to not pull it and to omit copying it when it sets up the vendor scripts.
[myTouch 3G, Magic Android Development] sharpt71:
Thanks a lot, dferreira. "change the Android.mk that's inside hardware/msm7k" is the file that made me totally lost. Actually, that was the first file I looked into. However, there is no libcamera defined. hardware/msm7k/Android.mk in my VM is defined as follows (comments were intentionally omitted to avoid long message)

common_msm_dirs := libcopybit liblights libopencorehw librpc libstagefrighthw

msm7k_dirs := $(common_msm_dirs) boot libgralloc libaudio

qsd8k_dirs := $(common_msm_dirs) libgralloc-qsd8k libaudio-qsd8k dspcrashd

ifeq ($(TARGET_BOARD_PLATFORM),msm7k)

include $(call all-named-subdir-makefiles,$(msm7k_dirs))

else

ifeq ($(TARGET_BOARD_PLATFORM),qsd8k)

include $(call all-named-subdir-makefiles,$(qsd8k_dirs))

endif

endif

Then, your reply gave me a hint to check out the Android.mk file in cyanogne git. It does have libcamera2 appended in the end of msm7k_dirs. So, if my guess is right, I will do that first to see how things going.
[myTouch 3G, Magic Android Development] JackMagic:
This problem exists on the latest compile df did for Sapphire too, just as an FYI, so it's more than likely an issue with the aosp source than individuals?

@InTr4nceWeTrust: Use the .zip I uploaded a few pages back, not the one df uploaded, and it should work.
[myTouch 3G, Magic Android Development] dferreira:
Cyanogen's libcamera2 already places the files libcamera.so on the correct place, so no need to have them on the vendor/htc/sapphire/device_sapphire-vendor-blobs.mk

I know Cyanogen has made changes to the official camera app, so thats compatible with the older drivers. Get his packages/Camera folder, replacing the one from Froyo and give it a go (I did that for v3).

About Gallery3D. The problem is on the 3D drivers we have. When we rotate the phone, the gallery3D messes up the 3d surface, creating the scanlines. What I did at the time for Cyanogen, was forcing the application to reload the GUI whenever the phone was rotated, changing the onConfigurationChanged inside Gallery.java in packages/Gallery3D. Of course, that also added a new problem, which was the fact that if you changed orientation, you had to go back to where the application starts and go back again to where you were when you rotated...

So my advice would be, ditch Gallery3D. It also eats chunks of memory everytime the phone boots or you mount/unmount the phone with its media scanner... For a picture gallery, I feel that the old Gallery is more than enough, specially on these devices.
[myTouch 3G, Magic Android Development] dferreira:
Yes, just add libcamera2 on the msm7k_dirs :)
[myTouch 3G, Magic Android Development] dferreira:
Thanks Jack, I've added your link on post 1 :)