Poll nvhost-vic

I’m using /dev/nvhost-vic to do colorspace conversion from ABGR to YUV420M. I’m using the unix poll(2) library call to monitor the v4l file descriptor for /dev/nvhost-vic. based on the documentation here: https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/func-poll.html, i expect POLLIN to be set when there is a capture buffer available to be DQ’d, and POLLOUT to be set when there is an output buffer available to be DQ’d.

This is the sequence of events i’m seeing:

Q 2 capture buffers
Q 1 output buffer
POLLOUT FIRES, DQ 1 output buffer
POLLIN FIRES, DQ 1 capture buffer, Q 1 capture buffer
POLLOUT FIRES, DQ 1 output buffer
POLLIN FIRES, Try to DQ 1 capture buffer, hang because I haven’t Q’d a second output buffer yet.

Am I misunderstanding how poll(2) works with V4L? it seems to me POLLIN shouldn’t fire until after i’ve passed new data through the converter. is there a deadline that I have to meet when Qing new output buffers? what is that deadline?

Hi,
We have NvVideoConverter class for the functionality and encourage users to use it.

I see that, but i’m trying to integrate the converter into an existing program that uses libev and the ‘poll’ mechanism to manage its video pipeline. I’d like to avoid spinning up another thread if I can.

If ‘poll’ doesn’t work with the Nvidia converter v4l driver, that’s fine, I just wish that was documented somewhere.

Thank you.

You may refer to the codes at

tegra_multimedia_api\samples\common\classes

Ideally if you understand what the call flow is and adapt to your code, it should work.

However we still suggest use existing classes.