Motion - Bug Report 2009x 06x 17x 090603
You are here: Foswiki>Motion Web>BugReports>BugReport2009x06x17x090603 (17 Apr 2010, AngelCarpintero)Edit Attach

BUG: SEGV on reload or quit for vloopback (maybe other v4l1 devices too)

I configured two threads. The first pipes throu vloopback to thread two.

On quit or restart i got a segv:

[1] vid_v4lx_start: Using V4L2

[1] image_ring_resize: Resizing pre_capture buffer to 1 items

[2] vid_v4lx_start: Failed to open video device /dev/video2: Invalid argument

[2] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s)

[2] image_ring_resize: Resizing pre_capture buffer to 1 items

[2] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8082

[2] http_bindsock: motion-stream Bound : IPV4 addr: 127.0.0.1 port: 8082

[2] motion_init: Started motion-stream server in port 8082

[2] motion_loop: Retrying until successful connection with camera

[2] vid_v4lx_start: Failed to open video device /dev/video2: Invalid argument

[1] motion_init: Opening video loopback device for normal pictures

[1] v4l_startpipe: Opened /dev/video1 as input

[1] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8081

[1] http_bindsock: motion-stream Bound : IPV4 addr: 127.0.0.1 port: 8081

[1] motion_init: Started motion-stream server in port 8081 [2] motion_loop: Retrying until successful connection with camera

[2] v4l2_get_capability: Not a V4L2 device?

[2] v4l_start: Using VIDEO_PALETTE_YUV420P palette [2] vid_v4lx_start: Using V4L1

CTRL-C

[1] motion_loop: Thread exiting

[1] stream_stop: Closing motion-stream listen socket & active motion-stream sockets

[2] motion_loop: Thread exiting

[2] stream_stop: Closing motion-stream listen socket & active motion-stream sockets

[2] stream_stop: Closed motion-stream listen socket & active motion-stream sockets

[2] motion_cleanup: Calling vid_close() from motion_cleanup

[2] vid_close: Closing video device /dev/video2

Segmentation fault

For v4l1 devices motion does only one mmap so why do two munmaps?

Environment

Motion version: 3.2.11
ffmpeg version:  
Shared libraries: ffmpeg, mysql, postgresql
Server OS:  

-- PeterHolik - 17 Jun 2009

Follow up

Fix record

Index: video_common.c
===================================================================
--- video_common.c (Revision 444)
+++ video_common.c (Arbeitskopie)
@@ -570,8 +570,7 @@
} else {
#endif
close(dev->fd);
- munmap(viddevs->v4l_buffers[0], viddevs->size_map);
- munmap(viddevs->v4l_buffers[1], viddevs->size_map);
+ munmap(dev->v4l_buffers[0], dev->size_map);
#ifdef MOTION_V4L2
}
#endif


Thanks Peter ... you are right that was a unhandled bug as i think no many people uses a v4l1 device.

Going to add a formal patch to release notes of 3.2.11.

-- AngelCarpintero - 12 Jul 2009


Dear Angel,

I am a new user to motion/ vloopback and having problems with vloopback.

Motion works just fine on 2.6.31 with v4l2 (Hardware: Logilink VG0001 with Easycap Driver).

I install vloopback with: modprobe vloopback dev_offset=1

and I get /dev/video0 which still works normal with motion and video1 and video2.

When I want to start another instance with motion accessing video1 or 2 I get:

video1: Not a V4L2 device?

video2: Failed to open video device /dev/video2: Invalid argument

Isn't Vloopback a virtual V4L2 device? If not, how come you write "i think no many people uses a v4l1 device". So anybody using Vloopback is using a V4L1 device?!

Is there a solution to this mentioned problem?

Many thanks from Ruben!


Please open a new bug or support request instead.

-- AngelCarpintero - 17 Apr 2010

BugReportForm edit

TopicTitle SEGV on reload or quit for vloopback (maybe other v4l1 devices too)
BugStatus Released
AssignedBugTo AngelCarpintero
SubmittedBy WikiGuest
Topic revision: r5 - 17 Apr 2010, AngelCarpintero
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.