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

Mainloop select() error: Success #256

Open
Assassins88 opened this issue Feb 9, 2024 · 11 comments
Open

Mainloop select() error: Success #256

Assassins88 opened this issue Feb 9, 2024 · 11 comments

Comments

@Assassins88
Copy link

I get the following error:

- INFO  [1893.164    stream] -- Device fd=8 opened
-- INFO  [1893.164    stream] -- Using capture type: single-planar
-- INFO  [1893.164    stream] -- Using input channel: 0
-- INFO  [1893.190    stream] -- Using resolution: 640x480
-- INFO  [1893.190    stream] -- Using format: YUYV
-- INFO  [1893.216    stream] -- Using HW FPS: 0 -> 30 (coerced)
-- INFO  [1893.216    stream] -- Using IO method: MMAP
-- INFO  [1893.217    stream] -- Requested 5 device buffers, got 5
-- INFO  [1893.233    stream] -- Capturing started
-- INFO  [1893.233    stream] -- Using JPEG quality: 80%
-- INFO  [1893.233    stream] -- Creating pool JPEG with 4 workers ...
-- INFO  [1893.233    stream] -- Capturing ...
-- ERROR [1894.235    stream] -- Mainloop select() error: Success
-- INFO  [1894.235    stream] -- Destroying workers pool JPEG ...
-- INFO  [1894.278    stream] -- Capturing stopped
-- INFO  [1894.282    stream] -- Device fd=8 closed

This advertisement repeats itself over and over again.

I run the standart command without parameters.

The system runs in a Proxmox VM without a GPU so i cant use hw encoding and MJPG...

@mdevaev
Copy link
Member

mdevaev commented Feb 9, 2024

Which capture device do you use?

@Assassins88
Copy link
Author

Which capture device do you use?

I'm sorry, but what do you mean exactly?

@mdevaev
Copy link
Member

mdevaev commented Feb 9, 2024

Tell me how you launched ustreamer, which video capture device (camera?) you use it. More information, I don't understand what's going on.

@Assassins88
Copy link
Author

Tell me how you launched ustreamer, which video capture device (camera?) you use it. More information, I don't understand what's going on.

I launched it with different commands:

./ustreamer

./ustreamer --device=/dev/video0 --host=0.0.0.0 --port=80 -m YVYU

./ustreamer --device=/dev/video0 --host=0.0.0.0 --port=80 -m mjpeg

with the mjpeg parameter comes a error that my device dosnt support hw encoding...

my cam supports the following formats:

ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture


	[0]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 544x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 432x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 352x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 320x176
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 160x120
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 752x416
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 800x448
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 864x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 960x544
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 960x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 1024x576
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 1184x656
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 544x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 432x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 352x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 320x176
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 160x120
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 752x416
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 800x448
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 864x480
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 960x544
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 1024x576
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 960x720
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 1184x656
			Interval: Discrete 0.100s (10.000 fps)

The cam is a cheap Hama webcam but it works with MJPG-Streamer.

@mdevaev
Copy link
Member

mdevaev commented Feb 9, 2024

with the mjpeg parameter comes a error that my device dosnt support hw encoding...

Which message exactly?

@Assassins88
Copy link
Author

Assassins88 commented Feb 9, 2024

with the mjpeg parameter comes a error that my device dosnt support hw encoding...

Which message exactly?

-- INFO  [9764.246    stream] -- Device fd=8 opened
-- INFO  [9764.246    stream] -- Using capture type: single-planar
-- INFO  [9764.246    stream] -- Using input channel: 0
-- INFO  [9764.270    stream] -- Using resolution: 640x480
-- INFO  [9764.271    stream] -- Using format: MJPEG
-- INFO  [9764.296    stream] -- Using HW FPS: 0 -> 30 (coerced)
-- ERROR [9764.296    stream] -- Device doesn't support setting of HW encoding quality parameters
-- INFO  [9764.297    stream] -- Using IO method: MMAP
-- INFO  [9764.298    stream] -- Requested 5 device buffers, got 5
-- INFO  [9764.313    stream] -- Capturing started
-- INFO  [9764.313    stream] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [9764.313    stream] -- Using JPEG quality: encoder default
-- INFO  [9764.313    stream] -- Creating pool JPEG with 1 workers ...
-- INFO  [9764.314    stream] -- Capturing ...
-- ERROR [9765.315    stream] -- Mainloop select() error: Inappropriate ioctl for device
-- INFO  [9765.315    stream] -- Destroying workers pool JPEG ...
-- INFO  [9765.358    stream] -- Capturing stopped
-- INFO  [9765.360    stream] -- Device fd=8 closed

@mdevaev
Copy link
Member

mdevaev commented Feb 10, 2024

Try --io-method=USERPTR

@Assassins88
Copy link
Author

Try --io-method=USERPTR

First came the error message above and then the following:

-- INFO  [69092.741    stream] -- Device fd=0 opened
-- INFO  [69092.741    stream] -- Using capture type: single-planar
-- INFO  [69092.741    stream] -- Using input channel: 0
-- INFO  [69092.768    stream] -- Using resolution: 640x480
-- INFO  [69092.768    stream] -- Using format: YUYV
-- INFO  [69092.794    stream] -- Using HW FPS: 0 -> 30 (coerced)
-- INFO  [69092.794    stream] -- Using IO method: USERPTR
-- INFO  [69092.794    stream] -- Requested 5 device buffers, got 5
-- INFO  [69092.811    stream] -- Capturing started
-- INFO  [69092.811    stream] -- Using JPEG quality: 80%
-- INFO  [69092.811    stream] -- Creating pool JPEG with 4 workers ...
-- INFO  [69092.812    stream] -- Capturing ...
-- ERROR [69093.813    stream] -- Mainloop select() error: Bad file descriptor
-- INFO  [69093.813    stream] -- Destroying workers pool JPEG ...
-- INFO  [69093.857    stream] -- Capturing stopped
-- ERROR [69093.860    stream] -- Can't close device fd=0: Bad file descriptor

@mdevaev
Copy link
Member

mdevaev commented Feb 10, 2024

Then I don't know what the reason may be, sorry. I don't see any visible difference with mjpg-streamer with select() and I don't have cameras with the same glitch.

@SageStarCodes
Copy link

I get the same error using PS3 Eye camera

ellie@pi3:~$ ustreamer
-- INFO  [10709.277      main] -- Using internal blank placeholder
-- INFO  [10709.279      main] -- Listening HTTP on [127.0.0.1]:8080
-- INFO  [10709.280    stream] -- Using V4L2 device: /dev/video0
-- INFO  [10709.280    stream] -- Using desired FPS: 0
-- INFO  [10709.280      http] -- Starting HTTP eventloop ...
================================================================================
-- INFO  [10709.282    stream] -- Device fd=8 opened
-- INFO  [10709.282    stream] -- Using input channel: 0
-- INFO  [10709.282    stream] -- Using resolution: 640x480
-- INFO  [10709.282    stream] -- Using pixelformat: YUYV
-- INFO  [10709.282    stream] -- Using HW FPS: 0 -> 255 (coerced)
-- INFO  [10709.282    stream] -- Using IO method: MMAP
-- INFO  [10709.285    stream] -- Requested 5 device buffers, got 5
-- INFO  [10710.175    stream] -- Capturing started
-- INFO  [10710.175    stream] -- Using JPEG quality: 80%
-- INFO  [10710.175    stream] -- Creating pool JPEG with 4 workers ...
-- INFO  [10710.178    stream] -- Capturing ...
-- ERROR [10711.179    stream] -- Mainloop select() error: Success
-- INFO  [10711.179    stream] -- Destroying workers pool JPEG ...
-- INFO  [10711.184    stream] -- Capturing stopped
-- INFO  [10711.186    stream] -- Device fd=8 closed
================================================================================
-- INFO  [10711.189    stream] -- Device fd=8 opened
-- INFO  [10711.190    stream] -- Using input channel: 0
-- INFO  [10711.190    stream] -- Using resolution: 640x480
-- INFO  [10711.190    stream] -- Using pixelformat: YUYV
-- INFO  [10711.190    stream] -- Using HW FPS: 0 -> 255 (coerced)
-- INFO  [10711.190    stream] -- Using IO method: MMAP
-- INFO  [10711.192    stream] -- Requested 5 device buffers, got 5
^C-- INFO  [10711.585      main] -- ===== Stopping by SIGINT =====
-- INFO  [10711.585      http] -- HTTP eventloop stopped
-- INFO  [10712.098    stream] -- Capturing started
-- INFO  [10712.098    stream] -- Using JPEG quality: 80%
-- INFO  [10712.098    stream] -- Creating pool JPEG with 4 workers ...
-- INFO  [10712.100    stream] -- Capturing ...
-- INFO  [10712.100    stream] -- Destroying workers pool JPEG ...
-- INFO  [10712.103    stream] -- Capturing stopped
-- INFO  [10712.105    stream] -- Device fd=8 closed
-- INFO  [10712.107      main] -- Bye-bye
ellie@pi3:~$ ustreamer --device=/dev/video0 --host=0.0.0.0 -c NOOP
-- INFO  [10828.772      main] -- Using internal blank placeholder
-- INFO  [10828.773      main] -- Listening HTTP on [0.0.0.0]:8080
-- INFO  [10828.774    stream] -- Using V4L2 device: /dev/video0
-- INFO  [10828.774    stream] -- Using desired FPS: 0
-- INFO  [10828.774      http] -- Starting HTTP eventloop ...
================================================================================
-- INFO  [10828.776    stream] -- Device fd=8 opened
-- INFO  [10828.776    stream] -- Using input channel: 0
-- INFO  [10828.776    stream] -- Using resolution: 640x480
-- INFO  [10828.777    stream] -- Using pixelformat: YUYV
-- INFO  [10828.777    stream] -- Using HW FPS: 0 -> 255 (coerced)
-- INFO  [10828.777    stream] -- Using IO method: MMAP
-- INFO  [10828.779    stream] -- Requested 5 device buffers, got 5
-- INFO  [10829.689    stream] -- Capturing started
-- INFO  [10829.689    stream] -- Using JPEG NOOP encoder
-- INFO  [10829.689    stream] -- Creating pool JPEG with 1 workers ...
-- INFO  [10829.690    stream] -- Capturing ...
-- ERROR [10830.691    stream] -- Mainloop select() error: Success
-- INFO  [10830.691    stream] -- Destroying workers pool JPEG ...
-- INFO  [10830.694    stream] -- Capturing stopped
-- INFO  [10830.696    stream] -- Device fd=8 closed
================================================================================
-- INFO  [10830.700    stream] -- Device fd=8 opened
-- INFO  [10830.700    stream] -- Using input channel: 0
-- INFO  [10830.700    stream] -- Using resolution: 640x480
-- INFO  [10830.700    stream] -- Using pixelformat: YUYV
-- INFO  [10830.700    stream] -- Using HW FPS: 0 -> 255 (coerced)
-- INFO  [10830.700    stream] -- Using IO method: MMAP
-- INFO  [10830.703    stream] -- Requested 5 device buffers, got 5
^C-- INFO  [10831.392      main] -- ===== Stopping by SIGINT =====
-- INFO  [10831.392      http] -- HTTP eventloop stopped
-- INFO  [10831.605    stream] -- Capturing started
-- INFO  [10831.606    stream] -- Using JPEG NOOP encoder
-- INFO  [10831.606    stream] -- Creating pool JPEG with 1 workers ...
-- INFO  [10831.606    stream] -- Capturing ...
-- INFO  [10831.607    stream] -- Destroying workers pool JPEG ...
-- INFO  [10831.609    stream] -- Capturing stopped
-- INFO  [10831.611    stream] -- Device fd=8 closed
-- INFO  [10831.613      main] -- Bye-bye
ellie@pi3:~$ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
        /dev/video10
        /dev/video11
        /dev/video12
        /dev/video18
        /dev/video31
        /dev/media2

bcm2835-isp (platform:bcm2835-isp):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16
        /dev/video20
        /dev/video21
        /dev/video22
        /dev/video23
        /dev/media0
        /dev/media1

USB Camera-B4.09.24.1 (usb-3f980000.usb-1.5.1.2):
        /dev/video0
ellie@pi3:~$ v4l2-ctl -d /dev/video0 --all
Driver Info:
        Driver name      : ov534
        Card type        : USB Camera-B4.09.24.1
        Bus info         : usb-3f980000.usb-1.5.1.2
        Driver version   : 6.5.13
        Capabilities     : 0x85200001
                Video Capture
                Read/Write
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x05200001
                Video Capture
                Read/Write
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (ov534: ok)
Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'YUYV' (YUYV 4:2:2)
        Field             : None
        Bytes per Line    : 1280
        Size Image        : 614400
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 255.000 (255/1)
        Read buffers     : 2

User Controls

                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=0 value=0 flags=slider
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=32 value=32 flags=slider
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=64 value=64 flags=slider
                            hue 0x00980903 (int)    : min=-90 max=90 step=1 default=0 value=0 flags=slider
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1
                       exposure 0x00980911 (int)    : min=0 max=255 step=1 default=120 value=120 flags=inactive, volatile
                 gain_automatic 0x00980912 (bool)   : default=1 value=1 flags=update
                           gain 0x00980913 (int)    : min=0 max=63 step=1 default=20 value=20 flags=inactive, volatile
                horizontal_flip 0x00980914 (bool)   : default=0 value=0
                  vertical_flip 0x00980915 (bool)   : default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=1 default=0 value=0 (Disabled)
                                0: Disabled
                                1: 50 Hz
                      sharpness 0x0098091b (int)    : min=0 max=63 step=1 default=0 value=0 flags=slider

Camera Controls

                  auto_exposure 0x009a0901 (menu)   : min=0 max=1 default=0 value=0 (Auto Mode) flags=update
                                0: Auto Mode
                                1: Manual Mode

Linux pi3 6.5.0-1015-raspi #18-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 5 15:38:16 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
Fresh install of Ubuntu Server 23.10

ellie@pi3:~$ apt show ustreamer
Package: ustreamer
Version: 4.9-1build2
Priority: optional
Section: universe/video
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Sam Reed <sam@reedyboy.net>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 420 kB
Depends: libbsd0 (>= 0.6.0), libc6 (>= 2.38), libevent-2.1-7 (>= 2.1.8-stable), libevent-pthreads-2.1-7 (>= 2.1.8-stable), libjpeg8 (>= 8c)
Homepage: https://pikvm.org/
Download-Size: 118 kB
APT-Manual-Installed: yes
APT-Sources: http://ports.ubuntu.com/ubuntu-ports mantic/universe arm64 Packages
Description: Lightweight and fast MJPG-HTTP streamer
 µStreamer is a lightweight and very quick server to stream MJPG video
 from any V4L2 device to the network. All new browsers have native
 support of this video format, as well as most video players such as
 mplayer, VLC etc. µStreamer is a part of the Pi-KVM project designed to
 stream VGA and HDMI screencast hardware data with the highest resolution
 and FPS possible.

If any other logs would be useful, let me know, I can also test stuff if you would like me to do so :)
(dmesg and journal are both clean)

@mdevaev
Copy link
Member

mdevaev commented May 1, 2024

You're using a very old ustreamer release, please build it from git and test again.

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

3 participants