Bug 21869 - Chroma mismatch using XV
Summary: Chroma mismatch using XV
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: 7.4 (2008.09)
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-22 04:54 UTC by Ancoron
Modified: 2013-08-18 18:09 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Test video (3 seconds) (818.50 KB, application/octet-stream)
2009-05-22 04:58 UTC, Ancoron
no flags Details
NV34M xvinfo (5.27 KB, text/plain)
2009-05-22 05:03 UTC, Ancoron
no flags Details
NV34M xdpyinfo (17.32 KB, text/plain)
2009-05-22 05:03 UTC, Ancoron
no flags Details
NV34M glxinfo (18.34 KB, text/plain)
2009-05-22 05:04 UTC, Ancoron
no flags Details
NV34M xrandr --verbose (24.05 KB, text/plain)
2009-05-22 05:04 UTC, Ancoron
no flags Details
NV34M xorg.conf (2.71 KB, application/octet-stream)
2009-05-22 05:04 UTC, Ancoron
no flags Details
NV34M Xorg.0.log (52.07 KB, application/octet-stream)
2009-05-22 05:05 UTC, Ancoron
no flags Details
Chroma not updated to current frame (178.71 KB, image/png)
2009-05-23 05:36 UTC, Ancoron
no flags Details

Description Ancoron 2009-05-22 04:54:19 UTC
I recently found out that the nouveau driver (and especially its XV implementation) causes the following chroma-issue with my NV34M. At every second frame I can see that the chroma is reused from the last frame and not updated for the current frame. The luminance is always correct.

I checked on another machine with a radeon card to verify that it is not a problem caused by some other things. XV rendering itself is very fast and I don't have other problems here.

I have extracted an interesting portion of an encoded video to show what I mean. I would really like to be able to provide a screenshot of a frame but I don't know how to get those rendered frames out of the video memory.

If anyone comes by this issue with another hardware than mine please check if you get the same issue there.

The command I used to verify the problem in mplayer was:

mplayer xv-chroma-mismatch.avi -fps 1 -vo x11

In addition mplayer output is just fine.

Machine infos:

Dell Inspiron 8600
- nVidia GeForce FX Go5200 64M (rev a1, NV34M)
- Kubuntu Jaunty (9.04)

$ dpkg -l | grep nouveau
ii  libdrm-nouveau1                 2.4.7-0~8.10~ppa3
ii  nouveau-kernel-source           0.0.11+git20090404-0ubuntu1
ii  xserver-xorg-video-nouveau      1:0.0.10~git+20090404+11be9a9-0ubuntu1
Comment 1 Ancoron 2009-05-22 04:58:39 UTC
Created attachment 26099 [details]
Test video (3 seconds)

This test video contains fast movement to better visualize the issue. The chroma mismatch doesn't appear e.g. with using 'x11' instead of 'xv'.
Comment 2 Ancoron 2009-05-22 05:03:23 UTC
Created attachment 26100 [details]
NV34M xvinfo
Comment 3 Ancoron 2009-05-22 05:03:45 UTC
Created attachment 26101 [details]
NV34M xdpyinfo
Comment 4 Ancoron 2009-05-22 05:04:11 UTC
Created attachment 26102 [details]
NV34M glxinfo
Comment 5 Ancoron 2009-05-22 05:04:36 UTC
Created attachment 26103 [details]
NV34M xrandr --verbose
Comment 6 Ancoron 2009-05-22 05:04:57 UTC
Created attachment 26104 [details]
NV34M xorg.conf
Comment 7 Stephane Marchesin 2009-05-22 05:05:25 UTC
What xv port are you using? Also, what happens when using different xv ports (texture, overlay, blitter) ?
Comment 8 Ancoron 2009-05-22 05:05:50 UTC
Created attachment 26105 [details]
NV34M Xorg.0.log
Comment 9 Ancoron 2009-05-22 05:16:54 UTC
(In reply to comment #7)
> What xv port are you using? Also, what happens when using different xv ports
> (texture, overlay, blitter) ?
> 

I didn't specify a port manually but I just checked and found out that according to 'xvinfo' the chroma mismatch only appears when mplayer uses the "NV Video Overlay with Composite" at port 57. The other three adaptors "NV30 texture adapter", "NV30 high quality adapter" and "NV Video Blitter" don't produce such an issue. They render all as expected and totally correct.
Comment 10 Stephane Marchesin 2009-05-22 06:02:38 UTC
Can you try editing nv10_xv_ovl.c from the DDX, and change :
        /* Those are important only for planar formats (NV12) */
        if (uvoffset) {

into  

        /* Those are important only for planar formats (NV12) */
        {

around line 120.
Comment 11 Ancoron 2009-05-22 10:14:43 UTC
That didn't change anything. Sorry.
Comment 12 Danny 2009-05-23 02:52:33 UTC
What should i be looking at exactly? Is it that the buttons are visible transparently through the hand?

In that case, i see it as well (nv34M@ppc). Only with the overlay. Now I do admit that I have for a long time suspected some of the changes darktama made to the overlay code a few months ago reduced the image quality, but I could never really pinpoint it. Perhaps it is this. I will try to see if i can bisect it with this testcase.

Danny
Comment 13 Ancoron 2009-05-23 05:32:49 UTC
(In reply to comment #12)
> What should i be looking at exactly? Is it that the buttons are visible
> transparently through the hand?
> 
> In that case, i see it as well (nv34M@ppc). Only with the overlay. Now I do
> admit that I have for a long time suspected some of the changes darktama made
> to the overlay code a few months ago reduced the image quality, but I could
> never really pinpoint it. Perhaps it is this. I will try to see if i can bisect
> it with this testcase.
> 
> Danny
> 

Yes, exactly. In addition as soon as I move the video window around the screen it gets updated and this seems to bring the chroma back in line.

I've just reproduced the issue in a picture.
Comment 14 Ancoron 2009-05-23 05:36:21 UTC
Created attachment 26143 [details]
Chroma not updated to current frame

This is a reproduction of the issue using gimp, the nice RGB to YUV plugin and frames number 58 (the chroma) and frame 59 (luminance) from the test video file.

This is exactly what I see in the video at frame 59.
Comment 15 Ancoron 2009-05-23 05:40:26 UTC
Also it not determined if the chroma issue appears at odd or even frames.
Comment 16 Pekka Paalanen 2009-05-30 05:11:07 UTC
I confirm this problem with nv28. Xv port "NV Video Overlay" suffers it, "NV Video Blitter" is fine.

I've been watching TV with gxine and some time in the past it started to look like there was something lagging with colors, especially certain red and blue hues. I didn't pinpoint it then, but this bug is the problem.

My Nouveau installation is still quite old, March 27th.

Thanks for the test case! For instance, when the red buttons light up in the beginning, they start white and turn red on the next frame. Without the bug they become red from the beginning. Later, when the red hands move, the chroma and luma are clearly "out of sync" every other frame: pale hands have a red "shadow".
Comment 17 Nick Bowler 2009-06-25 13:55:57 UTC
I can confirm this issue on NV36 as well.  It is possible to watch the chroma fail to change while doing single-frame steps with mplayer.
Comment 18 Ancoron 2009-10-25 07:35:56 UTC
(In reply to comment #12)
> What should i be looking at exactly? Is it that the buttons are visible
> transparently through the hand?
> 
> In that case, i see it as well (nv34M@ppc). Only with the overlay. Now I do
> admit that I have for a long time suspected some of the changes darktama made
> to the overlay code a few months ago reduced the image quality, but I could
> never really pinpoint it. Perhaps it is this. I will try to see if i can bisect
> it with this testcase.
> 
> Danny
> 

How's the progress on this issue?
Comment 19 Pekka Paalanen 2009-10-25 07:51:38 UTC
Since video overlays are not supported with KMS, I doubt there is any point in trying to fix this. Other types of Xv adaptors do not exhibit this bug, do they?
Comment 20 Stephane Marchesin 2009-10-25 11:59:42 UTC
(In reply to comment #19)
> Since video overlays are not supported with KMS, I doubt there is any point in
> trying to fix this. Other types of Xv adaptors do not exhibit this bug, do
> they?
> 

I disagree here, it's feasible to have overlay + KMS, we just need to put together an ioctl to program the overlay through KMS and things will work.
Comment 21 Ancoron 2009-10-25 12:43:28 UTC
(In reply to comment #19)
> Since video overlays are not supported with KMS, I doubt there is any point in
> trying to fix this. Other types of Xv adaptors do not exhibit this bug, do
> they?
> 

OK, but as long as I understand KMS it just provides textured video which uses the 3D engine whereas XV uses separate resources and therefore wouldn't interfere calculations in the 3D pipeline or OpenCL as much as textured video does.

Am I completely wrong at this point?

Additionally I see a lot of attributes for the overlay adapter:
      "XV_DOUBLE_BUFFER" (range 0 to 1)
      "XV_COLORKEY" (range 0 to 16777215)
      "XV_AUTOPAINT_COLORKEY" (range 0 to 1)
      "XV_SET_DEFAULTS" (range 0 to 0)
      "XV_BRIGHTNESS" (range -512 to 511)
      "XV_CONTRAST" (range 0 to 8191)
      "XV_SATURATION" (range 0 to 8191)
      "XV_HUE" (range 0 to 360)
      "XV_ITURBT_709" (range 0 to 1)
      "XV_ON_CRTC_NB" (range 0 to 1)

In contrast all other adapters just have these:
      "XV_SET_DEFAULTS" (range 0 to 0)
      "XV_SYNC_TO_VBLANK" (range 0 to 1)

That leads me to the conclusion that XV does provide much more utilizing the graphics hardware whereas the others provide less and therefore video players will do other tasks on the CPU regardless of the fact that the hardware might be better for that (although this may not be the case for nVidia cards).

As I see how fast the XV implementation is (except this chroma issue) on my rather limited system (Pentium M 1.4GHz, NV34M 64MB) and I fear that if I upgrade to Ubuntu Karmic later this month I will see much more of my CPU being used for just video playback whereas it is open most open for other tasks until now.

So can I be sure that KMS and its related stuff will use my available hardware at least as good as nouveau does it until now by itself?
Comment 22 Ilia Mirkin 2013-08-18 18:09:58 UTC
It appears that this bug report has laid dormant for quite a while. Sorry we haven't gotten to it. Since we fix bugs all the time, chances are pretty good that your issue has been fixed with the latest software. Please give it a shot. (Linux kernel 3.10.7, xf86-video-nouveau 1.0.9, mesa 9.1.6, or their git versions.) If upgrading to the latest isn't an option for you, your distro's bugzilla is probably the right destination for your bug report.

In an effort to clean up our bug list, we're pre-emptively closing all bugs that haven't seen updates since 2011. If the original issue remains, please make sure to provide fresh info, see http://nouveau.freedesktop.org/wiki/Bugs/ for what we need to see, and re-open this one.

Thanks,

The Nouveau Team


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.