Jump to content
PaulOBrien

Advent Vega kernel source code now available!

Recommended Posts

Well... I did the merge between the redscorpion libcamera version and mine. The resulting library seems to be much more stable and much more compatible that the previous ones. But, there are stil some things to figure out ... I will continue working on it ... Attached the source code as it is right now, and a precompiled version of the library... I really hope to be fixing the remaining issues very soon - Specially, the redish tint the image has right now ... I suspect where the problem could be.

I am interested specially in crash reports and compatibility reports :D

Eduardo

uvc3.rar

uvc3-compiled.rar

Share this post


Link to post
Share on other sites

Eduardo, ive given it a go and i've got a preview issue. in the camera app there is no preview (just a black screen) untill you take a picture then the preview appears.

ive tried a couple off apps but get a black screen that may be the same issue. ive attached the logcat output.

http://pastebin.com/2HfCKtxr

cheers

small update - tried a few more apps,

Retro camera has the preview window but when you take a picture the tablet locks requiring a reeboot

Barcode scanner - has a black screen, no picture

Google talk force closes as soon as it tries to connect - logcat http://pastebin.com/CXsXTqgx

Edited by CoWPlagued

Share this post


Link to post
Share on other sites

Hello,

and one more version of the camera... :-)

Changes:

-recording is now working

-hardware stretching (thanks for tip Eduardo!)

Kamil

Hi Kamil,

Is this from the same source as Eduardo just posted? i.e, does it include the changes he made ? If not maybe worthwhile you two getting together offline and working from the same base, saves duplication, .. Just a thought ..

Thanks again !!

Cass

Edited by Cass67

Share this post


Link to post
Share on other sites

Hi Kamil,

Is this from the same source as Eduardo just posted? i.e, does it include the changes he made ? If not maybe worthwhile you two getting together offline and working from the same base, saves duplication, .. Just a thought ..

Thanks again !!

Cass

Is there a way to set up some sort of subversion account for this? Maybe Google code or something where people can download the source the upload new versions as a different file until it can be merged?

Share this post


Link to post
Share on other sites

Hi Cass,

no, thats from my sources, but this is probably a last version from these sources.

Now I'm looking at the camera sources from Eduardo...

Eduardo: it seems that you have merged my code together with bugs :-)

Please change the previewEnabled() method, it always returns "false" and this is the reason why preview window is blank at the begining... :-)

Regards,

Kamil

Edited by redscorpion

Share this post


Link to post
Share on other sites

Hello,

and one more version of the camera... :-)

Changes:

-recording is now working

-hardware stretching (thanks for tip Eduardo!)

Kamil

Hi, I can't get this camera to work with the standard camera util, "retro camera" seems to work (although the preview size is off, but is probably related to an app issue rather than driver) Camera util cannot connect to the camera, log shows

V/CameraHolder( 824):open camera 1

E/CameraService( 96):CameraService::connect x (pid 824) rejected (invalid cameraId 1).

Cheers

Share this post


Link to post
Share on other sites

Hi Cass,

no, thats from my sources, but this is probably a last version from these sources.

Now I'm looking at the camera sources from Eduardo...

Eduardo: it seems that you have merged my code together with bugs :-)

Please change the isPreviewEnabled() method, it always returns "false" and this is causes the problem with the blank preview window.... :-)

Regards,

Kamil

Cool thanks ... Eduardo's last lib is nearly there id say ... receiving a video chat request from gTalk tries to work .. It looks to the V4L camera to open it .. nice ! Warns at line 124 (below) about unsupported video size but it looks like its the preview window problem mentioned before that makes it fail ..

http://pastebin.com/u18k6SLb

Good work :)

Cass

Share this post


Link to post
Share on other sites

Hi Cass,

no, thats from my sources, but this is probably a last version from these sources.

Now I'm looking at the camera sources from Eduardo...

Eduardo: it seems that you have merged my code together with bugs :-)

Please change the previewEnabled() method, it always returns "false" and this is the reason why preview window is blank at the begining... :-)

Regards,

Kamil

Yes... Yesterday i noticed that problem, but i was too tired to figure out the cause (i managed to find out the previewEnabled() issue)... I have fixed several locking problems in the original V4L library .. Most apps try to perform calls to the camera functiosn from the callbacks of the camera function, leading to a deadlock. That is why i had to reorder the lcoking in the threads. Yes, i think the previewEnabled() call is the culprit of not having a working preview sometimes... Will try to fix all those things... And another thing that i have seen is that the camera is rejecting some of the exposed capture formats.. I have also to try to figure out the cause...

Please, while trying to improve compatibility, i implemented a "dual" camera.. means the driver registers 2 cameras... front and back. But they are the same. So, once the camera is open in one mode, the other mode will fail. I think i will remove this feature, as it is causing apps to fail. I ma sure RetroCamre works, but, the camera tends to remain open in an incorrect mode, so then, the other apps begin to fail... Have to figure out a better way to do this

Eduardo

BTW: I just have to thank you for all your work here, Kamil... I think that reaching this goal (camera works!) would not be possible without the work of both you and me... Even if i had managed to find the new interface, you found a much better starting point than i (the V4L camera sources!), and that is why the library is so stable right now... There are no crashes right now, and that is very important. Some FC on apps are not worrying me, as those are problably caused by the apps not being able to parse something , but not for the camera library crashing, as it did in my initial library. THANKS a LOT! -- And, i think , after all, this is helping all of us, me, you and all the VegaCombo ecosystem! :)

Edited by ejtagle

Share this post


Link to post
Share on other sites

Hi,

this is the last version of the camera from me...

Retro camera & demotival camera: both apps should work OK now..

Have a nice day :-)

Kamil

Hi Kamil,

Thanks for the new lib. looking at this with gTalk it still fails ... Not sure at this point if you intended it to work with just those 2 apps or if this is more generic..

http://pastebin.com/me0KpQnN

From the above paste i casn see this error before the app stops the video chat attempt..

E/V4L2Camera( 96): SetZoom: VIDIOC_S_CROP failed: Invalid argument

Dont know if this is too relevent .. Thought id post it up anyway ..

Cheers

Cass

Share this post


Link to post
Share on other sites

Yes... Yesterday i noticed that problem, but i was too tired to figure out the cause (i managed to find out the previewEnabled() issue)... I have fixed several locking problems in the original V4L library .. Most apps try to perform calls to the camera functiosn from the callbacks of the camera function, leading to a deadlock. That is why i had to reorder the lcoking in the threads. Yes, i think the previewEnabled() call is the culprit of not having a working preview sometimes... Will try to fix all those things... And another thing that i have seen is that the camera is rejecting some of the exposed capture formats.. I have also to try to figure out the cause...

Please, while trying to improve compatibility, i implemented a "dual" camera.. means the driver registers 2 cameras... front and back. But they are the same. So, once the camera is open in one mode, the other mode will fail. I think i will remove this feature, as it is causing apps to fail. I ma sure RetroCamre works, but, the camera tends to remain open in an incorrect mode, so then, the other apps begin to fail... Have to figure out a better way to do this

Eduardo

BTW: I just have to thank you for all your work here, Kamil... I think that reaching this goal (camera works!) would not be possible without the work of both you and me... Even if i had managed to find the new interface, you found a much better starting point than i (the V4L camera sources!), and that is why the library is so stable right now... There are no crashes right now, and that is very important. Some FC on apps are not worrying me, as those are problably caused by the apps not being able to parse something , but not for the camera library crashing, as it did in my initial library. THANKS a LOT! -- And, i think , after all, this is helping all of us, me, you and all the VegaCombo ecosystem! :)

I've noticed the tablet doesn't get as hot if I power off the bluetooth, gsm, camera and 3g modules when I don't need them. The battery lasts longer when those devices are powered off. Is it possible to improve the power management somehow, by other means than powering off devices when they're not needed? I think I saw some power management related patches in other versions of the kernel in the nvidia repository. I didn't check them all out, but some were for tegra 3. Would it be possible to undervolt the SoC to lower power consumption when it's not running at high frequencies or when the tablet is sleeping?

Memory usage patterns are a little strange. The Market and a few other applications choke when scrolling large content areas (web pages, scrollable areas in the market). Android reports 120-160MB of RAM is available in settings. I don't even know what to say about this part any more. Should there be more free memory or not?

I've tried the zram patch on the 11.2.13 kernel and it seemed to help with the memory issue. However, it crashed about 20 hours later after enabling swap to a 96MB zram disk. It had swapped about 30MB to the ramdisk around the time it crashed. I couldn't tell if it was because memory was too fragmented or if something else went wrong.

There's an issue I can confirm is real. There are some "dead" or less responsive areas on the screen. The top area (the last 1cm to the top), the left area (1-1.5 cm to the left edge) seem to be affected. I also noticed one gets a wiggly line instead of a straight line when swiping the screen slowly in drawing apps. If you swipe quickly, it draws a straight line as expected. It's like parts of the screen compete for the input when swiping slowly. Pressing on the buttons of some apps is particularly challenging at times.

If you've got any ideas or some advice regarding any of the issues, they're more than welcome.

Eduardo, you've done amazing work and I see you're still taking it further.

Thank you!

Share this post


Link to post
Share on other sites

Hi Kamil,

Thanks for the new lib. looking at this with gTalk it still fails ... Not sure at this point if you intended it to work with just those 2 apps or if this is more generic..

http://pastebin.com/me0KpQnN

From the above paste i casn see this error before the app stops the video chat attempt..

E/V4L2Camera( 96): SetZoom: VIDIOC_S_CROP failed: Invalid argument

Dont know if this is too relevent .. Thought id post it up anyway ..

Cheers

Cass

Hi Cass,

this error message is not related to the problem with Gtalk, it only says that the zoom is not supported by our camera hardware (or driver).

More interesting is this message:

D/CameraHardware(   96): CameraHardware::getParameters

E/libjingle( 1123): Error(jnihelper.cpp:145): static void android::JniHelper::GetStaticIntArray(_jclass*, _jmethodID*, std::vector<int>*): null array returned from java 1449807584

E/libjingle( 1123): Error(videocapturer.cpp:146): void android::VideoCapturer::enumerateSupportedFormats(): No supported 4CCs in list

This error can have several reasons. For example missing/bad camera properties or we are not supporting the correct video frame format which Gtalk needs....

I'll do more tests tomorrow...

Kamil

Share this post


Link to post
Share on other sites

Well... some progress... but still some things to figure out:

> Redish image tinting fixed

> More camera programs seem to work, but there are still issues ... for example, eCamera sometimes works (and allows you to take 1Mpixel photos!), but sometimes it does not.... Seems not to enable de preview overlay... All the other apps i tried seem to work

> Recording videos not working properly, and i haven't figured out the cause yet...

> Still have to implement power control of the camera

Well, attached my latest sources. As always, compatibility issues reports are welcome. And also, if someone figures out a fix for something, or is able to point out an error in the library (and the fix, if possible ;) -- Will be always welcome!

Regards,

Eduardo

uvc3.rar

uvc3-compiled.rar

Share this post


Link to post
Share on other sites

Well... some progress... but still some things to figure out:

> Redish image tinting fixed

> More camera programs seem to work, but there are still issues ... for example, eCamera sometimes works (and allows you to take 1Mpixel photos!), but sometimes it does not.... Seems not to enable de preview overlay... All the other apps i tried seem to work

> Recording videos not working properly, and i haven't figured out the cause yet...

> Still have to implement power control of the camera

Well, attached my latest sources. As always, compatibility issues reports are welcome. And also, if someone figures out a fix for something, or is able to point out an error in the library (and the fix, if possible ;) -- Will be always welcome!

Regards,

Eduardo

Great work, some definite improvements there, other apps that weren't working with either driver like barcode scanner (although it's useless as the cam's too low res to scan a barcode) now work, the preview issue is fixed and apps like retro camera no longer crash.

Google talk still has an issue and the error -

E/libjingle( 3790): Error(videocapturer.cpp:146): void android::VideoCapturer::enumerateSupportedFormats(): No supported 4CCs in list

W/libjingle( 3790): Warning(lmimediaengine.cc:685): Unsupported format: width=320 height=200. Supported formats are:

is still showing up, so something's requesting 320x200 when we need it to be 320x240

Cheers

Quick update, I've found the following text regarding google talk -

"Currently two video modes are supported: 352x288 and 176x144 which are selected automatically depending on inbound video stream. The 352x288 video is being truncated to 320x200 due to limitations of Google Talk Plugin"

This would explain the issue with this failing as we have a minimum resolution of the camera of 320x240. Is there any way we can support a 320x200 resolution?

Edited by CoWPlagued

Share this post


Link to post
Share on other sites

Great work, some definite improvements there, other apps that weren't working with either driver like barcode scanner (although it's useless as the cam's too low res to scan a barcode) now work, the preview issue is fixed and apps like retro camera no longer crash.

Google talk still has an issue and the error -

E/libjingle( 3790): Error(videocapturer.cpp:146): void android::VideoCapturer::enumerateSupportedFormats(): No supported 4CCs in list

W/libjingle( 3790): Warning(lmimediaengine.cc:685): Unsupported format: width=320 height=200. Supported formats are:

is still showing up, so something's requesting 320x200 when we need it to be 320x240

Cheers

Quick update, I've found the following text regarding google talk -

"Currently two video modes are supported: 352x288 and 176x144 which are selected automatically depending on inbound video stream. The 352x288 video is being truncated to 320x200 due to limitations of Google Talk Plugin"

This would explain the issue with this failing as we have a minimum resolution of the camera of 320x240. Is there any way we can support a 320x200 resolution?

Yes... there is a way.. we could truncate the closest mode we have (320x240) to (320x200) ... Video Scaling could also be done, but i am not sure if it is worth to do..

Share this post


Link to post
Share on other sites

Yes... there is a way.. we could truncate the closest mode we have (320x240) to (320x200) ... Video Scaling could also be done, but i am not sure if it is worth to do..

any truncating or even cropping would be great, looks like most video conferencing apps are looking for low resolutions. google talk would be the priority from my perspective as its on everyones tablet.

fring errors out as it wants 240x160

keep up the good work and im happy to keep testing anything you like.

Share this post


Link to post
Share on other sites

Well... Next try: Added 320x200 mode, by cropping the closest one (320x240)... hopefully, will make gtalk work, but didnt test it yet...

Eduardo

With this lib, using the default camera app, whe I take a photo only the upper-left quarter of the image is saved (the previous lib produces the same effect). eCamera works fine, and saves the entire image.

And sadly talk video chat is still not working.

http://pastebin.com/53qEgejB

Edited by partner2

Share this post


Link to post
Share on other sites

With this lib, using the default camera app, whe I take a photo only the upper-left quarter of the image is saved (the previous lib produces the same effect). eCamera works fine, and saves the entire image.

And sadly talk video chat is still not working.

http://pastebin.com/53qEgejB

Hi,

I've made some changes in the camera library to make the Gtalk work, but currently I don't have access to wifi network, so I can't test it...

Please try this camera library and let me know if the Gtalk works...

Kamil

libcamera.so.zip

Share this post


Link to post
Share on other sites

Ok, talk doesn't crash now. I can ear the sound, but no image is captured (only my avatar shown in the other client).

http://pastebin.com/vdwdt0pR

Default camera application now takes the entire image. And eCamera still takes 1M photos laugh.gif

BTW Thank you all for your great work. Wish I have time to learn something just to help

Hi,

I've made some changes in the camera library to make the Gtalk work, but currently I don't have access to wifi network, so I can't test it...

Please try this camera library and let me know if the Gtalk works...

Kamil

Edited by partner2

Share this post


Link to post
Share on other sites

Slightly different logs for making or receiving a call, but yea we get

E/V4L2Camera( 96): SetZoom: VIDIOC_S_CROP failed: Invalid argument

Each time it tries to StartStreaming.

We also have

E/CameraHardware( 96): Could not open /sys/devices/platform/shuttle-pm-camera/power_on for writing.

But I presume this is fine, as we don't want to go switching on and off the camera until the USB bug is fixed.

Cheers

Share this post


Link to post
Share on other sites

Hi,

thanks for the testing...

Gtalk still not work but we are closer... :-)

Eduardo: it seems that GTalk is more happy with the yuv420 preview instead of the yuv422, can you add support for this format into camera? Conversion routines are already here, so this should not be a problem... Thanks :-)

Kamil

Edited by redscorpion

Share this post


Link to post
Share on other sites

Ok, talk doesn't crash now. I can ear the sound, but no image is captured (only my avatar shown in the other client).

http://pastebin.com/vdwdt0pR

Default camera application now takes the entire image. And eCamera still takes 1M photos laugh.gif

BTW Thank you all for your great work. Wish I have time to learn something just to help

Confirmed, the results are the same when using either the 4mb, or 29mb libtalk_jni.so libraries, I'm not 100% sure the 4mb library has the video chat capability built in, although it should (not sure about the huge difference in size between the two types yet).

Call connects, no FC, but this only works when the library is in /system/lib for me. symlinking or placing the library in the app and installing to /data results in a FC.

Black screen, no video either incoming or where the small preview window should be. Audio seems to work but the receiving end seems to get a lot of static. Looking for errors in the logcat soon, but most things seem to load almost correctly. Very close ;)

newbe5

Share this post


Link to post
Share on other sites

Hi,

thanks for the testing...

Gtalk still not work but we are closer... :-)

Eduardo: it seems that GTalk is more happy with the yuv420 preview instead of the yuv422, can you add support for this format into camera? Conversion routines are already here, so this should not be a problem... Thanks :-)

Kamil

Yes.. I don't know why, but i was thinking yuv420 would have to be added to make it work. I will add support for it ... I am just trying to avoid using another intermediate temporary buffer ;)

Eduardo

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.