Jump to content

a way to cleanly integrate u8220 eclair libcamera.so into froyo


Guest dr.flo

Recommended Posts

EDIT: For those that are not interested in technical discussions, just have a look at the new CM7.2 ROM that features my camera work among various improvements from other contributors

old post:

Most of you know that we have a working camera with CM6 (froyo) ROMs. Some of you also know that, in theory, a camera lib that works on froyo can be used for gingerbread as well - because CM7 has a built-in wrapper to allow the use of froyo compatible libcamera binaries.

Now, so why does the pulse have a camera in froyo and not in gingerbread? The answer is simple: our libcamera isn't froyo compatible. There were two major changes between eclair and froyo:

  • libui was split into libui, libcamera_client and libsurfaceflinger_client
  • components inside libbinder ("MemoryDealer" and others) were modified and expose a slightly different API

Both changes affect libcamera. First it is unable to resolve all dependencies because it was only linked to libui. It misses things that now reside in libcamera_client. Additionally, even if the dependency issue is resolved by some wrapper, libcamera will crash because it fails to allocate memory correctly.

In CM6, the camera only works because all above mentioned changes (eclair -> froyo) have been reverted when compiling CM6 for the pulse. The libui of CM6 (for the pulse, not in general!) is merged again with libcamera_client. Therefore, you won't find libcamera_client.so in a pulse CM6 ROM. Also, libbinder is modified to use eclair MemoryDealer. As a consequence, any library that depends on either libbinder, libui, libcamera_client or libsurfaceflinger_client is different in pulse-CM6 compared to any other CM6 build.

I followed an alternative approach: instead of patching the CM source to work with an old binary, I hexedited the binary to load an additional library. This additional library ("camera.so") contains wrappers for libbinder and libcamera_client.

The combination of hexedited "libcamera.so" and helper library "camera.so" integrates into an existing ROM like a normal froyo compatible libcamera.

It should therefore work on any froyo ROM, or on any non-froyo ROMs that require a froyo libcamera.

Anyone wants to know what happens when placing those two small files into a CM7 ROM? Be prepared... ;)

Edited by dr.flo
Link to comment
Share on other sites

Status: Functionality of the wrapper

#1

ROM: CM7.2 (the one from this post) with kernel .29

photo: no issues known (have taken about 20 3MP pictures in a row)

video: locks up when trying to save the recording. Low quality recordings work.

#2

ROM: CM7.1 (dtox125 old version august 2011) with kernel .29

photo: same as #1

video: same as #1

#3

ROM: u8150-froyo (pier11 reference rom) with kernel exchanged to .32 compat kernel

photo: same as #1

video: no recording possible at all. logcat suggests video encoder component VENC_OMX doesn't run. Maybe an issue with this specific rom (audio is also broken there)

#4

ROM: stock eclair 2.1 (with modified wrapper that links to libui instead of libcamera.so; just to test libbinder part of the wrapper)

photo: no issues

video: no issues

#5

ROM: CM6 TXG mod (with modified wrapper that links to libui instead of libcamera.so; just to test libbinder part of the wrapper)

photo: no issues

video: no issues

#6 - reported by pier11

ROM: CM7.2 dtox new with kernel .32 compat

photo: no issues

video: same as #1

#7

ROM: CM6 clean (rebuilt from source without BOARD_USES_ELCAIR_LIBCAMERA, therefore normal froyo libcamera_client, libsurfacfinger_client and MemoryDealer)

photo: no issues

video: no issues

Several users have reported the video issue to dissappear after a reboot. I could not yet verify this. For me, even after a reboot, video on high quality still locks up.

Zoom is not available, seems to be implemented vendor specific in eclair. No fix possible for this. There is also no zoom in our current CM6.

The wrapped parts (MemoryHeapPmem, which is 1:1 identical in froyo and gingerbread; CameraParameters which is damn simple) do not seem to cause the HQ video recording issues. Otherwise they would be present on rom #7 as well.

I consider the work on this wrapper as finished.

Additional note on video: With ROM #1, you may want to try lgCamera or similar apps. lgCamera managed to record H.263 in 430x320 (this is what HQ would be in built-in camera app) without issues.

Edited by dr.flo
Link to comment
Share on other sites

wow so camera works now? is this with pier's .32 kernel?

edit

woot camera works!

but video capture force closes after trying to save recording

fyi the rom is using .29 kernel

good work dr flo!

Edited by peelie
Link to comment
Share on other sites

...

but video capture force closes after trying to save recording

fyi the rom is using .29 kernel

The ROM uses .29 kernel because libcamera needs the old camera interface. But since pier11 also has a version of .32 kernel which exposes the old camera interface, we are not stuck with the old kernel. For testing things, though, I think the old kernel is fine right now.

I can confirm the freezing issue after video recording. For me, although it crashes, it looks like the video is saved to the sd card (DCIM folder). I will do some further tests when I have time. But I don't expect an easy solution.:(

Link to comment
Share on other sites

Have you tried changing the quality settings? For me, video recording doesn't lock up if I select low quality or MMS quality. High quality and YouTube make video recording crash.

Can anyone confirm?

I'm not quite sure yet if this issue is really related to the wrapper. I will do some further tests during the day... (e.g. test the wrapper on a froyo rom)

Link to comment
Share on other sites

Guest lloco73

fast test on u8230.

photos are ok. on video when selected high quality app stopped responding. rebooted and tested again and it recorded on high res. only prob is that zoom buttons do not work.

Link to comment
Share on other sites

fast test on u8230.

photos are ok. on video when selected high quality app stopped responding. rebooted and tested again and it recorded on high res. only prob is that zoom buttons do not work.

I have the same result, the video problem only hapens the first time, reboot the phone and now i am able to make video.

This is amazing! We have been waiting for this so mutch time.

Great job!

Link to comment
Share on other sites

I have the same result, the video problem only hapens the first time, reboot the phone and now i am able to make video.

This is amazing! We have been waiting for this so mutch time.

Great job!

I can confirm above.

Video starts work after reboot. First time it didn't work.

I test on dtox's 7.2 compiled against 2.6.32 kernel.

Just updated 3 libs from your upload.

Awesome work, man!!

(though still keep wanting crack msm7225 froyo camera libs to pave a way to msm7227 gingerbread libs, to ics?...)

Edited by pier11
Link to comment
Share on other sites

This means dtox compiled the kernel from compat-branch. I didn't know that, thought that ROM would have new camera API, otherwise I would have used that ROM for the tests.

To all who gave feedback. Thanks for testing. I'll add this to my status list in post two.

Regarding ZOOM not working. I don't know - does the pulse support Zoom at all? Is it supported in stock 2.1 roms? Anyways it would just be "software zoom" which is of no value. It only means cropping the recording area. No real optical zoom.

@pier11: I agree that on the long term, having the newer libs running would be a better approach. Especially a native gingerbread lib would be fine. With the current solution, we need to compile gingerbread with BOARD_USE_FROYO_LIBCAMERA - luckily this influences only libcameraservice, because the differences between froyo and gingerbread are quite small.

Link to comment
Share on other sites

This means dtox compiled the kernel from compat-branch. I didn't know that, thought that ROM would have new camera API, otherwise I would have used that ROM for the tests.

He did in fact.

But I tested it with my freshly compiled kernel form compat branch. (Testing my wifi re-integration among other things).

Link to comment
Share on other sites

To those that can record HQ video after a reboot: I could not reproduce that...

  • if you used the rom download linked in this thread: did you change any settings in the ROM (cyanogenmod settings / swap / compache / VM size / JIT etc / overclock )
  • what camera sensor do you have - just look at the shape of the camera sensor, see this post ?????

my sensor is mt9t013, maybe all of you that can record video have a OV3647 like pier11?

Edited by dr.flo
Link to comment
Share on other sites

Guest lloco73

To those that can record HQ video after a reboot: I could not reproduce that...

  • if you used the rom download linked in this thread: did you change any settings in the ROM (cyanogenmod settings / swap / compache / VM size / JIT etc / overclock )


for me just a fresh install withou any changes to the ROM


