Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FDogg
New Contributor II
2,157 Views

Anyone managed to get the Caspa 4k camera working in Ubuntu?

There seems to be a long list of dependencies, some of which I can find no information about, particularly libcamhal.

Tags (1)
0 Kudos
11 Replies
FDogg
New Contributor II
638 Views

I've got the kernel and firmware loaded for ipu4. Looks like gstreamer component icamerasrc is required to get the video, but it looks to be almost impossible to build - it depends on components that don't seem to be available anywhere else:

https://github.com/01org/icamerasrc/issues/1 Prerequisites? · Issue # 1 · 01org/icamerasrc · GitHub

idata
Community Manager
638 Views

Hello fnoop,

 

 

Thanks for reaching out!

 

 

It is important to point out what wli58 mentioned in https://github.com/01org/icamerasrc/issues/1, this package (icamerasrc) was not developed for Ubuntu, therefore it may have issues on this OS. So, in order to get a more accurate answer regarding other project support, I believe it's best to follow wli58's advise.

 

 

In https://github.com/01org/icamerasrc, it is mentioned that you have to install the prerequisite packages with rpm. Have you tried following the instructions found in rpm/README? In case you haven't, why don't you give it a go?

 

 

I hope this information helps you,

 

Pedro M.
FDogg
New Contributor II
638 Views

rpm is for Redhat/Fedora, so that's clearly not relevant here.

I've followed the bitbake breadcrumbs as best I can and compiled icamerasrc (the particular version for the joule), but I get errors when trying to run it:

(gst-inspect-1.0:17041): GLib-GObject-CRITICAL **: g_param_spec_enum: assertion 'g_enum_get_value (enum_class, default_value) != NULL' failed 

 

(gst-inspect-1.0:17041): GLib-GObject-CRITICAL **: g_object_class_install_property: assertion 'G_IS_PARAM_SPEC (pspec)' failed

I do get the expected output from gst-inspect-1.0 icamerasrc:

Factory Details:

Rank none (0)

Long-name icamerasrc

Klass Source/Video

Description CameraSource Element

Author Intel

Plugin Details:

Name icamerasrc

Description Template icamerasrc

Filename /srv/maverick/software/gstreamer/lib/gstreamer-1.0/libgsticamerasrc.so

Version 1.0.0

License LGPL

Source module my-plugin-package

Binary package GStreamer

Origin URL http://gstreamer.net/ http://gstreamer.net/

GObject

+----GInitiallyUnowned

+----GstObject

+----GstElement

+----GstBaseSrc

+----GstPushSrc

+----Gstcamerasrc

Implemented Interfaces:

GstCamerasrc3AInterface

Pad Templates:

SRC template: 'src'

Availability: Always

Capabilities:

EMPTY

Element Flags:

no flags set

Element Implementation:

Has change_state() function: 0x7f21cf5dc920

Element has no clocking capabilities.

Element has no URI handling capabilities.

Pads:

SRC: 'src'

Pad Template: 'src'

Element Properties:

name : The name of the object

flags: readable, writable

String. Default: "camerasrc0"

parent : The parent of the object

flags: readable, writable

Object of type "GstObject"

blocksize : Size in bytes to read per buffer (-1 = default)

flags: readable, writable

Unsigned Integer. Range: 0 - 4294967295 Default: 4096

num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)

flags: readable, writable

Integer. Range: -1 - 2147483647 Default: -1

typefind : Run typefind before negotiating

flags: readable, writable

Boolean. Default: false

do-timestamp : Apply current stream time to buffers

flags: readable, writable

etc etc, but there is no 'device-name' as indicated in the suggested test pipeline:

gst-launch-1.0 icamerasrc device-name=0 io-mode=3 ! video/x-raw,format=NV12,width=1920,height=1080 ! vaapisink dmabuf-alloc-tiled=true

So when I try to run it:

[dev] [mav@maverick-joule ~]$ gst-launch-1.0 icamerasrc device-name=0 io-mode=3 ! video/x-raw,format=NV12,width=1920,height=1080 ! vaapisink dmabuf-alloc-tiled=true

(gst-launch-1.0:17538): GLib-GObject-CRITICAL **: g_param_spec_enum: assertion 'g_enum_get_value (enum_class, default_value) != NULL' failed

(gst-launch-1.0:17538): GLib-GObject-CRITICAL **: g_object_class_install_property: assertion 'G_IS_PARAM_SPEC (pspec)' failed

libva info: VA-API version 0.39.2

libva info: va_getDriverName() returns 0

libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so

libva info: Found init function __vaDriverInit_0_39

libva info: va_openDriver() returns 0

libva info: VA-API version 0.39.2

libva info: va_getDriverName() returns 0

libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so

libva info: Found init function __vaDriverInit_0_39

libva info: va_openDriver() returns 0

WARNING: erroneous pipeline: no property "device-name" in element "camerasrc0"

idata
Community Manager
638 Views

I understand, could you please share a step by step explanation of what you tried, we would like to see if we can replicate the behavior. Please also include the environmental details, like the OS version that you are using and any other detail you deem relevant.

 

 

Pedro M.
FDogg
New Contributor II
638 Views

OK it looks like the gstreamer error:

(gst-launch-1.0:17538): GLib-GObject-CRITICAL **: g_param_spec_enum: assertion 'g_enum_get_value (enum_class, default_value) != NULL' failed

is due to the fact that camerahal isn't returning any devices, so the icamerasrc gstreamer element has nothing to enumerate.

The difference between Ubuntu (joule) and RefOS is that Ubuntu sees 4 fewer v4l2 subdevices:

Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_MediaController:@findEntities: 56 media entities found

Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_MediaController:@findEntities: 60 media entities found

RefOS has these subdevices, which Ubuntu doesn't:

/dev/v4l-subdev14

/dev/v4l-subdev10

/dev/v4l-subdev11

/dev/v4l-subdev12

/dev/v4l-subdev13

And so camerahal fails:

Jun 30 19:01:31 maverick-joule camerahal[7009]: CAMHAL_PlatformData:ERROR no sensor driver registered in media controller!

Jun 30 19:01:31 maverick-joule camerahal[7009]: CAMHAL_Profiles:No sensor Info available, exit parsing

Jun 30 19:01:31 maverick-joule camerahal[7009]: CAMHAL_AndroidProfiles:CameraProfiles base init error:-2147483648

Jun 30 19:01:31 maverick-joule camerahal[7009]: CAMHAL_PlatformData:Failed to initialize Camera profiles

Jun 30 19:01:31 maverick-joule camerahal[7009]: ICAMERA_ICameraAdapter:@camera_hal_init: Cannot get stream configuration from static metadata.

I can't find camerhal source anywhere (proprietary? It appears to be a linux port of android camera3hal), but I don't think it's at fault here - I'm guessing the kernel is missing some patches in the v4l2 subsystem.

This is frustrating, as I have everything else now installed and working, I think it's just these missing subdevices. The camera itself is available:

[dev] [mav@maverick-joule /var/tmp]$ v4l2-ctl --all -d /dev/video41

Driver Info (not using libv4l2):

Driver name : intel-ipu4-isys

Card type : ipu4/Broxton B

Bus info : pci:0000:00:03.0

Driver version: 4.4.67

Capabilities : 0x84203001

Video Capture

Video Capture Multiplanar

Video Output Multiplanar

Streaming

Extended Pix Format

Device Capabilities

Device Caps : 0x04200001

Video Capture

Streaming

Extended Pix Format

FDogg
New Contributor II
638 Views

This is using the latest joule ubuntu image/kernel:

Linux maverick-joule 4.4.0-1003-joule # 8-Ubuntu SMP PREEMPT Wed Jun 14 16:53:53 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

idata
Community Manager
638 Views

Thanks a lot for sharing this information with us. Please let us analyze it to see if we can determine what might be happening. If we are able to find anything useful, we'll make sure to share it with you in this thread.

 

 

Pedro M.
idata
Community Manager
638 Views

Hello fnoop,

 

 

Unfortunately, adding support for the MIPI cameras to Ubuntu is not something we can do. We suggest using the Ref-OS as it supports the MIPI cameras and is officially supported by Intel.

 

 

We will continue to help you in your other thread https://communities.intel.com/thread/115997 https://communities.intel.com/thread/115997 where you are indeed using the Ref-IoT-OS.

 

 

Pedro M.
YShil
Beginner
638 Views

Hi there,

Is there any progress with running the camera under Ubuntu after two months since fnoop's original post ?

LKini
Beginner
638 Views

fnoop,

Have you made any progress with the camera lately? I just got one today, and I'm starting to run into the same problems you are (that's how I found both of your posts about it). I've been using Ubuntu on my Joule up until now, and loaded up the Ref OS IoT to try out the camera.

It sounds to me like the only OS option that is compatible with the Caspa cameras is the Ref OS IoT, but it doesn't have a working package manager. So the only way to install additional software or libraries is to manually build and install everything from source. And the Caspa camera allows very limited access to camera controls.

On the other hand, if I want to use Ubuntu or something similar, which has a working package manager and libraries, I can't use the icamerasrc, so I can't use the Caspa cameras at all. Is that right from your experience? The camera seems like a nice little 4k capable camera, but if this is the case, I'm just going to continue using U3V cameras. I've had better experience with them so far.

FDogg
New Contributor II
638 Views

lkinion No unfortunately not, I gave up for two reasons.

1. The ubuntu joule kernel seems to be missing support for the lens, which is I think the missing devices. Camhal then fails to initiate so you can't access the actual video device. I couldn't work out how to download and patch the ubuntu joule kernel, even though the patches exist in the ref-os-iot joule recipes - none of the instructions or references work. Neither Ubuntu, Intel or Gumstix have made any response or effort to repeated requests to assist, which shows you how interested any of them actually are in supporting their products. The frustrating thing is this should be relatively trivial to get working, except Ubuntu and Intel have pretty much gone out of their way to make it impossible. You can see my efforts so far here:

https://github.com/fnoop/maverick/blob/stable/manifests/maverick-modules/maverick_hardware/manifests... maverick/caspa.pp at stable · fnoop/maverick · GitHub. I believe everything is installed and working except for the kernel support for the lens.

2. The camera itself has no support for manually controlling the lens autofocus, and the autofocus is, at least under the conditions I was testing it, totally useless. I was testing it on a drone hoping to use it for computer vision (one of the main target applications of this hardware), and the image was unuseable - blurry for all but the briefest glimpses.

The less said about ref-os-iot the better. The Joule (and cameras) was an interesting experiment and lesson for all those involved. For sure I've learnt never to buy Intel again.