it installed wonderfully on my eeepc901 and pd says gem 0.92.1 from
oct 30, but:
when trying out pix_video it starts with video driver 0: video4linux v4l
now, when i send a message "driver v4l2" console gives: could not find
a backend for driver "v4l2"
the webcam is otherwise working fine (tested with cheese)
anyone got an idea? thanks h www.hans-w-koch.net
hans w. koch wrote:
simple: the version of Gem you are using has been compiled without libv4l support. whoever built the package has either not enabled libv4l-support (there is a new flag in Gem's configure called --without-ALL which disables everything so you have to manually re-enable whatever you want; this is meant for package-maintainers so they have better control about what features the package will have) or there was no libv4l-dev installed on the build machine.
solutions:
installed (in your case, don't forget libv4l-dev)
fgmasdr IOhannes
hans w. koch wrote:
the "easy" (and clumsy) way out has been described on this list several times; it involves using LD_PRELOAD for enforcing a compatibility layer of libv4l.
obviously the good way is to get Gem built properly.
fgmasdr IOhannes
hi thanks IOhannes for the help. i installed libv4l-dev & recompiled the package but i'm not getting the v4l2 support, as i do not know in the pd-extended automation how to do the gem configure with libv4l-support... greets ø
IOhannes zmölnig wrote:
thanks hans for this indication this is the correct flag to compile it with v4l2?! --with-libv4l2-includes=/usr/lib/libv4l2.so the package builts but still i'm gettin error: [pix_video]: could not find a backend for driver 'v4l2'
i also tried a gem solo & make spits this error: recordQT4L.cpp -o ../Objects/recordQT4L.o recordQT4L.cpp: In function ‘lqt_file_type_t guess_qtformat(const char*)’: recordQT4L.cpp:96: error: invalid conversion from ‘const char*’ to ‘char*’ make[1]: *** [recordQT4L.o] Error 1 make[1]: Leaving directory `/home/olsen/pd/pd-extended/Gem/src/Pixes' make: *** [Pixes] Error 2
same with gem 0.92-1 recordQT4L.cpp: In function ‘lqt_file_type_t guess_qtformat(const char*)’: recordQT4L.cpp:96: error: invalid conversion from ‘const char*’ to ‘char*’ make[1]: *** [recordQT4L.o] Error 1 make[1]: Leaving directory `/home/olsen/pd/extra/0.92-1/Gem/src/Pixes' make: *** [Pixes] Error 2
with gem0.92svn i stuck at the configure:
./configure: line 3005: syntax error near unexpected token PIC,' ./configure: line 3005:
GEM_ARG_ENABLE(PIC, PositionIndependentCode
(potentially slower))'
Hans-Christoph Steiner wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
olsen wrote:
hmm, the ..-includes flag is meant for adding _include_ directives to the compiler rather than libraries for the linker.
try something like "--with-libv4l" and/or "--with-libv4l2" and you should be done if libv4l is properly installed.
yah, this is dues to an overly pedantic compiler (or probably: invalid headers: the line the error is referring to is (here; but i might have a different version :-)) using the (const char*) argument to guess_qtformat() as input for strchr(). according to my man-pages, strchr() indeed takes (const char*) rather than (char*). if this is indeed the problem, just add a cast to (const char*) to the call of strchr(), and file a bug-report to ubuntu that they are shipping broken headers)
you did run ./autogen.sh, did you?
mfgasr IOhannes
On Wed, 4 Nov 2009, IOhannes m zmölnig wrote:
hi, the problem is not the type of «filename», it's the type of «extension», because the error message is about casting const to non-const, and not the other way around.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
Quoting "Mathieu Bouchard" matju@artengine.ca:
hmm, to summarize:
this is the code: static lqt_file_type_t guess_qtformat(const char* filename) { char * extension = strrchr(filename, '.'); }
which means: that we expect strrchr() to take "const char*" and "int",
and to return "char*"
"man strrchr" says: char *strrchr(const char *s, int c);
i don't see any problems here. what is it, that i am missing?
apart from that: even if all or no compilers are that pedantic, i
don't experience the said problem when building myself (e.g. on debian
using g++-4.3.4-5)
it is not that i never compile Gem using gcc...
fgmasdr IOhannes
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
This message was sent using IMP, the Internet Messaging Program.
Quoting zmoelnig@iem.at:
or with 4.4.1-4.
to be precise, i don't even get a warning with HEAD:
% g++-4.4 -c -I/usr/include/lqt -I/usr/local/include
-I/usr/include/lqt -I/usr/include/FTGL -I/usr/include/freetype2
-I.. -I/usr/include/FTGL -I/usr/include/freetype2 -DHAVE_CONFIG_H
-g -O2 -fPIC -freg-struct-return -O3 -falign-loops=32
-falign-functions=32 -falign-jumps=32 -funroll-loops -ffast-math -mmmx
recordQT4L.cpp -o ../Objects/recordQT4L.o -Wall
%
with the 0.92 branch from subversion i get some warnings:
% g++-4.4 -c -I/usr/include/lqt -I/usr/local/include
-I/usr/include/lqt -I/usr/include/FTGL -I/usr/include/freetype2
-I.. -I/usr/include/FTGL -I/usr/include/freetype2 -DHAVE_CONFIG_H
-g -O2 -fPIC -freg-struct-return -O3 -falign-loops=32
-falign-functions=32 -falign-jumps=32 -funroll-loops -ffast-math -mmmx
recordQT4L.cpp -o ../Objects/recordQT4L.o -Wall
recordQT4L.cpp: In function 'lqt_file_type_t guess_qtformat(const char*)':
recordQT4L.cpp:106: warning: comparison between signed and unsigned
integer expressions
recordQT4L.cpp: In member function 'virtual bool
recordQT4L::init(const imageStruct*, int)':
recordQT4L.cpp:163: warning: comparison between signed and unsigned
integer expressions
recordQT4L.cpp: In member function 'virtual int
recordQT4L::putFrame(imageStruct*)':
recordQT4L.cpp:230: warning: unused variable 'err'
%
none of these have anything todo with "const char*" or "char*"
please post your Base/config.h (TRUNK) or Base/configLinux.h (0.92) and your version of libquicktime
fgmasdr IOhannes
This message was sent using IMP, the Internet Messaging Program.
zmoelnig@iem.at wrote:
/* configuration-file */ #ifndef HAVE_BASE_CONFIG_H_ #define HAVE_BASE_CONFIG_H_
#ifdef _MSC_VER # ifndef __WIN32__ # define __WIN32__ # endif #endif
#ifdef __WIN32__ # ifndef NT # define NT # endif # ifndef MSW # define MSW # endif # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif #endif
#ifdef HAVE_CONFIG_GENERIC_H
# include "Base/configGeneric.h"
#else /* includes system-specific files */
# ifdef __linux__ # include "Base/configLinux.h" # endif
# ifdef __APPLE__ # include "Base/configDarwin.h" # define HAVE_QUICKTIME # endif
# ifdef __WIN32__ # include "Base/configNT.h" # endif #endif
#ifdef NEW_VIDEOFILM # ifndef FILM_NEW # define FILM_NEW # endif # ifndef VIDEO_NEW # define VIDEO_NEW # endif #endif
#ifdef HAVE_LIBFTGL # define FTGL #endif
or Base/configLinux.h (0.92)
/* Base/configLinux.h. Generated from configLinux.h.in by configure. */
/* fullscreen: querying via libXxf86vm */ #define HAVE_LIBXXF86VM 1
/* font rendering */ #define HAVE_LIBFTGL 1
/* image loading / saving */ /* #undef HAVE_LIBTIFF */ /* #undef HAVE_LIBJPEG */ #define HAVE_LIBMAGICKPLUSPLUS 1
/* movie decoding */ /* #undef HAVE_LIBMPEG */ #define HAVE_LIBMPEG3 1 #define HAVE_LIBQUICKTIME 1 #define HAVE_LQT_OPEN_WRITE 1 #define HAVE_LIBAVIPLAY 1 /* #undef HAVE_LIBGMERLIN_AVDEC */
/* video grabbing */ #define HAVE_VIDEO4LINUX 1 /* #undef HAVE_VIDEO4LINUX2 */ #define HAVE_LIBDV 1 #define HAVE_LIBV4L1 1 #define HAVE_LIBV4L2 1
/* image analysis */ /* #undef HAVE_ARTOOLKIT */
/* posix threads */ #define HAVE_PTHREADS 1
/* Pd header files */ /* #undef HAVE_S_STUFF_H */
/* enable the use of the all-in-one video/movie objects */ #define NEW_VIDEOFILM 1
/* types, structures, compiler characteristics, ... */ #define SIZEOF_VOID_P 4 #define SIZEOF_UNSIGNED_INT 4
and your version of libquicktime
libquicktime-dev & libquicktime1 version: Source: libquicktime Version: 2:1.1.1+debian-1build1
my g++ version is (Ubuntu 4.4.1-4ubuntu8) 4.4.1
btw: the ./configure-error with the svn version was indeed from not ./autogen.sh... thanks & greets ø
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
olsen wrote:
with the 0.92 branch from subversion i get some warnings:
thanks to claude and matju, a fix should now be in svn (both trunk and 0.92 branch)
fgamsdr IOhannes
zmoelnig@iem.at wrote:
True - nicely spotted.
"man strrchr" says: char *strrchr(const char *s, int c);
Sure, but that's the C version, I imagine?
"two overloaded versions provided in C++." -- http://www.cplusplus.com/reference/clibrary/cstring/strrchr/
i don't see any problems here. what is it, that i am missing?
C != C++
C++ should use only the argument types to determine which function to call (if my memory is correct).
So a const argument forces C++ strrchr to return a const result (which is semantically correct, imho the C version is incorrectly specified to the point of being dangerous).
This cannot be converted to a non-const value without explicit casting (and arguably shouldn't be casted at all, as const values could well be in read-only memory, causing crashes when modification is attempted).
On Thu, 5 Nov 2009, Claude Heiland-Allen wrote:
And arguably the fact that read-only memory could be used shouldn't make a difference, because even in read-write memory you could piss off (or make confused) another piece of the programme by modifying something that is not to be modified, and in some sense this is worst than just a crash (because it's not nearly as obvious), which is the reason why the memory was set to read-only in the first place.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Thu, 5 Nov 2009, zmoelnig@iem.at wrote:
Ok, I made a mistake, I thought I remembered strrchr returned const char *. This is what your compiler is assuming, because what it reports about is a cast from const to non-const, which is what your error message is about.
What happens is that you are using the (new) C++ headers, which doesn't have the above declaration as in the manpage, and instead is using the following declarations (for covariant constness: so that the return type is exactly like the 1st argument):
const char * strchr ( const char * str, int character ); char * strchr ( char * str, int character );
(from #include <strchr>)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
On Nov 4, 2009, at 5:40 PM, IOhannes m zmölnig wrote:
FYI, I think all new versions of gcc are this pedantic.
.hc
"[T]he greatest purveyor of violence in the world today [is] my own
government." - Martin Luther King, Jr.
hm well pedantic or not i think i get stuck here as i my c-knowledge is to minim to
just add a cast to (const char*) to the call of strchr()
my gcc --version is gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1 any help welcome ø
Mathieu Bouchard wrote: