Jump to content

Android 2.2 Development


Guest eckengucker1

Recommended Posts

Guest McSpoon
libcamera.so depends on libmmcamera.so and libmm-qcamera-tgt.so which in turn depend upon libmmjpeg.so and libmmipl.so which in turn only depend on standard system shared libs.

Your post just reminded me of a useful command for discovering dependencies.

readelf -d libcamera.so

Link to comment
Share on other sites

Guest totiadrenalin
Yes but if you leave the froyo broken then you won't be able to install any application made for 2.2 that has the ability to install to the SD. You will find over the weeks that more and more apps will have the SD support built in. Imagine not being able to update your apps!

Camera is tricky. I've replaced the camera lib and the added the libs that AdamBaker mentioned but the camera app crashes. This needs more work.

What about the front camera?

in /sys/devices/virtual/msm_camera/ we have msm_camera0 and msm_camera1

So maybe this camera application can't recognise which one is front and whisch one is rear cam?

Link to comment
Share on other sites

Guest Simon O
Is there anything interesting in logcat or dmesg when the camera app crashes? Is youtube still crashing on this config (if so it might be playing the video while you frame the shot that is crashing, not the camera itself)

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): FATAL EXCEPTION: Thread-8

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): java.lang.NoSuchMethodError: android.hardware.Camera.open

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): at com.android.camera.CameraHolder.open(CameraHolder.java:106)

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): at com.android.camera.Camera.ensureCameraDevice(Camera.java:1532)

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): at com.android.camera.Camera.access$4700(Camera.java:92)

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): at com.android.camera.Camera$4.run(Camera.java:825)

09-05 22:24:49.895: ERROR/AndroidRuntime(2173): at java.lang.Thread.run(Thread.java:1096)

Why would Youtube be crashing if I'm trying the camera app?

Link to comment
Share on other sites

Guest Simon O
What about the front camera?

in /sys/devices/virtual/msm_camera/ we have msm_camera0 and msm_camera1

So maybe this camera application can't recognise which one is front and whisch one is rear cam?

