yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] MrDroopy:
Had a quick look in the published source. I found references to the desire-hd cmos cam (s5k3h1gx) in "board-spade.c" Also in the source are the halibut and mahimahi boards, both using the s5k3e2fx. The board-spade seems to define the Desire HD hardware platform and includes the s5k3h1gx as camera. Patching this file should bring some light into the cam I guess. the board-halibut.c or board-mahimahi.c should provide an easy template. (all three files are in /arch/arm/ )

I am not sure which sensor is used in the Desire, but for the HD2 it is the s5k3e2fx.

Any of the droid techies able to fiddle around with these findings?
[Desire Android Development] K900:
Will look tomorrow

Sent from my HDfied HTC Desire
[Desire Android Development] rolfd:
Ok, final warning to all involved in continuing to post off topic in this thread.

Both myself and Pulser_g2 have asked that this thread be kept clean and free from clutter. Infact, pulser actually created a thread in the General sub forum, for user discussion, to help keep this thread clean for developers and people who are working on this issue.

As of now, if I have to delete any off-topic posts, or posts not directly related to the fix of this issue, the member will be warned via PM, and issued with an infraction.

Infractions are basically a warning system, and if you accumulate enough infraction points in a given timeframe, they will result in a temporary ban from the site. I don't want to to this, but the continued off-topic posting, and blatant ignoring of our warnings have left me with no other options.

Please take note of this as no further warnings will be issued in the thread.
[Desire Android Development] JeckyllHavok:
What about our member dzo, he prted the android kernel to the HTC Vogue and Kaiser (and mybe mor, but not sure) he had some problems with the camera, too but he got it working somehow. Maybe his sources will help in finding a solution:

http://androidhtc.git.sourceforge.net/git/gitweb-index.cgi
[Desire Android Development] BlueVD:
Has anybody tried to debug mediaserver? Using a custom build segfaults. And the old one just doesn't create the overlay the camera asks for.

Right now I'm recompiling a lot of stuff with debugging symbols attached but if someone would feel like helping it would be a treat.

[EDIT]

After hours of tinkering, I've managed to get this:

E/Overlay ( 151): overlay_createOverlay: unsupported format! = 99
W/CameraService( 3117): Overlay create failed - retrying

as opposed to the old media frameword:

[ 10-22 17:23:40.308 2434:0x982 D/CameraService ]
Overlay create failed - retrying

I've recompiled all the media framework, but apparently there are still a few patches left to be done, but after that, it should be all down the hill, God be willing :)
[Desire Android Development] m0narx:
Of course I do not understand much, but could possibly recompile the kernel of Desire and replace in the source id of Desire's camera driver to the id of Desire's HD camera driver?

Thus at the Desire's kernel will show that we have a camera of Desire HD ...

Sorry for my English/
[Desire Android Development] K900:
In fact, our problem is exactly the opposite: the HD roms think that they run on a DHD, and so use the camera functions of the DHD. So we need to make the rom's framework understand that it's a different device with a different camera.

Sent from my HDfied HTC Desire
[Desire Android Development] Jeffdeaf:
This is exactly what I was talking about at page 1 of this discussion.

That part is now deleted.

Different phone, different camera, different options.

WHY DID NOBODY LISTEN?

You tell me.
[Desire Android Development] eViL D::
The 4th post says this, but until it's accomplished, there can't be any "I told you so's..."

I don't know how many people are qualified or skilled to decompile closed source framework and make those changes, but off the top of my head I can think of snq-. It's possible if somebody reached out to him, he may lend a helping hand. I also think if we can somehow merge (bad term) the "original 2.2 Desire" htc.framework into the framework, side by side with the HD's, it can work. But, that itself might be more work than just framework changes.
[Desire Android Development] ephumuris:
Im guessing that this isnt really ongoing anymore. Just wondering if this is a stupid idea but would it be possible to have two frameworks in one rom?

Concept would be have the desire hd framework for everything other than camera purpose.

Have the desires regular camera.apk and a 2.2 framework. Named frameworkold. Then somehow make the camera on launch call what it needs from frameworkold instead of framework.

May be way off the mark there but would it be possible to somehow implement dual framework?

Eph.
[Desire Android Development] beidl:
No, it's not possible, that would simply result in dual boot.
[Desire Android Development] ephumuris:
I guess I'm just clutching at straws as it all seems to have hit a brick wall!

Eph.
[Desire Android Development] K900:
Completely wrong. It is probably the way to go, because we now see no other.

Sent from my HDfied HTC Desire
[Desire Android Development] BlueVD:
At the best you could use the old binaries (since those are the problem) but it wouldn't help. You'd basically have to run 2 different OS'es in the same space and that would be even more cumbersome than porting the binaries.

Sorry for the absence guys, but now I'm back (has to do some traveling because of work) =)
[Desire Android Development] beidl:
There is NO WAY loading a different framework while running the OS. You would still have to reboot/kill zygote and the vm to get the right framework in RAM and even then,

some system apps WILL be incompatible with the newly loaded framework, which would result in a flood of annoying FC's, if not a boot loop.

Do you even know how linux and android work?
[Desire Android Development] ephumuris:
I dont so I do apologise for my suggestion. I have very basic knowledge I was just clutching at straws :(

Eph.
[Desire Android Development] beidl:
No need to apologize. ^^ bluevd will get it to work, i'm sure of it.
[Desire Android Development] eViL D::
I took a quick look at the framework.jar this morning. I did a diff on the HD vs. "normal" Desire.

Here are the differing camera files...

in /hardware/

Camera$Parameters

CameraSwitch

in /media/

audio (a lot of these)

CamcorderProfile

CameraProfile

media (also alot)

Also, encoder/decoder, etc...

It could be possible to just copy from one to the other, but I haven't tried yet.
[Desire Android Development] Zeljko1234:
I read this thread, I'm not developer but sometime someone could have good idea. Maybe it's easiest to port just new Sense HD to old Desire OS then port old camera to new Desire Sense HD.

I hope that this is not completely stupid idea and that you understand what I mean :)
[Desire Android Development] ephumuris:
There has been no official announcement about the new Sense coming to Desire. Not direct from HTC so anything for now is speculation.

@eViL D: That seems very interesting. If there are most errors with audio i'm sure most of us wouldn't mind if audio was missing at first as the audio is CRAP. Is the camera only dependent on framework.jar or are there more files in the spiderweb?

EDIT:

So i'm currently messing with the framework.jar. I have took classes.dex from a regular 2.2 rom and also one from Sense HD rom. I have baksmali'd both and copied some camera related files. Probably a total miss but once robocik has sent me the camera.apk for the version rom i am using i will post about my horrible failures :)
[Desire Android Development] eViL D::
I'm not sure. I'm only just trying the framework route. I'm using enomthers files from his N1 rom for the Desire cam.
[Desire Android Development] ownhere:
milestone devs release this :http://xdaforums.com/showthread.php?t=786316

with WORKING CAMERA!
[Desire Android Development] mutokenji:
This is a little thing i get from that thread, maybe this can help.. :)
[Desire Android Development] fllash:
I was just about to post that myself ;).

Josh.
[Desire Android Development] eViL D::
Can somebody unyaffs the data.img? I'm having technical difficulties with my computer...
[Desire Android Development] ivicask:
Do you need entire data.img? Or just some specific files, libs and so for the camera, because i started uploading, and my connection is breaking..im lazzy to try upload 185MB again..

I will upload you those if you want.
[Desire Android Development] MacCarron:
Here, unyaffed data.img minus the ebooks :p

http://dl.dropbox.com/u/6419606/Data.zip
[Desire Android Development] eViL D::
Ahh, you're awesome! I'll check it out, thanks.
[Desire Android Development] Beaverman20:
this might sound stupid, but did anyone ASK him how he did? maybe he could help?
[Desire Android Development] eViL D::
As far as I can tell, Dexter_nlb is using 1.04.161.2 for apps/framework (though his build.prop says otherwise). The libs... I can't tell where they're from, most likely a mix of other roms. All I know for sure is the libOlabase is from the original Desire. Anyway, I have PM'd him to talk to him more. So, right now, I am just getting a black screen, with UI block, when using the app/bin/lib camera files. The camera seems to be starting, but the preview is not.
[Desire Android Development] gurpreet3579:
guys may be this can help you

BTW, Dexter_nlb managed to fix this camera issue for the MotoFroyoSense ROM (Froyo port of HTC DesireHD SenseUI) ported to Motorola Droid

http://xdaforums.com/showthread.php?t=786316
[Desire Android Development] ephumuris:
I really wish i could fix this. Especially seeing the moto guys got the camera working for themselves. I have tried replacing the files mentioned in moto thread, tried different .apks, tried editing smali in framework.jar, tried just about everything others probably have too but just hoping to find some winning combination.
[Desire Android Development] pikey7:
I'm certainly no developer, but I can apply a bit of logic... maybe!

Reading their thread, the moto guys have done it so that they have the froyo camera working, and as an addon the sense camera?

So, for the desire, stripping back the sense part, does it work on the froyo kernel? If not, then what is the difference between the last working froyo kernel and this one?

I would imagine that without sense, the camera driver for desire should be compatible in a "vanilla" environment?

once that side is working, then the target should be the sense side?

right?

if not, then what about getting the latest sense to work with the latest build of working froyo (I would imagine that this would be the hard way to try to find all integrated and modified files...)
[Desire Android Development] Zeljko1234:
I suggested same thing :)

Maybe is easiest to port new Sense to old Desire Froyo.
[Desire Android Development] beidl:
A quick summary of what happened in this thread to keep the thread clean of unneeded questions...

The basic (shortened) way camera apps access the camera:

Camera app uses the camera APIs (Java) offered by the framework -> framework calls some native C/C++ written camera libraries which also depend on other libraries -> libraries access the camera through the radio.

So the problem lies somewhere between these steps.

Of course, flashing others phones radios on our Desires is a TOTAL NO-NO.

So there are only 2 possible ways left:

The moto guys had some luck by finding the right set of libraries, we had no luck as of yet trying that way.

And BlueVD tries to modify the framework functions to use the right calls to the camera libraries.

Let's hope the guys will get it working successfully soon.
[Desire Android Development] baadnewz:
well i couldn't even installed the desire camera.apk. Failed :)

And yeah nobody keeps the developers from working, we are just shooting ideas, who knows, maybe someone just gives a great idea, that whats the forum for aint?
[Desire Android Development] andycted:
Well, maybe those actually working on it could explain the current state of things. After monkeying around a bit with it, my idea was that you have to carefully re-link the chain:

Camera Application - Libraries - Kernel - Camera Hardware

since we are using a kernel for the normal Desire, the last link should already be ok.

Moving some/all libs with or without the camera application wouldn't work. So, I might be wrong, but wouldn't it require some modifications to the kernel ?
[Desire Android Development] andycted:
Good idea, and it could work in the meantime, while waiting for an eventual port of the hd camera, but wouldn't it involve a big number of files ? And I guess other applications wouldn't be able to use the camera itself ?
[Desire Android Development] K900:
Yeah, the problems are just as you say.

Sent from my HDfied HTC Desire
[Desire Android Development] MadMic:
Hi all, I'm not a dev or anything near as close - just a thought, the errors related to the audio - is the camera trying to initialise the audio for video purposes and failing? Just wondering if the issue is both the camera and audio recording systems.....

Just a thought.... good luck and respect to those trying to fix this issue - :)
[Desire Android Development] gurke1509:
So, maybe exactly this is the problem, since it says

.

Probably the new hd kernel provides the needed files.
[Desire Android Development] NeoPhyTe.x360:
The files I have tried changing to get a "black" screen without camera closes:

/system/bin/

awb_camera

lsc_camera

mm-vdec-omx-test

mmcamera_test

omx_tests​

/system/lib/

libcameraservice.so

libcamera.so

libcamera_client.so (from Desire Z dump, another one, crashes)

liboemcamera.so

libmm-omxcore.so

libOmxCore.so

libomx_sharedlibrary.so

libOmxVdec.so

libOmxVidEnc.so

libomx_wmadec_sharedlibrary.so

libomx_wmvdec_sharedlibrary.so

libqcomm_omx.so

libstagefright_omx.so

libhtc_ril.so

hardware_legacy.so

libgps.so​

(and many others of /system/etc/firmware, /system/lib/hw/, the apk(that do the same ), build.prop, and some smali code on framework.)

(hope no forget any file)

That I've seen is that files in /system/bin tells rom what are the "features" of camera (features that our desire doesn't have), changing this, it solves a lot of "errors" in logcat.
[Desire Android Development] Rabadabadingdongable:
I don't think so, since every app that needs the camera doesn't work. I've developed a game which uses the camera and has use of the audio system at this time and it's not working.
[Desire Android Development] bananacakes:
libsurfaceflinger.so

libsurfaceflinger_client.so

That's as maybe. So don't trust it

sorry, I'm still clumsy with speaking in English
[Desire Android Development] NeoPhyTe.x360:
surfaceflinger.so crashes system before start
[Desire Android Development] andycted:
Yeah, now that I remember that happened when I tried. Maybe a stupid question, but has anybody tried to work on this on an emulator, to tell apart which part is problematic for the hardware and which is just a bad combination of libs that doesn't work together ?
[Desire Android Development] bananacakes:
I know..

but.. That's as maybe related in hardware...

sorry, I'm still clumsy with speaking in English
[Desire Android Development] andycted:
Do you know what this refers to ?

WARN/CameraSwitch(1817): no file - can't switch camera
[Desire Android Development] Diamondback:
Sound's like there's a problem with the second (front) camera of the Desire HD...

No second camera --> no app-start...
[Desire Android Development] hamdir:
there is no front cam on the desire HD....
[Desire Android Development] Diamondback:
Bad Rumours.... :-/ My fault...

But what's about this Cam-Switching?
[Desire Android Development] andycted:
could switch camera be related to this ?

http://code.google.com/p/android/issues/detail?id=7909

could just be a warning though ?
[Desire Android Development] NeoPhyTe.x360:
I think that switching camera messages are normally, it comprobes how many cameras mobile has, I think it's not the fault (because I edited files in framework related to camera switching and logcat says the same).

Maybe related with the camera preview can be the fault.
[Desire Android Development] bananacakes:
Reference file from N1 forum for 2.12.4 rom

app>HTCCamera.apk

bin>cam_ins_spmo

lib>libcamera.so

libcamera_client.so

libcameraservice.so

liboemcamera.so

libOlaBase.so

boot.img
[Desire Android Development] andycted:
Good to know, makes sense too. You actually got the camera working, but the screen is black, right ? Does the camera interface show correctly ? Because if it does, it could well be something in the 'preview' display that fails, along with everything else that the camera can work with (autofocus, auto white balance, etc).

Unfortunately at the moment I have the normal rom installed, but I'm going to replace it with the HD one as soon as I have a minute.
[Desire Android Development] hamdir:
well if got lucky with the right set of libraries porting the htc stuff to a motorla phone! it means the solution for our port is the same, we need to find the right libraries however he did mention something about the kernel source in his answer

lets hope he replied to EVIL D
[Desire Android Development] alexdiaz:
I've talked to snq- who is on the issue right now and he said that he doesn't believe it's a framework issue, he said it's a kernel issue and libs, something about a msm_rotor our processor does not have and a few others. It's a huge task. Luck won't be applied here...
[Desire Android Development] Nekromantik:
correct me if im wrong but the Desire HD has the same CPU as the Desire. So the CPU cannot be the issue here. Or have I got it wrong?
[Desire Android Development] perettigiuliano:
You are wrong...

Desire: SnapDragon 1Ghz Model QSD8250

DesireHD: SnapDragon 1Ghz Model MSM8255
[Desire Android Development] Nekromantik:
oh right

I never saw the model no's in the press release. my bad.
[Desire Android Development] perettigiuliano:
I am not the "WISE ONE"...

WikiPedia helps sometimes: http://en.wikipedia.org/wiki/Snapdragon_(processor)
[Desire Android Development] eViL D::
That was the initial reply I got back from Dexter_nlb. It doesn't really help, so I've messaged him again.
[Desire Android Development] live_0978:
not suggesting you admit defeat, but do you think handing him the baton might help?
[Desire Android Development] kiepas96:
i tried many libs fws and no luck yet

also i found this http://source.android.com/porting/camera.html
[Desire Android Development] BlueVD:
I'm back once again (this time for good, no more business travelling untill after newyears). After a few brief email exchanges with HTC, I've got un unofficial hint that SenseUI2 is indeed comming to Desire. However, the term was kind of "unknown release date so far". So I wouldn't expect it in December (the main problem the guys at HTC have is that htcsense.com is already having a hard time keeping up with the connected devices, so I guess that it isn't a problem of building the ROM, it's a problem with making their servers support a ****load of users).

As for the camera port...

