Opened 3 years ago

Closed 3 years ago

#11297 closed defect (fixed)

Scratch: Camera quality in xo-1.5 is worst than in os874

Reported by: godiard Owned by: dsd
Priority: normal Milestone: 11.3.0
Component: kernel Version: 1.5-C2
Keywords: Cc:
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

The image displayed by the camera in Scratch in xo-1.5 is using 256 colors and is not really usable.(Tested in os8)

I am compiling plugins in xo-1.75 and the camera works ok.

Also in os874 (xo-1.75) the camera worked ok, then this is a regression.

We can look if re compilating the plugin is solved.

Attachments (1)

0001-ov7670-Disable-non-YUV-modes-on-XO-1.5-11297.patch (1.0 KB) - added by dsd 3 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 3 years ago by godiard

  • Summary changed from Scratch: Camera quality in xo-1.75 is worst than in os974 to Scratch: Camera quality in xo-1.75 is worst than in os874

comment:2 Changed 3 years ago by godiard

  • Summary changed from Scratch: Camera quality in xo-1.75 is worst than in os874 to Scratch: Camera quality in xo-1.5 is worst than in os874

comment:3 Changed 3 years ago by godiard

Compiling the plugin in xo-1.5 does not solve the problem.

comment:4 Changed 3 years ago by dmoco

The problem is in libv4l2, probably a colour-space conversion error. AFAICT this will be from a Fedora 14 build but being a dummy cannot even locate the Fedora/OLPC repo in order to check the change log :-)

comment:5 Changed 3 years ago by dmoco

"...being a dummy *I* cannot..."

Change log here unless I'm mistaken: http://git.linuxtv.org/v4l-utils.git/shortlog

comment:6 follow-up: Changed 3 years ago by dsd

  • Component changed from scratch-activity to kernel
  • Owner set to saadia

Scratch requests a variety of formats from the camera and has its own internal format conversion routines. With libv4l-0.8.3, all of these requests failed until we hit YUYV, which is what our camera is good at, and then Scratch converted it to ARGB in the camera plugin.

With libv4l-0.8.4, libv4l's format conversion routines improved greatly, so that when Scratch first requests RGB24 which is not supported by our camera, libv4l's conversion kicks in and says "yes we support it" and switches the camera to RGB565 mode (which we do support), and post-processes all the data to convert it to RGB24.

Scratch also sets the resolution to 320x240, which is half the dimensions of the single native resolution supported by this hardware configuration. via-camera therefore applies hardware scaling to the image to reduce it to these dimensions but it appears we had never tested this scaling with RGB. It works fine with YUYV but with RGB you get lots of green noise. The hardware documentation is very limited here, it does not describe how this scaling works or how it knows which pixel format it is dealing with. I guess it does not support scaling of RGB images and treats them as YUYV.

So, test case to reproduce the issue is:

gst-launch v4l2src ! video/x-raw-rgb,bpp=16,width=320,height=240 ! ffmpegcolorspace ! xvimagesink

Whereas 640x480 works.

I mailed Jon Corbet to see if he knows anything, if not I guess we will either disable hardware scaling or disable RGB support at the driver level. I just tested the latter solution, it works fine as libv4l falls back to YUYV on the camera and converts it to RGB24 internally, and the Scratch image then appears fine.

comment:7 Changed 3 years ago by dsd

  • Owner changed from saadia to dsd

comment:8 in reply to: ↑ 6 Changed 3 years ago by godiard

Replying to dsd:

Great, but why works ok in xo-1.75 and not in xo-1.5 ? The camera is the same or is different?

comment:9 Changed 3 years ago by dsd

The camera is the same but the capture device is not.

comment:10 Changed 3 years ago by dsd

  • Action Needed changed from diagnose to add to build

shipping the above patch in olpc-2.6.35 for 11.3.0, committed as 5d76efb

Upstreamable version submitted: http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/39746

comment:11 Changed 3 years ago by dsd

  • Action Needed changed from add to build to test in build

test in 11.3.0 candidate build 883

comment:12 Changed 3 years ago by erikos

Does work for me fine in os873 on a XO 1.5.

comment:13 Changed 3 years ago by greenfeld

  • Action Needed changed from test in build to no action
  • Resolution set to fixed
  • Status changed from new to closed

Camera captures now look much better in Scrach in 11.3.0 os883 on XO-1.5, and still look proper in the Record activity as well.

Note: See TracTickets for help on using tickets.