ustreamer icon indicating copy to clipboard operation
ustreamer copied to clipboard

Unable to start 2nd ustreamer instance

Open TwoWheelDev opened this issue 3 years ago • 1 comments

Hi,

I have been trying to start a 2nd ustreamer instance for a 2nd camera, but it is failing with an error or Cannot allocate memory

If I stop the 1st instance, I can start the 2nd and it will stream fine but can only ever start one instance.

Debug log from 2nd instance:

sudo /usr/bin/ustreamer --device /dev/video1 --device-timeout=8 --desired-fps=15 -m jpeg --port=8081 -r 640x480 --log-level=3
-- DEBUG [4045050.367      main] -- Increasing frame buffer 'blank_internal': 0 -> 524288 (+524288)
-- INFO  [4045050.367      main] -- Using internal blank placeholder
-- DEBUG [4045050.367      main] -- Installing SIGINT handler ...
-- DEBUG [4045050.367      main] -- Installing SIGTERM handler ...
-- DEBUG [4045050.367      main] -- Ignoring SIGPIPE ...
-- DEBUG [4045050.367      main] -- Binding HTTP to [127.0.0.1]:8081 ...
-- INFO  [4045050.367      main] -- Listening HTTP on [127.0.0.1]:8081
-- INFO  [4045050.367    stream] -- Using V4L2 device: /dev/video1
-- INFO  [4045050.367    stream] -- Using desired FPS: 15
-- DEBUG [4045050.367    stream] -- _stream_init_loop: stream->run->stop=0
================================================================================
-- INFO  [4045050.368      http] -- Starting HTTP eventloop ...
-- DEBUG [4045050.402      http] -- HTTP: Updating exposed frame (online=0) ...
-- VERB  [4045050.402      http] -- HTTP: Exposed frame: online=0, exp_time=0.000000
-- INFO  [4045050.432    stream] -- Device fd=8 opened
-- DEBUG [4045050.432    stream] -- Calling ioctl(VIDIOC_QUERYCAP) ...
-- INFO  [4045050.432    stream] -- Using input channel: 0
-- DEBUG [4045050.432    stream] -- Using TV standard: DEFAULT
-- DEBUG [4045050.432    stream] -- Calling ioctl(VIDIOC_S_FMT) ...
-- INFO  [4045050.444    stream] -- Using resolution: 640x480
-- INFO  [4045050.444    stream] -- Using pixelformat: JPEG
-- DEBUG [4045050.444    stream] -- Calling ioctl(VIDIOC_G_PARM) ...
-- INFO  [4045050.457    stream] -- Using HW FPS: 15 -> 30 (coerced)
-- ERROR [4045050.457    stream] -- Device does not support setting of HW encoding quality parameters
-- INFO  [4045050.457    stream] -- Using IO method: MMAP
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_REQBUFS) for V4L2_MEMORY_MMAP ...
-- INFO  [4045050.457    stream] -- Requested 3 device buffers, got 3
-- DEBUG [4045050.457    stream] -- Allocating device buffers ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 0 ...
-- DEBUG [4045050.457    stream] -- Mapping device buffer 0 ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 1 ...
-- DEBUG [4045050.457    stream] -- Mapping device buffer 1 ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QUERYBUF) for device buffer 2 ...
-- DEBUG [4045050.457    stream] -- Mapping device buffer 2 ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QBUF) for buffer 0 ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QBUF) for buffer 1 ...
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_QBUF) for buffer 2 ...
-- DEBUG [4045050.457    stream] -- Device fd=8 initialized
-- DEBUG [4045050.457    stream] -- Calling ioctl(VIDIOC_STREAMON) ...
-- ERROR [4045050.459    stream] -- Unable to start capturing: Cannot allocate memory
-- DEBUG [4045050.460    stream] -- Releasing device buffers ...
-- DEBUG [4045050.460    stream] -- Closing device ...
-- INFO  [4045050.460    stream] -- Device fd=8 closed
-- INFO  [4045050.460    stream] -- Sleeping 1 seconds before new stream init ...
-- DEBUG [4045051.432      http] -- HTTP: Repeating exposed ...

Any ideas? I did notice that both instances seem to get device fd=8, not sure if that is relevant at all?

TwoWheelDev avatar Sep 07 '22 15:09 TwoWheelDev

Hello. Fd isn't matter. This is a driver issue or limited bandwith of usb hub.

mdevaev avatar Sep 07 '22 16:09 mdevaev