mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.92k stars 2.87k forks source link

Automatic ICC retrieval fails on 2 monitor setup #8349

Open baybal opened 3 years ago

baybal commented 3 years ago

Important Information

Provide following Information:

On main display, 2 display setup: image

On secondary display, 2 display setup: image

On secondary display, 1 display setup: image

Reproduction steps

First, connect second display, configure ICC on it using XICCD, and xfce4-color-settings, or any colord compatible config UI

Second, try starting MPV on both displays. Secondary display will always fail to load ICC.

Now, disable the main display, and try starting MPV again. It will autoload the profile just fine.

Expected behavior

ICC loading should work on any number of displays.

Actual behavior

ICC autoloading fail on non-main display. I very much suspect some very simple arithmetic issue on the side of either the code that pulls ICC from colord, or colord itself, where it gets the wrong display number.

Log file

Fail: https://0x0.st/i7Tj.txt

Success: https://0x0.st/i7Te.txt

Success, secondary display set as main: https://0x0.st/i7T2.txt

Fail, primary display unset as main: https://0x0.st/i7TL.txt

The issue will be closed for ignoring the issue template.

Sample files

Sample files needed to reproduce this issue can be uploaded to https://0x0.st/ or similar sites. (Only needed if the issue cannot be reproduced without it.) Do not use garbage like "cloud storage", especially not Google Drive.

haasn commented 3 years ago

Can you paste the output of xprop -root -len 0?

baybal commented 3 years ago
_NET_DESKTOP_NAMES(UTF8_STRING) = 
XFDESKTOP_IMAGE_FILE_0(STRING) = 
_XROOTPMAP_ID(PIXMAP): pixmap id # <field not available>
XFDESKTOP_IMAGE_FILE_1(STRING) = 
_ICC_PROFILE(CARDINAL) = 
PULSE_COOKIE(STRING) = 
PULSE_SERVER(STRING) = 
PULSE_SESSION_ID(STRING) = 
PULSE_ID(STRING) = 
NAUTILUS_DESKTOP_WINDOW_ID(WINDOW): window id # 
XFCE_DESKTOP_WINDOW(WINDOW): window id # 
_NET_CLIENT_LIST_STACKING(WINDOW): window id # 
_NET_DESKTOP_LAYOUT(CARDINAL) = 
_NET_CLIENT_LIST(WINDOW): window id # 
XKLAVIER_ALLOW_SECONDARY(INTEGER) = 
_NET_ACTIVE_WINDOW(WINDOW): window id # 
_NET_CURRENT_DESKTOP(CARDINAL) = 
_NET_DESKTOP_VIEWPORT(CARDINAL) = 
_NET_DESKTOP_GEOMETRY(CARDINAL) = 
_NET_SUPPORTING_WM_CHECK(WINDOW): window id # 
_NET_SUPPORTED(ATOM) = 
_NET_WORKAREA(CARDINAL) = 
_NET_NUMBER_OF_DESKTOPS(CARDINAL) = 
GNOME_SM_PROXY(CARDINAL) = 
_DT_RESTORE_MODE(STRING) = 
_DT_SAVE_MODE(STRING) = 
RESOURCE_MANAGER(STRING) = 
XFree86_DDC_EDID1_RAWDATA(INTEGER) = 
AT_SPI_BUS(STRING) = 
GDK_VISUALS(INTEGER) = 
_XKB_RULES_NAMES(STRING) = 
XFree86_has_VT(INTEGER) = 
XFree86_VT(INTEGER) =
haasn commented 3 years ago

Seems like the issue here is that your X environment is missing an _ICC_PROFILE_1, which is what should be holding the ICC profile for the display with ID 1.

Since mpv does not use colord directly (for various reasons, mostly political), we rely on the methods made available to us by the windowing system. I would ordinarily tell you that this is a colord bug since colord should be setting these properties correctly.

However, I can already anticipate that the colord folks will struggle understanding the concept of a world in which colord isn't used universally by everyone, and will therefore just tell us to "use colord like normal people", rather than addressing this shortcoming in colord. But you may try your luck regardless.

Personally, I would just use argyll-dispwin to load the correct ICC profile for each monitor, which sets the correct X atoms automatically so mpv (and essentially all other ICC-aware software) picks up on it.

baybal commented 3 years ago

Argyll is by far less widespread that colord. Colord is used now by kde, gnome, and xfce. Though... colord itself does not manage devices themselves, and knows little about X11.

What about trying going through XICCD then?

baybal commented 3 years ago

I wrote them a feature request https://github.com/agalakhov/xiccd/issues/33

nvmnghia commented 3 years ago

Hi @baybal, is there any other desktop environment that supports color management other than gnome, kde and xfce (xfce supporting color management is new for me)?

baybal commented 3 years ago

@nvmnghia other than MATE, no, and I don't think anybody will try to support anything other than colord on their side.