Announcement

Collapse
No announcement yet.

Xv video output has purple tint instead of beeing black

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Xv video output has purple tint instead of beeing black

    Hi I've been searching for some solution for my particular problem but only found bug reports/solutions and talk about Nvidia and no mention off ATi in this regard off Xv video output having wrong/distorted colours. Or rather simple, black is dark purple and all colours are off a bit to the purple end whit that.

    X11 gives correct colors and black is real true black but I want to use Xv becouse it works better and gives less tearing and generally has better performance than the other ones.

    I'm using Ubuntu 8.04 64bit, Kernel 2.6.24-19 generic whit Gnome 2.22.3 and I use the ATi 8.7 fglrx drivers which work quite well except for some smaller problems.(video tearing and blinking video whit specific stuff) But those are not the concern in this matter. I'm looking for a solution to fix the Xv to show correct colours!

    My hardware is as follows:
    AMD Phenom 9750 2.4Ghz
    Gigabyte GA-MA78GM-S2H (780G+SB700, F4 bios)
    Corsair TWIN2X 6400C4DHX DDR2 4096MB 2x2Gb (can only use 3.4Gb thx to some bug in the bios whit linux over 4G memory mapping, everything gets graphics corrupted and eventually hangs...)

    Iv'e run xvattr and everything seems to be correct at default 0 values...

    I hope there is some help to be had into this matter.

    Edit: As no one had posted I started to do some more searching for myself and found this thread here at Phoronix
    http://www.phoronix.com/forums/showthread.php?t=10870
    It's exactly the same thing... As the thread died without a solution or proper investigation... well... I really would like to see if a bug report was made as it seems to be a bug... Some say the like the "washed out colors more" but I would rather have correct colours than incorrect! I don't like my black being dark purple >_>; or have the washed out colours "aka like my crt TV that can't show black but a gray instead" which is a piece of crap cheap TV....
    Bug is limited to the use of TexturedVideo it seems. The older VideoOverlay gives the correct colours in conjunction to Xv video playback according to them...
    I'm not entirely new to linux but I haven't really done all my homework so where do I go to check if this bug has been reported?
    Last edited by Nighthog; 08-12-2008, 03:17 PM.

  • legume
    replied
    Originally posted by archman View Post
    well, my resolution is 1024x768
    so, I think maybe there is something wrong parameters I set in xorg.conf:
    Hmm 1024x768 works for me. Maybe you could try removing a few things from you device section - don't know if it will help, though. IIRC the TLS one gets ignored and you get whatever is set with aticonfig anyway. I don't know what you actually need - On a single CRT mine is empty now, though I used to need XAANoOffscreenPixmaps for my old (R5xx) card. As a start try -

    Code:
    Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        BusID       "PCI:1:0:0"
        Option          "ForceMonitors" "lvds,crt1"
        Option          "Centermode" "off"
        Option          "XAANoOffscreenPixmaps" "true"
        Option          "DRI" "true"
    EndSection

    Leave a comment:


  • archman
    replied
    Originally posted by legume View Post
    This happens if your screen res x and y aren't divisible by 64 AFAICT.

    The work around is to add a virtual line to your xorg.conf with 1 added (it will mean your screen will scroll by a pixel).
    well, my resolution is 1024x768
    so, I think maybe there is something wrong parameters I set in xorg.conf:
    Code:
    Section "ServerLayout"
    	Identifier     "Default Layout"
    	Screen      0  "aticonfig-Screen[0]-0" 0 0
    	InputDevice    "MX300" "AlwaysCore"
            InputDevice    "Synaptics Touchpad" "CorePointer"
    	InputDevice    "Keyboard1" "CoreKeyboard"
    EndSection
    
    Section "Files"
        RgbPath	 "/usr/share/X11/rgb"
        FontPath     "/usr/share/fonts/TTF"
        FontPath     "/usr/share/fonts/Type1"
        FontPath     "/usr/share/fonts/wenquanyi/wqy-zenhei"
        FontPath     "/usr/share/fonts/wqy-bitmapfont/"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/misc"
        FontPath     "/usr/share/fonts/100dpi:unscaled"
        FontPath     "/usr/share/fonts/75dpi:unscaled"
    EndSection
    
    Section "Module"
        Load "glx"
        Load "dri"
        Load "GLcore"
        Load "freetype"
    EndSection
    
    Section "InputDevice"
    	Identifier  "Keyboard1"
    	Driver      "kbd"
    	Option	    "XkbRules" "xorg"
    	Option	    "XkbModel" "pc105"
    	Option	    "XkbLayout" "us"
    EndSection
    
    Section "InputDevice"
    	Identifier  "MX300"
    	Driver      "mouse"
    	Option      "CorePointer"
            Option      "Protocol" "ExplorerPS/2"
            Option	    "Device" "/dev/input/mice"
    	Option	    "Emulate3Buttons"
            Option      "Emulate3Timeout"    "50"
            Option      "EmulateWheel" "on"
            Option      "EmulateWheelButton" "2"
            Option      "EmulateWheelTimeOut" "200"
    	Option	    "YAxisMapping" "4 5"
            Option	    "XAxisMapping" "6 7"
            Option	    "ZAxisMapping" "4 5"
    EndSection
    
    Section "InputDevice"
            Identifier      "Synaptics Touchpad"
            Driver          "synaptics"
            Option          "SendCoreEvents"        "true"
            Option          "Device"                "/dev/psaux"
            Option          "Protocol"              "auto-dev"
            Option          "HorizScrollDelta"      "0"
            Option          "SHMConfig"             "true"
    EndSection
    
    Section "Monitor"
    	Identifier   "aticonfig-Monitor[0]-0"
    	Option	    "VendorName" "ATI Proprietary Driver"
    	Option	    "ModelName" "Generic Autodetecting Monitor"
    	Option	    "DPMS" "true"
            DisplaySize    271    203    # 1024x768 96dpi
    EndSection
    
    Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        BusID       "PCI:1:0:0"
        Option          "ForceMonitors" "lvds,crt1"
        Option          "TexturedVideo" "on"
        Option          "Centermode" "off"
        Option          "VideoOverlay" "on"
        Option          "OpenGLOverlay" "off"
        Option          "OverlayOnCRTC2" "0"
        Option          "PseudoColorVisuals" "off"
        Option          "UseFastTLS" "2"
        Option          "XAANoOffscreenPixmaps" "true"
        Option          "DRI" "true"
    EndSection
    
    Section "Screen"
    	Identifier "aticonfig-Screen[0]-0"
    	Device     "aticonfig-Device[0]-0"
    	Monitor    "aticonfig-Monitor[0]-0"
    	DefaultDepth     24
    	SubSection "Display"
    		Viewport   0 0
    		Depth     24
            Modes "1024x768"
    	EndSubSection
    EndSection
    
    Section "Extensions"
        Option "Composite" "0"
        Option "XVideo" "Enable"
    EndSection
    
    Section "DRI"
        Mode 0666
    EndSection
    my card is x1300 on T60
    I post my xorf.conf here, maybe someone can tell me what's wrong.

    Leave a comment:


  • legume
    replied
    Originally posted by archman View Post
    -vo gl:yuv=x
    Use whatever x works for you. With gl you can also choose the type of scaling with the lscale=x parameter.

    but when I use gl, I press f to go fullscreen, but when press f again to go back, the whole screen is messed up, I donot know why?
    This happens if your screen res x and y aren't divisible by 64 AFAICT.

    The work around is to add a virtual line to your xorg.conf with 1 added (it will mean your screen will scroll by a pixel).

    eg
    Code:
    Section "Screen"
            Identifier "aticonfig-Screen[0]"
            Device     "aticonfig-Device[0]"
            Monitor    "aticonfig-Monitor[0]"
            DefaultDepth     24
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
                    Modes   "1920x1440_50.00"
                    virtual 1920 1441
            EndSubSection
    EndSection
    fixes the problem for a test I just tried.

    Leave a comment:


  • leef
    replied
    Without actually looking anything up, here are some thoughts:

    1. Xv's job was utilize special video hardware to do colorspace and scaling for video (back when the CPU was slow). ATI doesn't even put this hardware on their cards anymore (but you can write a driver to allocate some of the texture units to simulate hardware).

    2. Each display device has its own (adjustible) color profile.

    3. Most video formats don't have color profiles.

    4. There's more than one way to specify colors.

    5. The OS (linux) might have a way of inserting filters (like mplayer's -vf). Maybe somewhere in X?

    6. The drivers should have a way of inserting filters, since they should be able to adjust displays based on the display's color profile, or a color profile supplied by a calibration tool.

    7. 8 bit color channel depth is a current hardware constraint. There were and will be displays with different bit depths.

    8. The cinematographers should be able to shoot the movie using the colors they want. That used to mean selecting film emulsions and adjusting camera exposures and lighting.

    Where should adjustments be done?

    1. The user program (mplayer) does the conversion (or calls upon the driver to do so (see gl:yuv) based on user input or headers in the video file.

    2. The driver does the conversion based on input from the user or from the driven display.

    So, IMO, Xv shouldn't be doing any "brightness" compression unless specifically asked.

    Thanks for listening.

    Leave a comment:


  • archman
    replied
    I have the same problem, and dig for a while, no solution is found.
    >_<
    And moreover, my video card's chipset is M52, so I have to enable TexturedVideo in order to use xv drive when using mplayer. -__-
    But, I want the best pic while playing video.
    So, I tried other drivers when using mplayer.
    Now, I find that both gl2 and gl will give the right black color,
    but here is another issue, since there are several other subparameters with gl2 or gl, I donot know which is better.
    Maybe you can have a try:
    -vo gl2:yuv=x
    or
    -vo gl:yuv=x
    above both x can be 2,3,or 4
    but when I use gl, I press f to go fullscreen, but when press f again to go back, the whole screen is messed up, I donot know why?

    My environment: Archlinux 2.6.26 i686, openbox, using catalyst 8.8-1 driver

    Leave a comment:


  • Nighthog
    replied
    Originally posted by Fran View Post
    Well, if the problem is what you exposed (good work BTW ), that's the logical solution, and the driver not doing it is a bug. These are PC cards, not TV adapters. Monitors are calibrated for 0-255, so the drivers should convert the 16-235 range to 0-255, as ALL the drivers do in linux (except fglrx). Movies look much better with -vo x11 than with -vo xv, at least in my monitor (Samsung 226BW).

    Anyway, do you know if is there a methodical way to expand the color range "by hand", using contrast/brightess/saturation? Just until this bug is fixed.

    (edit) Or at least they should allow us to change it in the control panel, as nvidia does (shit, everytime I see their beautiful gtk2 control panel I get jealous :P)
    Gotta tell though using the 16-235 colour range and calibrating the screen for that gives the best quality in image and the most correct one, it's the general consensus that it's better, but it's no where as easy to just expand the damn video which in turn mostly gives a all good image anyway for most to accept.
    Though calibrating a computer monitor for 16-235 levels will be a huge problem if you do other stuff than watch movies on it. Basically everything but 16-235 content video will show incorrect colours >_>;
    So if you have a seperate monitor/TV/HDTV calibrating that might be the better solution for best image as you will have it dedicated for the video only and you will probably like the image/colours on video there alot better than on your main screen when set up correctly for it.

    Leave a comment:


  • Fran
    replied
    Originally posted by Nighthog View Post
    The other way is like how all the other outputs work that they expand the 16-235 video into the 0-255 colour range that your screen is able and normally produces. You can read this kinda advanced stuff like buttloads over at AVSforums.
    =_=;
    Well, if the problem is what you exposed (good work BTW ), that's the logical solution, and the driver not doing it is a bug. These are PC cards, not TV adapters. Monitors are calibrated for 0-255, so the drivers should convert the 16-235 range to 0-255, as ALL the drivers do in linux (except fglrx). Movies look much better with -vo x11 than with -vo xv, at least in my monitor (Samsung 226BW).

    Anyway, do you know if is there a methodical way to expand the color range "by hand", using contrast/brightess/saturation? Just until this bug is fixed.

    (edit) Or at least they should allow us to change it in the control panel, as nvidia does (shit, everytime I see their beautiful gtk2 control panel I get jealous :P)
    Last edited by Fran; 08-24-2008, 06:00 AM.

    Leave a comment:


  • Nighthog
    replied
    Originally posted by bridgman View Post
    I took a look through the Bugzilla db and couldn't find a bug ticket for the "washed out colours" issue. I suspect it may have something to do with colour profiles and if so would probably be more noticeable on some displays than others, ie we may need to get a specific display in order to reproduce this in house.

    Can someone pls file a big at http://ati.cchtml.com and include specifics of their display as well as the usual card, driver, OS info ?
    Maybe a specific display isn't needed, but at least a screen that produces colours all right or good at least. I think the difference in colours on the video will show on any screen that does produce colour good or OK at least. It isn't a screen issue per-see.

    If you take a look at the screen captures, if you see a diffrence whit your current screens. well I don't see why then you would need to get any specific screen at all as you should be able to reproduce it whit just the graphics card (one using TexturedVideo) and use a mediaplayer that can output whit Xv on your current/any screen/monitor.

    I'll take a look tomorrow and see what info I can collect together for the bug-report (if no one does it before me, in which case I can complement their bug-report instead)



    EDIT:
    Ok I took some time and did some reading over at AVSforums and read about those pc levels and video levels a bit more.
    I've come to conclusion that the video level colours are in fact correct for several videos, but it's not for all videos. XV does give the accurate colours for most video whit black starting at 16 and white stopping at 235. DVD's and SD(standard definition video) like most PAL and NTSC source stuff use the 16-235 colour space, so if watching on a computer screen set to/calibrated for pc-level colours between 0-255 it's correct whit Xv video that black is gray and white isn't fully white eihter, so if video black starts at 16, it shows as 16 on your 0-255 range screen, which is correct.
    X11 etc are actually in this case giving the wrong colours and expanding the 16-235 colour palette off the SD video's to the full range off pc-level colours between 0 to 255. But this isn't wrong either really. As on a PC-monitor whit pc-level colours 0-255. Many would like black to be black and white to be white in video so it expands as per settings standard for X11 etc I think.

    But don't be writing this all away now yet. There still exists a bug, or lack off feature if one would put it in a another way, or someone just was lazy and implemented this thing in this way for now, or didn't have time to implement it fully correctly.

    Let me say what I found out when playing several videos on the Windows XP side and tell you how the colours etc looked like there and how it seems to work. Then I'll compare to the Linux side.

    As said dvd's and SD content most use the 16-235 colour range or "video colours", this shows as such in Windows. SD content and video's on the windows side all start whit black at 16 and white ending at 235. The video's are as they should and are exactly like they are here in linux now whit TexturedVideo combined whit Xv video output. i.e. if you have a 0-255 ranging screen 16 will show as 16 which is correct etc.
    Their black starts at 16 and it shows as 16 there in windows as in Linux. But there is a diffrence in when this is applied or not. I said SD and dvd's used the 16-235 range, but HD and full-HD many use the full range off 0-255. This diffrence is applied in windows side.
    Let me explain. HD content or rather all video off a resolution off 1280x720 (720p) and larger are treated and displayed whit their correct full-range 0-255 colour range when played and it's nice and colours are accurate in them if you watch them now on a 0-255 colour level screen, which is kinda any computer screen or HDTV, and all lower are set to use the 16-235 range. This is kinda nice and works quite nicely over in Windows XP.
    (or some way like that, something decides that this one video uses the 16-235 range while this other should use the 0-255, it works quite nicely in XP as far as I can tell, above description is a bit faulty as I have some SD sized video that use the 0-255 levels and gets them as well correctly. So I don't know how it fully works but you get the idea right? (a algorithm?))

    Now here in Linux/Ubuntu and the ati-drivers here. Standard seemed to have been that all video was expanded no matter what to use the 0-255 full range pc-levels no matter the output or source(dvd/SD,HD etc) you choose. Though there came an exception into the game which is TexturedVideo + Xv that gives you the 16-235 colour levels ALL THE TIME. Doesn't matter if it's a video that uses 0-255 colour range it is cramped together to use the 16-235 range also which is incorrect. All video I have end upp only getting the 16-235 colour range whit Xv. 1080p movies as well that should have 0-255 range.
    A: This is either a bug, it's not working as it should.
    B: It's not a bug. it's working the way it was coded. i.e. someone was lazy
    C: as B. but all the features for this wasn't implemented. i.e. it's unfinished. Correct implementation to be added later?
    the feature to automatically choose 0-255 range or 16-235 range or other isn't there so it default to use 16-235 as that's the most used one for videos?

    Well the problem in short is TexturedVideo + Xv all the time uses the 16-235 or such colours range? Well at least I get this result.

    so... what am I gonna make out of all this mess I might have figured out and wrote? is it a bug? a incomplete function? or something else?

    What can I do?

    What I want to do is able to choose the 0-255 range or 16-235 range for my videos manually when I play them or that it works automatically as in windows XP seemingly.

    >_>;

    and about getting best quality and correct colours for those 16-235 colour range videos. Well you should calibrate you screen whit brightness and contrast etc so black is black on 16 and white is white on 235 for best image and correct image. This isn't maybe the most easy way but will give best image for the video. The other way is like how all the other outputs work that they expand the 16-235 video into the 0-255 colour range that your screen is able and normally produces. You can read this kinda advanced stuff like buttloads over at AVSforums.
    =_=;
    Last edited by Nighthog; 08-23-2008, 12:44 PM.

    Leave a comment:


  • bridgman
    replied
    I took a look through the Bugzilla db and couldn't find a bug ticket for the "washed out colours" issue. I suspect it may have something to do with colour profiles and if so would probably be more noticeable on some displays than others, ie we may need to get a specific display in order to reproduce this in house.

    Can someone pls file a big at http://ati.cchtml.com and include specifics of their display as well as the usual card, driver, OS info ?

    Leave a comment:

Working...
X