ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov5640.json' not found for IPA module 'raspberrypi'? - raspberry-pi

I'm trying to interface ov5640 with raspberry Pi 4 model B, kernel version 5.15.61, till now I had loaded driver successfully and Bound driver with ov5640 successfully, and video nodes were created successfully.
I tried to stream video using gstreamer
command:
gst-launch-1.0 libcamerasrc ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! autovideosink
and it thrown error
error:
Setting pipeline to PAUSED ...
[0:02:06.704696651] [1320] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3866-0c55e522
[0:02:06.726785010] [1324] WARN CameraSensor camera_sensor.cpp:212 'ov5640 10-003c': Recommended V4L2 control 0x009a0922 not supported
[0:02:06.726879464] [1324] WARN CameraSensor camera_sensor.cpp:264 'ov5640 10-003c': The sensor kernel driver needs to be fixed
[0:02:06.726907245] [1324] WARN CameraSensor camera_sensor.cpp:266 'ov5640 10-003c': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[0:02:06.728038265] [1324] WARN CameraSensor camera_sensor.cpp:411 'ov5640 10-003c': Failed to retrieve the camera location
[0:02:06.746434072] [1324] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'ov5640.json' not found for IPA module 'raspberrypi'
[0:02:06.746582013] [1324] ERROR IPARPI raspberrypi.cpp:213 Could not create camera helper for ov5640
[0:02:06.746635055] [1324] ERROR RPI raspberrypi.cpp:1253 Failed to load a suitable IPA library
[0:02:06.746922788] [1324] ERROR RPI raspberrypi.cpp:1184 Failed to register camera ov5640 10-003c: -22
ERROR: from element /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0: Could not find any supported camera on this system.
Additional debug info:
../src/gstreamer/gstlibcamerasrc.cpp(354): gst_libcamera_src_open (): /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0:
libcamera::CameraMananger::cameras() is empty
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
can anyone give me a direction how to solve this?

Related

Gstreamer rtsp pipeline for videostream error

I have an issue when trying to connect to an rtsp videostream using gstreamer. The videostream originates from a IP camera.
Using the same rtsp address in vlc and opencv (without gstreamer) works as it should.
This pipeline is used when testing:
GST_DEBUG=1 gst-launch-1.0 -v rtspsrc location=rtsp://admin:password$#192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink
This error occurs when running the pipeline:
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:password192.168.2.1:554/ch1/main/av_stream
0:00:03.105886290 6248 0x559fd7cf1520 ERROR default gstrtspconnection.c:1046:gst_rtsp_connection_connect_with_response: failed to connect: Error resolving “admin”: Name or service not known
0:00:03.105953476 6248 0x559fd7cf1520 ERROR rtspsrc gstrtspsrc.c:5047:gst_rtsp_conninfo_connect:<rtspsrc0> Could not connect to server. (Generic error)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
If I use a password that is not correct, I also get the same error message. This makes me believe that gstreamer does not manage to log in to the ip camera videostream.
For trail and error purpose, I tried this pipeline without and usr or password:
GST_DEBUG=1 gst-launch-1.0 -v rtspsrc location=rtsp://192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.2.1:554/ch1/main/av_stream
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unauthorized
Additional debug info:
gstrtspsrc.c(6540): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Unauthorized (401)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
rtspsrc has properties for authentication.
Try using
gst-launch-1.0 -v rtspsrc user-id=admin user-pw=password location=rtsp://192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink

Setting up an USB webcam RTSP stream with GStreamer

I'm using GStreamer to send the camera feed of /dev/video1 (Raspberry Pi's usb webcam) through a RTSP server that I can connect with another Raspberry Pi.
Result of v4l2-ctl -d /dev/video1 --list-formats:
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'MJPG' (Motion-JPEG, compressed)
[1]: 'YUYV' (YUYV 4:2:2)
The pipeline I'm using is
./gst-rtsp-launch --port 8555 '( v4l2src device='/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! rtpjpegpay name=pay0 pt=96 )' --gst-debug-level=3`
When running it, and letting the other machine connect, the console gives this message:
0:00:02.097412343 3234 0xb4c1c0c0 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:<appsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:02.102907578 3234 0xb5a07600 WARN v4l2src gstv4l2src.c:692:gst_v4l2src_query:<v4l2src0> Can't give latency since framerate isn't fixated !
0:00:02.170888076 3234 0xb4c1b980 WARN v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:02.410829991 3234 0x166ba90 FIXME rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:02.414457433 3234 0x166ba90 FIXME rtspmedia rtsp-media.c:3581:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:02.414551635 3234 0x166ba90 WARN rtspmedia rtsp-media.c:3607:gst_rtsp_media_suspend: media 0xb5a34130 was not prepared
0:00:03.878249884 3234 0x166ba90 WARN rtspmedia rtsp-media.c:3868:gst_rtsp_media_set_state: media 0xb5a34130 was not prepared
On the client Raspberry Pi, using VLC on the static IP vlc rtsp://192.168.0.10:8555/video, gives this error (and triggers the previous one in the other board):
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.hvs' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.hvs' (1)
mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x909bcaa0 (EINVAL)
Falha de segmentação
The last line means "Segmentation fault". The screen in the client board flickers black before giving this error, and the board connect to the webcam only shows this error after the client connected.
Connecting to localhost on the same board using vlc rtsp://127.0.0.1:8555/video works for a little bit, then it breaks.
How can I fix this pipeline, so the video can be shown correctly through connection between the two boards?
For the record:
I asked in the comments which version of gstreamer you were using, to which the answer was "1.14.4".
I suggested you update to the latest version (1.20.1), because a segmentation fault where you see it sounds like a potential bug in gstreamer.
Turns out that it was correct: updating gstreamer (to 1.18.4) resolved the problem!

How do you enable the Raspberry Pi camera in Yocto

I'm trying to get my Raspberry Pi camera to work with my Yocto image.
I found here that I need to add the following line:
VIDEO_CAMERA = "1"
I added it to my meta's recipes-core/images/example-image.bb but still when I try to take a picture I get:
root#user:~# raspistill -o testshot.jpg
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled
So it seems like it's not enabled. And raspi-config seems to be only available on Raspbian, in fact it's not recognised as a command.
Am I missing anything else? I can't find much info out there and I'm still new to Yocto.

Why Unity's ML-Agents are not working with Google Colab

I am trying to train ML-Agents on Google colab but every time it fails with the same given error.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/compat/v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
▄▄▄▓▓▓▓
╓▓▓▓▓▓▓█▓▓▓▓▓
,▄▄▄m▀▀▀' ,▓▓▓▀▓▓▄ ▓▓▓ ▓▓▌
▄▓▓▓▀' ▄▓▓▀ ▓▓▓ ▄▄ ▄▄ ,▄▄ ▄▄▄▄ ,▄▄ ▄▓▓▌▄ ▄▄▄ ,▄▄
▄▓▓▓▀ ▄▓▓▀ ▐▓▓▌ ▓▓▌ ▐▓▓ ▐▓▓▓▀▀▀▓▓▌ ▓▓▓ ▀▓▓▌▀ ^▓▓▌ ╒▓▓▌
▄▓▓▓▓▓▄▄▄▄▄▄▄▄▓▓▓ ▓▀ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▄ ▓▓▌
▀▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▄ ▓▓ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▐▓▓
^█▓▓▓ ▀▓▓▄ ▐▓▓▌ ▓▓▓▓▄▓▓▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▓▄ ▓▓▓▓`
'▀▓▓▓▄ ^▓▓▓ ▓▓▓ └▀▀▀▀ ▀▀ ^▀▀ `▀▀ `▀▀ '▀▀ ▐▓▓▌
▀▀▀▀▓▄▄▄ ▓▓▓▓▓▓, ▓▓▓▓▀
`▀█▓▓▓▓▓▓▓▓▓▌
¬`▀▀▀█▓
Version information:
ml-agents: 0.15.1,
ml-agents-envs: 0.15.1,
Communicator API: 0.15.0,
TensorFlow: 2.0.2
Found path: /content/build/test/ball.x86_64
Mono path[0] = '/content/build/test/ball_Data/Managed'
Mono config path = '/content/build/test/ball_Data/MonoBleedingEdge/etc'
Preloaded 'lib_burst_generated.so'
Preloaded 'libgrpc_csharp_ext.x64.so'
Initialize engine version: 2018.4.21f1 (fd3915227633)
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
Version: NULL 1.0 [1.0]
Renderer: Null Device
Vendor: Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in 0.147 seconds
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'FORWARD' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'FORWARD_DELTA' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - Pass 'ShadowCaster' has no vertex shader
WARNING: Shader Unsupported: 'Autodesk Interactive' - All passes removed
UnloadTime: 1.492000 ms
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libcoreclr.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib.so
Fallback handler could not load library /content/build/test/ball_Data/Mono/libSystem.dylib
2020-05-29 13:53:12 INFO [environment.py:160] Connected to Unity environment with package version 0.15.1-preview and communication version 0.15.0
2020-05-29 13:53:12 INFO [environment.py:305] Connected new brain:
3DBall?team=0
2020-05-29 13:53:12 INFO [trainer_controller.py:167] Hyperparameters for the PPOTrainer of brain 3DBall:
trainer: ppo
... (Hyperparameter list)
summary_path: test-1_3DBall
model_path: ./models/test-1/3DBall
keep_checkpoints: 5
2020-05-29 13:53:12.718558: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-05-29 13:53:12.732085: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2200000000 Hz
2020-05-29 13:53:12.732627: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1818f40 executing computations on platform Host. Devices:
2020-05-29 13:53:12.732677: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version
Receiving unhandled NULL exception
2020-05-29 13:54:17 INFO [subprocess_env_manager.py:150] UnityEnvironment worker 0: environment stopping.
2020-05-29 13:54:17 INFO [trainer_controller.py:104] Learning was interrupted. Please wait while the graph is generated.
2020-05-29 13:54:17 INFO [environment.py:455] Environment shut down with return code -11 (SIGSEGV).
2020-05-29 13:54:18 INFO [trainer_controller.py:100] Saved Model
2020-05-29 13:54:18 INFO [model_serialization.py:222] List of nodes to export for brain :3DBall?team=0
2020-05-29 13:54:18 INFO [model_serialization.py:224] is_continuous_control
2020-05-29 13:54:18 INFO [model_serialization.py:224] version_number
2020-05-29 13:54:18 INFO [model_serialization.py:224] memory_size
2020-05-29 13:54:18 INFO [model_serialization.py:224] action_output_shape
2020-05-29 13:54:18 INFO [model_serialization.py:224] action
2020-05-29 13:54:18 INFO [model_serialization.py:224] action_probs
Converting ./models/test-1/3DBall/frozen_graph_def.pb to ./models/test-1/3DBall.nn
IGNORED: Cast unknown layer
IGNORED: Shape unknown layer
IGNORED: StopGradient unknown layer
GLOBALS: 'is_continuous_control', 'version_number', 'memory_size', 'action_output_shape'
IN: 'vector_observation': [-1, 1, 1, 8] => 'sub_2'
OUT: 'action', 'action_probs'
DONE: wrote ./models/test-1/3DBall.nn file.
2020-05-29 13:54:18 INFO [model_serialization.py:76] Exported ./models/test-1/3DBall.nn file
ML-Agents version = 0.15.1 check the repo
Unity Version = 2018.4.21f1 (Used to create a Linux build)
Steps used:
Create a build file for Linux from Unity Editor.
Zipped the build file and uploaded it to google colab.
Unzipped in google colab and enabled the execution permissions.
Cloned and installed the ml-agents repo. same as above repo
Using this command to start the training process
ENV_BINARY = '/content/build/test/ball.x86_64'
mlagents-learn /content/config.yaml --run-id=test-1 --env=$ENV_BINARY --train --no-graphics
Another method which I followed:
Install unity in google colab to create a build file in colab itself but the build didn't work in unity.
To implement this I used notebook
It seems that there are no resources on the internet related to this topic.
So please help me to get this working, I have already wasted my two days in search and trying to run ML-Agents in google colab.
Updates:
The colab notebook started working after I updated my environment build using the Unity engine's 2019.3.15f1 version.
I followed these links and it worked for me, so anyone who is looking for complete implementation can take a look at these:
GitHub repo: ML Agents with Google Colab
Medium article: Training ML-Agents with Google Colab

alsa cannot read control invalid argument - raspberry pi

I am trying to record audio with the PS Eye on a raspberry pi model b plus (I have tried with older b models and the same issue occurs as below).
I am able to record, and playback the recording with arecord/aplay so the mic is working. However, I want to increase the mic volume as the recording is very low.
When I attempt this in alsamixer, it exits with the following error when I use F6 to change to the PS Eye soundcard:
cannot load mixer controls: Invalid argument
I also notice that the alsa-utils service will fail when the PS Eye is plugged in (fine otherwise):
sudo service alsa-utils restart
[FAIL] Shutting down ALSA...warning: 'alsactl store' failed with error message 'alsactl: get_control:259: Cannot read control '2,0,0,Mic Capture Volume,0': Invalid argument'...failed.
[....] Setting up ALSA...warning: 'alsactl restore' failed with error message 'No state is present for card CameraB409241
Found hardware: "USB-Audio" "USB Mixer" "USB1415:2000" "" ""
Hardware is initialized using a generic method
No state is present for card CameraB409241'...amixer: Mixer hw:1 load error: Invalid argument
amixer: Mixer hw:1 load error: Invalid argument
amixer: Mixer hw:1 load error: Invalid argument
amixer: Mixer hw:1 load error: Invalid argument
amixer: Mixer hw:1 load error: Invalid argument
...
done.
The problem seems to be the controls definition of the PS Eye. I would like to know the following:
Where does alsamixer load the controls for a particular device from? Are they in the driver?
Is there a way to increase the mic volume another way?
I am not using Pulseaudio yet but will try it if I can't fix this in alsa.
thanks
Sytem logs:
Without pulseaudio installed, neither restarting alsa or trying to open the controls in alsamixer produce anything in the system log. If pulse audio is installed however, trying to open the controls in alsamixer gives:
Oct 30 10:21:26 signaler pulseaudio[19000]: [pulseaudio] alsa-util.c: Unable to load mixer: Invalid argument
Oct 30 10:21:27 signaler pulseaudio[19000]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Oct 30 10:21:27 signaler pulseaudio[19000]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11