What about the front camera? Do you mean the front camera that has never worked in any other Android app apart from the built-in camera application (so it's next to useless). :P

Edited by flibblesan
Link to comment
Share on other sites

Guest Simon O
Your post just reminded me of a useful command for discovering dependencies.

readelf -d libcamera.so

Doesn't work as the readelf bin is missing.

edit: ah ok. I guess this is meant to be run on your own computer. I don't use Linux.

Edited by flibblesan
Link to comment
Share on other sites

Guest Patrik W
Doesn't work as the readelf bin is missing.

edit: ah ok. I guess this is meant to be run on your own computer. I don't use Linux.

Can you post the libcamera.so? I can help you with checking that!

Link to comment
Share on other sites

Guest AdamBaker
Can you post the libcamera.so? I can help you with checking that!

I've already checked it - that's why I listed its dependencies. The logcat indicates it isn't even getting that far though - I'm suspecting that at build time the Froyo build process is deciding there is no camera support and not including core/java/android/hardware/Camera.java in /system/frameworks/framework.jar

edit: also note that readelf won't work for libcamera.so because for no obvious reason it uses dlopen to pull in its dependencies (with a fatal error if they are not found), I searched using

strings -a libcamera.so | grep '\.so'

Edited by AdamBaker
Link to comment
Share on other sites

Guest Simon O
I've already checked it - that's why I listed its dependencies. The logcat indicates it isn't even getting that far though - I'm suspecting that at build time the Froyo build process is deciding there is no camera support and not including core/java/android/hardware/Camera.java in /system/frameworks/framework.jar

Ah I think I remember Tom saying he built Froyo without camera support.

Link to comment
Share on other sites

Guest Simon O
Oh man. I really hope the SMS bug is fixed with Froyo! If not, I'll probably just get a new phone. :)

I've not had it so far even with my stress testing experiments :P

Link to comment
Share on other sites

Bleh, just tried to compile mkbootimg for windows, was going to add Darktremor a2sd to init.rc. I have managed to assemble an exe which looks and acts just like mkbootimg, with the exception that it fills my boot.img's with zeroes :P

Link to comment
Share on other sites

Guest Patrik W
Ah I think I remember Tom saying he built Froyo without camera support.

Here is what Tom G said earlier about the camera-support:

"The camera is not working. Android fails to build without camera support, so I am currently building it with the stub driver. This emulates a camera, but it is not actually driving the hardware. While you will see camera support you will never get a picture out of it with the current setup."

Link to comment
Share on other sites

Guest Simon O

Got a fix for the wifi guys:

adb shell;

su

chmod 6751 /system/bin/netcfg

chmod 0440 /system/etc/dbus.conf

chown 1002:1002 /system/etc/dbus.conf

chmod 0550 /system/etc/dhcpcd/dhcpcd-hooks

chown 1014:2000 /system/etc/dhcpcd/dhcpcd-hooks

chmod 0755 /system/xbin/tcpdump

chown 0:0 /system/xbin/tcpdump

chmod 02755 /system/bin/ping

chown 0:3004 /system/bin/ping

Link to comment
Share on other sites

Thanks. So to fix networking completely you need to:

chmod 6751 /system/bin/netcfg

chmod 0644 /system/etc/dbus.conf

chmod 0644 /system/etc/dhcpcd/dhcpcd-hooks

chmod 0755 /system/xbin/tcpdump

chmod 0755 /system/bin/ping

The only one needed for networking to work properly in netcfg. The 751 bit doesn't really matter, as long as the the first digit is 6 or 4 and the rest have execute it would work. However that permission is required because something else isn't right (it means that when netcfg runs it has root permissions which fixes its other permissions problems).

Nice find with the dhcpcd one, that may be the cause of the underlying problem.

Is there a reason the froyo testing is using the Hungarian kernel mixed with bits of userspace from the UK ROM. If any kernel / userspace interfaces have changed between Hungarian and UK kernels that could introduce some instability.

I still don't understand what the issue is with taking eclair libs for the camera unless it is just working out the required dependencies. If you use libcameraservice.so from froyo and libcamera.so from eclair the interface between those 2 shouldn't have changed.

libcamera.so depends on libmmcamera.so and libmm-qcamera-tgt.so which in turn depend upon libmmjpeg.so and libmmipl.so which in turn only depend on standard system shared libs.

There is no UK userspace in it, it is all HU. There is no reason other than that the Hungarian rom was all I had to work with when I started. It should be easy to move to a different set of libraries.

The don't know what the camera problem is, but you may want to look at the codeaurora source instead of aosp, the interface may be different. When I started all of this if the camera library was included the build would fail when linking the camera stuff. After porting the audio from codeaurora (which also needed a lot of other stuff) it now compiles successfully with the camera library included but the rom is not bootable.

When I have some time I will do a build on some old source and let you know what the compile error was, and also let you know what the boot error is now.

I've already checked it - that's why I listed its dependencies. The logcat indicates it isn't even getting that far though - I'm suspecting that at build time the Froyo build process is deciding there is no camera support and not including core/java/android/hardware/Camera.java in /system/frameworks/framework.jar

Its using the stub driver as it won't boot any other way. I don't think copying libraries straight into the rom will work, it seems like a new build is required.

Link to comment
Share on other sites

Guest Simon O
The only one needed for networking to work properly in netcfg. The 751 bit doesn't really matter, as long as the the first digit is 6 or 4 and the rest have execute it would work. However that permission is required because something else isn't right (it means that when netcfg runs it has root permissions which fixes its other permissions problems).

Nice find with the dhcpcd one, that may be the cause of the underlying problem.

There is no UK userspace in it, it is all HU. There is no reason other than that the Hungarian rom was all I had to work with when I started. It should be easy to move to a different set of libraries.

The don't know what the camera problem is, but you may want to look at the codeaurora source instead of aosp, the interface may be different. When I started all of this if the camera library was included the build would fail when linking the camera stuff. After porting the audio from codeaurora (which also needed a lot of other stuff) it now compiles successfully with the camera library included but the rom is not bootable.

When I have some time I will do a build on some old source and let you know what the compile error was, and also let you know what the boot error is now.

Its using the stub driver as it won't boot any other way. I don't think copying libraries straight into the rom will work, it seems like a new build is required.

Ignore most of those permissions. We found that they break wifi :P They should be:

chmod 6751 /system/bin/netcfg

chmod 0440 /system/etc/dbus.conf

chmod 0550 /system/etc/dhcpcd/dhcpcd-hooks

chmod 0755 /system/xbin/tcpdump

chmod 02755 /system/bin/ping

chown 1002:1002 /system/etc/dbus.conf

chown 1014:2000 /system/etc/dhcpcd/dhcpcd-hooks

chown 0:0 /system/xbin/tcpdump

chown 0:3004 /system/bin/ping

I only added these as a fix due to the permissions totiadrenalin posted didnt work.

Interestingly CyanogenMod 6 has netcfg set to 2750

Edited by flibblesan
Link to comment
Share on other sites

Interestingly CyanogenMod 6 has netcfg set to 2750

Thats what it should be. 2 means it will run with the permissions of the group even if the user is not a member of the group.

Link to comment
Share on other sites

Guest Simon O
Thats what it should be. 2 means it will run with the permissions of the group even if the user is not a member of the group.

Ah, I understand now. So something elsewhere in the system is preventing this from working with those permissions?

Link to comment
Share on other sites

Try it with Angry Birds. On 2.2 it tries to install to the SD. If I edit the APK manifest to remove the line that tells Android to install to SD, it will install fine. The Froyo A2SD just doesn't work.

Here is a trace of vold while trying to install that app.

[pid  1092] select(14, [10 11 13], NULL, NULL, NULL <unfinished ...>

[pid  1054] select(8, [6 7], NULL, NULL, NULL <unfinished ...>

[pid  1047] restart_syscall(<... resuming interrupted call ...> <unfinished ...>

[pid  1092] <... select resumed> )	  = 1 (in [13])

[pid  1092] read(13, "asec list\", 254) = 10

[pid  1092] writev(3, [{"\3", 1}, {"VoldCmdListener\", 16}, {"asec list\", 10}], 3) = 27

[pid  1092] open("/mnt/secure/asec", O_RDONLY|O_LARGEFILE|O_DIRECTORY) = 14

[pid  1092] getdents64(14, /* 2 entries */, 4200) = 48

[pid  1092] getdents64(14, /* 0 entries */, 4200) = 0

[pid  1092] close(14)				   = 0

[pid  1092] write(13, "200 asec operation succeeded\", 29) = 29

[pid  1092] futex(0x14088, FUTEX_WAKE_PRIVATE, 1) = 0

[pid  1092] select(14, [10 11 13], NULL, NULL, NULL) = 1 (in [13])

[pid  1092] read(13, "asec create smdl2tmp1 13 fat b15057997e90cbb534830d69d0393e5a 10019\", 254) = 68

[pid  1092] writev(3, [{"\3", 1}, {"VoldCmdListener\", 16}, {"asec create smdl2tmp1 13 fat {} 10019\", 38}], 3) = 55

[pid  1092] access("/mnt/secure/asec/smdl2tmp1.asec", F_OK) = -1 ENOENT (No such file or directory)

[pid  1092] open("/mnt/secure/asec/smdl2tmp1.asec", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0600) = 14

[pid  1092] ftruncate(14, 13870592)	 = 0

[pid  1092] close(14)				   = 0

[pid  1092] mknod("/dev/block/loop0", S_IFBLK|0660, makedev(7, 0)) = -1 EEXIST (File exists)

[pid  1092] open("/dev/block/loop0", O_RDWR|O_LARGEFILE) = 14

[pid  1092] ioctl(14, 0x4c03, 0x40119500) = -1 ENXIO (No such device or address)

[pid  1092] open("/mnt/secure/asec/smdl2tmp1.asec", O_RDWR|O_LARGEFILE) = 15

[pid  1092] ioctl(14, 0x4c00, 0xf)	  = 0

[pid  1092] ioctl(14, 0x4c02, 0x40119474) = 0

[pid  1092] close(14)				   = 0

[pid  1092] close(15)				   = 0

[pid  1092] open("/dev/device-mapper", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)

[pid  1092] writev(3, [{"\6", 1}, {"Vold\", 5}, {"Error opening devmapper (No such file or directory)\", 52}], 3) = 58

[pid  1092] writev(3, [{"\6", 1}, {"Vold\", 5}, {"ASEC device mapping failed (No such file or directory)\", 55}], 3) = 61

[pid  1092] open("/dev/block/loop0", O_RDONLY|O_LARGEFILE) = 14

[pid  1092] ioctl(14, 0x4c01, 0)		= 0

[pid  1092] close(14)				   = 0

[pid  1092] unlink("/mnt/secure/asec/smdl2tmp1.asec") = 0

[pid  1092] write(13, "406 asec operation failed (No such file or directory)\", 54) = 54

[pid  1092] futex(0x14088, FUTEX_WAKE_PRIVATE, 1) = 0

[pid  1092] select(14, [10 11 13], NULL, NULL, NULL

There is nothing mounted at /mnt/secure/asec/, so it will fail trying to write to the read-only rootfs. I think either the tmpfs at /mnt/asec should be at /mnt/secure/asec or /mnt/secure/asec should be a symlink to /mnt/asec. I will try adding a symlink later.

Link to comment
Share on other sites

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.