i set a breakpoint on set_input function and i see:


Hardware access (read/write) watchpoint 1: set_input

Value = {int (struct video_dev *, short unsigned int)} 0x80529e0 <set_input>

Breakpoint 2, set_input (viddev=0x298a60f0, input=65535) at video_freebsd.c:377
377         if (input >= array_elem(portdata)) {
(gdb)

cheers,
Karolis

On Wed, Feb 29, 2012 at 1:35 PM, Karolis Eigelis <karolis.eigelis@gmail.com> wrote:
some more info:

[ekar@tree ~/3.2/install/bin]$ ./motion -n -c ../etc/motion-dist.conf -d 9
[0] Processing thread 0 - config file ../etc/motion-dist.conf
[0] Unknown config option "sql_log_image"
[0] Unknown config option "sql_log_snapshot"
[0] Unknown config option "sql_log_mpeg"
[0] Unknown config option "sql_log_timelapse"
[0] Unknown config option "sql_query"

[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3439360 LIBAVFORMAT_BUILD 3436288
[0] Thread 1 is from ../etc/motion-dist.conf
[1] Thread 1 started
[1] vid_start: [/dev/video0]
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] set_input: Channel Port 65535 out of range (0-4)
[1] v4l_start: set input [65535]
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] vid_return_code 1

[1] Retrying until successful connection with camera
[1] vid_start: [/dev/video0]
[1] set_input: Channel Port 65535 out of range (0-4)
[1] v4l_start: set input [65535]
[1] vid_return_code 1
[0] DEBUG-2 threads_running 1 motion_threads_running 1 , finish 0
[1] vid_return_code 1
[1] vid_return_code 1
[0] DEBUG-2 threads_running 1 motion_threads_running 1 , finish 0
[1] vid_return_code 1
[1] vid_return_code 1

^C[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[0] DEBUG-2 threads_running 1 motion_threads_running 1 , finish 1
[1] vid_return_code 1
[1] Thread exiting
[0] DEBUG-1 threads_running 0 motion_threads_running 0 , finish 1
[0] Motion terminating

[ekar@tree ~/3.2/install/bin]$ gdb ./motion --pid=3516
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Attaching to program: /usr/home/ekar/3.2/install/bin/motion, process 3516
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libjpeg.so.11...done.
Loaded symbols for /usr/local/lib/libjpeg.so.11
Reading symbols from /usr/local/lib/libavformat.so.1...done.
Loaded symbols for /usr/local/lib/libavformat.so.1
Reading symbols from /usr/local/lib/libavcodec.so.1...done.
Loaded symbols for /usr/local/lib/libavcodec.so.1
Reading symbols from /usr/local/lib/libavutil.so.1...done.
Loaded symbols for /usr/local/lib/libavutil.so.1
Reading symbols from /lib/libz.so.6...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /lib/libthr.so.3...done.
[New Thread 29804c00 (LWP 100611/motion)]
[New Thread 29804900 (LWP 100610/motion)]
[New Thread 29804300 (LWP 100517/motion)]
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/lib/libbz2.so.4...done.
Loaded symbols for /usr/lib/libbz2.so.4
Reading symbols from /usr/local/lib/libxvidcore.so.4...done.
Loaded symbols for /usr/local/lib/libxvidcore.so.4
Reading symbols from /usr/local/lib/libx264.so.119...done.
Loaded symbols for /usr/local/lib/libx264.so.119
Reading symbols from /usr/local/lib/libvpx.so.1...done.
Loaded symbols for /usr/local/lib/libvpx.so.1
Reading symbols from /usr/local/lib/libvorbisenc.so.2...done.
Loaded symbols for /usr/local/lib/libvorbisenc.so.2
Reading symbols from /usr/local/lib/libvorbis.so.4...done.
Loaded symbols for /usr/local/lib/libvorbis.so.4
Reading symbols from /usr/local/lib/libtheoraenc.so.1...done.
Loaded symbols for /usr/local/lib/libtheoraenc.so.1
Reading symbols from /usr/local/lib/libtheoradec.so.1...done.
Loaded symbols for /usr/local/lib/libtheoradec.so.1
Reading symbols from /usr/local/lib/libschroedinger-1.0.so.11...done.
Loaded symbols for /usr/local/lib/libschroedinger-1.0.so.11
Reading symbols from /usr/local/lib/libogg.so.7...done.
Loaded symbols for /usr/local/lib/libogg.so.7
Reading symbols from /usr/local/lib/liborc-0.4.so.0...done.
Loaded symbols for /usr/local/lib/liborc-0.4.so.0
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
[Switching to Thread 29804c00 (LWP 100611/motion)]
0x28deec83 in select () from /lib/libc.so.7
(gdb) bt full
#0  0x28deec83 in select () from /lib/libc.so.7
No symbol table info available.
#1  0x28ce4e30 in select () from /lib/libthr.so.3
No symbol table info available.
#2  0x080639a0 in httpd_run (cnt=0x2980f050) at webhttpd.c:2249
        sd = 3
        client_socket_fd = 0
        val = 1
        client_sent_quit_message = 1
        servAddr = {sin_len = 0 '\0', sin_family = 2 '\002', sin_port = 36895, sin_addr = {s_addr = 16777343}, sin_zero = "\000\000\000\000\000\000\000"}
        act = {__sigaction_u = {__sa_handler = 0x1, __sa_sigaction = 0x1}, sa_flags = 0, sa_mask = {__bits = {0, 0, 0, 0}}}
        authentication = 0x0
#3  0x08064091 in motion_web_control (arg=0x2980f050) at webhttpd.c:2365
No locals.
#4  0x28ce24ba in pthread_getprio () from /lib/libthr.so.3
No symbol table info available.
#5  0x00000000 in ?? ()
No symbol table info available.
(gdb) frame 1
#1  0x28ce4e30 in select () from /lib/libthr.so.3
(gdb) l
2365        httpd_run(cnt);
2366        motion_log(LOG_DEBUG, 0, "httpd thread exit");
2367        pthread_exit(NULL);
2368    }
(gdb) frame 2
#2  0x080639a0 in httpd_run (cnt=0x2980f050) at webhttpd.c:2249
2249        if (select (serverfd + 1, &fds, NULL, NULL, &tm) > 0) {
(gdb) l
2244        tm.tv_sec = timeout; /* Timeout in seconds */
2245        tm.tv_usec = 0;
2246        FD_ZERO(&fds);
2247        FD_SET(serverfd,&fds);
2248
2249        if (select (serverfd + 1, &fds, NULL, NULL, &tm) > 0) {
2250            if (FD_ISSET(serverfd, &fds)) {
2251                if ((curfd = accept(serverfd, (struct sockaddr*)&client, &namelen)) > 0)
2252                    return curfd;
2253            }
(gdb)


Thanks,
Karolis





On Wed, Feb 29, 2012 at 1:13 PM, Karolis Eigelis <karolis.eigelis@gmail.com> wrote:
yes, it is working with pwcview and any other video viewers on FreeBSD.

/dev/video0 is created by default by webcamd.

K


On Wed, Feb 29, 2012 at 1:07 PM, Fritiof Hedman <fritiof@hedman.eu> wrote:
Hi Karolis,

# Videodevice to be used for capturing  (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0

Are you really sure that /dev/video0 is your video-device?


/Fritiof


On 29 February 2012 13:04, Karolis Eigelis <karolis.eigelis@gmail.com> wrote:
> Hi Fritiof,
>
> my motion.conf is a default one from here -
> http://www.lavrsen.dk/svn/motion/branches/3.2/motion-dist.conf.in
>
> Thanks,
> Karolis
>
>
> On Wed, Feb 29, 2012 at 12:57 PM, Fritiof Hedman <fritiof@hedman.eu> wrote:
>>
>> Hi Karolis,
>>
>> Please make a copy of your motion.conf and paste into a mail to this
>> list, and we'll try to help you!
>>
>> Cheers,
>> Fritiof
>>
>>
>> On 29 February 2012 12:53, Karolis Eigelis <karolis.eigelis@gmail.com>
>> wrote:
>> > Thanks Sebastian,
>> >
>> > do you know any manual on how to enable debugging in Motion and use gdb
>> > for
>> > having a meaningful output to track that part with "out of range" ?
>> >
>> > motion -d does not help a lot.
>> >
>> > Thanks,
>> > Karolis
>> >
>> >
>> > On Wed, Feb 29, 2012 at 11:37 AM, Sebastian Arcus <shop@open-t.co.uk>
>> > wrote:
>> >>
>> >> Hi Karolis,
>> >>
>> >> I'm afraid I am not familiar with FreeBSD. I was only guessing based on
>> >> the log output. Hopefully somebody with more knowledge on FreeBSD will
>> >> be along soon and offer some hints.
>> >>
>> >> Sebastian
>> >>
>> >> On 29/02/12 09:56, Karolis Eigelis wrote:
>> >> > anyway i see from the svn 3.2 source, is it possible to do something
>> >> > about that ?
>> >> >
>> >> > [ekar@tree ~/svn/motion]$ grep -iR "out of range" ./*
>> >> >
>> >> >
>> >> > ./3.2/.svn/pristine/be/beab99f2e3f1b6a4613e994552fa3c43d2542fd1.svn-base:
>> >> > // 1000 is out of range for pwc
>> >> >
>> >> >
>> >> > ./3.2/.svn/pristine/be/beab99f2e3f1b6a4613e994552fa3c43d2542fd1.svn-base:
>> >> > // 1000 is out of range for pwc
>> >> >
>> >> >
>> >> > ./3.2/.svn/pristine/9f/9f2ce3b36c981d4970ee2b7243f1035b75621833.svn-base:
>> >> > motion_log(LOG_INFO, 0, "%s: Channel Port %d out of range (0-4)",
>> >> > __FUNCTION__, input);
>> >> >
>> >> >
>> >> > ./3.2/.svn/pristine/9f/9f2ce3b36c981d4970ee2b7243f1035b75621833.svn-base:
>> >> > motion_log(LOG_WARNING, 0, "%s: Input format %d out of range (0-2)",
>> >> > __FUNCTION__, newformat);
>> >> > ./3.2/video_freebsd.c:        motion_log(LOG_INFO, 0, "%s: Channel
>> >> > Port
>> >> > %d out of range (0-4)", __FUNCTION__, input);
>> >> > ./3.2/video_freebsd.c:        motion_log(LOG_WARNING, 0, "%s: Input
>> >> > format %d out of range (0-2)", __FUNCTION__, newformat);
>> >> > ./3.2/webhttpd.c:                    // 1000 is out of range for pwc
>> >> > ./3.2/webhttpd.c:                    // 1000 is out of range for pwc
>> >> >
>> >> > Thanks,
>> >> > Karolis
>> >> >
>> >> > On Wed, Feb 29, 2012 at 9:57 AM, Karolis Eigelis
>> >> > <karolis.eigelis@gmail.com <mailto:karolis.eigelis@gmail.com>> wrote:
>> >> >
>> >> >     Hi Sebastian,
>> >> >
>> >> >     i use a default motion.conf
>> >> >
>> >> >     Karolis
>> >> >
>> >> >
>> >> >     On Tue, Feb 28, 2012 at 11:58 PM, Sebastian Arcus
>> >> > <shop@open-t.co.uk
>> >> >     <mailto:shop@open-t.co.uk>> wrote:
>> >> >
>> >> >         On 28/02/12 22:41, Karolis Eigelis wrote:
>> >> >          > [1] set_input: Channel Port 65535 out of range (0-4)
>> >> >
>> >> >         The above is an interesting snippet in the log you posted. Is
>> >> > this a
>> >> >         misconfiguration in motion.conf, or is the problem coming
>> >> > from
>> >> >         somewhere
>> >> >         else?
>> >> >
>> >> >         Sebastian
>> >> >
>> >> >
>> >> >         --
>> >> >         Linux vehicle CCTV - www.open-t.co.uk/iroko
>> >> >         <http://www.open-t.co.uk/iroko>
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------------------------------------------------
>> >> >         Keep Your Developer Skills Current with LearnDevNow!
>> >> >         The most comprehensive online learning library for Microsoft
>> >> >         developers
>> >> >         is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5,
>> >> >         CSS3, MVC3,
>> >> >         Metro Style Apps, more. Free future releases when you
>> >> > subscribe
>> >> > now!
>> >> >         http://p.sf.net/sfu/learndevnow-d2d
>> >> >         _______________________________________________
>> >> >         Motion-user mailing list
>> >> >         Motion-user@lists.sourceforge.net
>> >> >         <mailto:Motion-user@lists.sourceforge.net>
>> >> >         https://lists.sourceforge.net/lists/listinfo/motion-user
>> >> >         http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ------------------------------------------------------------------------------
>> >> > Virtualization&  Cloud Management Using Capacity Planning
>> >> > Cloud computing makes use of virtualization - but cloud computing
>> >> > also focuses on allowing computing to be delivered as a service.
>> >> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > Motion-user mailing list
>> >> > Motion-user@lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/motion-user
>> >> > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>> >>
>> >>
>> >> --
>> >> Linux vehicle CCTV - www.open-t.co.uk/iroko
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Virtualization & Cloud Management Using Capacity Planning
>> >> Cloud computing makes use of virtualization - but cloud computing
>> >> also focuses on allowing computing to be delivered as a service.
>> >> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> >> _______________________________________________
>> >> Motion-user mailing list
>> >> Motion-user@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/motion-user
>> >> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Virtualization & Cloud Management Using Capacity Planning
>> > Cloud computing makes use of virtualization - but cloud computing
>> > also focuses on allowing computing to be delivered as a service.
>> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> > _______________________________________________
>> > Motion-user mailing list
>> > Motion-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/motion-user
>> > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>> >
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization & Cloud Management Using Capacity Planning
>> Cloud computing makes use of virtualization - but cloud computing
>> also focuses on allowing computing to be delivered as a service.
>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> _______________________________________________
>> Motion-user mailing list
>> Motion-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/motion-user
>> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>
>