Re: v4l howto and help request
This is a short guide on how to build webcamd and a request for help.
webcamd is a port of Linux v4l drivers as a system daemon.
I'm tryng to get it working so that I can migrate my desktop someday.
Webcam support is mandatory or my sister will be upset ;-)
Here are my steps:
1. Install libusb2 8.1-5 or later (to fix bug #594330)
2. Download kernel source. Put it in /usr/src/sys
3. ln -s x86_64 /usr/src/sys/amd64
4. Download fetch script from bug #594483 and put it in your path
5. Add /usr/lib/freebsd to your path
6. Build cuse4bsd as in step 3 in http://www.selasky.org/hans_petter/video4bsd/
7. kldload cuse4bsd.ko and copy the library to /usr/lib
8. Build webcamd as in step 4 in http://www.selasky.org/hans_petter/video4bsd/
But then when I run webcamd, get this weird error:
Attached ugen0.2 to cuse unit 0
webcamd: malloc.c:3097: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Heap corruption maybe?
I also obtained a gdb backtrace. It seems that this is something related with threads.
What does sigsuspend do? Is the problem with handling of this signal or
is the signal itself something that shouldn't happen?
This part really gets me confused. Some help would be nice!
It looks like the cuse4bsd assumes BSD implementation of threads.
Namely the cuse_client_command() contains "struct thread *entered".
We use a different implementation. The sigsuspend() is used by our thread
Some tweaking of cuse4bsd would be needed to map user to kernel for thread