yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy R i9103] The-Droidster:
Karthik, thank you for taking time for reading through and answering. Regarding Camera HAL, I understand that we have necessary drivers in the kernel and we need either HAL or proprietary libraries for CM10 but what about CM9?, If in case I'm building CM9 from sources then do I have the necessary modules for a functioning camera from ICS sources or do I still need separate HAL or proprietary libraries?

Sorry for troubling you.:o

Thnx!:)
[Samsung Galaxy R i9103] karthik050782:
Same for cm9... u need camera hal.. as cm is different source and generic.. we need to do more fix for device specific...

Updates: tried by copying some libs but no change... drmserver not running... any ideas?
[Samsung Galaxy R i9103] Adam77Root:
1. Tegra devices, especially their camera, always give hard time to devs. It's the same with other devices. It has such a unique architecture that it's very hard to reverse engineer and the libs are not open source. No wonder why codeworkx or chainfire would not touch any Tegra device. I don't know if there is any difference in camera module between ICS and JB, I can only tell that NVidia's one is very specific. Most of the devices use ICS HAL for JB as they don't have official JB support (afaik only the S3 has official JB atm). Usually camera module depends on the kernel, just like a lot of other things (just remember my green CM10 build with 2.6.36.4 kernel). The ugliest things is how proprietaries change the official Android code. Sometimes they have changes in the base layer which we don't know about and they only have to share those sources they are obliged to, for example the kernel. It has GPLv2 which means they have to open the modified source. (Don't know about Apache license, correct me if I'm wrong.)

2. Bluetooth is a way easier to fix as Android uses a more generic way to handle it. Regarding mic: It should be easy too.

3. I can tell the same with modified AOSP code. You'll not be able to get camera functional in CM9. You need a camera wrapper that calls the functions in our lib.

4. Oficially ICS uses 3.0.x, JB uses 3.1.x kernel. The latest experimental AOSP upstream kernel is though 3.4.x. There are some devices that use 2.6 kernel for ICS as Karthik has also mentioned.
[Samsung Galaxy R i9103] milindthakker:
ICS Cam

Does this link help anyone :

http://translate.google.co.in/trans...a=X&ei=LkOWUOuCC83trQevzYC4AQ&ved=0CE4Q7gEwBQ

http://www.slideshare.net/pickerweng/android-camera-architecture-8098156
[Samsung Galaxy R i9103] The-Droidster:
Thank You for this beautiful explanation! Much obliged Sir!

This sorts a lot of things out.

1. We are lucky in the sense that Samsung released official ICS with kernel v3.1.x for us, which is exactly what JB requires. Had the kernel been 3.0.x, we would have been in trouble.

2. Here, the problem is not the Camera driver because the required tegra driver came with the kernel 3.1.x of ICS. The root problem is the abstraction layer or wrapper(Camera.h or CameraHardwareInterface.h) or HAL(Hardware Abstraction Layer) libraries which unfortunately are also vendor specific. From Adam's explanation it seems that nvidia has not released the HAL source specific to our device. Once we have the HAL or equivalent libraries that can communicate with the tegra camera driver we'll have a working camera.

One Question: Do we have the required Camera Service libraries libcameraservice.so at our disposal?

Thnx!:)
[Samsung Galaxy R i9103] karthik050782:
Boss is Boss!!! What an explanation! Great Adam!

Today lot of shopping for diwali :) Will do some research at night!

Googled DRM, nothing special about it.

