Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of RealDisplaySizeMM C-Extension #16

Closed
eoyilmaz opened this issue Feb 20, 2022 · 13 comments · Fixed by #444
Closed

Get rid of RealDisplaySizeMM C-Extension #16

eoyilmaz opened this issue Feb 20, 2022 · 13 comments · Fixed by #444
Assignees
Labels
feature request New feature request

Comments

@eoyilmaz
Copy link
Owner

The RealDisplaySizeMM C-Extension seems to be doing something that can be done using pure Python. Though, this needs further investigation.

Also, this ticket is related to #6, if this ticket is solved, there is no need to solve #6 .

@eoyilmaz
Copy link
Owner Author

Under Linux systems, xrandr --verbose gives all the info we need, including EDID which needs to be decoded:

import codecs
edid = codecs.decode(xrandr_edid_data, "hex")

I have no experience with Wayland though, so I don't know if xrandr behaves the same.

@eoyilmaz eoyilmaz added the feature request New feature request label Mar 20, 2022
@p5k369
Copy link
Collaborator

p5k369 commented Apr 3, 2022

I think the main reason for using the C-Extension at the time was getting the proper display dimensions under macos, maybe that is obsolete now.
Heres the story how RealDisplaySizeMM found its way into DisplayCAL:
https://www.python-forum.de/viewtopic.php?f=19&t=15859

@eoyilmaz
Copy link
Owner Author

eoyilmaz commented Apr 3, 2022

Thanks for the link. It was delighting to read. Though, it is really not enough motivation to use a C-Extension as far as I'm concerned. We should definitely remove it.

@eoyilmaz
Copy link
Owner Author

Let's do this... 😎

eoyilmaz added a commit that referenced this issue Oct 18, 2024
eoyilmaz added a commit that referenced this issue Oct 18, 2024
eoyilmaz added a commit that referenced this issue Oct 18, 2024
…DisplaySizeMM` module. This needs a redesign and better implementation. But is a good proof of concept.
eoyilmaz added a commit that referenced this issue Oct 18, 2024
…w uses regular expressions to extract the data.
eoyilmaz added a commit that referenced this issue Oct 20, 2024
eoyilmaz added a commit that referenced this issue Oct 20, 2024
eoyilmaz added a commit that referenced this issue Oct 20, 2024
…DisplaySizeMM` module. This needs a redesign and better implementation. But is a good proof of concept.
eoyilmaz added a commit that referenced this issue Oct 20, 2024
…w uses regular expressions to extract the data.
@eoyilmaz
Copy link
Owner Author

Good news, currently on my Macbook Pro running MacOS I can run DisplayCAL and do a full calibration and profiling without needing to build and use the extension. All the information is extracted from the dispwin command, which currently is the display name, width, height and the position. There are other data that needs to be gathered, but I think DisplayCAL will fallback to default values if the required data doesn't exist.

But, under Linux, the DisplayCAL.edid.get_edid() was using DisplayCAL.RealDisplaySizeMM._enumerate() to extract the EDID information. We need to update the code to extract the EDID from xrandr --verbose command. So I need some sample outputs of the xrandr --verbose command to build my tests around.

Any help is appreciated.

@p5k369 I think you were using a Linux machine, can you help me with this, please?

@p5k369
Copy link
Collaborator

p5k369 commented Oct 21, 2024

Hey @eoyilmaz,
great work. I think mac OS was the main reason why the c-extension was used in the first place.
Find attached the output for one display connected.
xrandr_output.txt

edit:
Find also attached example for multiple displays connected.
xrandr_output_multi.txt

@eoyilmaz
Copy link
Owner Author

Great, many thanks @p5k369

@eoyilmaz
Copy link
Owner Author

@p5k369 can you also send me the output of dispwin -v -d0 for those two conditions too please, many thanks.

@eoyilmaz
Copy link
Owner Author

eoyilmaz commented Oct 21, 2024

Ah, I was able to mock the output of dispwin through the information available through the xrandr output 👍

eoyilmaz added a commit that referenced this issue Oct 21, 2024
…to extract EDID data.

- [#16] Fixed `DisplayCAL.RealDisplaySizeMM.Display.from_dispwin_data()` to expect and use `bytes` data instead of `str`.
- [#16] Updated `DisplayCAL.RealDisplaySizeMM.get_dispwin_output()` to return `bytes` instead of `str` to match the rest of the application.
@eoyilmaz
Copy link
Owner Author

This should now work properly under Linux

@eoyilmaz eoyilmaz linked a pull request Oct 21, 2024 that will close this issue
eoyilmaz added a commit that referenced this issue Oct 21, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
…ta()` now uses regular expressions to extract the data.
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
… output to extract EDID data.

- [eoyilmaz#16] Fixed `DisplayCAL.RealDisplaySizeMM.Display.from_dispwin_data()` to expect and use `bytes` data instead of `str`.
- [eoyilmaz#16] Updated `DisplayCAL.RealDisplaySizeMM.get_dispwin_output()` to return `bytes` instead of `str` to match the rest of the application.
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
…and with `-d0` argument in `DisplayCAL.RealDisplaySizeMM`.
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
… utility to get the `xrandr` executable path under Linux.
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
…n_data()` and `DisplayCAL.RealDisplaySizeMM._enumerate_displays()` for ArgyllCMS<3.3.0 style output.
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Adam-Color pushed a commit to Adam-Color/displaycal-py3 that referenced this issue Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants