On Tue, Apr 17, 2018 at 8:41 PM Paul Kocialkowski < paul.kocialkowski@xxxxxxxxxxx> wrote: > Hi, > On Tue, 2018-04-17 at 06:17 +0000, Alexandre Courbot wrote: > > On Tue, Apr 17, 2018 at 3:12 PM Hans Verkuil <hverkuil@xxxxxxxxx> > > wrote: > > > > > On 04/17/2018 06:33 AM, Alexandre Courbot wrote: > > > > On Mon, Apr 9, 2018 at 11:20 PM Hans Verkuil <hverkuil@xxxxxxxxx> > > > > wrote: > > > > > > > > > From: Hans Verkuil <hans.verkuil@xxxxxxxxx> > > > > > Hi all, > > > > > This is a cleaned up version of the v10 series (never posted to > > > > > the list since it was messy). > > > > > > > > Hi Hans, > > > > > > > > It took me a while to test and review this, but finally have been > > > > able > > > > to > > > > do it. > > > > > > > > First the result of the test: I have tried porting my dummy vim2m > > > > test > > > > program > > > > (https://gist.github.com/Gnurou/34c35f1f8e278dad454b51578d239a42 > > > > for > > > > reference), > > > > and am getting a hang when trying to queue the second OUTPUT > > > > buffer > > > > (right > > > > after > > > > queuing the first request). If I move the calls the > > > > VIDIOC_STREAMON > > > > after > > > > the > > > > requests are queued, the hang seems to happen at that moment. > > > > Probably a > > > > deadlock, haven't looked in detail yet. > > > > > > > > I have a few other comments, will follow up per-patch. > > > > > > > I had a similar/same (?) report about this from Paul: > > > https://www.mail-archive.com/linux-media@xxxxxxxxxxxxxxx/msg129177.h > > > tml > > > > I saw this and tried to move the call to STREAMON to after the > > requests are queued in my example program, but it then hanged there. > > So there is probably something more intricate taking place. > I figured out the issue (but forgot to report back to the list): Hans' > version of the request API doesn't set the POLLIN bit but POLLPRI > instead, so you need to select for expect_fds instead of read_fds in the > select call. That's pretty much all there is to it. I am not using select() but poll() in my test program (see the gist link above) and have set POLLPRI as the event to poll for. I may be missing something but this looks correct to me?