mbox series

[0/8] staging: media: zoran: fusion in one module

Message ID 20210903191540.3052775-1-clabbe@baylibre.com (mailing list archive)
Headers show
Series staging: media: zoran: fusion in one module | expand

Message

Corentin LABBE Sept. 3, 2021, 7:15 p.m. UTC
Hello

The main change of this serie is to fusion all zoran related modules in
one.
This fixes the load order problem when everything is built-in.

Regards

Corentin Labbe (8):
  staging: media: zoran: move module parameter checks to zoran_probe
  staging: media: zoran: use module_pci_driver
  staging: media: zoran: rename debug module parameter
  staging: media: zoran: add debugfs
  staging: media: zoran: videocode: remove procfs
  staging: media: zoran: fusion all modules
  staging: media: zoran: remove vidmem
  staging: media: zoran: move videodev alloc

 drivers/staging/media/zoran/Kconfig        |  24 +-
 drivers/staging/media/zoran/Makefile       |   8 +-
 drivers/staging/media/zoran/videocodec.c   |  60 +----
 drivers/staging/media/zoran/videocodec.h   |   5 +
 drivers/staging/media/zoran/zoran.h        |   7 +-
 drivers/staging/media/zoran/zoran_card.c   | 259 +++++++++++++--------
 drivers/staging/media/zoran/zoran_driver.c |   5 +-
 drivers/staging/media/zoran/zr36016.c      |  23 +-
 drivers/staging/media/zoran/zr36016.h      |   2 +
 drivers/staging/media/zoran/zr36050.c      |  20 +-
 drivers/staging/media/zoran/zr36050.h      |   2 +
 drivers/staging/media/zoran/zr36060.c      |  20 +-
 drivers/staging/media/zoran/zr36060.h      |   2 +
 13 files changed, 229 insertions(+), 208 deletions(-)

Comments

Hans Verkuil Sept. 6, 2021, 11:03 a.m. UTC | #1
Hi Corentin,

I finally had the opportunity to test the staging zoran driver.

I found several issues when running v4l2-compliance -s (I posted a patch
for that), but more seriously is the fact that trying to capture MJPG
at resolutions 384x288 or less just hangs my PC. It works OK with 768x576.

I discovered this when running 'v4l2-compliance -s -a -f'.

BTW, why isn't the initial format equal to MJPG 768x576?
I would expect that for these boards that should be the default format.

Another issue is that the TODO should mention that for video output there
should be a second video device node. And that's really something that
has to be done before the zoran driver can be moved out of staging.

It shouldn't be that hard to implement, I think.

Right now it is impossible to run the compliance test for the output, since
it doesn't even see it as an output.

Regards,

	Hans

On 03/09/2021 21:15, Corentin Labbe wrote:
> Hello
> 
> The main change of this serie is to fusion all zoran related modules in
> one.
> This fixes the load order problem when everything is built-in.
> 
> Regards
> 
> Corentin Labbe (8):
>   staging: media: zoran: move module parameter checks to zoran_probe
>   staging: media: zoran: use module_pci_driver
>   staging: media: zoran: rename debug module parameter
>   staging: media: zoran: add debugfs
>   staging: media: zoran: videocode: remove procfs
>   staging: media: zoran: fusion all modules
>   staging: media: zoran: remove vidmem
>   staging: media: zoran: move videodev alloc
> 
>  drivers/staging/media/zoran/Kconfig        |  24 +-
>  drivers/staging/media/zoran/Makefile       |   8 +-
>  drivers/staging/media/zoran/videocodec.c   |  60 +----
>  drivers/staging/media/zoran/videocodec.h   |   5 +
>  drivers/staging/media/zoran/zoran.h        |   7 +-
>  drivers/staging/media/zoran/zoran_card.c   | 259 +++++++++++++--------
>  drivers/staging/media/zoran/zoran_driver.c |   5 +-
>  drivers/staging/media/zoran/zr36016.c      |  23 +-
>  drivers/staging/media/zoran/zr36016.h      |   2 +
>  drivers/staging/media/zoran/zr36050.c      |  20 +-
>  drivers/staging/media/zoran/zr36050.h      |   2 +
>  drivers/staging/media/zoran/zr36060.c      |  20 +-
>  drivers/staging/media/zoran/zr36060.h      |   2 +
>  13 files changed, 229 insertions(+), 208 deletions(-)
>
Corentin LABBE Sept. 6, 2021, 1:49 p.m. UTC | #2
Le Mon, Sep 06, 2021 at 01:03:56PM +0200, Hans Verkuil a écrit :
> Hi Corentin,
> 
> I finally had the opportunity to test the staging zoran driver.
> 
> I found several issues when running v4l2-compliance -s (I posted a patch
> for that), but more seriously is the fact that trying to capture MJPG
> at resolutions 384x288 or less just hangs my PC. It works OK with 768x576.
> 
> I discovered this when running 'v4l2-compliance -s -a -f'.
> 
> BTW, why isn't the initial format equal to MJPG 768x576?
> I would expect that for these boards that should be the default format.
> 
> Another issue is that the TODO should mention that for video output there
> should be a second video device node. And that's really something that
> has to be done before the zoran driver can be moved out of staging.
> 
> It shouldn't be that hard to implement, I think.
> 
> Right now it is impossible to run the compliance test for the output, since
> it doesn't even see it as an output.
> 
> Regards,
> 
> 	Hans