Will try something with coding (usually i won't do anything like this) and will update you guys..

---------- Post added at 07:03 PM ---------- Previous post was at 06:57 PM ----------

Thanks for the links! But already gone through it, as Adam said our tegra 2 architecture itself different :mad: and the Chinese link is just showing the architecture but no source..

Found some other link also, with pieces of codes

http://translate.google.com/transla...orum.php?mod=viewthread&tid=29&extra=page%3D1

translate.google.co.in/translate?hl=en&sl=zh-CN&u=http://blog.csdn.net/gerryzhu/article/details/7956092&prev=/search%3Fq%3Dnvomxcamera.cpp%26start%3D10%26hl%3Den%26sa%3DN%26biw%3D1366%26bih%3D680%26prmd%3Dimvns&sa=X&ei=hvWPUJ2xEsaqrAfSmYGQBA&ved=0CCoQ7gEwATgK

Let us see...
[Samsung Galaxy R i9103] ashikh89:
how do i flash??

this c.m zip file is to be flashed via cwm ??am on ginger bread.. i tried flashing by cwm and got stuck on cyanogen mod boot screen .. can someone help me?
[Samsung Galaxy R i9103] parmarket:
Wipe Data, Cache and Dalvik cache, if still not booting, once again flash CM10,,,last option is Flash ICS or GB via Odin which you can find in Developer section do little search. good luck, happy flashing :)
[Samsung Galaxy R i9103] ashikh89:
clearing data worked :) thanx
[Samsung Galaxy R i9103] Adam77Root:
1. We would not be in trouble if Samsung had released 3.0.x kernel as the code would be then created for the 3.0.x version. It's just better to have a higher version. :)

2. Nvidia unfortunately will never release proprietary sources (even Samsung didn't do that (I mean the libsomx... libs)) as I think.

The links are good! Needed that picture of the structure.

@Karthik: Does drmserver should run with camera? Or with hw accel?

Sent from my GT-I9103 with CM10
[Samsung Galaxy R i9103] karthik050782:
For hw acceleration also it should run... but I think it won't be an issue.

Read some links about AVP but nothing special... it seems tegra3 use NVAVP and we need to set in config as Nvavp as not set... not sure how much it work... just trying...

Not knowing how to debug... if u have any link.. plz share... will try it :)
[Samsung Galaxy R i9103] The-Droidster:
This explains the camera stack very well. May be it gives some hint.

http://marakana.com/static/courseware/android/Aptina-Android-Camera-Internals.pdf

Tapatalked from my Galaxy R GT-I9103 using XDA Premium App :p

I don't go to sleep until I utilize my quota of 8 thanx a day!
[Samsung Galaxy R i9103] Adi_Pat:
Just posting here since its the most active thread, I dont mean to SPAM or such :)

We have a community on Facebook- So it would be cool if more people could join, 170 members so far.

http://www.facebook.com/groups/248321161941554/?notif_t=group_r2j
[Samsung Galaxy R i9103] Tha TechnoCrat:
@adi_pat pls add me to the group I just requested to join it

name = Kartikey Mishra
[Samsung Galaxy R i9103] karthik050782:
Sent request! Hope we can discuss more there also, Please accept my request ;)
[Samsung Galaxy R i9103] Tha TechnoCrat:
Give me your name so I can add you
[Samsung Galaxy R i9103] vipul12389mehta:
Thanks adi_pat...

we just need...members...!!

i will accept the req..once i leave ofc..!!
[Samsung Galaxy R i9103] karthik050782:
Not getting much time!!! Just sent a PM to pershoot about the tegra_avp and I think he is very busy and won't be able to look into it.

As I said earlier, going to do some coding and debugging... let us see.. Won't be much contribution on this and next week(busy with office work and festival time :) )
[Samsung Galaxy R i9103] dhiru1602:
I have made a Camera HAL for Galaxy SL from scratch and I am pretty good with Cameras.

Had a look at the code for libcamera and the kernel source.

Manually powering on the camera wouldn't be required. The device that this Camera HAL belongs to might be using a different way of powering the camera device hence it use sysfs to power on and power down, but on Galaxy R, it is done by the V4L2 itself, when the videodev (/dev/tegra_camera) is opened. So you could comment out the code inside PowerOn().

This is where the camera is powered in the kernel. So we don't have to do it from the Camera HAL.

https://github.com/AdiPat/android_k...drivers/media/video/tegra/tegra_camera.c#L341

Secondly, I see that dev/tegra_camera indeed opens but fails at VIDIOC_QUERYCAP. This might happen when the kernel has issues which I guess is not the case since the kernel release is directly from Samsung, or maybe because of issues with IOCTL headers.

V4L2 implementations use IOCTL headers and they are often different for devices especially Samsung ones. We have to use a custom IOCTL headers even on Galaxy SL. The IOCTL headers are in the kernel which need to match the userspace. If you don't provide a custom IOCTL, the generic android ones will be used, which may not work for this device.

This is the dmesg which clearly indicates that the kernel doesn't understand the IOCTL call

https://github.com/AdiPat/android_kernel_tegra_n1/blob/ics/include/linux/videodev2.h

You need to include this videodev2.h in the camera HAL and change all the includes to linux/videodev2.h to the header file that you have locally, as we did here: https://github.com/teamhacksung/android_device_samsung_galaxysl/blob/ics/include/videodev2.h

Offtopic:

I would like to know if there is anyone from Dubai UAE who is willing to exchange his device for a few days so that I could work on the Camera HAL and OMX for you guys. Please drop me a PM message. Thank you.
[Samsung Galaxy R i9103] 1337SereniTyx3:
Will be in Dubai next month for two weeks. I might be able to exchange unless you get it first from someone else.

I hope you do get it first from someone else. As earlier as possible you get the device, the faster will be the development process.
[Samsung Galaxy R i9103] Tha TechnoCrat:
This means camera can/will work? Or is working?

Edit

Now that I have edited my post someone please tell me if camera can work
[Samsung Galaxy R i9103] parmarket:
Please edit your post, don't make thread long and messy. Please don't mind. :)
[Samsung Galaxy R i9103] karthik050782:
Thanks dhiru! I did the changes and compiling only the libcamera... u can find the camera sources in

https://github.com/karthik050782/android_device_toshiba_betelgeuse/tree/jellybean/libcamera

Will update you with latest logcat... one question, how this tegra_avp get called...

after commenting poweron, logcat as below: Not sure why it is trying to open video0

I/Camera_Factory( 120): Returning /dev/video0

I/CameraHardware( 120): Using camera /dev/video0

D/CameraHardware( 120): CameraHardware::PowerOn: Power ON camera.

E/CameraHardware( 120): Could not open /sys/devices/platform/tegra_camera/power for writing.

D/CameraHardware( 120): CameraHardware::initDefaultParameters

E/V4L2Camera( 120): ERROR opening V4L interface: No such file or directory

E/CameraHardware( 120): cannot open device.

I/CameraHardware( 120): Default preview size: (320 x 240), fps:30
[Samsung Galaxy R i9103] dhiru1602:
Galaxy R doesn't use /dev/video0 and dev/video1. Use /dev/s5k6aafx for Front Camera and /dev/s5k4ecgx for back camera.

Camera ID 0 = Back Camera and Camera ID 1 = Front Camera.

You need to change them here: https://github.com/karthik050782/an...lob/jellybean/libcamera/CameraFactory.cpp#L62

tegra_avp I guess is the Audio Video Processor. I guess its something like the DSPBridge on the TI platform. Most probably it would be used by the OMX Codecs. Can be dealt with at a later stage.
[Samsung Galaxy R i9103] karthik050782:
My Mistake!!! Copied the camera.tegra.so from different directory.

Tried with the changes, but same error!

I think we have tried already with dev/s5k6aafx and /dev/s5k4ecgx, but it failed in open itself. :(

When i see the log of stock, this tegra_avp getting initialized at the time of executing the camera application.

Had a chat with xplodwild, according to him it is because of missing libraries and wrong permissions :(
[Samsung Galaxy R i9103] F3niX:
Awesome work. I will check with my friends. If anyone is heading Dubai will tell ya.
[Samsung Galaxy R i9103] Adam77Root:
New build coming soon with all the fixes included, updated sources and this.

Sent from my GT-I9103
[Samsung Galaxy R i9103] D™:
wooopiiiiiii... You are great buddy..Show me your chick..wanna kiss you..here here..:D:D:p:p
[Samsung Galaxy R i9103] aliutak:
Mew build camera working???
[Samsung Galaxy R i9103] karthik050782:
I thought to PM you about this and u did it... thanks.. Any updates on the Nvidia Codec?
[Samsung Galaxy R i9103] Adam77Root:
No significant updates. Just a little: I'll include Samsung OMX too (it's used mainly for audio processing, you won't notice any big improvements).

Sent from my GT-I9103
[Samsung Galaxy R i9103] leanhua:
See the first paper(#1) where the latest information
[Samsung Galaxy R i9103] mj.vikram:
wait for some time Adam will upload it and update the OP...
[Samsung Galaxy R i9103] Tha TechnoCrat:
@karthik is camera working?
[Samsung Galaxy R i9103] Grarak:
I don't want to resync the repo ha ha :)
[Samsung Galaxy R i9103] karthik050782:
No buddy.. He mentioned that all the fixes in single build... Means the usb fix, deep sleep fix etc.. will be in single build and also he will add codec changes... and file manager and latest updates of CM...

Need to find a person in dubai to exchange the device for dhiru... He is very interested to develop for our device...
[Samsung Galaxy R i9103] karthik050782:
I did some changes for HW acceleration and messed up the framework directory, again did the repo sync by removing the framework and not sure what went wrong...

Last night spent on this itself, today everything is up.. just included NVMAP in the kernel configuration.. let us see the outcome.. Tomorrow, if dhiru is free will disturb him and try something for camera :)

Edit: Nothing Worked :( No Changes... Xplodwild is asking me to do some changes in OMXCodec.cpp where it failed to allocate the node.. but no idea how to make changes :(
[Samsung Galaxy R i9103] Adam77Root:
I've also looked into OMXCodec.cpp, but I think the problem is with Nvidia libs not having the necessary dependant libs on the device. Will examine all of the files on computer at the weekend. I don't think NVMAP is needed, stock ICS doesn't use it so our libs don't use it as well.
[Samsung Galaxy R i9103] karthik050782:
Wow!!! I made it! HWacceleration is working with Nvidia Codec! Thanks to the ejtagle who have uploaded a zip of Nvidia Lib...

Adam, please wait, i will send you the libraries ink so that u can give the whole build, now testing camera :)

Edit: Here is the link

Camera is giving error as below:

D/NvOsDebugPrintf( 120): pSensorBayerContext->FrameErrorCount = 0x0

D/NvOsDebugPrintf( 120): FocuserNvc_Open: cannot open focuser driver: /dev/focuser.1 Err: No such file or directory

D/NvOsDebugPrintf( 120): FocuserNvc_Close: No hImager->pFocuser->pPrivateContext
[Samsung Galaxy R i9103] Adam77Root:
Nice! I stopped uploading. Will check tomorrow using our libs. Did you make changes in media_codecs.xml?

I think the camera error is related to the new libs in the uploaded archive. That's why I'll use our ones.
[Samsung Galaxy R i9103] karthik050782:
May be! I will check with our camera.tegra.so. Using Nvidia codecs in media_codecs.xml, i think I used this
[Samsung Galaxy R i9103] txingu:
thanks you guys!!

You're work are awesome!!!

:victory::victory::victory::victory::victory::victory::victory:
[Samsung Galaxy R i9103] F3niX:
With working hardware acceleration and camera in route.. all is set for a happy Diwali. :P
[Samsung Galaxy R i9103] CallMeVentus:
Just asking....there are fixes for using GB libs for libstagefright on msm7x27 chips...I wonder if you guys can try the same thing ?

Sent from Nortrom's Glavies of Wisdom.
[Samsung Galaxy R i9103] D™:
Wowwwww.... Karthik you need a Hug from everybody here.. we Love you buddy. Now, we can play movies as well after HW acc working..great going Karthik and Adam buddy.

For you buddies:
[Samsung Galaxy R i9103] karthik050782:
Tonight, I will test the camera with our libraries.. Actually i have replace the libraries, bin and etc/firmware files.. and it booted and HW acceleration worked, but can't use gallery..

Also with the latest repo sync, message is not working. :(

Thanks for your support guys!
[Samsung Galaxy R i9103] Indha Lezzio:
Best wishes buddie

Enviado desde mi GT-I9103 usando Tapatalk 2
[Samsung Galaxy R i9103] mj.vikram:
Adam or karthik why battery usage data isn't available/activated, is it conflicting with any other features....
[Samsung Galaxy R i9103] Adam77Root:
I haven't investigated it yet, don't know why it doesn't work.

I think I have the solution for LPM bootup issue. Will check at home.

Sent from my GT-I9103 with CM10
[Samsung Galaxy R i9103] karthik050782:
Guys!!! I have a great news... Camera is working, but camcorder is not working..

will check the logcat... cant control myself, so just updated here :)
[Samsung Galaxy R i9103] hasanjaved:
Awesome great news...:D:thumbup:

You r just amazing buddy:thumbup:
[Samsung Galaxy R i9103] vbz89:
That's really amazing!!! you rock buddy!!

From my CM10 powered galaxy R
[Samsung Galaxy R i9103] karthik050782:
Adam, in ur latest build, is message working fine? in my latest it is not working... :(
[Samsung Galaxy R i9103] D™:
Woooppppiiiiii...you are the one.. now u need a kissssssss...from every user?? Yeesssssssss...
[Samsung Galaxy R i9103] vbz89:
Hahaha...control vikesh buddy.. but really awesome progress...

From my CM10 powered galaxy R
[Samsung Galaxy R i9103] karthik050782:
Thanks buddy! I know all you want to see the camera and hw acceleration in CM10. So uploading a zip file which have the libraries, binaries, configuration, firmware files.

And also a script file to push the files(u have to change the path) using adb.

Wait for another 45 min..

Else, I will try for the flashable zip, as u guys need the system for the adb...
[Samsung Galaxy R i9103] maheepmaurya:
Please. A Flashable Zip would be Awesome. I hope that would be applicable for Paranoid also eh??

You made our Diwali btw.... Keep Rocking!!! Great Work. :victory:
[Samsung Galaxy R i9103] F3niX:
Awesome. If possible please upload the whole package as BETA. With cam working all we need is stability fixes and Bluetooth. We can wait for that. ;) great work.

Btw cam is working with full 5mp or just vga?
[Samsung Galaxy R i9103] vipul12389mehta:
karthik... upload watever u r cimfortable with..with n inst how to flash.....

u made diwali better... nw i can atleast take pics for diwali from my cm10 powered R..!!
[Samsung Galaxy R i9103] karthik050782:
Full 5 MP and front facing camera also working... but only snaps no camcorder.. tried gtalk for video chat, FC :(

creating zip file.. will upload it soon...

Edit 1: Flashable Zip is ready :) Testing...
[Samsung Galaxy R i9103] mj.vikram:
wow great news buddy :good:...
[Samsung Galaxy R i9103] 1337SereniTyx3:
I think our device is the fastest developing NVIDIA device out there right now. I asked a friend of mine who has Atrix & he said they had to wait for 6 months to get working camera.

I know this comment doesn't belong here. I tried not to spam the thread but couldn't stop posting. Sorry and this is the first & last spam comment from my side. :)
[Samsung Galaxy R i9103] Adam77Root:
I enabled most of the Nvidia and Samsung codecs, they work together blazing fast!

@Karthik: Yeah, messaging works fine for me. What did you change for camera?
[Samsung Galaxy R i9103] D™:
Buddy dont want to breakdown ur breath bt can Adam buddy change the name of this thread with uploaded new cm10 zip to Beta Version of Cm10?? Means with working camera, hw acc and working msgs..
[Samsung Galaxy R i9103] parmarket:
this is huge success man :laugh:!! R guys will perty tonight :highfive:

Karthik you can take your time to sort out the things, no need to take trouble of uploading whole build in midway, just take your time for testing, and whenever you feel comfortable just hit the upload button :silly::cyclops:
[Samsung Galaxy R i9103] karthik050782:
Sorry guys! Some problem in Internet Connection, tested the Flashable Zip and it is working great :)

Here is the link... Not tested in other ROMS, please take a backup before installing this :)

@Adam Ji: No Changes for camera, as you said used our drivers and it worked. Y'day i replaced with our drivers, today just added the missing driver from the Zip file provided by ejtagle.

Ejtagle is the man to be appreciated!!! He is doing lot of great work with DerArterm!!! Even for them, camcorder and video chat is not working :(

Edit: Guys, test it and let me know how happy you are in the general thread, let have all development discussion here :)
[Samsung Galaxy R i9103] Indha Lezzio:
Would it be possible to flash the fix to PA?
[Samsung Galaxy R i9103] 'cooleagle':
Could you please post a link to their thread so we can thank him for this ?

BTW this is awesome news guys, I hope we can get it working completely soon. :D

Please don't forget dhiru has been helping us too and he has also offered help if someone can lend him his Galaxy R for some days.

Cheers ! :)
[Samsung Galaxy R i9103] karthik050782:
He is in different Forum :( Link of his forum is here... http://www.modaco.com/topic/330834-advent-vega-kernel-source-code-now-available/page__st__2660 )

I have registered and asked for their help :)

Yeah dhiru and adi_pat also helped much, but without device it will be very difficult for them :)

@Indha Lezzio: give a try, i think it should work in PA and AOKP as all these are vendor libraries and no need to compile with the base source... Before installing take a backup for safer side...
[Samsung Galaxy R i9103] Indha Lezzio:
I am happy to confirm that CAMERA WORKS!!!! How can i check about HW?
[Samsung Galaxy R i9103] emanoj.i9103:
I confirm hardware acceleration works. I was able to play videos in MX and Dice Player with HW decoding option
[Samsung Galaxy R i9103] shaheen7m:
Camera works perfectly. Tried with camera zoom fx

Edit: messaging also working fine with go sms
[Samsung Galaxy R i9103] amar1548:
Any one tried 4.2 Camera with photosphere.....??????

HIt tHnX iF i hElP u

Sent from my GALAXY RoYaL
[Samsung Galaxy R i9103] pulley06:
Buddy just got a couple of queries

1: phone going into deep sleep?

2: gyro working fine?
[Samsung Galaxy R i9103] mj.vikram:
1. Yes Phone is going into deep sleep.

2. All Sensors are also working...
[Samsung Galaxy R i9103] pulley06:
Thank you:D will flash asap!!!
[Samsung Galaxy R i9103] karthik050782:
None of the developer will like which use the proprietary libraries.. so we have to work on our own camera HAL...

@Adam: waiting for your full build... :)
[Samsung Galaxy R i9103] dr.ngk:
Never seen before dedication...What with flagship devices having official support? V have amazing devs who slogged it out day in day out for a cm 10, that too in a device which has the nvidia issues and all..hats off guys, i had decided to switch over to s2 and ics rolled out (the back up) was thinking of changing to s3, but u guys have sheerly made me stick to my Glx r..great work..keep em coming! !
[Samsung Galaxy R i9103] sachindpai1:
Super duper dude...thats enough for me ....data and camera

---------- Post added at 12:34 PM ---------- Previous post was at 12:30 PM ----------

Yes u guys saved me lot of money. If u havent developed cm10 i would have bought a s2 or note ...thank u so much
[Samsung Galaxy R i9103] Adam77Root:
Panorama is fully, video recording is partially working. 720p videos are lagging a lot, 480 videos are recording properly. But videos cannot be saved now. There is some error with stopping recording. There is no sound as back mic doesn't work.
[Samsung Galaxy R i9103] Bhavik Jain:
hey waiting fr d build very desperateeeeeeeeeeeeeeeeeeeeeeeee:p:p
[Samsung Galaxy R i9103] Indha Lezzio:
Isn't it beta yet? :confused::cool::laugh:
[Samsung Galaxy R i9103] shaheen7m:
'yet' I am not getting the logic behind your question. If you need a beta 'tagged' build, wait for it or else you need a good CM10 go ahead and flash it. Don't give much importance to the build version, its rocking
[Samsung Galaxy R i9103] mj.vikram:
Buddy he is telling that now most of the things are working, so now you can remove the Beta and say it as stable CM10 i think.......
[Samsung Galaxy R i9103] parmarket:
nope I guess he meant why It's still in Aplpha stage ? still not changed yet to beta after camera success.
[Samsung Galaxy R i9103] vipul12389mehta:
i think..beta tag shld b given when all the things are workin...