Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to allocate memory #1185

Open
maximelebastard opened this issue Jun 3, 2024 · 3 comments
Open

Failed to allocate memory #1185

maximelebastard opened this issue Jun 3, 2024 · 3 comments

Comments

@maximelebastard
Copy link

maximelebastard commented Jun 3, 2024

I'm trying to stream from a Raspberry PI Model 2 (I know, the tutorial recommands a Model 3, but both have 1GB of RAM), but I'm facing an issue when allocating memory.

Logging

./kvs_gstreamer_sample test-stream
DEBUG] [03-06-2024 20:29:51:537.425 GMT] Refreshing credentials. Force refreshing: 1 Now time is: 1717446591537386739 Expiration: 1717450190
[INFO ] [03-06-2024 20:29:51:537.687 GMT] New credentials expiration is 1717450191
[INFO ] [03-06-2024 20:29:51:538.037 GMT] getStreamingTokenResultEvent(): Get streaming token result event.
[DEBUG] [03-06-2024 20:29:51:538.330 GMT] streamReadyHandler invoked
[DEBUG] [03-06-2024 20:29:51:539.233 GMT] Stream is ready
[INFO ] [03-06-2024 20:29:58:224.594 GMT] Streaming from live source
[DEBUG] [03-06-2024 20:29:58:225.491 GMT] Streaming with live source and width: 0, height: 0, fps: 25, bitrateInKBPS512
[DEBUG] [03-06-2024 20:29:58:252.608 GMT] Using x264enc
[DEBUG] [03-06-2024 20:29:58:332.131 GMT] Using v4l2src
[DEBUG] [03-06-2024 20:29:58:335.079 GMT] src supports raw
[DEBUG] [03-06-2024 20:18:55:082.211 GMT] Constructing pipeline with encoding element
Error received from element source: Failed to allocate required memory.
Debugging information: ../sys/v4l2/gstv4l2src.c(976): gst_v4l2src_decide_allocation (): /GstPipeline:live-kinesis-pipeline/GstV4l2Src:source:
Buffer pool activation failed
[INFO ] [03-06-2024 20:18:55:187.522 GMT] stopKinesisVideoStreamSync(): Synchronously stopping Kinesis Video Stream 0000000000de4a18.
[DEBUG] [03-06-2024 20:18:55:188.051 GMT] streamClosedHandler invoked for upload handle: 18446744073709551615
[INFO ] [03-06-2024 20:18:55:188.578 GMT] Freeing Kinesis Video Stream for test-stream
[INFO ] [03-06-2024 20:18:55:188.910 GMT] freeKinesisVideoStream(): Freeing Kinesis Video stream.
[DEBUG] [03-06-2024 20:18:55:189.213 GMT] freeStream(): [test-stream] Freeing stream
[DEBUG] [03-06-2024 20:18:55:189.497 GMT] curlApiCallbacksShutdownActiveRequests(): pActiveRequests hashtable is empty
[DEBUG] [03-06-2024 20:18:55:590.300 GMT] freeStream(): [test-stream] Completed freeing stream
[INFO ] [03-06-2024 20:18:55:590.758 GMT] Freeing Kinesis Video Stream for test-stream
[INFO ] [03-06-2024 20:18:55:591.028 GMT] freeKinesisVideoClient(): Freeing Kinesis Video Client
[DEBUG] [03-06-2024 20:18:55:591.178 GMT] curlApiCallbacksShutdownActiveRequests(): pActiveRequests hashtable is empty
[DEBUG] [03-06-2024 20:18:55:995.027 GMT] freeKinesisVideoClientInternal(): Total allocated memory 0
[INFO ] [03-06-2024 20:18:55:995.559 GMT] Completed freeing client
[WARN ] [03-06-2024 20:18:55:996.237 GMT] curlApiCallbacksShutdown(): curlApiCallbacksShutdown called when already in progress of shutting down
$ free
               total        used        free      shared  buff/cache   available
Mem:          943044      103580      766380        1012      122892      839464
Swap:         102396           0      102396

Any design considerations/constraints

I'm following this tutorial

What's confusing me is this line saying the source is 0w x 0h

Streaming with live source and width: 0, height: 0, fps: 25, bitrateInKBPS512
@maximelebastard
Copy link
Author

I found a radical fix: I installed Raspbian Buster and now the script/instructions work perfectly.
It seems a refresh of the instructions for the latest versions of Raspberry OS would be useful

@niyatim23
Copy link
Contributor

Hi @maximelebastard, thanks for your update. Would you like to share the updates here / open a PR to add these steps?

@niyatim23 niyatim23 added the awaiting-response Waiting for reply from requester. label Jun 4, 2024
@maximelebastard
Copy link
Author

Hi @niyatim23

Unfortunately I'm not able to contribute here as I don't have any skills about C++ and video streaming.

I'm pointing out that most documentation about using KVS with Raspberry OS are not relevant with Bookworm, but that's all the help I can bring on the topic sorry !

@disa6302 disa6302 added documentation and removed awaiting-response Waiting for reply from requester. labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants