Ntemis has quit [Read error: Connection reset by peer]
<ndufresne>
mjourdan, not much progress on my side tonight, the driver prints "[ 75.445668] meson-vdec c8820000.video-decoder: Res. changed (1920x1080), DPB size 10", which seems correct, but when gst get the CID, the returned value is 0, no 10
<ndufresne>
and so it hangs
<ndufresne>
mjourdan, I believe the CREATE_BUFS calls you are seeing are "index=0, count=0", this is just a hack to check if the ioctl is supported
<ndufresne>
mjourdan, oh, interesting, no matter how long I wait, it seems that the trace "Res. changed (1920x1080), DPB size 10" only comes after video0: VIDIOC_STREAMON: type=vid-cap-mplane"
<ndufresne>
the parser should be running as soon at we do streamon on OUTPUT
<ndufresne>
at least, this is what all the other codecs do atm
<ndufresne>
because otherwise, I'm stuck with having to allocate some buffers, just for the sake of calling streamon, and will likely have to reallocate them
<ndufresne>
mjourdan, strange, after the flush in a seek, gstream reverse the order or STREAMON, it does qbuf(capture, all), STREAMON(capture), qbuf(out), STREAMON(out)
<ndufresne>
could that be the reason is hangs now ?
Darkmatter66_ has joined #linux-amlogic
Darkmatter66 has quit [Ping timeout: 244 seconds]
<ndufresne>
mjourdan, btw, I have changed the yesterday's fix to use the number of allocated buffers, this way, if REQBUFS changes the value, it should behave correctly
<mjourdan>
ndufresne: You can only expect V4L2_CID_MIN_BUFFERS_FOR_CAPTURE to have a relevant value after a "Res changed" log. In your case, it should return 10 once you see that "DPB size 10" message.
<mjourdan>
But on my end it doesn't look like the control is queried after I send the src_change event
<mjourdan>
I'd love to be able to support streaming only the OUTPUT queue but for now it's a limitation as this mode can't work with older codecs :(. MPEG2 & co require to have both queues up before running.
<mjourdan>
The only other implementation that supports src_change is chromium, and they setup a dummy capture queue + streamon at init., which is what I initially tested with
Darkmatter66 has joined #linux-amlogic
Darkmatter66_ has quit [Ping timeout: 246 seconds]
Darkmatter66 has quit [Ping timeout: 246 seconds]
<poulecaca>
j
<poulecaca>
oups sorry
Darkmatter66 has joined #linux-amlogic
<ndufresne>
mjourdan, well, you're drive should take care of the dummys then, since it's specific to this hw
<ndufresne>
mjourdan, it make no sense to allocate random size and impose this on usespace
<ndufresne>
specially when the buffers are contiguous
<ndufresne>
mjourdan, anyway, the point is that even if I implement the size change, I'll never receive it from your driver unless I implement this dummy buffers hack, I'm not sure I want this to be the general case
<ndufresne>
mjourdan, and about the streamon order, do you have some input ? do you impose that streamon must be OUTPUT follow by CAPTURE ?
<ndufresne>
anyway, for later ....
<mjourdan>
ndufresne: oh yeah no problem, I'm just telling you how it's now, I understand it's not optimal at all for userspace to have to allocate those dummy buffers.
<mjourdan>
ndufresne: there's no particular order in which to stream the queues
<mjourdan>
There's just one thing at the moment: without any hack for min buffers, then gst doesn't query V4L2_CID_MIN_BUFFERS_FOR_CAPTURE after it receives the SRC_CHANGE event, and doesn't seem to reconfigure the capture queue.
random_yanek has quit [Ping timeout: 245 seconds]
random_yanek has joined #linux-amlogic
random_yanek has quit [Max SendQ exceeded]
<ndufresne>
mjourdan, that's correct
<ndufresne>
mjourdan, and I guess there is no by-pass atm if the capture queue is streaming already with the right amount of buffers ?
<ndufresne>
I think you said that one must reset all queues, I think I'm starting to understand ;-D
ldevulder_vacati has quit [Quit: Leaving]
afaerber has quit [Quit: Leaving]
<mjourdan>
ndufresne: if you already set the resolution and you have enough buffers for DPB, then the event isn't fired and the decoder keeps running.
<mjourdan>
If you receive the event, then you must streamoff/querybuf/streamon the capture queue
<mjourdan>
You don't have to reset the output queue
<mjourdan>
reqbufs* sorry not querybuf
<mjourdan>
In the scenario that I'm looking at right now: gst streams both queues, with 4 CAPTURE buffers allocated. Then my driver fires the SRC_CHANGE event and V4L2_CID_MIN_BUFFERS_FOR_CAPTURE is set to 10 (the DPB size for this bitstream).
<mjourdan>
Then I wait until userspace has reset the capture queue
<mjourdan>
(which doesn't seem to happen)
random_yanek has joined #linux-amlogic
random_yanek has quit [Max SendQ exceeded]
afaerber has joined #linux-amlogic
sputnik_ has quit [Read error: Connection reset by peer]
sputnik_ has joined #linux-amlogic
random_yanek has joined #linux-amlogic
<ndufresne>
mjourdan, right, same behaviour, I then hacked up something to gst thinks that the driver said 10, but on seeks it still hang, from the traces, I'm pretty sure all 10 buffers have been requeued, I'll check if the event is fired, that would be an indicated that it's not happy with the current state
<ndufresne>
with my hacks yesterday, it didn't hang, something must be different
<ndufresne>
all this needs a rework in gst, that I admit
<ndufresne>
I'm pulling 15years of ancient code, it takes a lot of time to change this without breaking camera captures
<ndufresne>
anyway, whenever I get some time, I got some big plan, for the dummy buffers, I guess if we don't figure-out anything, we should consider this as valid quirk, but add a device flag to tell userspace, so I don't need to hardcode random strings/driver names
<ndufresne>
if chromium does this, it means there is at least one other driver that does not function without
<mjourdan>
ndufresne: the seeks "worked" (with the trippy effect) with create_bufs enabled, but they no longer do since I disabled it.
<mjourdan>
ndufresne: hehe no worries
<mjourdan>
ndufresne: about the dummy buffers, we'll see how the spec turns out, but ultimately we want to make your life simpler
afaerber has quit [Quit: Leaving]
afaerber has joined #linux-amlogic
vagrantc has joined #linux-amlogic
ldevulder has joined #linux-amlogic
AntonioND has quit [Ping timeout: 252 seconds]
jakogut has quit [Ping timeout: 268 seconds]
afaerber has quit [Quit: Leaving]
AntonioND has joined #linux-amlogic
ldevulder_ has joined #linux-amlogic
ldevulder has quit [Ping timeout: 272 seconds]
cottsay has joined #linux-amlogic
Ntemis has joined #linux-amlogic
afaerber has joined #linux-amlogic
Ntemis has quit [Remote host closed the connection]