Skip to contentSkip to conversation

about the y_skip_top parameter

soc-camera Sascha Hauer 3 participants 6 messages Sep 5, 2008 – Sep 9, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi all,

The y_skip_top parameter tells the cameras to effectively make the picture one line higher. I think this parameter was introduced to work around a bug in the pxa camera interface. The pxa refuses to read the first line of a picture. The problem with this parameter is that it is set to 1 in the sensor drivers and not in the pxa driver, so it's the sensor drivers which work around a bug in the pxa. On other hardware platforms (mx27 in this particular case) I cannot skip the first line, so I think this parameter should be set to 1 in the pxa driver and not the sensor drivers.

What do you think?

Sascha

Signature · 9 lines
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
#1 lore raw
Quoted 12 lines · Sascha Hauer

Hi all,

The y_skip_top parameter tells the cameras to effectively make the picture one line higher. I think this parameter was introduced to work around a bug in the pxa camera interface. The pxa refuses to read the first line of a picture. The problem with this parameter is that it is set to 1 in the sensor drivers and not in the pxa driver, so it's the sensor drivers which work around a bug in the pxa. On other hardware platforms (mx27 in this particular case) I cannot skip the first line, so I think this parameter should be set to 1 in the pxa driver and not the sensor drivers.

Quoted 1 line

What do you think?

Hm, AFAIR, the reason was different. I was told, that "all" cameras corrupt the first line, that's why that parameter has been introduced. I don't think it was related to PXA270. In any case, why don't you just set this parameter to whatever you need in your hist driver .add method, for example, before calling camera's .init?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw
Quoted 5 lines · Guennadi Liakhovetski

Hm, AFAIR, the reason was different. I was told, that "all" cameras corrupt the first line, that's why that parameter has been introduced. I don't think it was related to PXA270. In any case, why don't you just set this parameter to whatever you need in your hist driver .add method, for example, before calling camera's .init?

Actually I think there is now one camera at least which doesn't ... the mt9m111 :)

Maybe it has to do with the chip internals, which uses these first lines to make its calculation on white balance, gamma auto correction etc ...

--
Robert

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#3 lore raw
In reply to Guennadi Liakhovetski
Quoted 14 lines · Guennadi Liakhovetski
Quoted 12 lines · Sascha Hauer

Hi all,

The y_skip_top parameter tells the cameras to effectively make the picture one line higher. I think this parameter was introduced to work around a bug in the pxa camera interface. The pxa refuses to read the first line of a picture. The problem with this parameter is that it is set to 1 in the sensor drivers and not in the pxa driver, so it's the sensor drivers which work around a bug in the pxa. On other hardware platforms (mx27 in this particular case) I cannot skip the first line, so I think this parameter should be set to 1 in the pxa driver and not the sensor drivers.

Quoted 7 lines
Quoted 1 line

What do you think?

Hm, AFAIR, the reason was different. I was told, that "all" cameras corrupt the first line, that's why that parameter has been introduced. I don't think it was related to PXA270. In any case, why don't you just set this parameter to whatever you need in your hist driver .add method, for example, before calling camera's .init?

That's what I'm doing at the moment. I just had the feeling that there is a bug fixed in the wrong place, but I did not know that it's the cameras that corrupt the first line.
Anyway, what in case of bayer cameras? don't we have to skip the first two lines then? I'm asking because I'm still struggling with getting the correct pixel in the top left corner without introducing funny offsets. This brings me back to the question: Which color does the top left corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red line

Sascha

Signature · 9 lines
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
#4 lore raw
Quoted 8 lines · Sascha Hauer
Quoted 6 lines · Guennadi Liakhovetski

Hm, AFAIR, the reason was different. I was told, that "all" cameras corrupt the first line, that's why that parameter has been introduced. I don't think it was related to PXA270. In any case, why don't you just set this parameter to whatever you need in your hist driver .add method, for example, before calling camera's .init?

Quoted 5 lines

That's what I'm doing at the moment. I just had the feeling that there is a bug fixed in the wrong place, but I did not know that it's the cameras that corrupt the first line.
Anyway, what in case of bayer cameras? don't we have to skip the first two lines then?

I think so, yes. Or you start with the wrong line in your user-space application.

Quoted 6 lines

I'm asking because I'm still struggling with getting the correct pixel in the top left corner without introducing funny offsets. This brings me back to the question: Which color does the top left corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red line

http://www.siliconimaging.com/RGB%20Bayer.htm shows a green/red line on the top. But look in your camera datasheet - at least datasheets I was working with did describe the specific pattern the camera was producing. For example, mt9m001 also specifies green/red at the top.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#5 lore raw
Quoted 26 lines · Guennadi Liakhovetski
Quoted 8 lines · Sascha Hauer
Quoted 6 lines · Guennadi Liakhovetski

Hm, AFAIR, the reason was different. I was told, that "all" cameras corrupt the first line, that's why that parameter has been introduced. I don't think it was related to PXA270. In any case, why don't you just set this parameter to whatever you need in your hist driver .add method, for example, before calling camera's .init?

Quoted 5 lines

That's what I'm doing at the moment. I just had the feeling that there is a bug fixed in the wrong place, but I did not know that it's the cameras that corrupt the first line.
Anyway, what in case of bayer cameras? don't we have to skip the first two lines then?

I think so, yes. Or you start with the wrong line in your user-space application.

Quoted 6 lines

I'm asking because I'm still struggling with getting the correct pixel in the top left corner without introducing funny offsets. This brings me back to the question: Which color does the top left corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red line

Quoted 4 lines

http://www.siliconimaging.com/RGB%20Bayer.htm shows a green/red line on the top. But look in your camera datasheet - at least datasheets I was working with did describe the specific pattern the camera was producing. For example, mt9m001 also specifies green/red at the top.

Ah ok, so even the Micron chips are not consistent. I wonder whether we should move the pictures in kernel so that they all have the same pixel in the top left corner or introduce a second bayer fourcc then. It doesn't seem practical that the userspace apps hold a database of camera chips.

Sascha

Signature · 9 lines
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list