...
what camera sensor do you have - just look at the shape of the camera sensor, see this post ?????

my sensor is mt9t013, maybe all of you that can record video have a OV3647 like pier11?

Just reloaded stock rom and here are the details:

touch screen type: synaptics-rmi-touchscreen

External camera type: mt9t013_byd

Internal camera type:ov7690

Edited by lloco73
Link to comment
Share on other sites

for me just a fresh install withou any changes to the ROM

Just reloaded stock rom and here are the details:

touch screen type: synaptics-rmi-touchscreen

External camera type: mt9t013_byd

Internal camera type:ov7690

thanks for doing this detailed testing... While you're on stock rom - can you check if it features zoom? I don't remember - never used it....

Seems you have my hardware. I'm still wondering.... HQ video still working for you?

It worked for me once or twice, but normally it crashes... Anyone that said HQ video is working - is it still working?

Link to comment
Share on other sites

Guest lloco73

thanks for doing this detailed testing... While you're on stock rom - can you check if it features zoom? I don't remember - never used it....

Seems you have my hardware. I'm still wondering.... HQ video still working for you?

It worked for me once or twice, but normally it crashes... Anyone that said HQ video is working - is it still working?

Sorry just return to FLB

on FLB1.7 zoom works and does not crashes.

Link to comment
Share on other sites

It worked for me once or twice, but normally it crashes... Anyone that said HQ video is working - is it still working?

not to worry - video hung again :) But phone restored by itself after some time.

Video got recorded fine though.

Link to comment
Share on other sites

Status: Functionality of the wrapper

#3

ROM: u8150-froyo (pier11 reference rom) with kernel exchanged to .32 compat kernel

photo: same as #1

video: no recording possible at all. logcat suggests video encoder component VENC_OMX doesn't run. Maybe an issue with this specific rom (audio is also broken there)

As I remember people of u8120 (pulse-mini type on vodafone) on xda site struggled with video recording when ported u8150 froyo rom. Solution was to replace libaudio. So sound and video recording is pretty much correlated, while taking just pictures - not.

u8120 as us has never experienced official froyo...

EDIT:

may be not the most relevant, but referense to dev here.

EDIT2:

another reference to the same (first post):

"Video camera fixed. Please download the attachment libaudio.zip to extract and replace /system/lib/libaudio.so"

Edited by pier11
Link to comment
Share on other sites

As I remember people of u8120 (pulse-mini type on vodafone) on xda site struggled with video recording when ported u8150 froyo rom. Solution was to replace libaudio. So sound and video recording is pretty much correlated, while taking just pictures - not.

I tried with libaudio from CM6. No more noise, now no audio at all. Locat shows some error with libaudioflinger. If I put that also (from CM6), system won't boot. Unsatisfied link error.

I will try the libs from clean-CM6-pulse tonight (=CM6 for the pulse from source, compiled without libui/libbinder hacks, these make CM6-pulse libs incompatible with other ROMs).

Link to comment
Share on other sites

Guest desalesouche

hi to all .i just install your new rom.with gapps-gb 06132011 and dtapps2sd 2.5.7.2...everything is working fine...i could make hq videos after the first installation... i also had a crash after using youtube quality.but video was recorded..videos are store in dcim on sd...the zoom is not working...about picture; everything is working great...couldnĀ²t use the secret code about the cameras/lenses coz t-mobile i guess...so i give you old way...on left top corn it is saa 10/05...........on top right side it is saa 10/14....

would like to say thx for that good job...do u install your rom with same gapps than me or another one...sorry if it is a stupid question and do u do this order 1/ your rom 2/gapps 3/dtapps2sd. does this version rom is rooted;

Edited by desalesouche
Link to comment
Share on other sites

To those that can record HQ video after a reboot: I could not reproduce that...

  • if you used the rom download linked in this thread: did you change any settings in the ROM (cyanogenmod settings / swap / compache / VM size / JIT etc / overclock )
  • what camera sensor do you have - just look at the shape of the camera sensor, see this post ?????

my sensor is mt9t013, maybe all of you that can record video have a OV3647 like pier11?

i have the mt9t013 and video recording force closes

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.