Anders Brownworth

Technology and Disruption

Fix for Camera & GPS on the Galaxy Nexus with Android AOSP Jelly Bean

Proprietary drivers for the camera and GPS are included in Google's Nexus Drivers page at https://developers.google.com/android/nexus/drivers but the code to copy them into the Jelly Bean AOSP build isn't there. To fix, pull sirfgps.conf from a phone with the factory image: (obtainable from https://developers.google.com/android/nexus/images#takju)

adb pull /system/vendor/etc/sirfgps.conf

or grab a copy here: http://forum.xda-developers.com/showthread.php?t=1322765

and place it in vendor/samsung/maguro/proprietary/sirfgps.conf

Next, add the following to vendor/samsung/maguro/proprietary/Android.mk

###################################
include $(CLEAR_VARS)
LOCAL_MODULE := sirfgps
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := sirfgps.conf
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .conf
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := gps.omap4
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := gps.omap4.so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/hw
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := ducati-m3
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := ducati-m3.bin
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .bin
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/firmware
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := libpn544_fw
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := libpn544_fw.so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib
include $(BUILD_PREBUILT)
###################################

and in the same file, change the LOCAL_MODULE_PATH for fRom to install into $(TARGET_OUT)/bin rather than $(TARGET_VENDOR_OUT)/bin. This drastically speeds up the front / back camera switching and stops the video camera from crashing. The fixed fRom settings should look like this:

###################################
include $(CLEAR_VARS)
LOCAL_MODULE := fRom
LOCAL_MODULE_OWNER := samsung
LOCAL_SRC_FILES := fRom
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
include $(BUILD_PREBUILT)
###################################

Lastly, change your packages list in vendor/samsung/maguro/device-partial.mk to:

###################################
PRODUCT_PACKAGES := \
fRom \
libsec-ril \
libsecril-client \
sirfgps \
ducati-m3 \
gps.omap4 \
libpn544_fw
###################################

Now you should be able to clean compile AOSP and have the camera and GPS working smoothly.

Comments (5)

Luciano Carvalho from Grayslake

Hi Anders,

I have made the changes you proposed above and the build stopped with the error below:

make: *** No rule to make target `vendor/samsung/maguro/proprietary/sirfgps.conf', needed by `out/target/product/maguro/obj/lib/sirfgps.conf'. Stop.

Do you know what could be wrong?

Thanks,

Luciano.

Anders from Cambridge, MA

It looks like sirfgps.conf isn't where I am expecting - pull that file from a phone with the factory image: (obtainable from https://developers.google.com/android/nexus/images#takju)

adb pull /system/vendor/etc/sirfgps.conf

and place it in vendor/samsung/maguro/proprietary/sirfgps.conf

Thanks for the bug report - I've updated the main article.

Andy from Seattle

Have you had any trouble with white-balance settings on the back camera? I had built my own 4.1.1r4 release just recently, but was unable to get rid of a really bad yellow tint which seems to come from wrong white-balance settings on the camera.

Anders from Cambridge, MA

No, I'll give it a try though. I haven't played with 4.1.1r4 yet... Do you have sample images?

Benedikt from Munich

Thanks a lot. I got the camera running for 4.2.1.

In addition to what is described above I had to pull /system/vendor/lib/hw/gps.omap4.so and /system/vendor/firmware/ducati-m3.bin from a working phone and put them into vendor/samsung/maguro/proprietary

Further I had to comment everything including libpn544_fw otherwise it wouldn't build

make clean was not required in my case. Simply a new make did the job.

Leave a Comment

Name:
Location: (city / state / country)
Email: (not published / no spam)
Comment:

No HTML is allowed. Cookies must be enabled to post. Your comment will appear on this page after a moderator OKs it. Offensive content will not be published.

Click the umbrella to submit your comment.

To create links in comments:
[link:http://anders.com/] becomes http://anders.com/
[link:http://anders.com/|Anders.com] becomes Anders.com
Notice there is no rel="nofollow" in these hrefs. Links in comments will carry page rank from this site so only link to things worthy of people's attention.