I work on having a second device for output, (it is the reason of "staging: media: zoran: move videodev alloc" which will help).

But I still have the problem of non working output.

Does output is really needed for going out of staging ?
Probably nobody have it working for ages. The only way to had it was to use an old mplayer output which is broken since so many time.
Note that this plugin will never work again.

The only way to work on output is to use ffmpeg which just recently have suport for writing non-raw video to V4L.

Regards
Hans Verkuil Sept. 6, 2021, 2:11 p.m. UTC | #3
On 06/09/2021 15:49, LABBE Corentin wrote:
> Le Mon, Sep 06, 2021 at 01:03:56PM +0200, Hans Verkuil a écrit :
>> Hi Corentin,
>>
>> I finally had the opportunity to test the staging zoran driver.
>>
>> I found several issues when running v4l2-compliance -s (I posted a patch
>> for that), but more seriously is the fact that trying to capture MJPG
>> at resolutions 384x288 or less just hangs my PC. It works OK with 768x576.
>>
>> I discovered this when running 'v4l2-compliance -s -a -f'.
>>
>> BTW, why isn't the initial format equal to MJPG 768x576?
>> I would expect that for these boards that should be the default format.
>>
>> Another issue is that the TODO should mention that for video output there
>> should be a second video device node. And that's really something that
>> has to be done before the zoran driver can be moved out of staging.
>>
>> It shouldn't be that hard to implement, I think.
>>
>> Right now it is impossible to run the compliance test for the output, since
>> it doesn't even see it as an output.
>>
>> Regards,
>>
>> 	Hans
> 
> I work on having a second device for output, (it is the reason of "staging: media: zoran: move videodev alloc" which will help).
> 
> But I still have the problem of non working output.
> 
> Does output is really needed for going out of staging ?
> Probably nobody have it working for ages. The only way to had it was to use an old mplayer output which is broken since so many time.
> Note that this plugin will never work again.
> 
> The only way to work on output is to use ffmpeg which just recently have suport for writing non-raw video to V4L.

Then just remove it. The code for output remains in the git history so if someone wants to
resurrect that, then that's always possible.

The point is that I don't want to have half-baked output support in mainline.

But what exactly is the problem with getting output to work? Doesn't it just decode
MJPEG frames? (Sorry if you explained it before, it's so long ago that I looked at this
that I forgot the details)

In any case, before the driver can be moved out of staging video output should either
be working or removed. Either is fine, but not the halfway state it is in today.

Regards,

	Hans
Corentin LABBE Sept. 6, 2021, 2:56 p.m. UTC | #4
Le Mon, Sep 06, 2021 at 04:11:16PM +0200, Hans Verkuil a écrit :
> On 06/09/2021 15:49, LABBE Corentin wrote:
> > Le Mon, Sep 06, 2021 at 01:03:56PM +0200, Hans Verkuil a écrit :
> >> Hi Corentin,
> >>
> >> I finally had the opportunity to test the staging zoran driver.
> >>
> >> I found several issues when running v4l2-compliance -s (I posted a patch
> >> for that), but more seriously is the fact that trying to capture MJPG
> >> at resolutions 384x288 or less just hangs my PC. It works OK with 768x576.
> >>
> >> I discovered this when running 'v4l2-compliance -s -a -f'.
> >>
> >> BTW, why isn't the initial format equal to MJPG 768x576?
> >> I would expect that for these boards that should be the default format.
> >>
> >> Another issue is that the TODO should mention that for video output there
> >> should be a second video device node. And that's really something that
> >> has to be done before the zoran driver can be moved out of staging.
> >>
> >> It shouldn't be that hard to implement, I think.
> >>
> >> Right now it is impossible to run the compliance test for the output, since
> >> it doesn't even see it as an output.
> >>
> >> Regards,
> >>
> >> 	Hans
> > 
> > I work on having a second device for output, (it is the reason of "staging: media: zoran: move videodev alloc" which will help).
> > 
> > But I still have the problem of non working output.
> > 
> > Does output is really needed for going out of staging ?
> > Probably nobody have it working for ages. The only way to had it was to use an old mplayer output which is broken since so many time.
> > Note that this plugin will never work again.
> > 
> > The only way to work on output is to use ffmpeg which just recently have suport for writing non-raw video to V4L.
> 
> Then just remove it. The code for output remains in the git history so if someone wants to
> resurrect that, then that's always possible.
> 
> The point is that I don't want to have half-baked output support in mainline.
> 
> But what exactly is the problem with getting output to work? Doesn't it just decode
> MJPEG frames? (Sorry if you explained it before, it's so long ago that I looked at this
> that I forgot the details)
> 

The first problem is that zoran dont like comment COM/APP0 markers.
This imply a per buffer filtering but this is already handled in my next branch.

But the remaining problem is that any output is like http://kernel.montjoie.ovh/zoran_out.png.

I hacked the driver to grab a working buffer when doing input and overrun output buffer later.
And the result is a working static output.
So the hw handling is good and the problem came from the data feeding/handling.

I believe that something is wrong in what ffmpeg negociate/send.

Regards
Hans Verkuil Sept. 6, 2021, 3:06 p.m. UTC | #5
On 06/09/2021 16:56, LABBE Corentin wrote:
> Le Mon, Sep 06, 2021 at 04:11:16PM +0200, Hans Verkuil a écrit :
>> On 06/09/2021 15:49, LABBE Corentin wrote:
>>> Le Mon, Sep 06, 2021 at 01:03:56PM +0200, Hans Verkuil a écrit :
>>>> Hi Corentin,
>>>>
>>>> I finally had the opportunity to test the staging zoran driver.
>>>>
>>>> I found several issues when running v4l2-compliance -s (I posted a patch
>>>> for that), but more seriously is the fact that trying to capture MJPG
>>>> at resolutions 384x288 or less just hangs my PC. It works OK with 768x576.
>>>>
>>>> I discovered this when running 'v4l2-compliance -s -a -f'.
>>>>
>>>> BTW, why isn't the initial format equal to MJPG 768x576?
>>>> I would expect that for these boards that should be the default format.
>>>>
>>>> Another issue is that the TODO should mention that for video output there
>>>> should be a second video device node. And that's really something that
>>>> has to be done before the zoran driver can be moved out of staging.
>>>>
>>>> It shouldn't be that hard to implement, I think.
>>>>
>>>> Right now it is impossible to run the compliance test for the output, since
>>>> it doesn't even see it as an output.
>>>>
>>>> Regards,
>>>>
>>>> 	Hans
>>>
>>> I work on having a second device for output, (it is the reason of "staging: media: zoran: move videodev alloc" which will help).
>>>
>>> But I still have the problem of non working output.
>>>
>>> Does output is really needed for going out of staging ?
>>> Probably nobody have it working for ages. The only way to had it was to use an old mplayer output which is broken since so many time.
>>> Note that this plugin will never work again.
>>>
>>> The only way to work on output is to use ffmpeg which just recently have suport for writing non-raw video to V4L.
>>
>> Then just remove it. The code for output remains in the git history so if someone wants to
>> resurrect that, then that's always possible.
>>
>> The point is that I don't want to have half-baked output support in mainline.
>>
>> But what exactly is the problem with getting output to work? Doesn't it just decode
>> MJPEG frames? (Sorry if you explained it before, it's so long ago that I looked at this
>> that I forgot the details)
>>
> 
> The first problem is that zoran dont like comment COM/APP0 markers.
> This imply a per buffer filtering but this is already handled in my next branch.
> 
> But the remaining problem is that any output is like http://kernel.montjoie.ovh/zoran_out.png.
> 
> I hacked the driver to grab a working buffer when doing input and overrun output buffer later.
> And the result is a working static output.
> So the hw handling is good and the problem came from the data feeding/handling.
> 
> I believe that something is wrong in what ffmpeg negociate/send.
> 
> Regards
> 

Why not use v4l2-ctl to capture video and then replay it? You should be able to do this:

v4l2-ctl --stream-mmap --stream-to-hdr cap.hdr --stream-count 60

then this:

v4l2-ctl --stream-out-mmap --stream-from-hdr cap.hdr

The -hdr options write the frames prefixed with a header containing the length of the frame.
That way you can capture variable-length frames and stream them out with the same payload
length.

Regards,

	Hans