On 22-07-15 00:21:29, Kieran Bingham wrote: > Quoting Petko Manolov (2022-07-14 16:22:09) > > Hi guys, > > > > I've got a long pipeline of four entities and need to make the imx492 sensor > > stream out a test pattern. When i do: > > > > v4l2-ctl -d /dev/v4l-subdev2 --set-ctrl=test_pattern=2 > > > > I can see the driver acknowledging the switch to test pattern 2. However, > > when start streaming with: > > > > v4l2-ctl -d /dev/video0 --stream-mmap --stream-to=frame.raw > > --stream-count=1 > > > > the driver reports setting the test pattern to the default 0. How should > > this be done properly? > > 'Which' driver is reporting setting the test pattern? Can you check where > that's happening and identify 'why'? > > As I understand it - it shouldn't be happening, so I suspect it's something in > your CSI2 receiver driver initialising some defaults perhaps. Well, found it - my s_ctrl() was accidentally returning -EINVAL for V4L2_CID_TEST_PATTERN. I _assume_ this is why V4L2 was correcting it to '0' at stream time. Not being well versed in V4L2 i leave this one to you guys. :) Now, this brings out an interesting question. The way s_ctrl() is written 'int ret' is declared in the prologue of the function. The only place 'ret' was not assigned some value was at 'case V4L2_CID_TEST_PATTERN:'. s_ctrl() was happily returning whatever happened to be in the stack at that time. With all GCC warnings enabled these days for the kernel build, i'm rather surprised to see absolutely nothing on the command line when compiling the driver. Odd... Petko