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

Repeated CAP: Device select() timeout #284

Open
jamincollins opened this issue Aug 6, 2024 · 13 comments
Open

Repeated CAP: Device select() timeout #284

jamincollins opened this issue Aug 6, 2024 · 13 comments

Comments

@jamincollins
Copy link

I have an Arducam 5MP Camera and can't seem to get it streaming reliably under ustreamer.

Device details:

$ v4l2-ctl --list-devices
Arducam 5MP Camera Module: Ardu (usb-0000:c2:00.3-1.2):
	/dev/video0
	/dev/video1
	/dev/media0
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1600x1200
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 2048x1536
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.050s (20.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 1280x960
			Interval: Discrete 0.133s (7.500 fps)
		Size: Discrete 1600x1200
			Interval: Discrete 0.133s (7.500 fps)
		Size: Discrete 2048x1536
			Interval: Discrete 0.500s (2.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 0.500s (2.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.200s (5.000 fps)

I can get a consistent stream from it via vlc with the following command:

$ vlc v4l2:///dev/video0:chroma=MJPEG

When trying stream through ustreamer:

$ ./ustreamer
-- INFO  [543179.118          ] -- Starting PiKVM uStreamer 6.12 ...
-- INFO  [543179.118          ] -- HTTP: Listening HTTP on [127.0.0.1]:8080
-- INFO  [543179.118          ] -- Using V4L2 device: /dev/video0
-- INFO  [543179.118          ] -- HTTP: Starting eventloop ...
-- INFO  [543179.118          ] -- CAP: Using capture type: single-planar
-- INFO  [543179.118          ] -- CAP: Using input channel: 0
-- INFO  [543179.147          ] -- CAP: Using resolution: 640x480
-- INFO  [543179.147          ] -- CAP: Using format: YUYV
-- INFO  [543179.178          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [543179.178          ] -- CAP: Using IO method: MMAP
-- INFO  [543179.179          ] -- CAP: Requested 5 device buffers, got 5
-- INFO  [543179.201          ] -- CAP: Capturing started
-- INFO  [543179.201          ] -- Using JPEG quality: 80%
-- INFO  [543179.201          ] -- Creating pool JPEG with 4 workers ...
-- INFO  [543179.201          ] -- Capturing ...
-- ERROR [543182.238          ] -- CAP: Device select() timeout
-- INFO  [543182.334          ] -- Destroying workers pool JPEG ...
-- INFO  [543182.336          ] -- CAP: Capturing stopped
================================================================================
-- INFO  [543182.336          ] -- Using V4L2 device: /dev/video0
-- INFO  [543182.336          ] -- CAP: Using capture type: single-planar
-- INFO  [543182.336          ] -- CAP: Using input channel: 0
-- INFO  [543184.567          ] -- CAP: Using resolution: 640x480
-- INFO  [543184.567          ] -- CAP: Using format: YUYV
-- INFO  [543184.597          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [543184.597          ] -- CAP: Using IO method: MMAP
-- INFO  [543184.597          ] -- CAP: Requested 5 device buffers, got 5
-- INFO  [543184.608          ] -- CAP: Capturing started
-- INFO  [543184.608          ] -- Using JPEG quality: 80%
-- INFO  [543184.608          ] -- Creating pool JPEG with 4 workers ...
-- INFO  [543184.609          ] -- Capturing ...
-- ERROR [543187.158          ] -- CAP: Device select() timeout
-- INFO  [543187.258          ] -- Destroying workers pool JPEG ...
-- INFO  [543187.264          ] -- CAP: Capturing stopped
================================================================================
-- INFO  [543187.265          ] -- Using V4L2 device: /dev/video0
-- INFO  [543187.265          ] -- CAP: Using capture type: single-planar
-- INFO  [543187.265          ] -- CAP: Using input channel: 0
-- INFO  [543189.492          ] -- CAP: Using resolution: 640x480
-- INFO  [543189.492          ] -- CAP: Using format: YUYV
-- INFO  [543189.524          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [543189.524          ] -- CAP: Using IO method: MMAP
-- INFO  [543189.525          ] -- CAP: Requested 5 device buffers, got 5
-- INFO  [543189.536          ] -- CAP: Capturing started
-- INFO  [543189.536          ] -- Using JPEG quality: 80%
-- INFO  [543189.536          ] -- Creating pool JPEG with 4 workers ...
-- INFO  [543189.537          ] -- Capturing ...
-- ERROR [543193.609          ] -- CAP: Device select() timeout
-- INFO  [543193.658          ] -- Destroying workers pool JPEG ...
-- INFO  [543193.664          ] -- CAP: Capturing stopped
================================================================================
$ ./ustreamer --format MJPEG
-- INFO  [543107.002          ] -- Starting PiKVM uStreamer 6.12 ...
-- INFO  [543107.002          ] -- HTTP: Listening HTTP on [127.0.0.1]:8080
-- INFO  [543107.002          ] -- Using V4L2 device: /dev/video0
-- INFO  [543107.002          ] -- HTTP: Starting eventloop ...
-- INFO  [543107.002          ] -- CAP: Using capture type: single-planar
-- INFO  [543107.002          ] -- CAP: Using input channel: 0
-- INFO  [543107.031          ] -- CAP: Using resolution: 640x480
-- INFO  [543107.032          ] -- CAP: Using format: MJPEG
-- INFO  [543107.062          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- ERROR [543107.063          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [543107.063          ] -- CAP: Using IO method: MMAP
-- INFO  [543107.063          ] -- CAP: Requested 5 device buffers, got 5
-- INFO  [543107.072          ] -- CAP: Capturing started
-- INFO  [543107.072          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [543107.072          ] -- Using JPEG quality: encoder default
-- INFO  [543107.072          ] -- Creating pool JPEG with 1 workers ...
-- INFO  [543107.073          ] -- Capturing ...
-- ERROR [543112.690          ] -- CAP: Device select() timeout
-- INFO  [543112.785          ] -- Destroying workers pool JPEG ...
-- INFO  [543112.801          ] -- CAP: Capturing stopped
================================================================================
-- INFO  [543112.801          ] -- Using V4L2 device: /dev/video0
-- INFO  [543112.801          ] -- CAP: Using capture type: single-planar
-- INFO  [543112.801          ] -- CAP: Using input channel: 0
-- INFO  [543115.028          ] -- CAP: Using resolution: 640x480
-- INFO  [543115.028          ] -- CAP: Using format: MJPEG
-- INFO  [543115.059          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- ERROR [543115.059          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [543115.059          ] -- CAP: Using IO method: MMAP
-- INFO  [543115.060          ] -- CAP: Requested 5 device buffers, got 5
-- INFO  [543115.072          ] -- CAP: Capturing started
-- INFO  [543115.072          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [543115.072          ] -- Using JPEG quality: encoder default
-- INFO  [543115.072          ] -- Creating pool JPEG with 1 workers ...
-- INFO  [543115.073          ] -- Capturing ...
-- ERROR [543117.526          ] -- CAP: Device select() timeout
-- INFO  [543117.627          ] -- Destroying workers pool JPEG ...
-- INFO  [543117.633          ] -- CAP: Capturing stopped
================================================================================

With --debug:

$ ./ustreamer --format MJPEG --debug
-- INFO  [543231.634          ] -- Starting PiKVM uStreamer 6.12 ...
-- DEBUG [543231.634          ] -- Installing SIGINT handler ...
-- DEBUG [543231.634          ] -- Installing SIGTERM handler ...
-- DEBUG [543231.634          ] -- Ignoring SIGPIPE ...
-- DEBUG [543231.634          ] -- HTTP: Binding HTTP to [127.0.0.1]:8080 ...
-- INFO  [543231.634          ] -- HTTP: Listening HTTP on [127.0.0.1]:8080
-- INFO  [543231.634          ] -- HTTP: Starting eventloop ...
-- DEBUG [543231.634          ] -- CAP: Opening capture device ...
-- DEBUG [543231.634          ] -- CAP: Capture device fd=8 opened
-- INFO  [543231.634          ] -- Using V4L2 device: /dev/video0
-- DEBUG [543231.634          ] -- CAP: Querying device capabilities ...
-- INFO  [543231.634          ] -- CAP: Using capture type: single-planar
-- INFO  [543231.634          ] -- CAP: Using input channel: 0
-- DEBUG [543231.635          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [543231.635          ] -- CAP: Probing device format=MJPEG, stride=1280, resolution=640x480 ...
-- DEBUG [543231.651          ] -- HTTP: Repeating exposed ...
-- INFO  [543231.665          ] -- CAP: Using resolution: 640x480
-- INFO  [543231.665          ] -- CAP: Using format: MJPEG
-- DEBUG [543231.665          ] -- CAP: Querying HW FPS ...
-- INFO  [543231.696          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- ERROR [543231.696          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [543231.696          ] -- CAP: Using IO method: MMAP
-- DEBUG [543231.696          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [543231.697          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [543231.697          ] -- CAP: Allocating device buffers ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [543231.697          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [543231.697          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [543231.697          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [543231.697          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [543231.697          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [543231.697          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [543231.712          ] -- CAP: Capturing started
-- INFO  [543231.712          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [543231.712          ] -- Using JPEG quality: encoder default
-- INFO  [543231.712          ] -- Creating pool JPEG with 1 workers ...
-- DEBUG [543231.712          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [543231.712          ] -- Worker jw-0 waiting for a new job ...
-- INFO  [543231.713          ] -- Capturing ...
-- DEBUG [543231.713          ] -- CAP: Calling select() on video device ...
-- DEBUG [543232.008          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543232.008          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543232.008          ] -- CAP: Grabbed HW buffer=1: bytesused=88528, grab_ts=543231.928, latency=0.080, skipped=0
-- PERF  [543232.008          ] -- FPS: STREAM-CAPTURED: 0
-- DEBUG [543232.008          ] -- CAP: Calling select() on video device ...
-- VERB  [543232.008          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543232.008          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543232.008          ] -- CAP: HW buffer=1 released
-- DEBUG [543232.660          ] -- HTTP: Repeating exposed ...
-- DEBUG [543232.913          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543232.913          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543232.913          ] -- CAP: Grabbed HW buffer=1: bytesused=88757, grab_ts=543232.828, latency=0.085, skipped=0
-- DEBUG [543232.913          ] -- CAP: Calling select() on video device ...
-- VERB  [543232.913          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543232.918          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543232.918          ] -- CAP: HW buffer=1 released
-- DEBUG [543233.412          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543233.412          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543233.412          ] -- CAP: Grabbed HW buffer=1: bytesused=88611, grab_ts=543233.332, latency=0.080, skipped=0
-- PERF  [543233.412          ] -- FPS: STREAM-CAPTURED: 2
-- VERB  [543233.412          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543233.412          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543233.412          ] -- CAP: HW buffer=1 released
-- DEBUG [543233.412          ] -- CAP: Calling select() on video device ...
-- DEBUG [543233.669          ] -- HTTP: Repeating exposed ...
-- DEBUG [543233.712          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543233.712          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543233.712          ] -- CAP: Grabbed HW buffer=4: bytesused=88600, grab_ts=543233.632, latency=0.080, skipped=0
-- DEBUG [543233.712          ] -- CAP: Calling select() on video device ...
-- VERB  [543233.712          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543233.717          ] -- CAP: Releasing HW buffer=4 ...
-- DEBUG [543233.718          ] -- CAP: HW buffer=4 released
-- DEBUG [543234.676          ] -- HTTP: Repeating exposed ...
-- DEBUG [543234.713          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [543234.713          ] -- CAP: Device select() timeout
-- INFO  [543234.814          ] -- Destroying workers pool JPEG ...
-- DEBUG [543234.814          ] -- Bye-bye (worker jw-0)
-- DEBUG [543234.814          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [543234.816          ] -- CAP: Releasing HW buffers ...
-- INFO  [543234.816          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [543234.817          ] -- CAP: Opening capture device ...
-- DEBUG [543234.817          ] -- CAP: Capture device fd=8 opened
-- INFO  [543234.817          ] -- Using V4L2 device: /dev/video0
-- DEBUG [543234.817          ] -- CAP: Querying device capabilities ...
-- INFO  [543234.817          ] -- CAP: Using capture type: single-planar
-- INFO  [543234.817          ] -- CAP: Using input channel: 0
-- DEBUG [543234.817          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [543234.817          ] -- CAP: Probing device format=MJPEG, stride=1280, resolution=640x480 ...
-- DEBUG [543235.683          ] -- HTTP: Repeating exposed ...
-- DEBUG [543236.690          ] -- HTTP: Repeating exposed ...
-- INFO  [543237.045          ] -- CAP: Using resolution: 640x480
-- INFO  [543237.045          ] -- CAP: Using format: MJPEG
-- DEBUG [543237.045          ] -- CAP: Querying HW FPS ...
-- INFO  [543237.077          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- ERROR [543237.077          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [543237.077          ] -- CAP: Using IO method: MMAP
-- DEBUG [543237.077          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [543237.077          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [543237.077          ] -- CAP: Allocating device buffers ...
-- DEBUG [543237.077          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [543237.077          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [543237.078          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [543237.078          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [543237.078          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [543237.078          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [543237.078          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [543237.088          ] -- CAP: Capturing started
-- INFO  [543237.088          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [543237.088          ] -- Using JPEG quality: encoder default
-- INFO  [543237.088          ] -- Creating pool JPEG with 1 workers ...
-- DEBUG [543237.088          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [543237.088          ] -- Worker jw-0 waiting for a new job ...
-- INFO  [543237.089          ] -- Capturing ...
-- DEBUG [543237.089          ] -- CAP: Calling select() on video device ...
-- DEBUG [543237.284          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.284          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.284          ] -- CAP: Grabbed HW buffer=0: bytesused=36950, grab_ts=543237.092, latency=0.192, skipped=0
-- PERF  [543237.284          ] -- FPS: STREAM-CAPTURED: 2
-- DEBUG [543237.284          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.284          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.284          ] -- CAP: Releasing HW buffer=0 ...
-- DEBUG [543237.284          ] -- CAP: HW buffer=0 released
-- DEBUG [543237.332          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.332          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.332          ] -- CAP: Grabbed HW buffer=1: bytesused=88274, grab_ts=543237.284, latency=0.048, skipped=0
-- DEBUG [543237.332          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.332          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.332          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543237.332          ] -- CAP: HW buffer=1 released
-- DEBUG [543237.384          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.384          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.384          ] -- CAP: Grabbed HW buffer=2: bytesused=88422, grab_ts=543237.336, latency=0.048, skipped=0
-- DEBUG [543237.384          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.384          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.389          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543237.389          ] -- CAP: HW buffer=2 released
-- DEBUG [543237.436          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.436          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.436          ] -- CAP: Grabbed HW buffer=3: bytesused=88320, grab_ts=543237.384, latency=0.052, skipped=0
-- DEBUG [543237.436          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.436          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.436          ] -- CAP: Releasing HW buffer=3 ...
-- DEBUG [543237.436          ] -- CAP: HW buffer=3 released
-- DEBUG [543237.484          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.484          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.484          ] -- CAP: Grabbed HW buffer=4: bytesused=88388, grab_ts=543237.436, latency=0.048, skipped=0
-- DEBUG [543237.484          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.484          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.484          ] -- CAP: Releasing HW buffer=4 ...
-- DEBUG [543237.484          ] -- CAP: HW buffer=4 released
-- DEBUG [543237.536          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.536          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.536          ] -- CAP: Grabbed HW buffer=0: bytesused=88348, grab_ts=543237.484, latency=0.052, skipped=0
-- DEBUG [543237.536          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.536          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.536          ] -- CAP: Releasing HW buffer=0 ...
-- DEBUG [543237.536          ] -- CAP: HW buffer=0 released
-- DEBUG [543237.584          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.584          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.584          ] -- CAP: Grabbed HW buffer=1: bytesused=88317, grab_ts=543237.536, latency=0.048, skipped=0
-- DEBUG [543237.584          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.584          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.584          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543237.584          ] -- CAP: HW buffer=1 released
-- DEBUG [543237.636          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.636          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.636          ] -- CAP: Grabbed HW buffer=2: bytesused=88459, grab_ts=543237.584, latency=0.052, skipped=0
-- DEBUG [543237.636          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.636          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.641          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543237.641          ] -- CAP: HW buffer=2 released
-- DEBUG [543237.684          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.684          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.684          ] -- CAP: Grabbed HW buffer=3: bytesused=88308, grab_ts=543237.636, latency=0.048, skipped=0
-- DEBUG [543237.684          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.684          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.684          ] -- CAP: Releasing HW buffer=3 ...
-- DEBUG [543237.684          ] -- CAP: HW buffer=3 released
-- DEBUG [543237.700          ] -- HTTP: Repeating exposed ...
-- DEBUG [543237.736          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.736          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.736          ] -- CAP: Grabbed HW buffer=4: bytesused=88310, grab_ts=543237.684, latency=0.052, skipped=0
-- DEBUG [543237.736          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.736          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.736          ] -- CAP: Releasing HW buffer=4 ...
-- DEBUG [543237.736          ] -- CAP: HW buffer=4 released
-- DEBUG [543237.884          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.884          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.884          ] -- CAP: Grabbed HW buffer=1: bytesused=88393, grab_ts=543237.804, latency=0.080, skipped=0
-- DEBUG [543237.884          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.884          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.889          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543237.889          ] -- CAP: HW buffer=1 released
-- DEBUG [543237.936          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543237.936          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543237.936          ] -- CAP: Grabbed HW buffer=2: bytesused=88439, grab_ts=543237.884, latency=0.052, skipped=0
-- DEBUG [543237.936          ] -- CAP: Calling select() on video device ...
-- VERB  [543237.936          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543237.936          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543237.936          ] -- CAP: HW buffer=2 released
-- DEBUG [543238.236          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543238.236          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543238.236          ] -- CAP: Grabbed HW buffer=0: bytesused=88323, grab_ts=543238.156, latency=0.080, skipped=0
-- PERF  [543238.236          ] -- FPS: STREAM-CAPTURED: 12
-- DEBUG [543238.236          ] -- CAP: Calling select() on video device ...
-- VERB  [543238.236          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543238.236          ] -- CAP: Releasing HW buffer=0 ...
-- DEBUG [543238.236          ] -- CAP: HW buffer=0 released
-- DEBUG [543238.436          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543238.436          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543238.436          ] -- CAP: Grabbed HW buffer=2: bytesused=88409, grab_ts=543238.268, latency=0.168, skipped=0
-- DEBUG [543238.436          ] -- CAP: Calling select() on video device ...
-- VERB  [543238.436          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543238.441          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543238.441          ] -- CAP: HW buffer=2 released
-- DEBUG [543238.488          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543238.488          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543238.488          ] -- CAP: Grabbed HW buffer=3: bytesused=88401, grab_ts=543238.436, latency=0.052, skipped=0
-- DEBUG [543238.488          ] -- CAP: Calling select() on video device ...
-- VERB  [543238.488          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543238.493          ] -- CAP: Releasing HW buffer=3 ...
-- DEBUG [543238.493          ] -- CAP: HW buffer=3 released
-- DEBUG [543238.536          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543238.536          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543238.536          ] -- CAP: Grabbed HW buffer=4: bytesused=88350, grab_ts=543238.488, latency=0.048, skipped=0
-- DEBUG [543238.536          ] -- CAP: Calling select() on video device ...
-- VERB  [543238.536          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543238.536          ] -- CAP: Releasing HW buffer=4 ...
-- DEBUG [543238.536          ] -- CAP: HW buffer=4 released
-- DEBUG [543238.588          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543238.588          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543238.588          ] -- CAP: Grabbed HW buffer=0: bytesused=88387, grab_ts=543238.536, latency=0.052, skipped=0
-- DEBUG [543238.588          ] -- CAP: Calling select() on video device ...
-- VERB  [543238.588          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543238.588          ] -- CAP: Releasing HW buffer=0 ...
-- DEBUG [543238.588          ] -- CAP: HW buffer=0 released
-- DEBUG [543238.706          ] -- HTTP: Repeating exposed ...
-- DEBUG [543239.340          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543239.340          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543239.340          ] -- CAP: Grabbed HW buffer=2: bytesused=88683, grab_ts=543239.260, latency=0.080, skipped=0
-- PERF  [543239.340          ] -- FPS: STREAM-CAPTURED: 5
-- DEBUG [543239.340          ] -- CAP: Calling select() on video device ...
-- VERB  [543239.340          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543239.340          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543239.340          ] -- CAP: HW buffer=2 released
-- DEBUG [543239.716          ] -- HTTP: Repeating exposed ...
-- DEBUG [543239.840          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543239.840          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543239.840          ] -- CAP: Grabbed HW buffer=2: bytesused=90763, grab_ts=543239.792, latency=0.048, skipped=0
-- DEBUG [543239.840          ] -- CAP: Calling select() on video device ...
-- VERB  [543239.840          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543239.840          ] -- CAP: Releasing HW buffer=2 ...
-- DEBUG [543239.840          ] -- CAP: HW buffer=2 released
-- DEBUG [543239.892          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543239.892          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543239.892          ] -- CAP: Grabbed HW buffer=3: bytesused=90779, grab_ts=543239.840, latency=0.052, skipped=0
-- DEBUG [543239.892          ] -- CAP: Calling select() on video device ...
-- VERB  [543239.892          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543239.897          ] -- CAP: Releasing HW buffer=3 ...
-- DEBUG [543239.897          ] -- CAP: HW buffer=3 released
-- DEBUG [543239.940          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543239.940          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543239.940          ] -- CAP: Grabbed HW buffer=4: bytesused=90504, grab_ts=543239.892, latency=0.048, skipped=0
-- DEBUG [543239.940          ] -- CAP: Calling select() on video device ...
-- VERB  [543239.940          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543239.940          ] -- CAP: Releasing HW buffer=4 ...
-- DEBUG [543239.940          ] -- CAP: HW buffer=4 released
-- DEBUG [543240.723          ] -- HTTP: Repeating exposed ...
-- DEBUG [543240.941          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [543240.941          ] -- CAP: Device select() timeout
-- INFO  [543240.999          ] -- Destroying workers pool JPEG ...
-- DEBUG [543240.999          ] -- Bye-bye (worker jw-0)
-- DEBUG [543240.999          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [543241.024          ] -- CAP: Releasing HW buffers ...
-- INFO  [543241.024          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [543241.024          ] -- CAP: Opening capture device ...
-- DEBUG [543241.024          ] -- CAP: Capture device fd=8 opened
-- INFO  [543241.024          ] -- Using V4L2 device: /dev/video0
-- DEBUG [543241.024          ] -- CAP: Querying device capabilities ...
-- INFO  [543241.024          ] -- CAP: Using capture type: single-planar
-- INFO  [543241.024          ] -- CAP: Using input channel: 0
-- DEBUG [543241.024          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [543241.024          ] -- CAP: Probing device format=MJPEG, stride=1280, resolution=640x480 ...
-- DEBUG [543241.729          ] -- HTTP: Repeating exposed ...
-- DEBUG [543242.740          ] -- HTTP: Repeating exposed ...
-- INFO  [543243.251          ] -- CAP: Using resolution: 640x480
-- INFO  [543243.251          ] -- CAP: Using format: MJPEG
-- DEBUG [543243.251          ] -- CAP: Querying HW FPS ...
-- INFO  [543243.282          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- ERROR [543243.282          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [543243.282          ] -- CAP: Using IO method: MMAP
-- DEBUG [543243.282          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [543243.282          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [543243.282          ] -- CAP: Allocating device buffers ...
-- DEBUG [543243.282          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [543243.282          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [543243.283          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [543243.283          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [543243.283          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [543243.283          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [543243.283          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [543243.296          ] -- CAP: Capturing started
-- INFO  [543243.296          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [543243.296          ] -- Using JPEG quality: encoder default
-- INFO  [543243.296          ] -- Creating pool JPEG with 1 workers ...
-- DEBUG [543243.296          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [543243.297          ] -- Worker jw-0 waiting for a new job ...
-- INFO  [543243.297          ] -- Capturing ...
-- DEBUG [543243.297          ] -- CAP: Calling select() on video device ...
-- DEBUG [543243.492          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543243.492          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543243.492          ] -- CAP: Grabbed HW buffer=0: bytesused=37507, grab_ts=543243.300, latency=0.192, skipped=0
-- PERF  [543243.492          ] -- FPS: STREAM-CAPTURED: 4
-- DEBUG [543243.492          ] -- CAP: Calling select() on video device ...
-- VERB  [543243.493          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543243.498          ] -- CAP: Releasing HW buffer=0 ...
-- DEBUG [543243.498          ] -- CAP: HW buffer=0 released
-- DEBUG [543243.544          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543243.544          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543243.544          ] -- CAP: Grabbed HW buffer=1: bytesused=88595, grab_ts=543243.492, latency=0.052, skipped=0
-- DEBUG [543243.544          ] -- CAP: Calling select() on video device ...
-- VERB  [543243.544          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543243.549          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543243.549          ] -- CAP: HW buffer=1 released
-- DEBUG [543243.746          ] -- HTTP: Repeating exposed ...
-- DEBUG [543243.992          ] -- CAP: Device select() --> 1; has_read=1, has_error=0
-- DEBUG [543243.992          ] -- CAP: Grabbing hw buffer ...
-- DEBUG [543243.992          ] -- CAP: Grabbed HW buffer=1: bytesused=88382, grab_ts=543243.912, latency=0.080, skipped=0
-- DEBUG [543243.992          ] -- CAP: Calling select() on video device ...
-- VERB  [543243.992          ] -- JPEG: Passed encoding because nobody is watching
-- DEBUG [543243.998          ] -- CAP: Releasing HW buffer=1 ...
-- DEBUG [543243.998          ] -- CAP: HW buffer=1 released
-- DEBUG [543244.756          ] -- HTTP: Repeating exposed ...
-- DEBUG [543244.994          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [543244.994          ] -- CAP: Device select() timeout
-- INFO  [543245.094          ] -- Destroying workers pool JPEG ...
-- DEBUG [543245.094          ] -- Bye-bye (worker jw-0)
-- DEBUG [543245.094          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [543245.120          ] -- CAP: Releasing HW buffers ...
-- INFO  [543245.120          ] -- CAP: Capturing stopped
================================================================================
@mdevaev
Copy link
Member

mdevaev commented Aug 7, 2024

Is it showing something at least between timeouts?

@jamincollins
Copy link
Author

Yes a few frames then the no signal notice. Then this cycle repeats. Also worth noting that the mjpeg format works best. The other seems almost like still frames or very low frame rate even though the device details says it should support 30 fps at 640x480.

@mdevaev
Copy link
Member

mdevaev commented Aug 7, 2024

There may be something wrong with the driver. Try --device-timeout=10.

@jamincollins
Copy link
Author

jamincollins commented Aug 7, 2024

That does not appear to resolve the CAP: Device select() timeout.

Here is a capture from the same camera using VLC, as you can see it has no trouble staying connected and getting decent frame rate for the resolution. This is scaled down from the original 1600x1200 capture.

vlc-capture.mp4

@mdevaev
Copy link
Member

mdevaev commented Aug 7, 2024

Did you use device timeout with -m MJPEG?

@jamincollins
Copy link
Author

Yes. Both the ustreamer and vlc testing has been done with the same format option of MJPEG.

@mdevaev
Copy link
Member

mdevaev commented Aug 8, 2024

I can't say now what's wrong with it. Could you try mjpg-streamer? uStreamer doesn't do anything weird with camera, but maybe there is some difference.

@jamincollins
Copy link
Author

No change with mjpg-streamer.

@James4Ever0
Copy link

#278 #274

@James4Ever0
Copy link

@James4Ever0
Copy link

@mdevaev
Copy link
Member

mdevaev commented Sep 8, 2024

@jamincollins Please check if this is working.

@Mactarvish
Copy link

Same error with log:

-- INFO  [2546.600          ] -- Starting PiKVM uStreamer 6.16 ...
-- DEBUG [2546.600          ] -- Installing SIGINT handler ...
-- DEBUG [2546.600          ] -- Installing SIGTERM handler ...
-- DEBUG [2546.600          ] -- Ignoring SIGPIPE ...
-- DEBUG [2546.600          ] -- HTTP: Binding HTTP to [0.0.0.0]:8080 ...
-- INFO  [2546.600          ] -- HTTP: Listening HTTP on [0.0.0.0]:8080
-- DEBUG [2546.600          ] -- CAP: Opening capture device ...
-- INFO  [2546.600          ] -- HTTP: Starting eventloop ...
-- DEBUG [2546.615          ] -- HTTP: Repeating exposed ...
-- DEBUG [2546.701          ] -- CAP: Capture device fd=8 opened
-- INFO  [2546.701          ] -- Using V4L2 device: /dev/video2
-- DEBUG [2546.701          ] -- CAP: Querying device capabilities ...
-- INFO  [2546.701          ] -- CAP: Using capture type: single-planar
-- INFO  [2546.701          ] -- CAP: Using input channel: 0
-- DEBUG [2546.701          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [2546.701          ] -- CAP: Probing device format=YUYV, stride=1280, resolution=640x480 ...
-- INFO  [2546.725          ] -- CAP: Using resolution: 640x480
-- INFO  [2546.725          ] -- CAP: Using format: YUYV
-- DEBUG [2546.725          ] -- CAP: Querying HW FPS ...
-- INFO  [2546.749          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [2546.750          ] -- CAP: Using IO method: MMAP
-- DEBUG [2546.750          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [2546.750          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [2546.750          ] -- CAP: Allocating device buffers ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [2546.750          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [2546.750          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [2546.750          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [2546.750          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [2546.750          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [2546.750          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [2546.764          ] -- CAP: Capturing started
-- INFO  [2546.764          ] -- Using JPEG quality: 80%
-- INFO  [2546.764          ] -- Creating pool JPEG with 4 workers ...
-- DEBUG [2546.765          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [2546.765          ] -- Worker jw-0 waiting for a new job ...
-- DEBUG [2546.765          ] -- Hello! I am a worker jw-1 ^_^
-- DEBUG [2546.765          ] -- Worker jw-1 waiting for a new job ...
-- INFO  [2546.765          ] -- Capturing ...
-- DEBUG [2546.765          ] -- CAP: Calling select() on video device ...
-- DEBUG [2546.765          ] -- Hello! I am a worker jw-2 ^_^
-- DEBUG [2546.765          ] -- Worker jw-2 waiting for a new job ...
-- DEBUG [2546.765          ] -- Hello! I am a worker jw-3 ^_^
-- DEBUG [2546.765          ] -- Worker jw-3 waiting for a new job ...
-- DEBUG [2547.623          ] -- HTTP: Repeating exposed ...
-- DEBUG [2547.766          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [2547.766          ] -- CAP: Device select() timeout
-- INFO  [2547.866          ] -- Destroying workers pool JPEG ...
-- DEBUG [2547.867          ] -- Bye-bye (worker jw-0)
-- DEBUG [2547.867          ] -- Bye-bye (worker jw-1)
-- DEBUG [2547.867          ] -- Bye-bye (worker jw-2)
-- DEBUG [2547.867          ] -- Bye-bye (worker jw-3)
-- DEBUG [2547.867          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [2547.974          ] -- CAP: Releasing HW buffers ...
-- INFO  [2547.974          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [2547.974          ] -- CAP: Opening capture device ...
-- DEBUG [2547.974          ] -- CAP: Capture device fd=8 opened
-- INFO  [2547.974          ] -- Using V4L2 device: /dev/video2
-- DEBUG [2547.974          ] -- CAP: Querying device capabilities ...
-- INFO  [2547.974          ] -- CAP: Using capture type: single-planar
-- INFO  [2547.974          ] -- CAP: Using input channel: 0
-- DEBUG [2547.974          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [2547.974          ] -- CAP: Probing device format=YUYV, stride=1280, resolution=640x480 ...
-- INFO  [2548.000          ] -- CAP: Using resolution: 640x480
-- INFO  [2548.001          ] -- CAP: Using format: YUYV
-- DEBUG [2548.001          ] -- CAP: Querying HW FPS ...
-- INFO  [2548.025          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [2548.025          ] -- CAP: Using IO method: MMAP
-- DEBUG [2548.025          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [2548.026          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [2548.026          ] -- CAP: Allocating device buffers ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [2548.026          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [2548.026          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [2548.026          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [2548.026          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [2548.026          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [2548.026          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [2548.040          ] -- CAP: Capturing started
-- INFO  [2548.040          ] -- Using JPEG quality: 80%
-- INFO  [2548.040          ] -- Creating pool JPEG with 4 workers ...
-- DEBUG [2548.040          ] -- Hello! I am a worker jw-1 ^_^
-- DEBUG [2548.040          ] -- Worker jw-1 waiting for a new job ...
-- DEBUG [2548.040          ] -- Hello! I am a worker jw-2 ^_^
-- DEBUG [2548.041          ] -- Worker jw-2 waiting for a new job ...
-- DEBUG [2548.041          ] -- Hello! I am a worker jw-3 ^_^
-- DEBUG [2548.041          ] -- Worker jw-3 waiting for a new job ...
-- DEBUG [2548.041          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [2548.041          ] -- Worker jw-0 waiting for a new job ...
-- INFO  [2548.041          ] -- Capturing ...
-- DEBUG [2548.041          ] -- CAP: Calling select() on video device ...
-- DEBUG [2548.632          ] -- HTTP: Repeating exposed ...
-- DEBUG [2549.042          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [2549.042          ] -- CAP: Device select() timeout
-- INFO  [2549.142          ] -- Destroying workers pool JPEG ...
-- DEBUG [2549.142          ] -- Bye-bye (worker jw-0)
-- DEBUG [2549.142          ] -- Bye-bye (worker jw-1)
-- DEBUG [2549.142          ] -- Bye-bye (worker jw-2)
-- DEBUG [2549.143          ] -- Bye-bye (worker jw-3)
-- DEBUG [2549.143          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [2549.269          ] -- CAP: Releasing HW buffers ...
-- INFO  [2549.270          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [2549.270          ] -- CAP: Opening capture device ...
-- DEBUG [2549.270          ] -- CAP: Capture device fd=8 opened
-- INFO  [2549.270          ] -- Using V4L2 device: /dev/video2
-- DEBUG [2549.270          ] -- CAP: Querying device capabilities ...
-- INFO  [2549.270          ] -- CAP: Using capture type: single-planar
-- INFO  [2549.270          ] -- CAP: Using input channel: 0
-- DEBUG [2549.270          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [2549.270          ] -- CAP: Probing device format=YUYV, stride=1280, resolution=640x480 ...
-- INFO  [2549.296          ] -- CAP: Using resolution: 640x480
-- INFO  [2549.296          ] -- CAP: Using format: YUYV
-- DEBUG [2549.296          ] -- CAP: Querying HW FPS ...
-- INFO  [2549.320          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [2549.320          ] -- CAP: Using IO method: MMAP
-- DEBUG [2549.320          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [2549.321          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [2549.321          ] -- CAP: Allocating device buffers ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [2549.321          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [2549.321          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [2549.321          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [2549.321          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [2549.321          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [2549.321          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [2549.335          ] -- CAP: Capturing started
-- INFO  [2549.335          ] -- Using JPEG quality: 80%
-- INFO  [2549.335          ] -- Creating pool JPEG with 4 workers ...
-- DEBUG [2549.335          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [2549.335          ] -- Worker jw-0 waiting for a new job ...
-- DEBUG [2549.335          ] -- Hello! I am a worker jw-2 ^_^
-- DEBUG [2549.335          ] -- Worker jw-2 waiting for a new job ...
-- DEBUG [2549.335          ] -- Hello! I am a worker jw-1 ^_^
-- DEBUG [2549.335          ] -- Worker jw-1 waiting for a new job ...
-- DEBUG [2549.335          ] -- Hello! I am a worker jw-3 ^_^
-- DEBUG [2549.335          ] -- Worker jw-3 waiting for a new job ...
-- INFO  [2549.335          ] -- Capturing ...
-- DEBUG [2549.336          ] -- CAP: Calling select() on video device ...
-- DEBUG [2549.640          ] -- HTTP: Repeating exposed ...
-- DEBUG [2550.336          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [2550.336          ] -- CAP: Device select() timeout
-- INFO  [2550.436          ] -- Destroying workers pool JPEG ...
-- DEBUG [2550.437          ] -- Bye-bye (worker jw-0)
-- DEBUG [2550.437          ] -- Bye-bye (worker jw-1)
-- DEBUG [2550.437          ] -- Bye-bye (worker jw-2)
-- DEBUG [2550.437          ] -- Bye-bye (worker jw-3)
-- DEBUG [2550.437          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [2550.564          ] -- CAP: Releasing HW buffers ...
-- INFO  [2550.564          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [2550.565          ] -- CAP: Opening capture device ...
-- DEBUG [2550.565          ] -- CAP: Capture device fd=8 opened
-- INFO  [2550.565          ] -- Using V4L2 device: /dev/video2
-- DEBUG [2550.565          ] -- CAP: Querying device capabilities ...
-- INFO  [2550.565          ] -- CAP: Using capture type: single-planar
-- INFO  [2550.565          ] -- CAP: Using input channel: 0
-- DEBUG [2550.565          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [2550.565          ] -- CAP: Probing device format=YUYV, stride=1280, resolution=640x480 ...
-- INFO  [2550.591          ] -- CAP: Using resolution: 640x480
-- INFO  [2550.591          ] -- CAP: Using format: YUYV
-- DEBUG [2550.591          ] -- CAP: Querying HW FPS ...
-- INFO  [2550.615          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [2550.615          ] -- CAP: Using IO method: MMAP
-- DEBUG [2550.615          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [2550.616          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [2550.616          ] -- CAP: Allocating device buffers ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [2550.616          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [2550.616          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [2550.616          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [2550.616          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [2550.616          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [2550.616          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [2550.630          ] -- CAP: Capturing started
-- INFO  [2550.630          ] -- Using JPEG quality: 80%
-- INFO  [2550.630          ] -- Creating pool JPEG with 4 workers ...
-- DEBUG [2550.630          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [2550.630          ] -- Hello! I am a worker jw-1 ^_^
-- DEBUG [2550.630          ] -- Worker jw-1 waiting for a new job ...
-- DEBUG [2550.630          ] -- Hello! I am a worker jw-2 ^_^
-- DEBUG [2550.630          ] -- Worker jw-2 waiting for a new job ...
-- INFO  [2550.630          ] -- Capturing ...
-- DEBUG [2550.630          ] -- CAP: Calling select() on video device ...
-- DEBUG [2550.631          ] -- Hello! I am a worker jw-3 ^_^
-- DEBUG [2550.631          ] -- Worker jw-3 waiting for a new job ...
-- DEBUG [2550.631          ] -- Worker jw-0 waiting for a new job ...
-- DEBUG [2550.648          ] -- HTTP: Repeating exposed ...
-- DEBUG [2551.631          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [2551.631          ] -- CAP: Device select() timeout
-- DEBUG [2551.656          ] -- HTTP: Repeating exposed ...
-- INFO  [2551.731          ] -- Destroying workers pool JPEG ...
-- DEBUG [2551.732          ] -- Bye-bye (worker jw-0)
-- DEBUG [2551.732          ] -- Bye-bye (worker jw-1)
-- DEBUG [2551.732          ] -- Bye-bye (worker jw-2)
-- DEBUG [2551.732          ] -- Bye-bye (worker jw-3)
-- DEBUG [2551.741          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [2551.859          ] -- CAP: Releasing HW buffers ...
-- INFO  [2551.860          ] -- CAP: Capturing stopped
================================================================================
-- DEBUG [2551.860          ] -- CAP: Opening capture device ...
-- DEBUG [2551.860          ] -- CAP: Capture device fd=8 opened
-- INFO  [2551.860          ] -- Using V4L2 device: /dev/video2
-- DEBUG [2551.860          ] -- CAP: Querying device capabilities ...
-- INFO  [2551.860          ] -- CAP: Using capture type: single-planar
-- INFO  [2551.860          ] -- CAP: Using input channel: 0
-- DEBUG [2551.860          ] -- CAP: Using TV standard: DEFAULT
-- DEBUG [2551.860          ] -- CAP: Probing device format=YUYV, stride=1280, resolution=640x480 ...
-- INFO  [2551.886          ] -- CAP: Using resolution: 640x480
-- INFO  [2551.886          ] -- CAP: Using format: YUYV
-- DEBUG [2551.886          ] -- CAP: Querying HW FPS ...
-- INFO  [2551.910          ] -- CAP: Using HW FPS: 0 -> 30 (coerced)
-- INFO  [2551.910          ] -- CAP: Using IO method: MMAP
-- DEBUG [2551.910          ] -- CAP: Requesting 5 device buffers for MMAP ...
-- INFO  [2551.911          ] -- CAP: Requested 5 device buffers, got 5
-- DEBUG [2551.911          ] -- CAP: Allocating device buffers ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=0 ...
-- DEBUG [2551.911          ] -- CAP: Mapping device buffer=0 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=1 ...
-- DEBUG [2551.911          ] -- CAP: Mapping device buffer=1 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=2 ...
-- DEBUG [2551.911          ] -- CAP: Mapping device buffer=2 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=3 ...
-- DEBUG [2551.911          ] -- CAP: Mapping device buffer=3 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QUERYBUF) for device buffer=4 ...
-- DEBUG [2551.911          ] -- CAP: Mapping device buffer=4 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=0 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=1 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=2 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=3 ...
-- DEBUG [2551.911          ] -- CAP: Calling us_xioctl(VIDIOC_QBUF) for buffer=4 ...
-- INFO  [2551.925          ] -- CAP: Capturing started
-- INFO  [2551.925          ] -- Using JPEG quality: 80%
-- INFO  [2551.925          ] -- Creating pool JPEG with 4 workers ...
-- DEBUG [2551.926          ] -- Hello! I am a worker jw-1 ^_^
-- DEBUG [2551.926          ] -- Worker jw-1 waiting for a new job ...
-- DEBUG [2551.926          ] -- Hello! I am a worker jw-0 ^_^
-- DEBUG [2551.926          ] -- Worker jw-0 waiting for a new job ...
-- DEBUG [2551.926          ] -- Hello! I am a worker jw-2 ^_^
-- DEBUG [2551.926          ] -- Worker jw-2 waiting for a new job ...
-- INFO  [2551.926          ] -- Capturing ...
-- DEBUG [2551.926          ] -- CAP: Calling select() on video device ...
-- DEBUG [2551.926          ] -- Hello! I am a worker jw-3 ^_^
-- DEBUG [2551.926          ] -- Worker jw-3 waiting for a new job ...
-- INFO  [2552.021          ] -- ===== Stopping by SIGINT =====
-- INFO  [2552.021          ] -- HTTP: Eventloop stopped
-- DEBUG [2552.926          ] -- CAP: Device select() --> 0; has_read=0, has_error=0
-- ERROR [2552.926          ] -- CAP: Device select() timeout
-- INFO  [2552.927          ] -- Destroying workers pool JPEG ...
-- DEBUG [2552.927          ] -- Bye-bye (worker jw-0)
-- DEBUG [2552.927          ] -- Bye-bye (worker jw-1)
-- DEBUG [2552.927          ] -- Bye-bye (worker jw-2)
-- DEBUG [2552.928          ] -- Bye-bye (worker jw-3)
-- DEBUG [2552.928          ] -- CAP: Calling VIDIOC_STREAMOFF ...
-- DEBUG [2553.025          ] -- CAP: Releasing HW buffers ...
-- INFO  [2553.025          ] -- CAP: Capturing stopped
-- INFO  [2553.026          ] -- Bye-bye

mjpg-streamer works well.
The camera is usb2.0, while my laptop inplace camera works well.
jacksonliam/mjpg-streamer#182 (comment) doesn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants