intel / icamerasrc

icamerasrc
24 stars 35 forks source link

Prerequisites? #1

Open fnoop opened 7 years ago

fnoop commented 7 years ago

Where on earth do you find the prerequisites, particularly libcamhal?

Trying to build for joule ubuntu.

wli58 commented 7 years ago

This release is particular for Intel IoTG TSD and DSS projects. Please contact with Hu, Gang A gang.a.hu@intel.com for other project support.

Thanks.

fnoop commented 7 years ago

Hi, it looks like icamerasrc is required to use the Joule CSI cameras. I'm looking for the software required to use these cameras.

friissoren commented 7 years ago

Hi Libcamhal is not used on the Linux camera SW stack for Joule. Instead, it uses a different Linux camera HAL implementation and an icamera_adaptor component to interface to icamerasrc. Please refer to the following documentation: https://software.intel.com/en-us/node/721500 and https://software.intel.com/en-us/node/721499

ghu3 commented 7 years ago

Hi, Friissoren Please get the recipe for Joule from here: https://github.com/01org/meta-intel-camera https://github.com/01org/meta-intel-camera/tree/master/recipes-camerasource/camerasource

This repo is the upstream version of iCameraSrc.

fnoop commented 7 years ago

OK looks like it should be possible somehow. This repo: https://github.com/Intel-5xx-Camera/intel-camera-adaptation contains a lot of the proprietary/unreleased binary blobs, although the 'dev' packages don't contain any headers so I don't see how we can build icamerasrc.
I don't understand why you would release cameras and only half support them, especially limiting support to an OS nobody wants to use.

ghu3 commented 7 years ago

The Joule is a different project which use a specific version icamerasrc for release. And I think you should be able to build it according to the recipe. Please ask for the header files in Joule forum if they missed to release them.

The master branch of this icamerasrc repo contains lots of new code for other Linux projects. Follow the README to build it

fnoop commented 7 years ago

So I've built the specific version of icamerasrc for the joule (8a4a9e575b382ff70f1950a4b52c9d835d982101) against gstreamer 1.12.1, but it won't run any of the example pipelines as it seems to be missing 'device-name', and if I remove that from the pipeline the icamerasrc module doesn't seem to connect to anything (sink, videoconvert etc).

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

Should also note there are errors when calling gst-inspect icamerasrc that only occur when this plugin is loaded:

(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
fnoop commented 7 years ago

I'm guessing the assertion comes from poor handling of lack of cameras found through the HAL?

g_object_class_install_property (gobject_class,PROP_DEVICE_ID,
      g_param_spec_enum("device-name","device-name","The input devices name queried from HAL",
   gst_camerasrc_device_id_get_type(), DEFAULT_PROP_DEVICE_ID, (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
fnoop commented 7 years ago

This seems to be the problem:

Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_PlatformData:Camera HAL static init
Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_CameraDetect:Found media device candidate: media0
Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_MediaController:xioctl: Request 0xc1007c01 failed: Invalid argument
Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_MediaController:@findEntities: 56 media entities found
Jun 30 19:02:40 maverick-joule camerahal[7073]: CAMHAL_CameraDetect:Found device that matches: intel-ipu4-isys
Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_CameraDetect:deviceOffset(): "Intel IPU4 ISA capture": video41, media0, 11 nodes
Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_PlatformData:ERROR no sensor driver registered in media controller!
Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_Profiles:No sensor Info available, exit parsing
Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_AndroidProfiles:CameraProfiles base init error:-2147483648
Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_PlatformData:Failed to initialize Camera profiles
Jun 30 19:02:41 maverick-joule camerahal[7073]: ICAMERA_ICameraAdapter:@camera_hal_init: Cannot get stream configuration from static metadata.
fnoop commented 7 years ago

This is a 'good' invocation from working ref-os. I realise this is out of the realm of icamerasrc, but not sure where else I might get some help

Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_PlatformData:Camera HAL static init
Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_CameraDetect:Found media device candidate: media0
Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_MediaController:xioctl: Request 0xc1007c01 failed: Invalid argument
Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_MediaController:@findEntities: 60 media entities found
Jun 30 13:54:25 intel-5xx-64 camerahal[1050]: CAMHAL_CameraDetect:Found device that matches: intel-ipu4-isys
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_CameraDetect:deviceOffset(): "Intel IPU4 ISA capture": video41, media0, 11 nodes
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_MediaController:xioctl: Request 0xc1007c01 failed: Invalid argument
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_MediaController:@findEntities: 60 media entities found
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_Profiles:Num of output formats = 2
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_IPU4ConfParser:Using settings file /etc/graph_settings_imx214.xml for camera 0
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_PlatformData:ERROR in opening file /sys/spid/vendor_id
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_PlatformData:vendor_id could not be read from sysfs
Jun 30 13:54:26 intel-5xx-64 camerahal[1050]: CAMHAL_PlatformData:Camera HAL static init - Done!
ghu3 commented 7 years ago

Hi, Fnoop I think the reason should be that you need to connect the sensor to the platform. Jun 30 19:02:41 maverick-joule camerahal[7073]: CAMHAL_PlatformData:ERROR no sensor driver registered in media controller! Can you capture it with v4l2 yavta ?

fnoop commented 7 years ago

Do you mean plug it in? Yes, it's plugged in :) It works fine if I reboot to ref-os-iot.

Could you please give me a hint as to yavta arguments I should use? There are dozens of v4l devices, not sure which one I should be using.

fnoop commented 7 years ago
[dev] [mav@maverick-joule ~/var/build/yavta]$ ./yavta -c /dev/video41
Device /dev/video41 opened.
Device `ipu4/Broxton B' on `pci:0000:00:03.0' (driver 'intel-ipu4-isys') is a video capture (without mplanes) device.
Video format: bV0I (49305662) 0x0 (stride 0) field none buffer size 1024
8 buffers requested.
length: 1024 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0x7f1386b4e000.
length: 1024 offset: 4096 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0x7f1386b4d000.
length: 1024 offset: 8192 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0x7f1386b4c000.
length: 1024 offset: 12288 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0x7f1386b4b000.
length: 1024 offset: 16384 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0x7f1386b4a000.
length: 1024 offset: 20480 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0x7f1386b49000.
length: 1024 offset: 24576 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0x7f1386b48000.
length: 1024 offset: 28672 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0x7f1386b47000.
Unable to start streaming: Broken pipe (32).
8 buffers released.