Hello, I want to request a device to be patched in the kernel... i'm not a programmer and don't know how to do it myself... on the linux-media wiki they say that I can send a mail to the linux-media mailing list... do you know what kind of info I can get from my device to help ?
tonitch: If you do avoid "device" , it too vague, if you it is a camera, call it a camera, if its acquisition, call it acquisition, explain the problem and errors you are getting with the details you understand, folks over the ML will ask you for more details when they start to understand what you are dealing with
okay, its acquisition that have the video but no sound and I found a lot of articles online that has the same problem ^^ I will do thank you!
if you do have a patch in the code, but don't think its good for inclusion, send it, but use the [RFC]  prefix in the email
RFC stands for request for comment, and will tell that someone needs help with a work in progress fix
okay ^^ I don't actually have a patch because as I said, I'm really bad with kernel programming and all of this... but this is good to know! 
hey! 
ho and, can I send mail without being sub to the linux-media mailing list ? I'm pretty sure I have read somewhere that you can't ?
a bit off-topic, but def. media/pipeline related... I was wondering if there are common patterns that manages "data" (e.g. video/audio frames) where the data gets reused once they have been pushed through the pipeline? (hopefully this makes sense)
tonitch: I believe you can, but it will be moderated and it will take more time, but we keep CC for replies
roxlu: perhaps give a concrete example ?
for audio ALSA is ring-buffer based, so there isn't zero-copy, well there is, but if you do, you have to use that buffer before the ring buffer have come back to that point
for V4L2, "buffers" are explicitly dequeued and queued into the driver, as there is not kind of fence support in v4l2, userspace must to not queue a buffer that is in use elsewhere
ndufresne: thanks, let's see if I can come up with a clear example ...
ALSA can do copy() as well but it's not the way most hardware works so it's rarely directly implemented.
.. not sure if this is a good example, but here it goes ..
Most audio hardware has a ring buffer, you do copies but you minimise interrupts.
let say I'm enconding video frames, storing raw YUV in a `struct MediaPacket`, this media packet gets passed into the encoder which keeps it around until it receives the 10th frame, then it's ready and the `MediaPacket` can be filled again with a new frame
in this case it would (to me) make sense to reuse the `MediaPacket` and don't allocate new memory to hold the raw video frame
there is a bit more to my story though ...
at the same time another thread might want to use the raw video frame data to generate a thumbnail/jpg/png ...
now there are 2 users of the same packet that read the raw video frame data
and I'm wondering if there is some sort of common pattern to handle this?
ndufresne: any thoughts? :) or did I maybe make it even more unclear what I'm thinking about
roxlu: you can solve this with refference counting (or shared ptr if you programming language have such a memory model)
this is what the GStreamer layer will handle for you when you setup a graph fyi
ndufresne: yeah that's something which I was thinking about too
what I'm not sure about is how to "manage" this; e.g. I was thinking about keeping a collection of `MediaPackets` and a function like `get_free_media_packet(list, &out)`
but, how would a `MediaPacket` which can be reused be added back to the list
yes, you need a pool, and you recount mechanism needs to have recycling feature
most implementation of weak pointers will give you the ability to keep the object alive
in GStreamer we rely on glib GObject implementation, but also have a smaller, faster C object called GstMiniObject, which have this kind of feature, well that and also writability mechanism
ah awesome! 
but if you use other language, like C++ or Rust, this kind of feature comes with the language, and can even be checked at build time
so you mean that a recount function would check if e.g. `num_refs` is 0 then it woulud be added back to the `freelist` for example?
a weak ref is basically a callback, which tells you when the buffer has gone to rec_count 0 (or is about to get there depending if the implementation is lock free or not)
the other approach is fences
which is a companion object that can be waited on, and will be triggered when the buffer is ready to be reused (or filled when use the other way around)
in the DRM subsystem (GFX) this is the preferred method
but I don't think fences gives you the multi-plexing ability, or at least it's not obvious to me
back 
when I would use a weak ref, who is responsible of triggering the callback?
is that the cleanup function?
Well depends, as I said, in all project I work on, this is done by GLib/Gst objects, or C++ STL
and in Rust it's part of the language
ah ok, I'm most likely to use C++
then perhaps aim at C++14 or more, and you can use the STL instead of over designing and implementing your own
what features of c++14 are you referring too?
but yeah, it looks like you are about to design your own media framework, perhaps read a bit about prior art, for C++ I'd look perhas at Chromium internal framework (though not easy to read)
I'm more looking into this as a general solution.  I think this could be evenly valid for a GUI app where I need pass messages to different handlers and e.g. can only continue when all shared data has been released
actually, just a shared_ptr with a deleter seems enoug to implement an object pool https://en.cppreference.com/w/cpp/memory/shared_ptr
ok thanks! that makes sense; I understand what you mean now
just found this https://nullprogram.com/blog/2015/02/17/ which I think is also interesting; I've to dive into that but I think the nice thing here is that the "type" doesn't need to know how it's ref-counted
the struct does need to hold a ref count itself in that link btw
this is plain C, this is similar to what GLib will give you, except GLib works on C89, were this is C11+
(well perhaps only C99 now ...)
Yes, I do like that approach tbh. Although what I don't like is to add a ref_count member to objects that I want to refcount. A cleaner solution (at least, that's what I think) is to separate the ref-counting; e.g. create a `RefCountManager` or something
then do: `inc_ref_count(manager, obj)`  and `dec_ref_count(manager, obj)`
but that also has it's downsides as you have to pass along the `manager` 
ho... i'm sad... I just subscribed to linux-media, then sent my mail, then noticed that I forgot to confirm my subscribrtion ^^ my mail is not on linux-media archive so I suppose that It's in verification process :'(
tonitch: no worries, I saw your email, so it made it through
hopefully some em2860 will pick it up and reply
thanks a lot ! ^^
can I unsub to linux-media then ? ^^ to be honest, I already tried to sub in the past and it's a spam for me! I don't follow half of the mails
I guess so, when I click reply, it will reply to "Debucquoy Anthony <d.tonitch@gmail.com>, linux-media@vger.kernel.org, "
so that will work
make sure to reply all though on your side
tonitch: you can also stay subcribe, but disable emails
this way you don't get the moderation notice
I often mix my company email with my personal address, so I did that for the second
sure, how can I do that ?
ho, do you mean with majordomo or with my mail client ?
hverkuil: any comment on cedrus patches? are they gtg?
tonitch: yeah, it's not mailman or something with a web UI, I wonder if one of the moderator didn't do it for me, but there is commands you can send to majordom
I see there is a suspend command
tonitch: so perhaps "mailto:majordomo@vger.kernel.org?body=suspend linux-media"
I'll try thanks
'suspend' not recognized ^^
I'm sure Nicolas meant "subscribe linux-media"
that's what too much time deailing with pm does to you.
no, I'm already subscribed ^^
oh, he actually meant "suspend" :P
jernej: I hope to spend some time on patch review tomorrow/next week. I'm behind on my reviews :-(
ok, no problem
ezequielg: let me know when you are happy with the vp9 patches. I'd love to get that merged.
hverkuil: I took a look at the previous round, checked the uapi with pahole, and reviewed everything.
I think ndufresne then made some comments. ndufresne if you are happy, can you give your R-b to the patches?
hverkuil: I believe you can take a look... I'll check the new version now just in case, but it's good.
jernej: are you happy with the uAPI changes and how it looks overall?
Great, I see if I can take a look tomorrow.
ezequielg: hverkuil: there is room for improvement, consider line num_ctbs = ((w + 63) / 64) * ((h + 63) / 64);
it could use roundup() instead of manually doing alignment to 64
I have plan to comment on that (many places) but I didn't managed yet
there are few unneeded intermediate variables
but all that is just cosmetics
but is that on the driver or the uAPI?
no, that is driver
I don't think we care as much about the driver... we can do that as follow-up improvements, right?
I'm good with how API looks like, but I can't comment about it's content - I really don't know VP9
jernej: neither do I, so I relies on others for that :-)
I managed to make this driver also work on Allwinner H6, with some changes (it has older core design)
so I can say it works
I guess those cosmetic changes can be done later
anyway, have to go
yeah, that's why I really wanted ndufresne and dwlsalmeida to check out the VP9 uAPI and make sure they are cool with it.
ezequielg: I need to find time to make another pass, right now I was busy trying to get the code to run, depends on your fmt patch, depends on some DT bindings that I think aren't accepted
gst moved to monorepo too, so I asked dwlsalmeida to move his MR
hverkuil: I'd say give me perhas till next week ?
hverkuil: ezequielg: cause other then that, I'm comparing scores against NVidia decoder (using that one since it does not support inter-frame scaling like us), and getting close by scores, jernej manage to get an older G2 to work too, we have 2 HW running now
yeah, it's a moving target.
I even got Neil A. to look at it a bit, and he said meson HW structure contains exactly the same fields but shuffled
(yes, meson is stateful, but the driver implement probs update too, just found yesterday)
ndufresne: thank you for the input, I'll wait.