You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time I captured several images from the xtion and then closed the device, I got a kernel warning and stack-dump:
[...] WARNING: CPU: x PID: xxxxxx at drivers/media/v4l2-core/videobuf2-core.c:2135 __vb2_queue_cancel+0x117/0x180 [videobuf2_core]()
Following raspberrypi/linux#817 this warning happens from kernel 3.18 onwards (due to new sanity checks within v4l) when not returning all buffers to v4l using vb2_buffer_done().
Adding some debug-output to xtion_kill_urbs I noticed that only 7 of the 8 buffer (aquired by my application) were returned. I only have a very basic knowledge of kernel-modules so I looked into the code of some other webcam modules. Just guessing: The queue contains only the currently unused buffers for later use and we miss to return the currently active buffer? Thus I added the following line:
/* It's important to clear current buffer */
vb2_buffer_done(&endp->active_buffer->vb, VB2_BUF_STATE_ERROR); <<<<
endp->active_buffer = 0;
and the warning disappeared. Is this the correct fix for the issue?
The text was updated successfully, but these errors were encountered:
ah.. haven't done my homework properly... forgot to check for active_buffer == 0 and got a kernel panic when: disconnecting the xtion or killing the application currently using it ;)
/* It's important to clear current buffer */
if (endp->active_buffer != 0) {
vb2_buffer_done(&endp->active_buffer->vb, VB2_BUF_STATE_ERROR);
endp->active_buffer = 0;
}
Every time I captured several images from the xtion and then closed the device, I got a kernel warning and stack-dump:
Following raspberrypi/linux#817 this warning happens from kernel 3.18 onwards (due to new sanity checks within v4l) when not returning all buffers to v4l using
vb2_buffer_done()
.Adding some debug-output to
xtion_kill_urbs
I noticed that only 7 of the 8 buffer (aquired by my application) were returned. I only have a very basic knowledge of kernel-modules so I looked into the code of some other webcam modules. Just guessing: The queue contains only the currently unused buffers for later use and we miss to return the currently active buffer? Thus I added the following line:and the warning disappeared. Is this the correct fix for the issue?
The text was updated successfully, but these errors were encountered: