-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture DQBUF ioctl returns wrong buffer #304
Comments
totally. bug fixes are always welcome :-) sidenote: rather than using time/space relative versions (e.g. "top-of-tree v4l2loopback (as of this morning)"), i'd prefer if you used the actual commit (e.g. d3f15e3) which still can be identified in 3 months. |
Yes, that's the commit I meant, and yes, I should have said that. Sorry. |
@umlaeute it seems we've found a similar (same?) issue when trying to stream from v4l2loopback using ustreamer. ustreamer dumps core as it has an assert for a case when it decides to skip a frame ("return a buffer"). Reproducer is very simple:
(if the reproducer won't work for you as is, try higher frame rate or higher resolution or change rgb565 to rgb24 as chances are you have too beefy machine 😉) More details in pikvm/ustreamer#43 . Any ideas why v4l2loopback returns the previous buffer before the skipped buffer? How could this surprising (wrong?) behavior be tamed? |
For reproducing I recommend to checkout ustreamer at this commit:
Master branch of ustreamer is fine for this now. |
In fact, on the capture side the QBUF ioctl doesn't have any effect currently. It sets I think if both capture and output side use the QBUF/DQBUF API, it would be unavoidable to have separate queues for capture and output side and do some memory copying, since you can't be sure that a certain index that is provided by the output side has been queued by the capture side. I'm experiencing this issue with the Linphone SIP client, which uses mediastreamer2. Mediastreamer2 uses the returned buffer indices for its own frame management, so dequeueing buffers that have not been queued results in problems. In my case, the problem can be worked around by increasing |
Hi everyone, |
Does it make sense to allow working in-kernel buffer of frames? |
this works only for userptr mode, I think. |
The plain approach is to rename |
The details could be different, |
https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/mmap.html#mmap |
Just wondering if there has been any movement on this front recently? |
I'm having a range of problems with v4l2loopback and so today I started trying to write a basic test harness for it so I could investigate them, however I'm falling at the first hurdle.
I've attached a fairly minimal program which provokes the DQBUF ioctl to return an illegal buffer ID which should be owned by userspace already. With top-of-tree v4l2loopback (as of this morning) I get the following output from it:
minimal.c.txt
The "Source" lines are feeding the loopback device's output side, and the "Sink" lines are reading from the associated capture side. Here the capture side has returned buffer index 1, where according to my reading of the documentation, it should have returned buffer 0 which was previously queued for it.
(If I get anywhere with this test harness I'll be happy to upstream it, if it's of any interest to the project.)
The text was updated successfully, but these errors were encountered: