Ticket #11297 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Action Needed: no action Verified: no
Deployments affected: Blocked By:
Blocking:

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

Change History

  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

  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

  Changed 3 years ago by godiard

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

  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 :-)

  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

follow-up: ↓ 8   Changed 3 years ago by dsd

  • owner set to saadia
  • component changed from scratch-activity to kernel

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.

  Changed 3 years ago by dsd

  • owner changed from saadia to dsd

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?

  Changed 3 years ago by dsd

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

  Changed 3 years ago by dsd

  • next_action 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

  Changed 3 years ago by dsd

  • next_action changed from add to build to test in build

test in 11.3.0 candidate build 883

  Changed 3 years ago by erikos

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

  Changed 3 years ago by greenfeld

  • status changed from new to closed
  • next_action changed from test in build to no action
  • resolution set to fixed

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.