El mar, 17-05-2005 a las 19:29 +0200, Christophe GRENIER escribi=C3=B3:
> Netcam in Motion 3.2.1 snap 17 is still bogus =3D:-(
> When running with 3 netcams, there are 7 threads/processus, main and 2=20
> threads per netcam (1+3*2=3D7). When hitting Ctrl-C, most of the times
> motion doesn't stop.
The number of threads is correct ( if motion is running without http
control interface and webcam ). Netcam uses 2 threads for each network
camera as many times Kenneth , Kit and me explained .
> Processing thread 0 - config file motion.conf
> Processing thread 1 - config file /home/motion/motion-3.2.1/thread1.conf
> Processing thread 2 - config file /home/motion/motion-3.2.1/thread2.conf
> Processing thread 3 - config file /home/motion/motion-3.2.1/thread3.conf
> Thread 1 started
> Thread 2 started
> Thread 3 started
> Corrupt JPEG data: premature end of data segment
>  File of type 8 saved to: /home/motion/public_html/20050517/2005051718=
> [msmpeg4v2 @ 0xbad130]warning, cliping 1 dct coefficents to -127..127
> Thread 2 exiting
> Thread 1 exiting
> Motion is still running.
It seems a race condiction in netcam code after an error happened
decoding the jpeg image , JWRN_HIT_MARKER error. ( it shouldn't
happen ). :-/ The warning i guess is from ffmpeg , btw i never saw it .
> ls -l /proc/`/sbin/pidof motion`/task
> total 0
> dr-xr-xr-x 3 motion motion 0 May 17 18:57 10182
> dr-xr-xr-x 3 motion motion 0 May 17 18:57 10185
> strace -p 10185
> Process 10185 attached - interrupt to quit
> futex(0x90cc01c, FUTEX_WAIT, 2, NULL <unfinished ...>
Thanks Good information , so seems that the 3th netcam thread didn't
exit due a block in a thread lock .
> Any idea of the problem ?
> Is motion using 2 threads per netcam to be able to restart
> the capture ?
I don't think , because still there's not a implementation to "talk"
with the thread created by the main netcam thread.
> BTW I think threads_running variable must be protected by a lock.
Yes maybe , but i don't think that is a problem here because the 3th
thread never decrement this variable in netcam_loop().
ack ( at ) telefonica ( dot ) net
Key fingerprint =3D 3FD3 9C90 149E 7824 CECD 6BCF AC2C CA61 6EF1 B90D
"No basta saber, hay que aplicar lo que se sabe;=20
no basta querer hacerlas cosas, hay que hacerlas".
"Knowing is not enough; we must apply.=20
Willing is not enough; we must do"
Johann Wolfgang von Goethe