On the diagram posted by kiepas96 you'll notice the Binder IPC (ISurface) block. That's where the problem is.

After many tests, logcats and dmesgs, every problem seems to be related to the libs (and not the framework.jar file). It has a *big* issue with createOverlay. On the Preview sequence diagram (from the same link about the camera porting) you'll see that the flow is Start Preview -> Start Preview -> openCameraHardware -> set Preview Display -> Get parameters -> Get parameters -> Get parameters -> Set Pramateres. From the logcats I posted some time ago you'll notice that the cam works until setParameters or startPreview. That's when something from the media libs get's their panties in a bunch and everything falls apart.

Right now I've dropped the idea of blindly compiling new sets of libs and I'm working on disassembling the libs (from the original rom and the new HD ones) and check where the main differences are. It's a slow process since I'm used to x86 PE files and not ARM ELF's. But I'm slowly progressing. I've got my brother involved in this project too (since he knows more assembly than I do) so progress should be smoother from now on.

Keep you posted on results...
[Desire Android Development] alexdiaz:
BlueVD get in hold with snq-. Message him or find him on #LeeDrOiD-ROMs (irc.freenode.net). He is working on the same issue and he can tell you where he's at with the problem. He's one of the few capable of really doing this but he has no time...
[Desire Android Development] ephumuris:
Would that be a way to permanently run the camera from a different set of libs or is that just for testing?
[Desire Android Development] m0narx:
I think it is possible to replace the original cam_ins_spmo to sh script .... which will perform cam_ins_spmo from the original firmware Desire and with the original set of libraries.

But so far only for experimentation
[Desire Android Development] eViL D::
Great utility, thanks for posting it. This will certainly help.
[Desire Android Development] prcctv:
*Mod Edit* DO NOT post on this thread unless you are contributing to the development. I have started to issue infractions to repeat offenders.
[Desire Android Development] hack.mod:
Post edited as not contributing to the development.

If you want to discuss this thread, or ask how the progress is going please go to Porting HTC Desire Camera to Sense HD ROMs (User discussion) . Otherwise please only post here if you have something to contribute to the development.

Thanks

Edit2: I've just edited this post instead of deleting it, as it serves as a little bump and keeps the thread up in the page rankings.
[Desire Android Development] casca:
11-10 10:43:47.684 E CameraController 1779 not support FlashMode !!

11-10 10:43:47.694 W HTCCamera 1779 reset_layout_from_surface - width: 480, height: 800

Reset layout end, set mMainLayout visible

11-10 10:43:47.704 E CameraController 1779 not support WhiteBalance !!

exposure-compensation: set value failed !!

is the flashmode error, referring to the actual photographic flash?or is it as in flash developing language?
[Desire Android Development] ephumuris:
Are you getting that error using the HD camera apk or the regular desire camera apk?

Eph.
[Desire Android Development] m0narx:
I use HD camera apk, and Barcode scaner.

I think the main problem in this:

11-10 10:43:47.684 E CameraController 1779 SupportedList.FlashMode == null
SupportedList.FocusModes == null
SupportedList.WhiteBalance == null
SupportedList.Effects == null
SupportedList.Antibanding == null
[Desire Android Development] patasenko:
Comparing the logcat that you posted and the one from working 2.2 rom, there seem to be a difference in the beginning specifically:

The last 2 lines are missing in your logcat.

I am no developer, but it seems that the new camera apk fails to start activity com.android.camera
[Desire Android Development] mastersjef:
Sorry i've read a few pages, but everybody is looking for the camera MP but is it not the screensize what's the issue? Because desire (Z) have 3,7 " and HD has 4,3". I have seen that the orientation and black screens are the main problems. I hope you can solve the issue b.t.w. Good luck! and keep up the very good work.
[Desire Android Development] DroidRevenge:
Screen size?

Mmmmh...

Maybe resolution... but it is the same.

Screen size it not the right way...
[Desire Android Development] mastersjef:
Oke yeah could be but i tought i give it a shot :) i'll folow the post from now on just in case. I'm very interested when it works i'm going to use the HD Rom for sure!!!!!!! Good luck
[Desire Android Development] Beaverman20:
Nope... because to make the bigger screen HTC just decreased the PPI instead of increasing the resolution... what does this mean? well HTC made the screen bigger but because it is at the same res it should look identical to the normal one... (the DHD will be slightly more blurry)