[WIP] - ICS Camera HAL for 2.6 kernel

Search This thread

rapmv78

Senior Member
May 9, 2010
113
791
I have re-written the ICS camera HAL module to be a thin wrapper for the gingerbread libcamera.so and hence it will only work with the 2.6 kernel. The advantage is that getting to gingerbread level functionality should be quick :) Creating a new thread because there is a slight chance that this will work for all qualcomm devices with existing libcamera.so files (with slight mods ofcourse :))

http://www.mediafire.com/download.php?wjf035mz2vzunw4

Here is a zip file which contains the new camera HAL module. README file accompanying it has instructions on the locations for the files. If you already have the previous version of camera HAL working, all you have to do is replace camera.qsd8k.so and libcamera.so with the ones in the zip file.

What works:
1) Preview works.
2) Taking a picture works pretty well.
3) Size of picture is no longer huge.
4) Software zoom works.
5) Most of the other knobs like focus, file size etc. seemed to work as well in my testing.
6) Pretty stable as far as I can see :)

Not working yet:
Video and other fancy stuff.

If people have requests for other qualcomm devices after having tried the HAL included in the zip file, kindly include the following information.
1) logcat from having used the HAL module.
2) build.prop
3) libcamera.so from gingerbread ROM for the device.
4) liboemcamera.so from gingerbread ROM.

Currently known to work on the following devices:
1) Nexus One.
2) HTC Desire
3) HTC HD2

Enjoy and thanks for all the feedback.
 
Last edited:

rapmv78

Senior Member
May 9, 2010
113
791
Updates:

02/09/2012

Working barcode scanner mode

Flashable zip file (should work with texasice's ROMs)
http://www.mediafire.com/?w4fu0u05qtxq3tu

01/30/2012
Working Panorama mode

Flashable zip file (should work with texasice's ROMs)
http://www.mediafire.com/?5r599m5jg5yfaqn

Known issues:
Sometimes screen has some garbage while in Panorama mode viewfinder. Quitting completely from the app and restart or invoking Gallery from inside the app and returning back to camera app should mostly fix it.

Video enabled version:

Fastboot compatible images compiled from evervolv base:

For Stock hboot :
http://www.mediafire.com/?wdlip7h6necetia

For HBoot(s) supporting larger /system partition
http://www.mediafire.com/?f6rz3sz2r97qln0

Source code is now available at
https://github.com/rapmv78/
 
Last edited:

mulerokeh

Senior Member
Apr 22, 2010
144
19
Jakarta
please show me what i have to type in adb to push these files? (sorry i'm noob) :)
is camera.qsd8k.so not included?
sorry for my english.. :D
 
Last edited:

rapmv78

Senior Member
May 9, 2010
113
791
Your upload doesn't include a HAL, and from your instructions I am not sure if you are implying to use the HAL and the GB libcamera and liboemcamera, or the ones included.

Link fixed. The files included in the zip are the ones to be used. The generic libs part is only for people with non nexus one devices and would want help enabling camera on them. Hope this clarifies better.
 

mulerokeh

Senior Member
Apr 22, 2010
144
19
Jakarta
Sorry wrong link. Now updated. Please re-download. And yes the files need to pushed through adb.

if i have installed the previous version, is it right what i have to type in adb?
Code:
adb remount
adb push libcamera.so /system/lib/libcamera.so
adb push camera.qsd8k.so /system/lib/hw/camera.qsd8k.so
adb reboot bootloader
fastboot flash boot boot-new.img
fastboot reboot

please help, i don't know what to do..
thanks.. :D
 

rapmv78

Senior Member
May 9, 2010
113
791
if i have installed the previous version, is it right what i have to type in adb?
Code:
adb remount
adb push libcamera.so /system/lib/libcamera.so
adb push camera.qsd8k.so /system/lib/hw/camera.qsd8k.so
adb reboot bootloader
fastboot flash boot boot-new.img
fastboot reboot

please help, i don't know what to do..
thanks.. :D

If you have previously working camera, you can skip flashing the boot-new.img file. It is there for people who do not have existing ics camera hal. Rest looks fine to me.
 

rapmv78

Senior Member
May 9, 2010
113
791
Is the code specific to qsd8 or just a generic wrapper function? On most "newer" devices you are looking at msm7x30, but generic qsd8 code, much like the gralloc, would still work with a rename.

Sent from my ADR6400L using Tapatalk

It is just a wrapper, but is dynamically linked with the libcamera.so file. So, if kernel change does not change structs and constants, things will work fine with a rename as you suggest. Otherwise it will not.
 
There are none in this hal, that is why it works. What I was intending to say was that if MSMx30 kernel uses different size structs/constants it will not work.

That is why I asked if it was generic code or specialized to qsd8. If the kernel code was not edited, that will be irrelevant because the source is not built (at least not by anyone other than CAF) using an inline kernel.
 

rapmv78

Senior Member
May 9, 2010
113
791
That is why I asked if it was generic code or specialized to qsd8. If the kernel code was not edited, that will be irrelevant because the source is not built (at least not by anyone other than CAF) using an inline kernel.

The hal code itself is generic, but it depends on libcamera.so, which inturn depends on kernel structs and constants to match the running kernel for successful control ioctls/pmem etc.
 
  • Like
Reactions: amolji and AKRRKA

sucon

Member
Feb 25, 2010
14
1
I tried it with (Texas)Ice ICS ROM and network not work. Failed to load driver! Need flash another kernel?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 142
    I have re-written the ICS camera HAL module to be a thin wrapper for the gingerbread libcamera.so and hence it will only work with the 2.6 kernel. The advantage is that getting to gingerbread level functionality should be quick :) Creating a new thread because there is a slight chance that this will work for all qualcomm devices with existing libcamera.so files (with slight mods ofcourse :))

    http://www.mediafire.com/download.php?wjf035mz2vzunw4

    Here is a zip file which contains the new camera HAL module. README file accompanying it has instructions on the locations for the files. If you already have the previous version of camera HAL working, all you have to do is replace camera.qsd8k.so and libcamera.so with the ones in the zip file.

    What works:
    1) Preview works.
    2) Taking a picture works pretty well.
    3) Size of picture is no longer huge.
    4) Software zoom works.
    5) Most of the other knobs like focus, file size etc. seemed to work as well in my testing.
    6) Pretty stable as far as I can see :)

    Not working yet:
    Video and other fancy stuff.

    If people have requests for other qualcomm devices after having tried the HAL included in the zip file, kindly include the following information.
    1) logcat from having used the HAL module.
    2) build.prop
    3) libcamera.so from gingerbread ROM for the device.
    4) liboemcamera.so from gingerbread ROM.

    Currently known to work on the following devices:
    1) Nexus One.
    2) HTC Desire
    3) HTC HD2

    Enjoy and thanks for all the feedback.
    55
    Updates:

    02/09/2012

    Working barcode scanner mode

    Flashable zip file (should work with texasice's ROMs)
    http://www.mediafire.com/?w4fu0u05qtxq3tu

    01/30/2012
    Working Panorama mode

    Flashable zip file (should work with texasice's ROMs)
    http://www.mediafire.com/?5r599m5jg5yfaqn

    Known issues:
    Sometimes screen has some garbage while in Panorama mode viewfinder. Quitting completely from the app and restart or invoking Gallery from inside the app and returning back to camera app should mostly fix it.

    Video enabled version:

    Fastboot compatible images compiled from evervolv base:

    For Stock hboot :
    http://www.mediafire.com/?wdlip7h6necetia

    For HBoot(s) supporting larger /system partition
    http://www.mediafire.com/?f6rz3sz2r97qln0

    Source code is now available at
    https://github.com/rapmv78/
    14
    Got video to work finally with hardware encoder support as well. It is not as smooth as I would like it to, but I do not know what the issue is. I could see that all frames were encoded, so the issue is probably in the encoder or my SD card is slow. Would like some feedback on whether others see some stutters too or not. Updated the second post with new fastboot system images. Also source code is now available on my github, as promised :) DISCLAIMER: The code has a bunch of hacks and is not very clean, as I did not get much time to clean it up before sharing.

    For people with non-nexus devices, you can use the source code to compile your own or here is just the HAL module as a separate download

    http://www.mediafire.com/?87nizd1jrx01j49

    You also need

    media_profiles.xml which should to into /system/etc/

    http://www.mediafire.com/?ig6t931i8h3zhzf

    libmediaplayer.so which should go into /system/lib/

    http://www.mediafire.com/?8jb64a94tdfe4vp

    Here are the source changes for libmediaplayer.so
    --- a/frameworks/base/media/libmediaplayerservice/StagefrightRecorder.cpp
    +++ b/frameworks/base/media/libmediaplayerservice/StagefrightRecorder.cpp

    uint32_t encoder_flags = 0;
    - if (mIsMetaDataStoredInVideoBuffers) {
    + if (0 && mIsMetaDataStoredInVideoBuffers) {
    encoder_flags |= OMXCodec::kHardwareCodecsOnly;
    encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
    }

    Enjoy!!
    13
    Just updated the second post with a new flashable zip to enable panorama mode.
    The black lines should be either completely gone or very rare as far as I can tell.
    A bonus, Gallery hanging randomly should be fixed as well.
    Enjoy and thanks a lot for your feedback. Please keep them coming.
    12
    Have updated the post with another flashable zip file which should fix colors for the panorama mode and also the barcode scanner mode should work now.

    Enjoy!!