<!-- Some styling for better description lists --><style type='text/css'>dt { font-weight: bold;float: left;display:inline;margin-right: 1em} dd { display:block; margin-left: 2em}</style> ***: Killerkid_ has quit IRC (Ping timeout: 252 seconds) <br> al has quit IRC (Ping timeout: 264 seconds) <br> paulk-leonov has quit IRC (Ping timeout: 252 seconds) hverkuil: <u>pH5</u>: I assume you want to add 'capture colorspace conversion' afterwards? So the initial driver is without this feature? <br> Not a problem, I just want to know what I can expect. pH5: <u>hverkuil</u>: yes, I'm just now writing a reply to the RFC thread. <br> I have just realized that I have to limit capture pixel formats depending on output ycbcr_enc and quantization. <br> If the driver is fed limited range RGB, it can't convert it to anything but limited range RGB, currently. ***: mszyprow has quit IRC (Ping timeout: 245 seconds) hverkuil: <u>pH5</u>: that's a HW limitation? <br> Why can't it convert this? It shouldn't be a problem with a matrix + offset vector. pH5: <u>hverkuil</u>: no, that's just a driver limitation. alternatively, I could add another set of coefficients for limited range RGB. <br> I think V4L2_YCBCR_ENC_BT2020_CONST_LUM has the same issue, though. ***: jmleo has quit IRC (Ping timeout: 240 seconds) ezequielg: <u>hverkuil</u>: we are working on adding a kernelci job to run v4l2-compliance -s on some virtual devices, on a qemu instance. the plan is to send reports to the media ML, so we can get some feedback from the community. ***: bingbu has quit IRC (Ping timeout: 244 seconds) paulk-leonov: hverkuil, I'm having a pretty big issue with buffer allocation after the change you (rightfully) requested regarding queue setup <br> hverkuil, what's happening is that the requested number of distinct buffers to allocate is taken from f->fmt.pix_mp.num_planes <br> because we want our 2 (logical) planes contiguous, that would need to be set to 1 <br> so the associated size must match the sum of the both planes hverkuil: <u>ezequielg</u>: nice! paulk-leonov: then, there's about no way for userspace to figure out the offset to the second logical plane in that buffer, except explicitly knowing how to calculate that offset <br> (before that, the fmt num_planes was 2 and each offset was set for the logical planes) <br> I realize this was wrong in the first place <br> overriding the values in cedrus_queue_setup would end up in requesting 1 plane while not touching the pixfmt description (that still had 2 planes described) <br> so right now I'm thinking of always declaring 1 plane for V4L2_PIX_FMT_NV12 and let userspace calculate the right offset to the start of the 2nd logical plane <br> would that make sense? <br> (I'm not sure my description of the problem is very clear, either) hverkuil: num_planes is a horrible misnomer: it refers to the number of buffers to allocate for the planes of a frame. <br> Typically it is 1 if all planes are in a single buffer, 2 if you have separate luma and chroma planes and in rare cases 3 if you have Y, Cb and Cr planes. <br> num_planes is pixel format dependent, and queue_setup should reject (when called with CREATE_BUFS) a different num_planes value compared to the current format. paulk-leonov: hverkuil, alright, so that should definitely be 1 in my case hverkuil: So NV12 sets num_planes to 1, always. paulk-leonov: so it's normal to expect userspace to know where luma starts there, then? hverkuil: NV12M sets it to 2. paulk-leonov: chroma* hverkuil: YUV444M sets it to 3 (three buffers, one for each plane) paulk-leonov: I see <br> so sizeimage also concerns the size of the buffer (not each logical plane)? hverkuil: The description of the pixelformat (like NV12) describes how planes in a single buffer are organized. paulk-leonov: fair enough <br> thanks hverkuil, I'll try to post a new cedrus version later today hverkuil: For _MPLANE formats sizeimage is per plane (struct v4l2_pix_format_mplane) ezequielg: paulk-leonov: if it helps, you can take a look at the rockchip vpu driver. hverkuil: I wish we could go back in time and give these things better names, it's really confusing. paulk-leonov: ah! so num_planes is not the number of elements in plane_fmt then hverkuil: Just remember that when V4L2 talks about 'multiplanar' then what we really mean is "multiple buffers per frame, each buffer containing one or more planes" paulk-leonov: I see <br> that's a good way to summarize it mjourdan: just like the "OUTPUT" queue, I keep having to do the translation to "input/src" when doing m2m work hverkuil: Yes, num_planes is the number of elements in plane_fmt. <br> num_planes should be 'num_bufs_per_frame' or something like that :-( paulk-leonov: mjourdan, I call them source/destination everywhere I can :) mjourdan: Yeah, that's a good name, especially with most helpers using "src" and "dst" ***: quopax has left rpici: Hello. I have an app that accesses a V4L2 device from two different threads. One thread fetches frames from the device if the device is streaming. The other thread periodically toggles the V4L stream on and off. To prevent race conditions I use a mutex. Under the mutex each thread calls whatever it needs to call to do its job. The fetcher thread locks the mutex, checks to see if the device is streaming, fetches a frame if it is, an paulk-leonov: hverkuil, given that I'm always going to need a single buffer, does it still make sense to use the MPLANE API? rpici: The toggler thread locks the mutex and toggles whether the device is streaming. My issue is I sometimes see errors with VIDIOC_STREAMON. The error I see is EFBIG (File too large). I've found that if I add a sleep of 1 second in the start_streaming() call, in between the VIDIOC_QBUF calls and the VIDIOC_STREAMON call, the crash goes away. I'm not sure why. hverkuil1: paulk-leonov: probably not. paulk-leonov: okay so I'll convert everything to the single-planar API rpici: I said "start_streaming()" but I meant "start_capturing()", based on this example: https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/capture.c.html <br> Can anyone help me figure out what causes the crash and why a sleep seems to fix it? I'd like to fix the actual problem without having to resort to using a sleep as a bandaid. hverkuil1: <u>rpici</u>: what driver are you using? <br> and what kernel version? rpici: <u>hverkuill</u>: how do I determine the driver? for my kernel, uname -a says: Linux cubox-i 3.14.14-cubox-i #14 SMP Tue Jul 28 10:46:10 CDT 2015 armv7l GNU/Linux hverkuil1: you have v4l2-ctl installed? Then run v4l2-ctl -D to see the driver name <br> But this is a 3.14 kernel for an imx freescale, so that (I'm sure) is running crap drivers from Freescale that we do not support. rpici: v4l2-ctl: command not found, v4l2-ctl also doesn't seem to be in my apt-get repo hverkuil1: Apparently the driver returns EFBIG in some cases, so you're best bet is to download the kernel source and start digging in the driver code. <br> Probably a package v4l-utils. <br> -D just executes the VIDIOC_QUERYCAP ioctl. <br> You can do that in your application as well and show the driver field. rpici: Ok. I'll do that and find the driver field. bbl. Thank you for your help. ***: benjiG has left rpici: <u>hverkuil1</u>: driver: uvcvideo, card: UVC Camera (046d:0825), bus_info: usb-ci_hdrc.0-1.4.2 hverkuil1: <u>rpici</u>: no idea where EFBIG comes from. uvc is part of the 3.14 kernel, but it doesn't return EFBIG. <br> (so you're just running a uvc webcam, not the freescale driver, that's good). rpici: Here's a snippet from my code: https://pastebin.com/UsnCRPZE. This sometimes (but not always) results in an error: "Error: void V4L2CaptureDevice::start_capturing(): VIDIOC_STREAMON: File too large" hverkuil1: I think EFBIG comes from the usb subsystem. <br> Sorry, I know nothing about that. rpici: Ok. I guess I'll take a dive into the kernel source. Thanks for your help. ezequielg: <u>hverkuil1</u>: I forgot to put a "Media summit" prefix to the RFP for the test discussion. Wonder if the RFP was still properly noticed. ***: Guest26088 is now known as koike paulk-leonov: hverkuil1, by the way, I'm getting a v4l2-compliance error on VIDIOC_G_FMT because it returns a zero width/height <br> since that's before setting a format, I'm not sure what to do abou tit <br> the hardware state is "unconfigured" at this point, but returning EINVAL in the driver shall indicate that the format is not supported, not that the hardware is not configured <br> also try_ext_ctrls fails because the default value for the control (that v4l2-compliance uses) is (rightfully) invalid ezequielg: paulk-leonov: G_FMT fails on what queue? paulk-leonov: ezequielg, both of them <br> the problem is that there is no hardware state ezequielg: that's definitely wrong. <br> just pick a default state. <br> well, i won't argue about this making <br> a lot of sense, or little, or no sense... <br> but on the drivers I've written, they simply have a default state. <br> so you may open() and read(). <br> (iirc) <br> now, we don't have a stateless spec (yet). but for capture drivers, the drivers always have a default state. <br> you can check what rockchip vpu does paulk-leonov: ezequielg, I see, thanks for the explanation ezequielg: paulk-leonov: how about the try_ext_ctrls? paulk-leonov: ezequielg, that one is because the default control value (all zeroed) is not valid <br> I'm not sure what to think about it ***: ntrrgc has quit IRC (Ping timeout: 252 seconds) paulk-leonov: well, that can probably be fixed later ezequielg: can you show me the error? I am curious about that, as I've never seen it. <br> the G_FMT one, I know it very well... it was a pain to comply with that. paulk-leonov: it just says "fail: v4l2-test-controls.cpp(659): try_ext_ctrls returned an error (22)" <br> which originates from std_validate I think ezequielg: oh, i see. <br> because there's some validation for those controls. paulk-leonov: yes ezequielg: but you set no default value paulk-leonov: right ezequielg: well, just set a default value and it'll pass i think. <br> the test does G_CTRL/S_CTRL. paulk-leonov: yes but that seems even more far-fetched than setting a default value for the format