Skip to content

Dummy monitor - #423

Draft
raldone01 wants to merge 4 commits into
DisplayLink:mainfrom
raldone01:dummy-monitor
Draft

raldone01 wants to merge 4 commits into
DisplayLink:mainfrom
raldone01:dummy-monitor

Conversation

@raldone01

@raldone01 raldone01 commented Jun 14, 2023 •

Copy link
Copy Markdown
Contributor

This pr is an extension to #421.
It adds a working dummy_monitor script.
It currently requires an edid file.
I would like it to work with just <width>x<height>@<fps>.

@raldone01
raldone01 force-pushed the dummy-monitor branch 2 times, most recently from e0779d7 to be9bd64 Compare June 17, 2023 18:49
@raldone01 raldone01 mentioned this pull request Nov 21, 2023
@pradyvrp

Copy link
Copy Markdown

does this support wayland?

@raldone01

Copy link
Copy Markdown
Contributor Author

What do you mean exactly?

The dummy monitor program itself has no issue with wayland as it uses PySide6.
evdi should also not have any issues with wayland as I have used a displaylink docking station yesterday with plasma wayland.

But just try it out?

@ESHARK22

ESHARK22 commented Mar 18, 2025 •

Copy link
Copy Markdown

Hey, im wondering what version of python and pyside6 you are using, since I am getting the following error:

Oh I just relealized this is might be casued by a mismatched pyevdi version - Could you please update this pr the latest?

Traceback (most recent call last):
  File "/home/eshark/stuff/evdi/evdi/pyevdi/examples/dummy_monitor/dummy_monitor.py", line 201, in <lambda>
    card_timer.timeout.connect(lambda: card.handle_events(0))
                                       ~~~~~~~~~~~~~~~~~~^^^
  File "/home/eshark/stuff/evdi/evdi/pyevdi/examples/dummy_monitor/dummy_monitor.py", line 186, in <lambda>
    card.acquire_framebuffer_handler = lambda buffer: framebuffer_handler(
                                                      ~~~~~~~~~~~~~~~~~~~^
        buffer, my_app
        ^^^^^^^^^^^^^^
    )
    ^
  File "/home/eshark/stuff/evdi/evdi/pyevdi/examples/dummy_monitor/dummy_monitor.py", line 151, in framebuffer_handler
    app.image_buffer_widget.update_image(buffer)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/eshark/stuff/evdi/evdi/pyevdi/examples/dummy_monitor/dummy_monitor.py", line 103, in update_image
    image = QImage(buffer.bytes, buffer.width, buffer.height, QImage.Format_RGB32)
TypeError: 'PySide6.QtGui.QImage.__init__' called with wrong argument types:
  PySide6.QtGui.QImage.__init__(PyCapsule, int, int, Format)
Supported signatures:
  PySide6.QtGui.QImage.__init__()
  PySide6.QtGui.QImage.__init__(PySide6.QtGui.QImage, /)
  PySide6.QtGui.QImage.__init__(PySide6.QtCore.QSize, PySide6.QtGui.QImage.Format, /)
  PySide6.QtGui.QImage.__init__(str, int, int, PySide6.QtGui.QImage.Format, /)
  PySide6.QtGui.QImage.__init__(str, int, int, int, PySide6.QtGui.QImage.Format, /)
  PySide6.QtGui.QImage.__init__(Iterable, /)
  PySide6.QtGui.QImage.__init__(Union[bytes, bytearray, memoryview], int, int, PySide6.QtGui.QImage.Format, /, Optional[Callable[..., Any]] = None, Optional[int] = None)
  PySide6.QtGui.QImage.__init__(Union[bytes, bytearray, memoryview], int, int, int, PySide6.QtGui.QImage.Format, /, Optional[Callable[..., Any]] = None, Optional[int] = None)
  PySide6.QtGui.QImage.__init__(Union[str, bytes, os.PathLike[str]], /, Union[bytes, bytearray, memoryview, NoneType] = None)
  PySide6.QtGui.QImage.__init__(int, int, PySide6.QtGui.QImage.Format, /)

@mkaspryk-synaptics mkaspryk-synaptics left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a more precise description to this PR.
Here is an example template generated with Copilot that you can use:

Summary: Briefly describe what this PR changes.
Motivation / Context: Explain why the change is needed and what problem it solves.
Related work item: Link the relevant issue, bug, ticket, or user story.
Changes introduced: List the main implementation changes and any important design decisions.
How to test: Provide clear steps, including any required configuration, commands, or test data.
Testing performed: Mention the automated and manual tests that were completed, including the tested environments or platforms.
Expected result: Describe what should be observed after following the test steps.
Screenshots or logs: Include supporting screenshots, logs, or command output where applicable.
Impact and risks: Highlight possible side effects, regression risks, performance impact, or compatibility concerns.
Breaking changes: Indicate whether the PR changes any APIs, configuration, data formats, or existing behavior.
Deployment / Migration notes: Mention any special deployment steps, feature flags, migrations, or rollback considerations.
Documentation: Link the updated documentation or explain why no documentation changes are required.
Reviewer notes: Point out any areas that require particular attention and mention known limitations or planned follow-up work.

Please use it (;

Please remove all dead code and run black and flake8.

If you’re finished, I’ll take another look.

Many thanks for your contribution!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of having this edid file here in this repository?
Files like EDID should be auto-generated in the code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository is not the best place for files like this one.
Please remove it or change it into a set of unit tests that verify the logic of your change.

Comment on lines +87 to +96
# x_size, y_size = buffer.width, buffer.height
# for y in range(y_size):
# for x in range(x_size):
# rgb: int = buffer.bytes[y, x]
# bytes = [rgb >> 24, (rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF]
# color = QColor(bytes[1], bytes[2], bytes[3])
# self.image.setPixelColor(x, y, color)

# np_array = np.array(buffer, copy = False) # This is possible thanks to buffer protocol
# self.image = QImage(np_array, buffer.width, buffer.height, QImage.Format_RGB32)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this commented code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit tests for this file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run black and flake8 and fix PEP8 violations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run black and flake8 and fix PEP8 violations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add copyrights

Comment thread .vscode/launch.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository isn't the right place for files like launch.json. Please remove it and add a README file on how to use dummy_monitor. Please add it under pyevdi/examples/dummy_monitor

Comment thread .vscode/settings.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove settings.json as well and move all needed information to the README file

Comment on lines +156 to +160
if options.edid_file:
edid = load_edid_file(options.edid_file)
connect_ret = card.connect(edid, len(edid), area, area * options.refresh_rate)
else:
connect_ret = card.connect(None, 0, area, area * options.refresh_rate)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description claims the script should work with just @, but the code path that omits --edid-file still passes None to card.connect().

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants