# [DEV] ICS Camera + HD video HW acceleration Fix



## PresidentPutin

#EDIT 2/15:
*Le Pan II drivers may have been dumped, check it out:*
http://rootzwiki.com/topic/18295-for-developers-lib-files-with-hw-acceleration/

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

*Perhaps camera and HD acceleration (OMX) drivers can be pulled from the HTC Jetstream:*
http://forum.xda-dev...play.php?f=1274

Same SoC as the HP TouchPad, and the HTC device runs Honeycomb. Afaik Honeycomb uses same driver model as ICS.

*Also, the Le Pan II seems to have identical specs, to the HP TouchPad, and also has the same SoC:*
http://www.newegg.co...N82E16834322002

Maybe this will help getting cam / hd hw acceleration working. Perhaps a driver port.

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

*Proposed fix is in this 7zip archive:*
http://www.mediafire...9ulh3eavq6w28fv (nvm this turns out to be GINGERBREAD)

Make a nandroid backup of your Touchpad before trying it out.

The archive contains proposed fix for camera and HD video hw acceleration.

Need to use a tool like Root Explorer, or adb to push the files onto /system/lib

May need to chmod to 644.

Enjoy.


----------



## Divine_Madcat

PresidentPutin said:


> *Two proposed fixes are in this 7zip archive:*
> http://www.mediafire...xttxees1tlix3pe
> 
> Make a nandroid backup of your Touchpad before trying it out.
> 
> The 7zip archive contains two proposed fixes in two separate folders (both folders contain proposed fix for camera and HD video hw acceleration).
> 
> Need to use a tool like Root Explorer, or adb to push the files onto /system/lib
> 
> May need to chmod to 644.
> 
> Enjoy.


Um.. awesome if true, but can i inquire about the source of this? I have to admit, these fixes don't come out of nowhere....


----------



## GoldenOski

Divine_Madcat said:


> Um.. awesome if true, but can i inquire about the source of this? I have to admit, these fixes don't come out of nowhere....


agree. I don't mean to bash on the OP but it would be nice to know where this fix came from.


----------



## PresidentPutin

GoldenOski said:


> The 7zip archive contains *two* *proposed fixes*


----------



## suppliesidejesus

No dice. Tried both of them, neither did anything for me. Thanks for trying, though.


----------



## PresidentPutin

suppliesidejesus said:


> No dice. Tried both of them, neither did anything for me. Thanks for trying, though.


You've tested both proposed fixes, both webcam and video acceleration?


----------



## GoldenOski

PresidentPutin said:


> You've tested both proposed fixes, both webcam and video acceleration?


Did the proposed fixes work for you? I'm willing to try it once I get home


----------



## suppliesidejesus

PresidentPutin said:


> You've tested both proposed fixes, both webcam and video acceleration?


Both folders contain all of the same files. I tried both sets of files. There was no change to the camera or HW video.


----------



## PresidentPutin

Uploaded new proposed fix, updated OP link.


----------



## cme4oil

So where did this proposed fix come from OP?


----------



## kingzope

After installing the 3rd proposed fix it will not make it to the bootanimation. Nandroid backup FTW lol.


----------



## PresidentPutin

cme4oil said:


> So where did this proposed fix come from OP?


Qualcomm made them, for Snapdragon Generation 3 SoC devices running Android 4.x


----------



## PresidentPutin

kingzope said:


> After installing the 3rd proposed fix it will not make it to the bootanimation. Nandroid backup FTW lol.


Try removing some of the files.


----------



## kingzope

PresidentPutin said:


> Try removing some of the files.


It's in the middle of a restore. I can try when it's done. If it's going to come down to "some of the files in the proposed 3rd fix" will work, it's going to take a lot more than just me randomly testing lol. If it eventually comes up golden, this would be a hell of a find.


----------



## HY-rowi

The .7z has only a bunch of pre-compiled .so binaries (i.e., no source code). I'm getting the impression it's a plug-and-pray at best type of "fix" even if it works.


----------



## nunja business

What the hell happened to the forum? 
Things look ... different.


----------



## PresidentPutin

kingzope said:


> It's in the middle of a restore. I can try when it's done. If it's going to come down to "some of the files in the proposed 3rd fix" will work, it's going to take a lot more than just me randomly testing lol. If it eventually comes up golden, this would be a hell of a find.


Scratch it... it turns out the third proposed fix was pulled from Gingerbread, not ICS.

Too bad...


----------



## litdroid

nunja business said:


> What the hell happened to the forum?
> Things look ... different.


https://twitter.com/#!/RootzWiki


----------



## Dorregaray

The included camera fix rather will not work. The CameraService searches the HAL library in /system/lib/hw under the names camera.tenderloin.o, camera.msm8660.o and probably camera.default.o. There's a ICS camera wrapper from TeamICS (https://github.com/T...are_qcom_camera) which should be able to do the trick but I'm having the issues with it described here.


----------



## bluntedslc

Dorregaray said:


> The included camera fix rather will not work. The CameraService searches the HAL library in /system/lib/hw under the names camera.tenderloin.o, camera.msm8660.o and probably camera.default.o. There's a ICS camera wrapper from TeamICS (https://github.com/T...are_qcom_camera) which should be able to do the trick but I'm having the issues with it described here.


Just saw this on twitter

TripNRaVeR Noeri ...

Fixed omxcore for msm8660 cm source running iboo2 for 1 day still not releasable maybe ib003 will be

Now this was for the HTC Sensation but shouldn't this also apply for HP Touchpad


----------



## drgci

bluntedslc said:


> Just saw this on twitter
> 
> TripNRaVeR Noeri ...
> 
> Fixed omxcore for msm8660 cm source running iboo2 for 1 day still not releasable maybe ib003 will be
> 
> Now this was for the HTC Sensation but shouldn't this also apply for HP Touchpad


woa great,great,great,
i cant wait 
i want hw on my hp touchpad!!!


----------



## PresidentPutin

Perhaps camera and HD acceleration (OMX) drivers can be pulled from the HTC Jetstream:
http://forum.xda-dev...play.php?f=1274

Same SoC as the HP TouchPad, and the HTC device runs Honeycomb. Afaik Honeycomb uses same driver model as ICS.

#EDIT:
The Le Pan II seems to have *identical specs, *to the HP TouchPad, and also has the same SoC:
http://www.newegg.com/Product/Product.aspx?Item=N82E16834322002


----------



## dalingrin

Note: availability of hardware OMX codecs is not a problem. We can build these from source if we want to.
The issue is making the new ICS codecs work with our kernel and AOSP


----------



## ReverendKJR

PresidentPutin said:


> Perhaps camera and HD acceleration (OMX) drivers can be pulled from the HTC Jetstream:
> http://forum.xda-dev...play.php?f=1274
> 
> Same SoC as the HP TouchPad, and the HTC device runs Honeycomb. Afaik Honeycomb uses same driver model as ICS.
> 
> #EDIT:
> The Le Pan II seems to have *identical specs, *to the HP TouchPad, and also has the same SoC:
> http://www.newegg.co...N82E16834322002


Le Pan II has a different camera. 2MP vs. our 1.3MP.


----------



## cinnabarcorp

They both have the Same Chipset, it's possible to work with this


----------



## Dorregaray

I tried libcamera.so and liboemcamera.so from jetstream, evo3d but without any luck - no matter which libcamera.so I use I always get:



Code:


E/HAL ( 137): Cannot load library: link_image[1965]: 137 could not load needed library 'libcamera.so' for 'camera.tenderloin.so' (reserve_mem_region[845]: 137 can NOT map (prelinked) library 'libcamera.so' at 0xa7900000 as requested, will try general pool: 12 (Out of memory))<br />
E/CameraService( 137): Could not load camera HAL module

I compiled libcamera.so on my own and put onto the device but now I'm getting the same error (with different address) when trying to dlopen liboemcamera.so no matter which liboemcamera.so I use








The prelinked libraries can be reverted to the original state using the prelink --undo but as far as I know on Android the different implementation of prelink (called apriori) has been used however I cannot find it anywhere for ICS


----------



## TT01

Wonder if that a result of the other devices having multiple cameras and the TP only 1 front facing. This library trying to link to a non-existant back camera?


----------



## Aganar

A fair point...but wasn't that the whole reasoning behind opensourcing CM?


----------



## dhrandy

Never hurts to try.

Sent from my Touchpad using Tapatalk


----------



## PainToad

Aganar said:


> A fair point...but wasn't that the whole reasoning behind opensourcing CM?


And once one of you actually do something related to the source, this will be a valid point.


----------



## MidnightRob

PainToad said:


> And once one of you actually do something related to the source, this will be a valid point.


Actually, the fact that he/she is even attempting to work on features the team is currently trying to work out is the point of open source. You never know if someone may just stumble onto something that will help out in the long run.. effort is all the matters... instead of sitting back and critizing others for trying and offering inpute. Sorry, i just saw this as quite rude. My bad if I misinterupted what you were trying to say.


----------



## HY-rowi

MidnightRob said:


> Actually, the fact that he/she is even attempting to work on features the team is currently trying to work out is the point of open source. You never know if someone may just stumble onto something that will help out in the long run.. effort is all the matters... instead of sitting back and critizing others for trying and offering inpute. Sorry, i just saw this as quite rude. My bad if I misinterupted what you were trying to say.


Effort is all the matters...but only with the effort that actually makes sense.

Unless one knows exactly how ICS works down at the code level, simply plugging in random binaries into system directories is extremely dangerous, as we already saw a few people tried and it won't boot as a result. Software debugging isn't that simple.


----------



## Dorregaray

Let me describe the situation.
The liboemcamera.so is the library that provides the camera functionality that is available for Touchpad is closed source and is from Froyo. There's also libcamera.so wrapper for this library which loads the lib and provides the API for Android. However the API has changed in ICS and this libraries are not working anymore. 
Fortunately there is an ICS Camera Wrapper by TeamICS - the library which can be used to wrap the existing libraries from Froyo and make them usable under ICS.
So the situation seems to be simple - build the wrapper, load onto the device and you're done. Unfortunately it's not so simple. The Froyo libs are prelinked and wants to be loaded to the memory at addresses that are currently in use. The solution may be to: 1) "un-prelink" the Froyo libraries (I don't now how yet), 2) make the other libraries be loaded at different memory addresses than the camera libs, 3) build the libs on your own.
I didn't find the method to "un-prelink" the libraries and I'm not as familiar with CM9 sources as the developers so I have gone with the 3) - the liboemcamera.so is closed source so I cannot do anything about it so I decided to give a try the binary from other devices having the same processor, I built the libcamera.so on my own to have the not prelinked version.
As the developers has more important things to do than the camera so I thought I maybe I'll be able to get this working so they will have less work in the future. Maybe I was wrong and I have lost my time, but this is better than doing nothing.


----------



## situbusitgooddog

Dorregaray said:


> As the developers has more important things to do than the camera so I thought I maybe I'll be able to get this working so they will have less work in the future. Maybe I was wrong and I have lost my time, but this is better than doing nothing.


----------



## Formula84

Dorregaray said:


> Let me describe the situation.
> The liboemcamera.so is the library that provides the camera functionality that is available for Touchpad is closed source and is from Froyo. There's also libcamera.so wrapper for this library which loads the lib and provides the API for Android. However the API has changed in ICS and this libraries are not working anymore.
> Fortunately there is an ICS Camera Wrapper by TeamICS - the library which can be used to wrap the existing libraries from Froyo and make them usable under ICS.
> So the situation seems to be simple - build the wrapper, load onto the device and you're done. Unfortunately it's not so simple. The Froyo libs are prelinked and wants to be loaded to the memory at addresses that are currently in use. The solution may be to: 1) "un-prelink" the Froyo libraries (I don't now how yet), 2) make the other libraries be loaded at different memory addresses than the camera libs, 3) build the libs on your own.
> I didn't find the method to "un-prelink" the libraries and I'm not as familiar with CM9 sources as the developers so I have gone with the 3) - the liboemcamera.so is closed source so I cannot do anything about it so I decided to give a try the binary from other devices having the same processor, I built the libcamera.so on my own to have the not prelinked version.
> As the developers has more important things to do than the camera so I thought I maybe I'll be able to get this working so they will have less work in the future. Maybe I was wrong and I have lost my time, but this is better than doing nothing.


Thank you keep at it.

Sent from my aokp_tenderloin using Tapatalk


----------



## 1981suede

ironman said:


> no offense but your post is the most useless post I have seen on this forum. More useless than asking for ETA.


Haha. That is a matter of opinion, my post does seem to have a like so clearly not everyone agrees with you. It is quite amusing watching people who clearly have no idea what they are doing fumbling about though. If someone on this thread does fix it then I will offer my humble apologies, I don't think that is very likely though.


----------



## uwndrd

https://twitter.com/#!/dalingrin/status/164984267812773888



> hardware UI accel has worked since first release of CM9


I don't understand it. If the acceleration is already on, why isn't the interface smooth? Even Adreno 220 can't be THAT slow.


----------



## HY-rowi

uwndrd said:


> Even Adreno 220 can't be THAT slow.


are you sure.


----------



## silvertipp

I do not have this smoothness issue you speak of.


----------



## Dorregaray

I've been able to go one step further with the camera libraries, but got into another obstacle - the undefined symbol _ZNK7android16CameraParameters15getTouchIndexAfEPiS1_ required by the libcamera.so - it does not exist in liboemcamera.so (I'm using both libs from CM9 a0.6).


----------



## robreefer

1981suede said:


> Haha. That is a matter of opinion, my post does seem to have a like so clearly not everyone agrees with you. It is quite amusing watching people who clearly have no idea what they are doing fumbling about though. If someone on this thread does fix it then I will offer my humble apologies, I don't think that is very likely though.


Instead of bringing negativity to some one that is trying to help, why don't you go back over to XDA and have fun trolling all day.


----------



## dudemaaan

I agree negativity does not help with any progress whether it has merit or not. I stumble my way into fixes all the time.

He seems to have a grasp of what the problems are so with some time ,research, and trial and error he might just solve it. No one is born knowing everything .you have to crawl before you walk, and walk before you run.


----------



## Dorregaray

Ok, I've ported some stuff from Code Aurora CameraParameters class implementation and get rid of the undefined symbols problem. I've also modified the linker to load the prelinked libraries normally however I have got into another problem - segfault:


Code:


I/CameraService( 138): CameraService started (pid=138)<br />
F/libc ( 138): Fatal signal 11 (SIGSEGV) at 0xa7911200 (code=1)<br />
I/DEBUG ( 133): Build fingerprint: 'google/yakju/maguro:4.0.1/ITL41D/223971:user/release-keys'<br />
I/DEBUG ( 133): pid: 138, tid: 138 >>> /system/bin/mediaserver <<<<br />
I/DEBUG ( 133): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr a7911200

So it seems that I cannot load the prelinked libcamera.so in that way







Probably I need some mechanism for loading /system/bin/mediaserver (and maybe other stuff) to different memory address to make the 0xa7000000 memory address available for libcamera.so.
Any clues appreciated.


----------



## PresidentPutin

This looks very helpful:
http://rootzwiki.com/topic/18295-for-developers-lib-files-with-hw-acceleration/


----------



## Dorregaray

PresidentPutin said:


> This looks very helpful:
> http://rootzwiki.com...w-acceleration/


Thanks, but unfortunately the libcamera and liboemcamera are prelinked too to similar addresses (0xa7800000 and 0xa7600000) they won't load on CM9 (because it has a different memory map).


----------



## Motoki

Dorregaray said:


> Thanks, but unfortunately the libcamera and liboemcamera are prelinked too to similar addresses (0xa7800000 and 0xa7600000) they won't load on CM9 (because it has a different memory map).


Dang it.










I don't suppose there are any other devices with the same or similar hardware that might have useful drivers? Phones maybe?


----------



## punkypogo

Hi all,

Dorregaray, I've been looking for dealing with the fixed memory address loading issue you talked about with liboemcamera.so and libcamera.so.
I think I found something, but unfortunately I can't test it: it is the prelink utility, and especially the --reloc-only=ADDR option which changes the base address of the library.
I hope this can help.

Cheers.


----------



## Dorregaray

I've been trying prelink utiliy before without much success (maybe I tried it wrong or maybe that's because in Froyo google used their own prelink implementation called apriori which may be incompatible with prelink somehow).
However after chat with dalingrin I have changed the memory split in kernel and android settings and after rebuilding the image I'm now able to load the libraries. 
Actually I'm working on the wrapper for those libraries to make them working in ICS. At this point I'm able to initialize the camera and get the crash on getting the camera parameters and enabling preview (when having camera parameters hardcoded).
If someone is interested, here's the log of the latest crash http://pastebin.com/pWPFjh26.
I can also provide the instructions and patches for kernel and android sources I made so far if someone is interested in trying on its own.


----------



## punkypogo

Looks really great, you seem to be so close!


----------



## uwndrd

Hey, guys. HW accel is fixed in alpha 1, but the following information could still be usefull to developers.

It seems that there is a tablet called Pantech Element out there, it's based on Qualcomm *APQ8060* and has Android Honeycomb OS. It's kernel sources could be downloaded here: http://opensource.pa...ategory=Mobile# , the model name is P4100


----------



## Dorregaray

I'm giving up. I reached the point where someone with more knowledge about android is needed.
The kernel driver hangs on wait_event_interruptible_timeout() in msm_ioctl_config(MSM_CAM_IOCTL_GET_STATS) function in drivers/media/video/msm/msm_camera.c.

If any one wants to try here are the patches:
http://tomasz.rostan...msm8660_v2.diff
http://tomasz.rostan...ient_patch.diff

Kernel patch:
http://pastebin.com/VuxCg03m

The prebuilt kernel with memory split 3:1:
http://tomasz.rostan...-split31.tar.gz

The brief instruction how to proceed with those ones:
http://tomasz.rostan...hpad/readme.txt

The logcat and strace output:
http://tomasz.rostan...hpad/logcat.txt
http://tomasz.rostan...hpad/strace.txt

The logcat and strace output with hardcoded camera params in wrapper:
http://tomasz.rostan...oded-params.txt
http://tomasz.rostan...oded-params.txt


----------



## Dorregaray

I've still didn't give it up completely but still have no success (however I'm one or two steps further).
In order to be able to play with that you need to rebuild the kernel and the image using the patches from the previous post (they're up to date).
The kernel changes contains the memory split change (to be able to load the binary camera libraries) and some changes backported from the froyo kernel released by HP. The changes to android contains also the mem split change, the camera wrapper for ics and some compat stuff needed by the libcamera.so.
The current status is that the binary libraries loads, the camera get initialized but hangs at some point when setting the camera parameters on camera app start.


----------



## nozyczek

Dorregaray said:


> I've still didn't give it up completely ...


Good to hear it! Keep it up!


----------



## aspirin240

AT&T skyrocket ICS leak just came out, do you think we can use the driver from that instead?


----------



## HY-rowi

aspirin240 said:


> AT&T skyrocket ICS leak just came out, do you think we can use the driver from that instead?


for the n-th time: the issue is *NOT *because there is no driver binaries, it's the current kernel code doesn't work with it!


----------



## ReverendKJR

ironman said:


> I want camera and mic on touchpad so bad...
> 
> useless post but true story.


FIRST!!!!!!!

Wait a minute.... is this thread alive again?

Nope. Chuck Testa.


----------



## coppolla

HY-rowi said:


> for the n-th time: the issue is *NOT *because there is no driver binaries, it's the current kernel code doesn't work with it!


someone in xda said he is working on 3.0.8 kernal for hp touchpad
maybe he can help you

Envoyé depuis mon SGH-T989 avec Tapatalk


----------



## HY-rowi

coppolla said:


> someone in xda said he is working on 3.0.8 kernal for hp touchpad
> maybe he can help you


yes, people are trying, dalingrin included (via moving up to higher level kernel).

but the point is driver binaries availability has never been the problem.


----------



## crakarjax

If we had driver source and compiled it against the existing, non-patched kernel would it work? Is the kernel hackery the result of having to deal with a fixed binary driver?


----------



## Dorregaray

crakarjax said:


> If we had driver source and compiled it against the existing, non-patched kernel would it work? Is the kernel hackery the result of having to deal with a fixed binary driver?


There are two components:
- kernel driver for the camera,
- userspace library that talks to the kernel driver and tell it what to do.

We have kernel and the camera driver sources from both WebOS and froyo linux kernel that some TPs had installed. This is not a problem.

We have a userspace library in the binary form only. The library loads, initializes the camera than for some reason hangs or segfaults in some functions it provides. And here is the problem - it is extremaly difficult to figure out what is wrong in situation when you have no sources and only a stripped version of the library.

There are two solutions possible: solve those problems and make this library working or rewrite the library from scratch.
If we would have the sources for the libcamera and liboemcamera libraries from the HP it would be a piece of cake to make it work. The Code Aurora Forum has some sources of the libcamera but they require some proprietary headers to make compiling so I haven't been able to build it.


----------



## Dorregaray

Latest patches:
kernel: http://tomasz.rostanski.pl/touchpad/camera_kernel.diff
libcamera_client: http://tomasz.rostanski.pl/touchpad/libcamera_client_v3.diff
camera wrapper + device config: http://tomasz.rostan...msm8660_v3.diff

Prebuilt kernel: http://tomasz.rostan...mera_v2.tar.bz2

Instructions: http://tomasz.rostan...hpad/readme.txt


----------



## rohan

Dorregaray said:


> Latest patches:
> kernel: http://tomasz.rostan...mera_v2.tar.bz2
> libcamera_client: http://tomasz.rostan..._client_v2.diff
> camera wrapper + device config: http://tomasz.rostan...msm8660_v3.diff
> 
> Prebuilt kernel: http://tomasz.rostan...mera_v2.tar.bz2


Looks good, great progress, keep it up


----------



## akash1229

Great job @Dorregaray


----------



## papau

Dorregaray said:


> There are two components:
> - kernel driver for the camera,
> - userspace library that talks to the kernel driver and tell it what to do.
> 
> We have kernel and the camera driver sources from both WebOS and froyo linux kernel that some TPs had installed. This is not a problem.
> 
> We have a userspace library in the binary form only. The library loads, initializes the camera than for some reason hangs or segfaults in some functions it provides. And here is the problem - it is extremaly difficult to figure out what is wrong in situation when you have no sources and only a stripped version of the library.
> 
> There are two solutions possible: solve those problems and make this library working or rewrite the library from scratch.
> If we would have the sources for the libcamera and liboemcamera libraries from the HP it would be a piece of cake to make it work. The Code Aurora Forum has some sources of the libcamera but they require some proprietary headers to make compiling so I haven't been able to build it.


impressive work to date Dorregaray - Thanks for your efforts.


----------



## Sergyk

Dorregaray said:


> Latest patches:
> kernel: http://tomasz.rostan...mera_v2.tar.bz2
> libcamera_client: http://tomasz.rostan..._client_v2.diff
> camera wrapper + device config: http://tomasz.rostan...msm8660_v3.diff
> 
> Prebuilt kernel: http://tomasz.rostan...mera_v2.tar.bz2
> 
> Instructions: http://tomasz.rostan...hpad/readme.txt


so, can we hope that camera in our touchpad will work in the future in ICS?


----------



## Dorregaray

I have found the following merge request: http://review.cyanogenmod.com/#change,13650 which is quite similar to what I'm trying to do but form msm7x30 devices. 
This merge requires another two: http://review.cyanogenmod.com/#change,13317 and http://review.cyanogenmod.com/#change,13285 
I think the first one is also needed for touchpad so I have applied it (unfortunately didn't solve the isue). I'm not sure about the second one - I've added stubbed Overlay implementation. 
I think some more compatibility change may be required in order to make the camera works but I have no idea where to search for it...


----------



## jiremek

Any news, any updates ?
The camera working great with this patches ?


----------



## Dorregaray

Not much. 
All I have found out is that there's division by zero in vfe_set_dimension() frunction which is called somewhere from the cam_conf() function within liboemcamera.so (which is proprietary, stripped binary we have no sources of)...


----------



## yarly

Lets keep the thread on topic. If you're not helping contribute to finding the fixes or can contribute in some other useful way without putting others down or discouraging others from helping then there's always the offtopic forum for you to post in


----------



## Dorregaray

Started uploading my patches to gerrit: http://r.cyanogenmod.com/#/q/owner:%2522Tomasz+Rostanski%2522,n,z
The camera wrapper still to come.


----------



## drgci

is that mean camera for touchpad coming very soon?


----------



## Dorregaray

there's still one (at least) problem to be solved to make te camera working. hope dalingreen and other devs will help with that.
I'm also waiting for the gingerbread compatible overlay to be checked in (http://review.cyanogenmod.com/#/c/13285/)


----------



## Dorregaray

All my stuff is in gerrit. If any one would like to give it a try and build use this script to download all the changes: http://pastebin.com/ywUixLbM
Unfortunately the SIGFPE is stil there. Maybe someone else will have more luck on that than me.


----------



## drgci

Dorregaray said:


> All my stuff is in gerrit. If any one would like to give it a try and build use this script to download all the changes: http://pastebin.com/ywUixLbM
> Unfortunately the SIGFPE is stil there. Maybe someone else will have more luck on that than me.


if someone build your on work can camera will working!!!!!


----------



## maniac103

Dorregaray said:


> Not much.
> All I have found out is that there's division by zero in vfe_set_dimension() frunction which is called somewhere from the cam_conf() function within liboemcamera.so (which is proprietary, stripped binary we have no sources of)...


From the function name, I would suspect the problem in the stubbed overlay, which returns 0 for getWidth() and getHeight(). Maybe the driver is trying to calculate an aspect ratio? Suggestion: Pass the actual size into the overlay stub and return it accordingly - for the Defy, we had to do that as well.


----------



## Dorregaray

Thanks, for the tip but unfortunately didn't help. The libcamera uses only the following functions from Overlay class (according to objdump): queueBuffer, setFd, setCrop so setting the getWidth and getHeight to return the size made no difference.
It also uses several methods from VectorImpl, SortedVectorImpl, MemoryHeapBase, MemoryBase, RefBase, String8 and CameraParameters. I've checked all of them and didn't find anything suspicious. It also uses get_property function for obtaining: ro.board.platform, persist.debug.sf.showfps, persist.camera.hal.dis but after adding them to the build.prop I've seen no change also.
I've also checked the if there are the proper access rights to the /dev/pmem_adsp, /dev/pmem_smipool, /dev/graphics/fb0, /dev/oncrpc that are used by libcamera but everything is ok there.


----------



## Dorregaray

Some status update. Several patches are uploaded to gerrit. If anyone wishes to give them a try here's the script to apply them: http://pastebin.com/ywUixLbM
Unfortunately it's not enough - there are still two issues:
1) the binary liboemcamera.so crashes in native_set_parm(CAMERA_SET_PARM_DIMENSION) call,
2) the CameraHardwareInterface.h in camerahal does not match the one used for compiling binary libcamera.so which causes freeze when trying to call CameraHardwareInterface::getParameters()

So I started porting the libcamera2 sources from CAF to touchpad to workaround problems 1 and 2. The sources can be found here: https://github.com/Dorregaray/libcamera2
The camera initializes but crashes in cam_frame from liboemcamera.so while displaying preview so there's still some work to do here (fix the crash and port the adreno extensions)...


----------



## hyperfire21

Keep up the good work Dorregaray.. i'm following this thread for all ur updates.


----------



## kolpa06

Dorregaray said:


> Some status update. Several patches are uploaded to gerrit. If anyone wishes to give them a try here's the script to apply them: http://pastebin.com/ywUixLbM
> Unfortunately it's not enough - there are still two issues:
> 1) the binary liboemcamera.so crashes in native_set_parm(CAMERA_SET_PARM_DIMENSION) call,
> 2) the CameraHardwareInterface.h in camerahal does not match the one used for compiling binary libcamera.so which causes freeze when trying to call CameraHardwareInterface::getParameters()
> 
> So I started porting the libcamera2 sources from CAF to touchpad to workaround problems 1 and 2. The sources can be found here: https://github.com/D...aray/libcamera2
> The camera initializes but crashes in cam_frame from liboemcamera.so while displaying preview so there's still some work to do here (fix the crash and port the adreno extensions)...


How we can support you Dorregaray?


----------



## kaede

im not that familiar with the coding etc. but looking from his posts. theres definetely something coming soon.








keep it up doreagray.


----------



## Dongers

Just been looking at the github repositories and see that Dorregaray is still working on this, with fresh commits on a daily basis. Sure we are going to see something special from this soon

Happy to do some beta testing if and when you have anything available, Dorregaray. Keep up the good work!

cheers

Dongers


----------



## nevertells

Dongers said:


> Just been looking at the github repositories and see that Dorregaray is still working on this, with fresh commits on a daily basis. Sure we are going to see something special from this soon
> 
> Happy to do some beta testing if and when you have anything available, Dorregaray. Keep up the good work!
> 
> cheers
> 
> Dongers


You all should check the post I left in the Official thread yesterday. I think you are getting the cart way before the horse. Unless Dorregaray has made some remarkable progress, getting the camera working is still very far away from getting done. In fact, unless Qualcomm starts feeling very generous, the camera may never work. Speaking of that, have you heard anything back from the folks over at the Aurora Project Dorregaray?


----------



## Dorregaray

I've asked several people I found but only response I got was "sign the petition to Qualcomm for opening the camera drivers". I have no contact to anyone at Aurora Project so didn't contact them.


----------



## clayjar

Dorregaray said:


> I've asked several people I found but only response I got was "sign the petition to Qualcomm for opening the camera drivers". I have no contact to anyone at Aurora Project so didn't contact them.


Thanks for all your work on this. Are you working off of any hardware spec or reference of any sort?


----------



## nevertells

Dorregaray said:


> I've asked several people I found but only response I got was "sign the petition to Qualcomm for opening the camera drivers". I have no contact to anyone at Aurora Project so didn't contact them.


If anyone can sign this petition, post the link and we'll all go sign. By the time we are done they will have tens of thousands of signatures.


----------



## Dorregaray

I believe this is this petition: http://www.change.org/petitions/qualcomm-release-camera-drivers-for-ics-2

I have just fixed the CameraHardwareInterface.h in camerahal so finally all the proper functions are being called and I can get rid of the hardcodes. Now I have to fix the preview crash.


----------



## clayjar

Dorregaray said:


> I believe this is this petition: http://www.change.or...ivers-for-ics-2


Dorregaray, I couldn't find any README in your repository, but I'd highly appreciate some guidance on where to place those files for kernel recompilation and try it out. I only went through a "vanilla" compilation of the latest CyanogenMod last night with success. Taking toddler steps here. Thanks!


----------



## nevertells

Dorregaray said:


> I believe this is this petition: http://www.change.org/petitions/qualcomm-release-camera-drivers-for-ics-2
> 
> I have just fixed the CameraHardwareInterface.h in camerahal so finally all the proper functions are being called and I can get rid of the hardcodes. Now I have to fix the preview crash.


Don't know if this will help, but I contacted Qualcomm about their drivers and this is the reply I got:

Hi Tom

Qualcomm's HAL and driver components are open sourced and available at Code Aurora Forum which follows Android imaging framework. Drivers in kernel are open-sourced under GPL. There are Qualcomm proprietary camera components in user space running as a system daemon that provide a competitive advantage to Qualcomm partners and currently Qualcomm does not have plans to open source those imaging solution components.

Thx, -Lisa


----------



## nevertells

clayjar said:


> Good lord, why is the petition letter so generic? Could it be deemed ineffectual because there is no mention of camera model or the platform. In our case, it's HP TouchPad (Snapdragon, APQ8060 processor (compatible w/ MSM8x60)) with CBFA157. It's highly likely they will ping us back to HP or Chicony, but it's worth a try. Someone (Puckett??) probably needs to rewrite that darn petition letter.
> 
> Dorregaray, I couldn't find any README in your repository, but I'd highly appreciate some guidance on where to place those files for kernel recompilation and try it out. I only went through a "vanilla" compilation of the latest CyanogenMod last night with success. Taking toddler steps here. Thanks!


I agree 100%. The wording in the petition needs to be specific to the TouchPad, chip set, driver type and any other technical information so there is no doubt what is being asked for.

Dorregaray, do you know exactly what is needed to get the camera working on the TouchPad that Qualcomm would have to open scource?


----------



## Dorregaray

nevertells said:


> Dorregaray, I couldn't find any README in your repository, but I'd highly appreciate some guidance on where to place those files for kernel recompilation and try it out. I only went through a "vanilla" compilation of the latest CyanogenMod last night with success. Taking toddler steps here. Thanks!


Added readme files to the repos. Hope they will be useful.


----------



## clayjar

Dorregaray, I've been poring over the net trying to find a possible match on the hardware, and narrowed it down to a possible match of Toshiba's TCM8240MD (20+4 pin configuration), which has app/datasheets available at http://www.sparkfun.com/products/8668. I highly doubt internal registers are going to line up exactly, but it's the closest looking sibling. It'd be super if they're both using the same chipset.

There is an open linux 2.6.x kernel driver for TCM825x out there, and the slave address matches with TCM8240MD. Someone from Nokia had created it and the source is probably as good as the datasheet itself. I'm trying to use TCM825x driver as a source template while using TCM8240MD as a spec template for CBFA157. I'm not sure how much of progress we'll be making by rebuilding a kernel-level camera library on our own, deductively using the interfaces (CameraHardwareInterface) available to us and a lot of guesswork, but isn't that one of the main issues (lack of an open camera lib) we're facing right now? I'd appreciate any helpful pointers on this, and please, anyone more experienced is welcome to give it a go.

From V4L2 to Android PDK, this is turning out to be much more reading than I originally signed up for.. X-)


----------



## Dorregaray

We have a matching kernel module for the camera (and is working). The problem is with userspace drivers that cooperates with kernel module to provide the camera functionality.


----------



## clayjar

Dorregaray said:


> We have a matching kernel module for the camera (and is working). The problem is with userspace drivers that cooperates with kernel module to provide the camera functionality.


Is it the one that was included with HP's Android GB?


----------



## Dorregaray

clayjar said:


> Is it the one that was included with HP's Android GB?


It's in 2.6.35 kernel from webos and probably in the regular kernel too.


----------



## darkpoe

I have a question related to this. I have done some rudimentary driver programming for interfacing a device to a usb controller before, my question is how does LSPCI work in Linux(the native ubuntu for Hp touchpad) arm.. does the camera show up in some kind of device vendor list or is it you have to probe a memory address looking for the device manually? I am very unfamiliar with how arm works and its HAL in linux...


----------



## Dorregaray

The camera is directly connected to the processor. I doubt you can list it using lspci


----------



## jcsullins

FWIW, I think the actual camera used is this one:

http://www.aptina.com/products/soc/mt9m113d00stc/


----------



## Dorregaray

Good news. I have just found this commit to Code Aurora Forum repo: https://www.codeaurora.org/gitweb/quic/la/?p=platform/hardware/qcom/camera.git;a=commit;h=d7e11e06cca163e57de7a6bd410450af08db79b5
it brings in QCamera_Intf.h some structure definitions was missing when building libcamera.so from sources.


----------



## 7erl

Dorregaray said:


> Good news. I have just found this commit to Code Aurora Forum repo: https://www.codeauro...10450af08db79b5
> it brings in QCamera_Intf.h some structure definitions was missing when building libcamera.so from sources.


Great news, Dorregaray! Hope that's the missing step to a solution. Let the compiler glow 
Thanks!


----------



## hyperfire21

Really good news. Awaiting ur results. Need someone to test for u?


----------



## wolfgr

omg,omg i watch dorregarey commiting stuff at his github and i am sure that something good is goin on about camera fix


----------



## drgci

wolfgr said:


> omg,omg i watch dorregarey commiting stuff at his github and i am sure that something good is goin on about camera fix


yeap i think camera its allready done lol


----------



## clayjar

drgci said:


> yeap i think camera its allready done lol


What do you mean it's already done? Have you tested Dorregaray's libcamera2 code? I have yet to compile and test...


----------



## oldpapa49

Wait for it, Wait for it...


----------



## cobjones

.... Anyone? This guy gets a big beer.


----------



## mgus

cobjones said:


> .... Anyone? This guy gets a big beer.


Just tell me where to send it!


----------



## kaede

oh wow i think its getting closer. cant wait !!!!
thx dorregarayh34r:

Sent from my cm_tenderloin using Tapatalk 2


----------



## Zzed

not quite there... but hopefully... Soon[sup]TM[/sup]

*** cheers Dorregaray on ***


----------



## kbluhm

I've had my Touchpad listed on swappa for a week or so. When/if the camera is functioning... who knows, I may pull the listing and hold onto it as a second tablet for trips, flights, etc. The devs in who ultimately get this hashed out definitely have a donation coming their way.


----------



## wolfgr

no news is good news?


----------



## clayjar

According to recent message from Dorregaray, the user space libraries for camera needs a lot of work. He said that the kernel level hardware driver works fine. He's been working diligently to make it work, we just need more patience friends.


----------



## mgus

clayjar said:


> According to recent message from Dorregaray, the user space libraries for camera needs a lot of work. He said that the kernel level hardware driver works fine. He's been working diligently to make it work, we just need more patience friends.


Thanks for the update. Standing by.....


----------



## nytewind1

Hello, not sure if this is the correct place to post this, but it was suggested from the cyanogenmod HP touchpad forum that I mention it here. Thanks!

nytewind1, on 08 July 2012 - 06:58 PM, said:​
"Avadon:The Black Forest" for Andriod worked perfectly for Android ICS 4.0.4 and CyanogenMod 9-20120706-NIGHTLY-tenderloin ROM installed. With the installation of the next ROM version, 9-20120707-NIGHTLY-tenderloin, the application starts but minus any screen display. Sound and key interaction is still there, but display all black. Tried reinstalling app but met same results. Restored ROM to 9-20120706-NIGHTLY-tenderloin ROM and application working perfectly again. Just FYI.​
It might be the Adreno drivers that are included in the 07/07 nightly. Report the problem here to let the developer know:

http://rootzwiki.com...celeration-fix/


----------



## drgci

nytewind1 said:


> Hello, not sure if this is the correct place to post this, but it was suggested from the cyanogenmod HP touchpad forum that I mention it here. Thanks!
> 
> nytewind1, on 08 July 2012 - 06:58 PM, said:​
> "Avadon:The Black Forest" for Andriod worked perfectly for Android ICS 4.0.4 and CyanogenMod 9-20120706-NIGHTLY-tenderloin ROM installed. With the installation of the next ROM version, 9-20120707-NIGHTLY-tenderloin, the application starts but minus any screen display. Sound and key interaction is still there, but display all black. Tried reinstalling app but met same results. Restored ROM to 9-20120706-NIGHTLY-tenderloin ROM and application working perfectly again. Just FYI.​
> It might be the Adreno drivers that are included in the 07/07 nightly. Report the problem here to let the developer know:
> 
> http://rootzwiki.com...celeration-fix/


Install the old version of adreno drivers and that its all!! Don't ask for link because I don't know


----------



## kaede

install the latest nightly. shud fix ur problem.


----------



## RolandDeschain79

nytewind1 said:


> Install the old version of adreno drivers and that its all!! Don't ask for link because I don't know


I have links to the old and new versions of the Adreno driver in this videos description.


----------



## backeby

Dorregaray, I REALLY want to donate to you. I suspect there are others who are willing to do the same. How can I go about doing this? Paypal, banktransfer, any other service?! You tell me!


----------



## kaede

looking at all the commit he done. seems like camera already work. if it is. please make a video for spoiler.


----------



## Dorregaray

the camera does not work yet and won't be working until I say so







sorry


----------



## kubek1334

Dorregaray said:


> the camera does not work yet and won't be working until I say so
> 
> 
> 
> 
> 
> 
> 
> sorry


Good to know that someone who comes from Poland has HP touchpad and is a Camera DEV.

For me good work. I'm just simple student but I could you send a nice cold beer







.


----------



## wolfgr

hahah Dorregaray u have done a lot so far but if u fix tp camera prepare to be drunk for months from all those beers ,as for me i am from Hellas so i ll send some ouzo


----------



## Dorregaray

backeby said:


> Dorregaray, I REALLY want to donate to you. I suspect there are others who are willing to do the same. How can I go about doing this? Paypal, banktransfer, any other service?! You tell me!


You can find the donation link in my profile but the camera does not work yet so I'm not sure it's worth donation


----------



## wolfgr

any news about cam?


----------



## kubek1334

Yes.

Here:
https://github.com/Dorregaray

stop asking about eta, news etc.

Because of asking those stupid questions IRC channel is invite only etc.


----------



## touchmypad

Dorregaray said:


> For example the headers: camera.h, camframe.h, liveshot.h, mm-still/jpeg/jpege.h, jpeg_encoder.h otherwise you want be able to compile the libcamera2 code that is released at Code Aurora Forum.
> 
> Added readme files to the repos. Hope they will be useful.


Hi, Dorregaray

I was trying to compile the libcamera.so from the source fetched from CAF, and found a lot of missing header files, did you find any of them? Thanks.

Also, I looked in your repo/Andriod.mk, you included header files under mm-camera and mm-still/jpeg, but I don't see these folds on my system, what's in there? Thanks!


----------



## Dorregaray

touchmypad said:


> Hi, Dorregaray
> 
> I was trying to compile the libcamera.so from the source fetched from CAF, and found a lot of missing header files, did you find any of them? Thanks.
> 
> Also, I looked in your repo/Andriod.mk, you included header files under mm-camera and mm-still/jpeg, but I don't see these folds on my system, what's in there? Thanks!


The sources from CAF does not compile - they require proprietary headers to compile. I did not include any files from mm-camera or mm-still/jpeg because among the others this headers are proprietary so I don't have them. You can ask for those files at Code Aurora Forum (I have already asked but didn't get any response yet). You can find several of the missing structure definitions in QualcommCameraHardware.h in my repo - they have been reversed engineered by cyanogenmod team from froyo or by me.


----------



## wiresandstuff

Hi Dorregaray,

Does this help at all?

https://www.codeaurora.org/git/projects/ag-gb-dsds-7227/repository/revisions/1c9e597947788b65f6adc9752bb1e11086d3d525/entry/vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp


----------



## Dorregaray

wiresandstuff said:


> Hi Dorregaray,
> 
> Does this help at all?
> 
> https://www.codeauro...eraHardware.cpp


Unfortunately not. The sources at Code Aurora are incomplete.

I need the definition of mm_camera_config, mm_camera_notify, mm_camera_ops structures to use the same API as the binary libcamera uses - now I'm using the older deprecated API and this may be responsible for crash during preview (because of incomplete driver initialization).
In the meantime I'm porting some patches from CAF to the kernel camera driver.


----------



## unbehagen

The Code Aurora Forum looks like a dead end to me - it seems nobody actually looks at the questions asked there. Is there a chance you or the CM team can obtain the missing structs by reverse engineering as well? Can we help you by filling Qualcomm's email inboxes with polite requests for the source code? The files are headers in the end, so nothing too worthy of protection by QC. Or can we none-coders help you in any other way? I googled for those proprietary headers for quite some time without any luck. Are these user space libraries or kernel modules? If they are kernel modules or linked agains GPL-code, we might have a better chance at receiving them from QC without all the begging.


----------



## Dorregaray

unbehagen said:


> The Code Aurora Forum looks like a dead end to me - it seems nobody actually looks at the questions asked there. Is there a chance you or the CM team can obtain the missing structs by reverse engineering as well? Can we help you by filling Qualcomm's email inboxes with polite requests for the source code? The files are headers in the end, so nothing too worthy of protection by QC. Or can we none-coders help you in any other way? I googled for those proprietary headers for quite some time without any luck. Are these user space libraries or kernel modules? If they are kernel modules or linked agains GPL-code, we might have a better chance at receiving them from QC without all the begging.


You can always write an email to Qualcomm but I don't know if you'll get any response. I've asked on Qualcomm's Developer Forum and was redirected to Code Aurora Forum but get no response there. I've also written an email to Code Aurora Forum but no response either. The mentioned missing structures are passed between libcamera and liboemcamera libraries in userspace and I wasn't able to reverse engineered them (the libraries are stripped and prelinked).


----------



## nevertells

Dorregaray said:


> You can always write an email to Qualcomm but I don't know if you'll get any response. I've asked on Qualcomm's Developer Forum and was redirected to Code Aurora Forum but get no response there. I've also written an email to Code Aurora Forum but no response either. The mentioned missing structures are passed between libcamera and liboemcamera libraries in userspace and I wasn't able to reverse engineered them (the libraries are stripped and prelinked).


So you didn't get any response from Lisa?


----------



## oldpapa49

nevertells said:


> So you didn't get any response from Lisa?


If you write to a girl, must send CHOCOLATES!... No CHOCOLATES, no response! Simple as that...
You young'n must learn..


----------



## Dorregaray

nevertells said:


> So you didn't get any response from Lisa?


No response yet

Lisa is the Code Aurora Forum employee I asked about the missing headers in Code Aurora Forum's camera repository. In fact I'm not surprised with the lack of response as noone before has been able to get those headers from CAF.

I'm going on vacations so I won't be here for 2 weeks. If anyone is willing to try to fix the camera I have posted the detailed building instruction to:
https://github.com/D...in-camera-build


----------



## oldpapa49

Dorregaray said:


> No response yet
> 
> Lisa is the Code Aurora Forum employee I asked about the missing headers in Code Aurora Forum's camera repository. In fact I'm not surprised with the lack of response as noone before has been able to get those headers from CAF.
> 
> I'm going on vacations so I won't be here for 2 weeks. If anyone is willing to try to fix the camera I have posted the detailed building instruction to:
> https://github.com/D...in-camera-build


Go ahead and take that Vacation, Clear your MIND, refresh your Body... After weeks of running around, come back with a new look on life..

Have a great Vacation... See ya back in 2 weeks.. Keep your cellphone off!


----------



## Dorregaray

The one thing that came to my mind is that maybe the crash is caused by the overlay returning 0 as the width and height so this patch https://github.com/Dorregaray/cm9-tenderloin-camera-build/blob/master/overlay.patch may help but I'm unable to check it right now


----------



## wolfgr

anyone tested latest camera build from Dorregaray's github?


----------



## sananth

Dorregaray, I spent my weekend compiling CM9 with your patch, and the good news is that I did not see the crash.

The preview was passing in 320x480, so it looks like that was not the issue. I will try investigating a bit more to see why it still comes up blank.

I hope you enjoy your vacation! Thanks for all the hard work you put into getting the cam to work!


----------



## unbehagen

Sananth, I am curious. Can you describe for us what works and what doesn't? Does the camera already capture images and it's just the preview that causes problems, or is both not functional at the moment? The preview is passing means that it does not crash, but just shows a blank image? Thank you for sacrificing your weekend to test [background=rgb(245, 245, 245)]Dorregaray's code![/background]


----------



## sananth

unbehagen, there is a lot of progress by the devs, but the preview still comes up blank (dark, black). However, some other functions like the camera settings work now. Functions like viewing/sharing pictures that were taken seem to be working. However, there is a lot of work to be done here. I am not a great dev, but I am just trying to help with what little programming knowledge I have.

I would recommend that other people join in as well. Downloading and compiling CM9 with Dorregaray's patches isn't too hard, it's just time consuming. I went through it, and here is a piece of advice:
1. Do not use -j16 when syncing -> it just splits up into 16 threads, and it seemed to lock up for me, causing some pain. Just sync as one thread if it seems stuck
2. If using Ubuntu 64-bit, make sure you install the following packages (not in the instructions given):
curl
g++
pngcrush
lib32z1-dev
lib32tinfo-dev

I am also not a camera expert, so if anyone has experience with overlays or camera hardware drivers, please PM me.


----------



## scifan

So, what does this mean... does it actually take pictures without the overlay/image being viewable as a preview? or you're just seeing black images?

Sent from my cm_tenderloin using Tapatalk 2


----------



## sananth

No, taking pictures does not work at all. The images coming from the camera are displayed using the overlay. When you click on the button to take a photo, the image shown is grabbed from the buffer and saved. However, the image sent from the camera to the overlay (or any other app) is blank, since the HAL is still being worked on.

The overlay is sort of the best way to debug the images coming in from the camera sensor (since it bypasses different layers when showing up on the screen). Once the overlay starts showing images, we should be in good shape. I am trying to see if I can figure it out in order to help Dorregaray, but if anyone else has some knowledge to share (like experience with reverse engineering camera drivers on other devices), please share!


----------



## oldpapa49

Vacation over Dude, hope to it!

Just kidding, hope you had a great time on Vacation.. Post pictures and all... Slide Show..

My Family Vacation..

Hehe...


----------



## Dorregaray

sananth said:


> However, the image sent from the camera to the overlay (or any other app) is blank, since the HAL is still being worked on.


The image is blank because the HAL is not starting the preview (in dmesg you will see no start preview command being passed to kernel).
If you edit the camera_start_preview method in device/hp/tenderloin/camerahal/cameraHAL.cpp and remove the


Code:


<br />
if (dev->window == 0) {<br />
    return 0;<br />
}<br />

you will see the preview will be started but the logcat will complain with message:


Code:


<br />
lockIfMessageWanted(16): dropped unwanted message<br />

because the camera service is not expecting the preview to be running after calling startPreview in ICS (sic!) for the first time (and not everything is being initialized for it). With the code above the preview won't be started until the preview window (and overlay) is initialized but it does not work either.


----------



## sananth

Dorregaray said:


> The image is blank because the HAL is not starting the preview (in dmesg you will see no start preview command being passed to kernel).
> If you edit the camera_start_preview method in device/hp/tenderloin/camerahal/cameraHAL.cpp and remove the
> 
> 
> Code:
> 
> 
> <br />
> if (dev->window == 0) {<br />
> return 0;<br />
> }<br />
> 
> you will see the preview will be started but the logcat will complain with message:
> 
> 
> Code:
> 
> 
> <br />
> lockIfMessageWanted(16): dropped unwanted message<br />
> 
> because the camera service is not expecting the preview to be running after calling startPreview in ICS (sic!) for the first time (and not everything is being initialized for it). With the code above the preview won't be started until the preview window (and overlay) is initialized but it does not work either.


Thanks for the info Dorregaray! Let me try that. In case there is some specific section of code you want me to look at (in order to get the overlay initialization or other sections for startPreview), please PM me. I am just trying to see if I can reduce your burden while learning something new 

Also, welcome back! Hope you had a nice vacation!


----------



## Dorregaray

Thanks, the vacations were very nice. Unfortunately I don't have much time to work on camera right now.

However it would be great to have the sequence of commands issued by the Camera app via CameraService (frameworks/base/services/camera/libcameraservice/CameraService.cpp) so we could figure out the right sentence of the operations. Maybe the logcat from any ICS running device with working camera (especially running snapdragon) may be helpful. I don't have such device so if there's anyone willing help it would be great.


----------



## vbelo

Could this thread help you ? http://forum.xda-dev...d.php?t=1427030
A logcat is included in the zip (even if you don't use the same HAL, it's Qualcomm but not Snapdragon).

This could also help you (not 100% working, but many useful informations) :
http://forum.xda-developers.com/showthread.php?p=29238355&highlight=logcat#post29238355


----------



## wiresandstuff

Very sad to see no posts in a long time in here, I appreciate everyones efforts so much, and wish i had the technical ability with developing to assist. Still keeping my fingers crossed at a working camera for the cm9 touchpad. As i can tell from the posts and the work, you guys definately are smart cookies, and i will keep the faith that one day i can use my touchpad with all the important hardware working.


----------



## 0082

me too, look forward to the Best person to get the camera working. Thanks!


----------



## Dorregaray

The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame 
Unfortunately just after that I got another crash :-D


----------



## ktklein72

Call it a baby step but its still progress and a step in the right direction!

Sent from my HP TouchPad using TapaTalk 2.2.6


----------



## cobjones

Dorregaray said:


> The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame
> Unfortunately just after that I got another crash :-D


Well if you have a preview, then you are more than halfway there.. Awesome job, and hope this works for jelly bean too, Haha. Just when we get process Google updates stuff.

You are why android is great though!


----------



## Deadsmile

Dorregaray said:


> The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame
> Unfortunately just after that I got another crash :-D


Kudos to this !








Reading here 2-3 times each day and would love to help (if I could)...
Wishing you all possible luck to get this to a good end


----------



## ennu

Dorregaray said:


> The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame
> Unfortunately just after that I got another crash :-D


superrrrrrr


----------



## domvillan

Still need that logcat for ICS? I have a sensation running latest cm9 nightly. If that helps I'll get one.

Sent from my cm_tenderloin using Tapatalk 2


----------



## Coda

Dorregaray said:


> The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame
> Unfortunately just after that I got another crash :-D


Yeah!


----------



## dhomas

Dorregaray said:


> The good news is that I've fixed (in ugly way) the crash during preview start and was able to see the first preview frame
> Unfortunately just after that I got another crash :-D


This is great news! Sounds like you're very close now. Keep up the good work!


----------



## kaede

oh wow. its coming. amazing work.


----------



## thanks4playing

Tried google and could not find an answer. Now that Open WebOS is now open sourced, can the code be used to help/guide with a camera fix? Or just use the code and the apache license (however the license works..)

Here is a link to the code
https://github.com/openwebos

It seems that simple, but in truth, the real answer is.. its always more complicated than that, eh?


----------



## ktklein72

Maybe I'm way off on this but I thought it was a closed source Qualcomm driver and that they weren't being very helpful. With WebOS going open source will that even matter?

Sent from my Eclipsed DROID X2 using Tapatalk 2.2.8


----------



## Shelnutt2

ktklein72 said:


> Maybe I'm way off on this but I thought it was a closed source Qualcomm driver and that they weren't being very helpful. With WebOS going open source will that even matter?
> 
> Sent from my Eclipsed DROID X2 using Tapatalk 2.2.8


Precisely, it's a closed source driver that has to be reverse engineered. The Qcomm driver is based on the HP webos kernel, which was close to the standard linux kernel than Android but still different. With openwebos they are targeting only the LSK, which means all existing webos devices don't get official support. So in short it does nothing to help us in Android, as their still are no open source/Android (ics/jb) compatible drivers.


----------



## thanks4playing

Shelnutt2 said:


> Precisely, it's a closed source driver that has to be reverse engineered. The Qcomm driver is based on the HP webos kernel, which was close to the standard linux kernel than Android but still different. With openwebos they are targeting only the LSK, which means all existing webos devices don't get official support. So in short it does nothing to help us in Android, as their still are no open source/Android (ics/jb) compatible drivers.


Argh, Shelnutt2 : you are precisely correct. This puts a damper on my day.

You can read more about it here http://www.zdnet.com/hp-kills-the-platform-again-open-webos-not-for-existing-hp-devices-7000001933/


----------



## yamaha_wins

fingers crossed.... thanks for everyones hardwork on this!


----------



## hyperfire21

Its always been closed source but it has worked in cm7 somewhat... I'm sure the devs here will find a way. Keep up the good work.


----------



## kaede

saw a few commit from dorregaray at his github. and lots of them from codeaurora port. does that mean you already get something from them ??


----------



## ennu

patience is a beautifull thing!


----------



## Dorregaray

kaede said:


> saw a few commit from dorregaray at his github. and lots of them from codeaurora port. does that mean you already get something from them ??


They provide the sources for several kernels in their git repository (also for 2.6.35 we're using on touchpad). I'm looking there for some guidance and porting some fixes from their kernel as well while working on fixing the preview crash (which is not fixed yet).


----------



## ShadowTech2008

hello dorregaray,
i would like to say thank you for all your hard work. im glad to see that your following through. thanks for the updates and keep it up.


----------



## menthe

Hello Dorregaray,

I've found those data sheets and maybe it should help you









https://www.dropbox.com/s/4uaubue7r0ymca1/MT9M11x.zip


----------



## Dorregaray

menthe said:


> Hello Dorregaray,
> 
> I've found those data sheets and maybe it should help you
> 
> 
> 
> 
> 
> 
> 
> 
> 
> https://www.dropbox....ca1/MT9M11x.zip


Thanks for the docs, but I'm trying the get the existing, binary driver to work recently. I'd like to add some debug messages to the CM7 kernel to check what's going on on CM7 firmware but I'm unable to produce the proper kernel to switch when following the http://rootzwiki.com/topic/21362-guide-build-cm9-kernel-wo-building-rom/ - I need the proper offsets for mkimage commands. Unfortunately noone helped me with that yet.


----------



## wineaux

Should we start a petition requesting that the devs at Project Aurora respond to your emails and work with you in getting our cameras working on the Touchpad? LOL


----------



## nevertells

wineaux said:


> Should we start a petition requesting that the devs at Project Aurora respond to your emails and work with you in getting our cameras working on the Touchpad? LOL


Won't help, They have already said that they flat out will not release their proprietary code.


----------



## rscovel

How about we offer them money or a license fee?

$0.99 or even $1.50 from thousands of people for them to write the driver and distribute it on Google Play?

I'm up for that. I know people want to have open-source, but come on... let's just get a driver that works.


----------



## hdokes

I'm all for that. One has to wonder if Project Aurora was screwed by HP when HP dropped the Tablet. Can't think of any other reason not to release code for an out of production product. Sure would like to see both the camera and mic working for the tablet tho.


----------



## Dorregaray

just got the preview working. taking pictures does not work, camera does not work in skype (yet). all the sources are uploaded to github if anyone is interested.


----------



## shezar

Dorregaray said:


> just got the preview working. taking pictures does not work, camera does not work in skype (yet). all the sources are uploaded to github if anyone is interested.


Whoa, that's some very nice work you've done. Unfortunately I'm on jelly bean (I need the localised phisical keyboards), can I build the libs for that? Is it much different than building for ICS?


----------



## nevertells

rscovel said:


> I'm all for that. One has to wonder if Project Aurora was screwed by HP when HP dropped the Tablet. Can't think of any other reason not to release code for an out of production product. Sure would like to see both the camera and mic working for the tablet tho.


Why don't you contact Qualcomm and ask? Dorregaray can tell you if such a method would work. When I say method, I mean inserting the correct code via a download from the Play Store that would get the Camera working. I'm betting that it would require an entire nightly to do it. What about it Dorregaray?


----------



## Dorregaray

nevertells said:


> Dorregaray can tell you if such a method would work. When I say method, I mean inserting the correct code via a download from the Play Store that would get the Camera working. I'm betting that it would require an entire nightly to do it. What about it Dorregaray?


Entire nightly build is needed to make it working (because dalingrin has changed the memory split in CM9 which prevents camera libs from loading) so even if I post anything on play store or provide flashable zip with prebuilt files it won't work.
I'm gonna provide the image but first I would like to get the pictures taking or skype working. I can post the build or describe how to build one if anyone is interested.


----------



## Coda

Dorregaray said:


> Entire nightly build is needed to make it working (because dalingrin has changed the memory split in CM9 which prevents camera libs from loading) so even if I post anything on play store or provide flashable zip with prebuilt files it won't work.
> I'm gonna provide the image but first I would like to get the pictures taking or skype working. I can post the build or describe how to build one if anyone is interested.


Oh, yeah!


----------



## iflu

Dorregaray said:


> just got the preview working. taking pictures does not work, camera does not work in skype (yet). all the sources are uploaded to github if anyone is interested.


Just want to say Thank you so much for your hard work! We all know this is really not easy.


----------



## worm9111

Nice work. Can't wait to see whats next.


----------



## Dorregaray

Taking pictures now works. The ROM is released here:
http://rootzwiki.com/topic/34482-unofficial-cm9-with-working-camera/


----------



## Stoned99

wouhou! That's the best day of my life... ok, my wedding and child birth comes 1st. Let's say it's the 3rd best day of my life. You're the man Dorregaray!

Edit: The link you posted is pointing to the CM9 nightly discussion, I think it should point to here http://rootzwiki.com/topic/34482-unofficial-cm9-with-working-camera/


----------



## Dorregaray

Stoned99 said:


> Edit: The link you posted is pointing to the CM9 nightly discussion, I think it should point to here http://rootzwiki.com...working-camera/


You're fast like lightning. I've fixed immediately when I found out but you've been faster


----------



## jwhood

Dorregaray said:


> Taking pictures now works. The ROM is released here:
> http://rootzwiki.com/topic/34482-unofficial-cm9-with-working-camera/


 holy freakin crap!!! Dorregaray,you have ridiculous coding skills bro,my hat off to you on this amazing feat congrats on your hard work

Sent from my HTC Glacier using RootzWiki


----------



## chrislewis915

Dorregaray said:


> You're fast like lightning. I've fixed immediately when I found out but you've been faster


Your link now reads as though it points to the new post, but its still to the original CM thread

Chris


----------



## ennu

Dorregaray said:


> Taking pictures now works. The ROM is released here:
> http://rootzwiki.com...working-camera/


what an great day this is, you gonna be drunk off all that beer they prommised you!


----------



## Dorregaray

chrislewis915 said:


> Your link now reads as though it points to the new post, but its still to the original CM thread
> 
> Chris


thanks, this time should be fixed properly


----------



## Ph4r

I've been lurking on this thread for quite some time, Congrats and Thanks for the hard work!


----------



## Deadsmile

This just made my day !
Thank you so much Doregaray, all my rainbows are flying to you ^^


----------



## Zzed

Dorregaray said:


> Taking pictures now works. The ROM is released here:
> http://rootzwiki.com...working-camera/


*** very excited ***

I've checked out your preview. It's awesome that you have made significant progress. At least there is hope again as we see the light at the other end of the tunnel. That's another step in the right direction. Thank you Dorregaray for your perseverence.


----------



## c000

don't know how helpful this info will be but it seems like the pantech element got an official ics update. from the little i know, i believe the pantech has the same cpu and gpu as the touchpad. no idea about the camera. but, maybe there is something in the official pantech ics rom that could be used with the touchpad? https://www.pantechusa.com/upgrade/element/


----------



## yarly

c000 said:


> don't know how helpful this info will be but it seems like the pantech element got an official ics update. from the little i know, i believe the pantech has the same cpu and gpu as the touchpad. no idea about the camera. but, maybe there is something in the official pantech ics rom that could be used with the touchpad? https://www.pantechusa.com/upgrade/element/


camera isn't the same.


----------



## c000

well so much for that


----------



## wineaux

This is incredible news! I can't wait to see this finally merged into the nightlies, and we see the Touchpad with a Final ICS CM9 build. This should also mean that when our devs return from their recent hiatus's, they can incorporate all of your hard work into their CM10 builds, so we can have a fully working camera from the first alpha build. This really should make the Touchpad a hot commodity once again.


----------



## ericdabbs

So Dorregray, what other things need to be worked on the camera to get it fully working? I haven't had a chance to test out the camera build yet. What build do you guys suggest I should use? Do all the latest nightlies have the camera fix in them?


----------



## Dorregaray

ericdabbs said:


> I haven't had a chance to test out the camera build yet. What build do you guys suggest I should use? Do all the latest nightlies have the camera fix in them?


the nightlies has no camera support yet. you need to try the camera build


----------



## c000

someone pulled the drivers off an htc device. not sure what has been updated in the drivers, but just posting here in case anyone was interested 
http://forum.xda-developers.com/showpost.php?p=33089326&postcount=2324


----------



## nevertells

ericdabbs said:


> So Dorregray, what other things need to be worked on the camera to get it fully working? I haven't had a chance to test out the camera build yet. What build do you guys suggest I should use? Do all the latest nightlies have the camera fix in them?


You need to go here and read: http://rootzwiki.com/topic/34482-unofficial-cm9-with-working-camera/


----------

