diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index 0649aed..6efeb0a 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -254,6 +254,9 @@ if (verbosity) fprintf(stderr,"pid %d is going to grab %d picz...\n", getpid(), nbre_capt); #endif +/* + * START ON THE GRABBING LOOP + */ for (i = 0; i < nbre_capt; i++) { do { FD_ZERO(&fds); @@ -268,7 +271,8 @@ for (i = 0; i < nbre_capt; i++) { if (r == -1) { perror("select"); - return errno; + return errno; /* WTF ? a rogue return + from the main() ? */ } if(verbosity > 1) { diff --git a/v4l2/notes.txt b/v4l2/notes.txt index 71291fa..2cee059 100644 --- a/v4l2/notes.txt +++ b/v4l2/notes.txt @@ -1,17 +1,25 @@ -Heisenbug dans la capture d'image. +Heisenbug dans la capture d'image +================================= +Contexte : Debian 10 32 bits sur Sony Vaio, + webcam Logitech classique. + +Mon soft 'grabvidseq' part _parfois_ en torche oo, à la louche une +fois sur cent. Mais toujours au même endroit, au début de la boucle +de capture des images, précisément dans cet appel système : CLEAR(buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; xioctl(fd, VIDIOC_DQBUF, &buf); +Quand le programme semble figé, un strace -p sort le même +message en rafale _très_ féroce : ioctl(3, VIDIOC_DQBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EAGAIN (Resource temporarily unavailable) ioctl(3, VIDIOC_DQBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EAGAIN (Resource temporarily unavailable) ioctl(3, VIDIOC_DQBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE^Cstrace: Process 11181 detached - - +WTF ?