* how solid is vivi?
@ 2008-10-29 20:44 Carl Karsten
2008-10-31 17:58 ` capture.c memory leak Carl Karsten
0 siblings, 1 reply; 2+ messages in thread
From: Carl Karsten @ 2008-10-29 20:44 UTC (permalink / raw)
To: video4linux-list
I am trying to use vivi to test some v4l2 apps, but I am wondering how many of
the problems are really bugs in vivi that can be fixed so that the remaining
bugs are really bugs in the client app.
Here is the result of using it with some popular apps. If anyone knows any more
like this, please let me know - I am collecting tools to help with testing.
camorama just errors.
xawtv and tvtime both display the test patteren, but also log a bunch of stuff
to stderr. I am guessing they are trying to do things without checking to make
sure the driver supports it, but given that I can't find anything that works
witout some error, I have to wonder.
I am working with
http://code.google.com/p/python-video4linux2/
and getting segfaults. I am reporting them, but it would be nice to be a bit
more confident in knowing what we can rely on.
++ sudo modprobe vivi
++ dmesg
++ grep vivi
[ 1967.326840] vivi: V4L2 device registered as /dev/video0
++ camorama -d /dev/video0
gui error dialog: "Could not connect to the video device (/dev/video0) Please
check the connection."
++ xawtv -device /dev/video0
This is xawtv-3.95.dfsg.1, running on Linux/i686 (2.6.27-7-generic)
xinerama 0: 1024x768+0+0
/dev/video0 [v4l2]: no overlay support
v4l-conf had some trouble, trying to continue anyway
Warning: Cannot convert string "-*-ledfixed-medium-r-*--39-*-*-*-c-*-*-*" to
type FontStruct
++ tvtime --device /dev/video0
Running tvtime 1.0.2.
Reading configuration from /etc/tvtime/tvtime.xml
I/O warning : failed to load external entity "/home/juser/.tvtime/tvtime.xml"
I/O error : Permission denied
I/O error : Permission denied
Cannot change owner of /home/juser/.tvtime/tvtime.xml: Permission denied.
videoinput: Can't get tuner info: Invalid argument
videoinput: Can't get tuner info: Invalid argument
videoinput: Can't mute card. Post a bug report with your
videoinput: driver info to http://tvtime.net/
videoinput: Include this error: 'Invalid argument'
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
I/O error : Permission denied
videoinput: Can't mute card. Post a bug report with your
videoinput: driver info to http://tvtime.net/
videoinput: Include this error: 'Invalid argument'
I/O warning : failed to load external entity "/home/juser/.tvtime/stationlist.xml"
station: No station file found, creating a new one.
I/O error : Permission denied
I/O error : Permission denied
Thank you for using tvtime.
++ v4l-info /dev/video0
ioctl VIDIOCGTUNER: Invalid argument
ioctl VIDIOCGAUDIO: Invalid argument
ioctl VIDIOCGFBUF: Invalid argument
### v4l2 device info [/dev/video0] ###
general info
VIDIOC_QUERYCAP
driver : "vivi"
card : "vivi"
bus_info : ""
version : 0.5.0
capabilities : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]
standards
VIDIOC_ENUMSTD(0)
index : 0
id : 0xb000 [NTSC_M,NTSC_M_JP,?]
name : "NTSC"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(1)
index : 1
id : 0x1000 [NTSC_M]
name : "NTSC-M"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(2)
index : 2
id : 0x2000 [NTSC_M_JP]
name : "NTSC-M-JP"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(3)
index : 3
id : 0x8000 [?]
name : "NTSC-M-KR"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(4)
index : 4
id : 0x4000 [?]
name : "NTSC-443"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(5)
index : 5
id : 0x100 [PAL_M]
name : "PAL-M"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(6)
index : 6
id : 0x800 [PAL_60]
name : "PAL-60"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Camera"
type : CAMERA
audioset : 0
tuner : 0
std : 0xf900 [PAL_M,PAL_60,NTSC_M,NTSC_M_JP,?,?]
status : 0x0 []
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 0
description : "4:2:2, packed, YUYV"
pixelformat : 0x56595559 [YUYV]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 640
fmt.pix.height : 480
fmt.pix.pixelformat : 0x56595559 [YUYV]
fmt.pix.field : INTERLACED
fmt.pix.bytesperline : 1280
fmt.pix.sizeimage : 614400
fmt.pix.colorspace : unknown
fmt.pix.priv : 0
controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 255
step : 1
default_value : 16
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+3)
id : 9963779
type : INTEGER
name : "Hue"
minimum : -128
maximum : 127
step : 1
default_value : 0
flags : 0
### video4linux device info [/dev/video0] ###
general info
VIDIOCGCAP
name : "vivi"
type : 0x1 [CAPTURE]
channels : 1
audios : 0
maxwidth : 1024
maxheight : 768
minwidth : 48
minheight : 32
channels
VIDIOCGCHAN(0)
channel : 0
name : "Camera"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 1
tuner
audio
picture
VIDIOCGPICT
brightness : 32639
hue : 32896
colour : 32639
contrast : 4112
whiteness : 0
depth : 16
palette : YUYV
buffer
window
VIDIOCGWIN
x : 0
y : 0
width : 640
height : 480
chromakey : 0
flags : 0
Carl K
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 2+ messages in thread* capture.c memory leak 2008-10-29 20:44 how solid is vivi? Carl Karsten @ 2008-10-31 17:58 ` Carl Karsten 0 siblings, 0 replies; 2+ messages in thread From: Carl Karsten @ 2008-10-31 17:58 UTC (permalink / raw) To: video4linux-list Looks like there is a memory leak in the v4l2 example code: http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec/capture-example.html ==5166== malloc/free: 5 allocs, 0 frees, 2,457,632 bytes allocated. (see valgrind below) Should this be reported to http://bugzilla.kernel.org? There also seems to be a problem with the way it handles "application allocated buffers" which is when it eats memory. or maybe it's a problem with vivi: http://linuxtv.org/hg/v4l-dvb/file/50e4cdc46320/linux/drivers/media/video/vivi.c $ ./capture --userp -d /dev/video1 VIDIOC_QBUF error 22, Invalid argument I would think this error should kick in: init_userp (unsigned int buffer_size) req.count = 4; req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; req.memory = V4L2_MEMORY_USERPTR; if (-1 == xioctl (fd, VIDIOC_REQBUFS, &req)) { if (EINVAL == errno) { fprintf (stderr, "%s does not support " "user pointer i/o\n", dev_name); exit (EXIT_FAILURE); but instead it errors here: start_capturing (void) case IO_METHOD_USERPTR: if (-1 == xioctl (fd, VIDIOC_QBUF, &buf)) errno_exit ("VIDIOC_QBUF"); wget http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/v4l2spec/capture.c gcc capture.c -g -o capture juser@dhcp186:~/vga2usb/v4l.org/examples$ sudo modprobe vivi juser@dhcp186:~/vga2usb/v4l.org/examples$ dmesg | grep /dev/video1 [ 1015.491550] vivi: V4L2 device registered as /dev/video1 juser@dhcp186:~/vga2usb/v4l.org/examples$ valgrind -v --leak-check=full --show-reachable=yes ./capture --userp -d /dev/video1 ==5166== Memcheck, a memory error detector. ==5166== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==5166== Using LibVEX rev 1854, a library for dynamic binary translation. ==5166== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==5166== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework. ==5166== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==5166== --5166-- Command line --5166-- ./capture --5166-- --userp --5166-- -d --5166-- /dev/video1 --5166-- Startup, with flags: --5166-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp --5166-- -v --5166-- --leak-check=full --5166-- --show-reachable=yes --5166-- Contents of /proc/version: --5166-- Linux version 2.6.27-7-generic (buildd@palmer) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11) ) #1 SMP Thu Oct 30 04:18:38 UTC 2008 --5166-- Arch and hwcaps: X86, x86-sse1-sse2 --5166-- Page sizes: currently 4096, max supported 4096 --5166-- Valgrind library directory: /usr/lib/valgrind --5166-- Reading syms from /lib/ld-2.8.90.so (0x4000000) --5166-- Reading debug info from /lib/ld-2.8.90.so... --5166-- ... CRC mismatch (computed 371b8ee6 wanted cc0a418a) --5166-- Reading debug info from /usr/lib/debug/lib/ld-2.8.90.so... --5166-- Reading syms from /home/juser/vga2usb/v4l.org/examples/capture (0x8048000) --5166-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000) --5166-- object doesn't have a dynamic symbol table --5166-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp --5166-- Reading suppressions file: /usr/lib/valgrind/default.supp --5166-- REDIR: 0x40155d0 (index) redirected to 0x3802cf63 (vgPlain_x86_linux_REDIR_FOR_index) --5166-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x401F000) --5166-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4022000) ==5166== WARNING: new redirection conflicts with existing -- ignoring it --5166-- new: 0x040155d0 (index ) R-> 0x040261a0 index --5166-- REDIR: 0x40157c0 (strlen) redirected to 0x4026450 (strlen) --5166-- Reading syms from /usr/lib/debug/libc-2.8.90.so (0x402A000) --5166-- REDIR: 0x409d2f0 (rindex) redirected to 0x4026080 (rindex) --5166-- REDIR: 0x409cf00 (strlen) redirected to 0x4026430 (strlen) --5166-- REDIR: 0x409d110 (strncmp) redirected to 0x40266a0 (strncmp) --5166-- REDIR: 0x409c7e0 (index) redirected to 0x4026170 (index) --5166-- REDIR: 0x409df70 (memset) redirected to 0x4027340 (memset) --5166-- REDIR: 0x4099c50 (calloc) redirected to 0x4023d20 (calloc) --5166-- REDIR: 0x409a190 (memalign) redirected to 0x4023b80 (memalign) --5166-- REDIR: 0x409e490 (memcpy) redirected to 0x40268a0 (memcpy) --5166-- REDIR: 0x409e180 (stpcpy) redirected to 0x40270d0 (stpcpy) --5166-- REDIR: 0x409dfd0 (mempcpy) redirected to 0x4027470 (mempcpy) --5166-- REDIR: 0x409f010 (strchrnul) redirected to 0x4027410 (strchrnul) VIDIOC_QBUF error 22, Invalid argument --5166-- REDIR: 0x4097730 (free) redirected to 0x4024a90 (free) ==5166== ==5166== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 1) --5166-- --5166-- supp: 11 dl-hack3-cond-1 ==5166== malloc/free: in use at exit: 2,457,632 bytes in 5 blocks. ==5166== malloc/free: 5 allocs, 0 frees, 2,457,632 bytes allocated. ==5166== ==5166== searching for pointers to 5 not-freed blocks. ==5166== checked 51,772 bytes. ==5166== ==5166== 32 bytes in 1 blocks are still reachable in loss record 1 of 2 ==5166== at 0x4023DE2: calloc (vg_replace_malloc.c:397) ==5166== by 0x80494AF: init_userp (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== by 0x80498B0: init_device (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== by 0x8049B63: main (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== ==5166== ==5166== 2,457,600 bytes in 4 blocks are still reachable in loss record 2 of 2 ==5166== at 0x4023C4A: memalign (vg_replace_malloc.c:460) ==5166== by 0x8049536: init_userp (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== by 0x80498B0: init_device (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== by 0x8049B63: main (in /home/juser/vga2usb/v4l.org/examples/capture) ==5166== ==5166== LEAK SUMMARY: ==5166== definitely lost: 0 bytes in 0 blocks. ==5166== possibly lost: 0 bytes in 0 blocks. ==5166== still reachable: 2,457,632 bytes in 5 blocks. ==5166== suppressed: 0 bytes in 0 blocks. --5166-- memcheck: sanity checks: 0 cheap, 1 expensive --5166-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --5166-- memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10 --5166-- memcheck: auxmaps_L2: 0 searches, 0 nodes --5166-- memcheck: SMs: n_issued = 10 (160k, 0M) --5166-- memcheck: SMs: n_deissued = 0 (0k, 0M) --5166-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M) --5166-- memcheck: SMs: max_undefined = 34 (544k, 0M) --5166-- memcheck: SMs: max_defined = 20 (320k, 0M) --5166-- memcheck: SMs: max_non_DSM = 10 (160k, 0M) --5166-- memcheck: max sec V bit nodes: 0 (0k, 0M) --5166-- memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0) --5166-- memcheck: max shadow mem size: 464k, 0M --5166-- translate: fast SP updates identified: 1,933 ( 89.4%) --5166-- translate: generic_known SP updates identified: 128 ( 5.9%) --5166-- translate: generic_unknown SP updates identified: 100 ( 4.6%) --5166-- tt/tc: 4,312 tt lookups requiring 4,351 probes --5166-- tt/tc: 4,312 fast-cache updates, 3 flushes --5166-- transtab: new 2,035 (43,121 -> 617,673; ratio 143:10) [0 scs] --5166-- transtab: dumped 0 (0 -> ??) --5166-- transtab: discarded 8 (200 -> ??) --5166-- scheduler: 25,512 jumps (bb entries). --5166-- scheduler: 0/2,355 major/minor sched events. --5166-- sanity: 1 cheap, 1 expensive checks. --5166-- exectx: 769 lists, 8 contexts (avg 0 per list) --5166-- exectx: 16 searches, 8 full compares (500 per 1000) --5166-- exectx: 4 cmp2, 26 cmp4, 0 cmpAll --5166-- errormgr: 8 supplist searches, 271 comparisons during search --5166-- errormgr: 11 errlist searches, 26 comparisons during search Carl K -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-31 17:59 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-10-29 20:44 how solid is vivi? Carl Karsten 2008-10-31 17:58 ` capture.c memory leak Carl Karsten
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox