#linux-media 2021-11-02,Tue

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
***djrscally has quit IRC (Ping timeout: 480 seconds)
camus1 has joined #linux-media
[00:44]
camus has quit IRC (Ping timeout: 480 seconds) [00:49]
.... (idle for 18mn)
svarbanov has quit IRC (Ping timeout: 480 seconds) [01:07]
svarbanov has joined #linux-media [01:16]
.......... (idle for 45mn)
svarbanov has quit IRC (Ping timeout: 480 seconds) [02:01]
...... (idle for 27mn)
BrianG61UK_ has quit IRC (Read error: Connection reset by peer) [02:28]
...... (idle for 25mn)
camus has joined #linux-media [02:53]
camus1 has quit IRC (Ping timeout: 480 seconds) [02:58]
jarthur has quit IRC (Quit: Textual IRC Client: www.textualapp.com)
eelstrebor has quit IRC (Quit: Ex-Chat)
[03:10]
......... (idle for 43mn)
gnuroundufresne: at this point there is more dust than carpet anyway ;) [03:53]
***camus has quit IRC (Read error: Connection reset by peer)
camus has joined #linux-media
[03:53]
gnuroundufresne: but I guess the suggestion of adding a flag to inform that CAPTURE buffer can be safely written into would work, wouldn't it?
in this case, user-space that want to be on the safe side or doesn't need to write into these buffers can just ignore the flag and follow the documented behavior
which is the only safe behavior at the moment anyway
so I don't see any problem with adding these two paragraphs to the spec?
[03:54]
***fleebs has joined #linux-media [03:59]
fleebs has quit IRC (Quit: fleebs) [04:07]
...... (idle for 27mn)
camus1 has joined #linux-media [04:34]
camus has quit IRC (Ping timeout: 480 seconds) [04:39]
..... (idle for 22mn)
jarthur has joined #linux-media [05:01]
camus has joined #linux-media [05:12]
camus1 has quit IRC (Ping timeout: 480 seconds) [05:17]
............. (idle for 1h4mn)
camus1 has joined #linux-media
camus has quit IRC (Ping timeout: 480 seconds)
[06:21]
.......... (idle for 46mn)
ao2 has joined #linux-media [07:07]
.... (idle for 18mn)
sailorek1234 has joined #linux-media
gouchi has joined #linux-media
gouchi has quit IRC (Remote host closed the connection)
camus has joined #linux-media
camus1 has quit IRC (Ping timeout: 480 seconds)
cphealy_ has joined #linux-media
[07:25]
cphealy has quit IRC (Ping timeout: 480 seconds) [07:40]
.... (idle for 15mn)
djrscally has joined #linux-media [07:55]
.... (idle for 19mn)
paulk2 has quit IRC (Quit: WeeChat 3.3)
mripard has joined #linux-media
[08:14]
GBenji has joined #linux-media [08:21]
jmondiEugen_H: format verification is perfromed by the media-controller framework in media_pipeline_start() which walks the graph and calls link_validate()
link_validate() it's a pad op and you can override it if you want in your driver
and it is again responsibility of userspace to set the right formats on each subdevice along the pipeline. In your example, 640x480 is the output format which is produced by down-scaling the sensor produced frame ?
[08:22]
Eugen_Hjmondi: no, it's the format that the userspace configures with --set-fmt-video to the top /dev/video0 [08:31]
jmondisure, but how is that produced in your river ? What does your top driver represents ?
s/river/platform
[08:36]
Eugen_Hmy top driver captures the frame from the sensor and then just converts it to data and a dma engine dumps it to memory [08:38]
jmondiI mean, is there be a downscale/crop happening somewhere between the sensor produced frame and the frame stored in memory ? Is your top driver that does so, the CSI-2 receiver or a scaler ? [08:38]
Eugen_Hso the frame size is given by the sensor frame
it's just a basic receiver but has a size limit on the frame , because of internal buffers. so it will crop it if it's exceeding the maximum size, but that's all about the cropping
[08:38]
jmondino crop/downscale ? You platform will save to memory frames in the format produced by the sensor and that's it ?
format and size I meant
[08:39]
Eugen_Hyes, exactly
it can perform some format conversions, but even if it does, it will not change the frame size
e.g. it will interpolate BAYER raw to RGB
[08:40]
jmondiso how can you produce 640x480 if the sensor is configured to produce 752x480 ? [08:40]
Eugen_Hit cannot. so it has to produce 752x480 [08:40]
jmondior the sensor has to produce 640x480 [08:41]
Eugen_Hbut the top video driver does not know what frame size the sensor produces. so it informs userspace that it can be configured 16x16 up to 2900x1440
so the userspace can configure anything, 640x480, or 2900x1400, regardless
the problem is that when the sensor starts, the sensor will throw 752x480 , but the userspace configured the top driver at an arbitrary resolution
[08:41]
jmondiuserspace that knows that your top-driver cannot downscale should configure the sensor with the same frame size requested to the top driver [08:42]
Eugen_Hthat's right. but what happens if the userspace does not ?
i just use v4l2-ctl --set-video-fmt to 640x480, my top video driver says it's fine, because it does not know what is the sensor frame size.
when streaming starts, the frame is bigger, and the userspace expects 640x480 but the frame is 752x480
thus the buffer is overflown
[08:43]
jmondiok, so if I got you right, the issue is that you have a sensor subdev directly connected to the video device that represents the dma-engine
an media_pipeline_start() cannot verify that the formats match as you only have a subdev
s/a subdev/one subdev/
[08:45]
Eugen_Hthe issue is that when setting the format on the top video driver (--set-fmt-video); the sensor may or may not be configured at the frame size that it will stream. meaning the userspace can change the frame size *after* the top video driver is configured
reconfiguring the sensor at a different frame size and then starting streaming will make the userspace unaware of the real frame size that is coming in
the only solution I found so far is to return an error at streamon() if the sensor is emitting a frame that is a different size than what I would expect to receive
https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vsp1/vsp1_video.c#L81
something similar with what is done here
[08:47]
***svarbanov has joined #linux-media [08:49]
jmondiI think in this case it's acceptable to call the remote subdev g_fmt() to verify the format [08:50]
Eugen_Hokay, I am doing that. My idea was to inform the userspace of frame size change. what is usually done in s_fmt, when userspace is requesting one format, but I can change the frame size and return new values [08:50]
jmondihowever your userspace should be aware that it apply to the sensor the same frame size as requested to the video node
and your pipeline handler (if you plan to work on that) is in control of that
[08:50]
Eugen_Hyes, userspace should be aware, but I have to be careful about all possible cases, like what happens when the video node has another framesize than the sensor [08:51]
jmondiis this a CSI-2 platform ? [08:53]
Eugen_Hin this specific case it's a parallel bus interface [08:53]
jmondiok, I was surprised as I thought CSI-2 receivers can usually perform at least some cropping [08:57]
Eugen_HThe hardware allows me to do more cropping. just that it's not implemented completely, and I would like to just pass the exact frame from the sensor at the moment, not crop it
I am also thinking about the usual dumb user, who might complain that he is using a high resolution sensor but our hardware outputs just 640x480 :))
(because he can't configure a higher frame size and our driver just crops everything down to the default VGA res )
[08:58]
........... (idle for 50mn)
***wwilly has joined #linux-media [09:49]
................ (idle for 1h16mn)
b-rad has quit IRC (Ping timeout: 480 seconds) [11:05]
............... (idle for 1h11mn)
ndufresnegnurou: strictly speaking no, there is no problem, but it leaves application/software that would like to know when it can modify the buffer without any option, v4l2 ecosystem also does not provide any fast cloning of pictures, so there is really a gap there [12:16]
gnurouright, what I mean is that we can probably easily add such a flag to the v4l2_buffer buffer. Do you think that would solve the problem, at least partially? [12:17]
ndufresneat least from my point of view, it would do
What it does is that it will inform my software, so I can export DMABuf FDs in RO, and also flag it in my abstraction
[12:21]
gnurouok, let me try to spin a v2 that adds this flag, then the driver can set it if relevant for them [12:22]
ndufresnegnurou: perhaps its worth mentionning what it does not do, I think what it does not do, is that it does not inform userspace how to configure the decoder to get writable buffers
but I don't really have solution or use case to that ...
[12:23]
gnuroummm are there decoders that support making optional copies of reference frames so userspace can write the buffers? That sounds very very specific to me [12:24]
ndufresneAs HW evolve, it looks like most decoders are aiming toward native tiled or compressed format, and any other formats are copy
but Hantro and rkvdec does have that feature, you can produce read-only or read-write (secondary) NV12
as I said, I don't think v4l2 API can distringuish between two NV12 formats here
this looks like a bigger work, and perhaps very niche
on VA API, as an example, there is a clone function, though as drivers are GPU driven, the linear formats as references frame storage are long time gone
gnurou: the clone function is mostly used for RW buffers when decoding VP9, since in VP9 you can get a partial header that tells you to output one of the reference, and that can be outputed multiple time
(though, most encoders shares logic with hevc, and will simulate b-frames with that mechanism)
[12:27]
gnurouI see. It looks like there are two different things that we can signal here:
1) The global ability of a decoder to produce writable buffers for the client, for a particular format/modifier combo, and
2) Whether a particular frame of a decoded stream can be written into because it is not used as reference (I don't know if this particular ability could be required, but that's what I thought of first)
I was initially thinking that we want to support 2), but actually 1) is probably more useful, right? In this case the ability should probably be signaled when querying/setting a format, not when dequeuing frames
[12:37]
ndufresneah sorry, for 2), in the case of stateless decoder, the driver is not aware, we just pick from the reference, but we have no mechanism to copy it [12:41]
gnurouguess this is something we could consider to add along with modifiers support (not sure what happened to them) [12:41]
ndufresnebut for 2) in case of stateful decode, I really don't know, we can't really return the same buffer in the way vb2 works, so I guess there is a copy happening internally somewhere ... [12:42]
gnuroufor stateless decoders the client manages the reference frames itself, so IIUC the problem does not apply at all - this is a purely stateful feature. [12:43]
ndufresnegnurou: modifier support was part of v4l2_buffer_ext proposal, currently on hold, Helen's left the profession, so we need a new volunteer
well, for stateless, the driver may shadow the buffer, if the formats require a PP
post processor
but it is not implicated in 2)
I think 1) is more useful, the question I was asking was basically were that flag would be
svarbanov seemed to prefer v4l2_buffer.flags, and I tend to agree
so the flow would be, the usuall, S_FMT, REQBUFS(), and the information would be known through QUERYBUF before doing mmap/expbuf
specific to stateful decoder, it would be SRC_CH event, G_FMT, REQBUF, QUERYBUF
and as usual, we can try another format too, which may lead to different buffer property
[12:43]
***camus1 has joined #linux-media [12:47]
gnurouif the capability is global to the format, it seems a bit wasteful to signal it in v4l2_buffer though...
unless we plan of doing 2), i.e. allow decoders that don't do any copy to signal non-reference frames as writable. Is that useful to anyone, who knows :)
[12:48]
ndufresnea small subtility, we aren't going to change the flags at run-time, so what you get at QUERYBUF, right after you have allocated the buffer will stay
but indeed, to signal 2), but a bit theoritical, we'd need to set the flag per DQBUF
[12:50]
***camus has quit IRC (Ping timeout: 480 seconds) [12:52]
ndufresnebut I guess you start to see why for 1, I believe that you can flag it in S_FMT structure, REQBUFS structure, or QUERYBUF structure (v4l2_buffer) ?
they are pretty equal to me, but again, svarbanov and some other dev had a preference to v4l2_buffer, perhaps they have a use case for 2) ?
[12:52]
gnuroulet's ask - in any case, I think we can agree that the default behavior should be the safest, i.e. assume that buffers are not writable unless being told the contrary? [12:57]
.... (idle for 19mn)
ndufresneyeah, it is the common valid behaviour [13:16]
***eelstrebor has joined #linux-media [13:21]
........... (idle for 50mn)
tomeu has joined #linux-media [14:11]
...... (idle for 28mn)
sailorek1234 has quit IRC () [14:39]
........ (idle for 37mn)
camus1 has quit IRC ()
mugnierb2 has quit IRC (Quit: WeeChat 2.8)
mugnierb has joined #linux-media
[15:16]
.... (idle for 17mn)
ao2 has quit IRC (Remote host closed the connection)
BrianG61UK has quit IRC (Quit: Leaving)
[15:36]
camus has joined #linux-media [15:42]
..... (idle for 24mn)
GBenji has quit IRC (Quit: Leaving.) [16:06]
............... (idle for 1h12mn)
svarbanov has quit IRC (Ping timeout: 480 seconds) [17:18]
camus has quit IRC () [17:32]
gouchi has joined #linux-media
andrzej_p has quit IRC (Quit: Ping timeout (120 seconds))
andrzej_p has joined #linux-media
[17:37]
......................... (idle for 2h0mn)
svarbanov has joined #linux-media [19:40]
............. (idle for 1h0mn)
ao2 has joined #linux-media [20:40]
kitzman has quit IRC ()
dekenevs has joined #linux-media
[20:48]
..... (idle for 22mn)
BrianG61UK has joined #linux-media [21:12]
BrianG61UK_ has joined #linux-media [21:18]
....... (idle for 31mn)
ao2 has quit IRC (Quit: Leaving) [21:49]
......... (idle for 40mn)
gouchi has quit IRC (Remote host closed the connection) [22:29]
................ (idle for 1h18mn)
djrscally has quit IRC (Quit: Konversation terminated!) [23:47]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)