Problems starting motion
Question
I installed motion motion_3.2.8-0.ubuntu.feisty_i386.deb and tried to start it then, it says (among other things) ioctl(VIDIOCGMBUF) - Error device does not support memory map and terminates. My card is working with VLC media player, using channel 2 in pvr settings. what am I missing?
[ 0.000000] Linux version 2.6.20-16-generic (root@terranova) (gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)) #2 SMP Thu Jun 7 20:19:32 UTC 2007 (Ubuntu 2.6.20-16.29-generic)
[ 31.420000] ivtv: ==================== START INIT IVTV ====================
[ 31.420000] ivtv: version 0.10.1 (tagged release) loading
[ 31.420000] ivtv: Linux version: 2.6.20-16-generic SMP mod_unload 586
[ 31.420000] ivtv: In case of problems please include the debug info between
[ 31.420000] ivtv: the START INIT IVTV and END INIT IVTV lines, along with
[ 31.420000] ivtv: any module options, when mailing the ivtv-users mailinglist.
[ 31.420000] ivtv0: Autodetected Hauppauge card (cx23416 based)
[ 31.420000] ACPI: PCI Interrupt 0000:00:14.0[A] -> GSI 17 (level, low) -> IRQ 19
[ 31.420000] ivtv0: Unreasonably low latency timer, setting to 64 (was 32)
[ 32.836000] input: PC Speaker as /class/input/input3
[ 33.776000] ivtv0: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
[ 33.992000] ivtv0: Encoder revision: 0x02050032
[ 33.992000] ivtv0: Recommended firmware version is 0x02060039.
[ 34.084000] tveeprom 0-0050: Hauppauge model 26559, rev F189, serial# 9913033
[ 34.084000] tveeprom 0-0050: tuner model is TCL MFPE05 2 (idx 89, type 38)
[ 34.084000] tveeprom 0-0050: TV standards PAL(B/G) PAL(I) SECAM(L/L') PAL(D/D1/K) (eeprom 0x74)
[ 34.084000] tveeprom 0-0050: audio processor is CX25843 (idx 37)
[ 34.084000] tveeprom 0-0050: decoder processor is CX25843 (idx 30)
[ 34.084000] tveeprom 0-0050: has radio, has no IR receiver, has no IR transmitter
[ 34.084000] ivtv0: Autodetected Hauppauge WinTV PVR-150
[ 34.132000] tuner 0-0043: chip found @ 0x86 (ivtv i2c driver #0)
[ 34.132000] tda9887 0-0043: tda988[5/6/7] found @ 0x43 (tuner)
[ 34.136000] tuner 0-0061: chip found @ 0xc2 (ivtv i2c driver #0)
[ 34.216000] cx25840 0-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #0)
[ 39.344000] cx25840 0-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
[ 39.496000] wm8775 0-001b: chip found @ 0x36 (ivtv i2c driver #0)
[ 39.568000] ivtv0: Registered device video0 for encoder MPEG (4 MB)
[ 39.572000] ivtv0: Registered device video32 for encoder YUV (2 MB)
[ 39.572000] ivtv0: Registered device vbi0 for encoder VBI (1 MB)
[ 39.572000] ivtv0: Registered device video24 for encoder PCM audio (1 MB)
[ 39.572000] ivtv0: Registered device radio0 for encoder radio
[ 39.572000] tuner 0-0061: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
[ 39.976000] ivtv0: Initialized Hauppauge WinTV PVR-150, card #0
[ 39.976000] ivtv: ==================== END INIT IVTV ====================
:~$ motion -n
[0] Processing thread 0 - config file /etc/motion/motion.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] Thread 1 is from /etc/motion/motion.conf
[1] Thread started
[1] cap.driver: "ivtv"
[1] cap.card: "Hauppauge WinTV PVR-150"
[1] cap.bus_info: "0000:00:14.0"
[1] cap.capabilities=0x01070051
[1] - VIDEO_CAPTURE
[1] - VBI_CAPTURE
[1] - TUNER
[1] - AUDIO
[1] - READWRITE
[1] v4l2_select_input: name = "Composite 1", type 0x00000002, status 00000000
[1] - CAMERA
[1] - video standard PAL-BGH
[1] - video standard PAL-DK
[1] - video standard PAL-I
[1] Supported palettes:
[1] 0: HM12 (HM12 (YUV 4:1:1))
[1] 1: MPEG (MPEG)
[1] Unable to find a compatible palette format.
[1] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[1] V4L capturing using read is deprecated!
[1] Motion only supports mmap.
[1] Capture error calling vid_start
[1] Thread finishing...
motion.conf:
###########################################################
# Capture device options
############################################################
# Videodevice to be used for capturing (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0
# Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
# This is ONLY used for FreeBSD. Leave it commented out for Linux
; tunerdevice /dev/tuner0
# The video input to be used (default: 8)
# Should normally be set to 1 for video/TV cards, and 8 for USB cameras
input 2
# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 0
# The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
frequency 0
Environment
Motion version: |
3.2.8 |
ffmpeg version: |
|
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
|
--
GBGAndersSvensson - 29 Jul 2007
Answer
Take a look to this topic :
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionWinTVPVRCardSupport
--
AngelCarpintero - 01 Aug 2007
Follow-up
The support request
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionWinTVPVRCardSupport provides patches for 3.2.3 and 3.2.4 versions of motion. These are not valid for 3.2.8 version. Do you know if there is an equivalent patch available for the latest motion (3.2.8)?
--
JasjeetSingh - 08 Aug 2007
I've made a patch agains svn trunk , but not sure how it will work .
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionWinTVPVRCardSupport
--
AngelCarpintero - 09 Aug 2007
Thanks for your quick response.
I have applied the new patch on 3.2.8 source and recompiled motion. However I still get the same error:
[1] Thread started
[1] cap.driver: "ivtv"
[1] cap.card: "Hauppauge WinTV PVR-150"
[1] cap.bus_info: "0000:04:04.0"
[1] cap.capabilities=0x01070051
[1] - VIDEO_CAPTURE
[1] - VBI_CAPTURE
[1] - TUNER
[1] - AUDIO
[1] - READWRITE
[1] v4l2_select_input: name = "Composite 1", type 0x00000002, status 00000000
[1] - CAMERA
[0] motion-httpd/3.2.8 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] - video standard NTSC-M
[1] - video standard NTSC-J
[1] - video standard NTSC-K
[1] Supported palettes:
[1] 0: HM12 (HM12 (YUV 4:1:1))
[1] 1: MPEG (MPEG)
[1] Unable to find a compatible palette format.
[1] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[1] V4L capturing using read is deprecated!
[1] Motion only supports mmap.
[1] Capture error calling vid_start
[1] Thread finishing...
I think the patch got applied correctly, but can you please still reconfirm. Here is the terminal output while applying the patch. BTW, I had to manually enter each file name to patch (as shown in the terminal output below):
patch -p1 < wintv-motion-svn-202.patch.txt
missing header for unified diff at line 6 of patch
can't find file to patch at input line 6
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|Index: conf.c
|===================================================================
|--- conf.c (revisión: 203)
|+++ conf.c (copia de trabajo)
--------------------------
File to patch: conf.c
patching file conf.c
missing header for unified diff at line 53 of patch
can't find file to patch at input line 53
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: conf.h
|===================================================================
|--- conf.h (revisión: 203)
|+++ conf.h (copia de trabajo)
--------------------------
File to patch: conf.h
patching file conf.h
missing header for unified diff at line 73 of patch
can't find file to patch at input line 73
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: motion.c
|===================================================================
|--- motion.c (revisión: 203)
|+++ motion.c (copia de trabajo)
--------------------------
File to patch: motion.c
patching file motion.c
missing header for unified diff at line 87 of patch
can't find file to patch at input line 87
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: video.h
|===================================================================
|--- video.h (revisión: 203)
|+++ video.h (copia de trabajo)
--------------------------
File to patch: video.h
patching file video.h
missing header for unified diff at line 125 of patch
can't find file to patch at input line 125
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: video_common.c
|===================================================================
|--- video_common.c (revisión: 203)
|+++ video_common.c (copia de trabajo)
--------------------------
File to patch: video_common.c
patching file video_common.c
Hunk #1 succeeded at 545 (offset -45 lines).
Hunk #2 succeeded at 740 (offset -45 lines).
Hunk #3 succeeded at 925 (offset -45 lines).
Hunk #4 succeeded at 1054 (offset -45 lines).
Hunk #5 succeeded at 1064 (offset -45 lines).
missing header for unified diff at line 484 of patch
can't find file to patch at input line 484
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: motion-dist.conf
|===================================================================
|--- motion-dist.conf (revisión: 203)
|+++ motion-dist.conf (copia de trabajo)
--------------------------
File to patch: motion-dist.conf
patching file motion-dist.conf
Thanks,
Jasjeet
Here it's the whole process :
mkdir motion-svn
cd motion-svn
svn co -r202 http://www.lavrsen.dk/svn/motion/trunk .
wget 'http://www.lavrsen.dk/twiki/bin/viewfile/Motion/MotionWinTVPVRCardSupport?rev=1;filename=wintv-motion-svn-202.patch' -O wintv-motion-svn-202.patch
patch <wintv-motion-svn-202.patch
./configure ; make
--
AngelCarpintero - 09 Aug 2007
I did the above steps, patch applied correctly but "make" fails with the following error:
------------------------------------
Version: 3.2.9
Platform: Linux (if this is incorrect, please read README.FreeBSD)
Generating dependencies, please wait...
Compiling Motion object files...
--------------------------------------------------------------------------------
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o motion.o motion.c
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o conf.o conf.c
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o draw.o draw.c
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o video.o video.c
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o video2.o video2.c
video2.c:51:17: warning: #warning **************************************************
video2.c:52:4: warning: #warning Using experimental V4L2 support
video2.c:53:17: warning: #warning **************************************************
video2.c:390: warning: #v4l2_set_fps# defined but not used
gcc -g -O2 -DHAVE_FFMPEG -I/usr/local/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=i686 -Wall -DVERSION=\"3.2.9\" -D_REENTRANT -Dsysconfdir=\"/usr/local/etc\" -c -o video_common.o video_common.c
video_common.c: In function #ffmpeg_next#:
video_common.c:717: error: duplicate case value
video_common.c:702: error: previously used here
video_common.c:752: warning: #img_convert# is deprecated (declared at /usr/local/include/ffmpeg/avcodec.h:2398)
video_common.c: In function #vid_next#:
video_common.c:1128: warning: assignment makes pointer from integer without a cast
make: *** [video_common.o] Error 1
------------------------------------
--
JasjeetSingh - 10 Aug 2007
The problem seems to be the version of ffmpeg you are using , because i cannot reproduce your problem with ffmpeg in Ubuntu either debian.
So please use a motion certified ffmpeg version.
--
AngelCarpintero - 12 Aug 2007
I was getting problems while installing 0.4.8 version of ffmpeg as it required an older version of gcc, so I tried to understand why this compile error was coming.
------------------------------------
video_common.c: In function #ffmpeg_next#:
video_common.c:717: error: duplicate case value
video_common.c:702: error: previously used here
------------------------------------
Lines 717 and 702 of video_common (after applying the patch) are:
------------------------------------
line 702: case AVERROR_UNKNOWN:
line 717: case AVERROR_INVALIDDATA:
------------------------------------
In avcodec.h found in latest version of ffmpeg, AVERROR_UNKNOWN and AVERROR_INVALIDDATA have same value. As a result gcc complains for duplicate case statement. So I commented out the case statement at line 717 in video_common.c (motion_3.2.9 + patch) and motion compiles and installs without error.
However, still I get the same error if I run motion with PVR-150 as video source. That is
------------------------------------
[1] Supported palettes:
[1] 0: HM12 (HM12 (YUV 4:1:1))
[1] 1: MPEG (MPEG)
[1] Unable to find a compatible palette format.
[1] ioctl(VIDIOCGMBUF) - Error device does not support memory map
[1] V4L capturing using read is deprecated!
[1] Motion only supports mmap.
[1] Capture error calling vid_start
[1] Thread finishing...
------------------------------------
--
JasjeetSingh - 13 Aug 2007
I had missed declaring the "ffmpeg_device on" in the motion.conf. Also declared "discard_frames 2". Both are requried by the patch as indicated in
http://www.lavrsen.dk/twiki/bin/view/Motion/MotionWinTVPVRCardSupport
After this the error goes away and motion works fine.
Thanks for your help.
--
JasjeetSingh - 14 Aug 2007