ok thanks for the info on setting up an XIP kernel, and I now realize that its not feasible.
I compiled the ipcamd code, and ran it on my 3.1 kernel.
Aside from a couple of changes that I needed to make to the code in order to get it to run, it seems to work fine. However, Im consistently seeing a frame drop rate of '2 frames per capture'
mainloop
Frame dropped (jumping from 20 to 22) for client 0x003ff004
Frame dropped (jumping from 30 to 32) for client 0x003ff004
Frame dropped (jumping from 34 to 36) for client 0x003ff004
Frame dropped (jumping from 40 to 42) for client 0x003ff004
Frame dropped (jumping from 42 to 44) for client 0x003ff004
Frame dropped (jumping from 45 to 47) for client 0x003ff004
Frame dropped (jumping from 47 to 49) for client 0x003ff004
Frame dropped (jumping from 52 to 54) for client 0x003ff004
Frame dropped (jumping from 60 to 62) for client 0x003ff004
Frame dropped (jumping from 62 to 64) for client 0x003ff004
Frame dropped (jumping from 67 to 69) for client 0x003ff004
Frame dropped (jumping from 69 to 71) for client 0x003ff004
Frame dropped (jumping from 74 to 76) for client 0x003ff004
Frame dropped (jumping from 76 to 78) for client 0x003ff004
Frame dropped (jumping from 82 to 84) for client 0x003ff004
Frame dropped (jumping from 85 to 87) for client 0x003ff004
Frame dropped (jumping from 87 to 89) for client 0x003ff004
Frame dropped (jumping from 89 to 91) for client 0x003ff004
FPS: 23.2
Frame dropped (jumping from 94 to 96) for client 0x003ff004
Frame dropped (jumping from 96 to 98) for client 0x003ff004
Frame dropped (jumping from 100 to 102) for client 0x003ff004
Frame dropped (jumping from 102 to 104) for client 0x003ff004
any idea why this is happening or how it can be fixed?
FYI, Im running my kernel with a HZ setting of '1000', in order to be able to run the stepper motors at full speed. I dont know if this could possibly affect the frame capture and/or frame processing routines. Also, I noticed that when I tried running the kernel with a HZ value of '2000' I got higher frame rates, @ around 30 fps.
- a couple of changes that I needed to make to the code:
1) my foscam clone has the onboard MJPG encoder, so the code that tries to set the format to V4L2_PIX_FMT_JPEG
needed to be changed to V4L2_PIX_FMT_MJPEG
in order for the capture to succeed, otherwise Id get an 'invalid argument' error message.
2) I needed to disable the 'enumerate_controls' routine because it was erroring out trying to read the JPEG quality value (I assume that this attribute doesnt apply to MJPEG V4L2 streams?)
3) the ipcamd code doesnt seem to provide a method to do 'continuous capturing'; you must specify a fixed number of frames to capture (I didnt really understand your intention here, how would a streaming server be setup using this method?). So, I modified the 'mainloop' routine in order to be able to run an infinite capture loop:
static void mainloop(void)
{
int fps_counter = 0;
struct timeval begin;
gettimeofday(&begin, NULL);
while ((count == -1 || count-- >= 0) && !restart_cam) {
for (;;) {
so, by passing a value of '-1' for the 'count' argument, the capture loop will run infinitely and continue to capture frames. Perhaps this is not the most elegant method, but it seems to work.