Giter VIP home page Giter VIP logo

evdipp's Introduction

evdipp

Ubuntu

Simple C++ wrapper for DisplayLink evdi library, with some example client code. Currently undocumented, but hopefully simple enough to be useful even as-is.

Contents

This project is a very simple example of how to write a complete client for DisplayLink's evdi/libevdi.

It includes:

  • a very thin C++ wrapper for the library, called libevdipp,
  • a simple terminal-based example which registers a virtual screen and logs to console,
  • a more complete monitorsim Qt sample app which uses evdi to add an additional screen an show its contents in a window. This application uses more features of the library than the console client - for example, enables client-side mouse compositing.

screenshot2021

Building

You need cmake to build. EVDI is defined as external project which will be cloned from git as part of the build. As with libevdi, you need libdrm-dev package to be installed to be able to compile the library.

Additionally:

  • to build the example terminal app, you need libev/libev++.
  • to build the Qt example, you obviously need Qt 5 dev packages installed.

If you're using recent Ubuntu, you can do it by executing

sudo apt-get install -y libev-dev qtbase5-dev libdrm-dev

Then, you can build it by pretty standard chain of commands:

mkdir -p build/stage
cd build
cmake -DCMAKE_INSTALL_PREFIX=stage -DCMAKE_INSTALL_RPATH="$(pwd)/stage/lib" ..
make install

Running

This project assumes you are familiar with what evdi is, and how to build it for your system. Before attempting to launch any of the samples, make sure evdi kernel module is loaded. If you don't see it in the output of lsmod, run modprobe evdi first.

Any client app for EVDI at the moment must be run by root to be able to function - so, using sudo is required. For example, to run the monitorsim binary built in the stage/bin subdirectory of your build folder, use:

cd stage/bin
sudo monitorsim

Note that both the example app, and the Qt monitorsim client expect an input file with an EDID of a monitor that they should connect to evdi (which acts like a virtual graphics adapter that you need to connect to it). They will still run without it, but will use a hard-coded, single mode (800x600) EDID, which will reduce your possibilities - for example, you will not be able to change display modes for the virtual screen as it will only have one mode available.

You can get an EDID from any monitor you have (see ls -la /sys/class/drm/*/edid), or source it from the net - for example from Google's autotest project. Note however that the EDIDs you use must be valid - and many are not. EVDI refuses EDIDs with invalid checksums, connection attempts will fail with Invalid argument error reported by the libevdi library.

evdipp's People

Contributors

mlukaszek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evdipp's Issues

Documentation for running

On Ubuntu would monitorsim be run e.g.
cd ~/target/
sudo ./bin/monitorsim /sys/class/drm/card1-DVI-I-1/edid

Can't compile because of no matching function for call to 'evdi_enable_cursor_events'

Hi, I'd want to test you application out, but I cannot finish compilation of it.
openSUSE Tumbleweed, recently updated, evdi 1.9.1 installed on the system.
Any ideas?

[ 9%] Performing update step for 'github_evdi'
[ 9%] Building CXX object libevdipp/CMakeFiles/evdipp.dir/buffer.cpp.o
[ 19%] Building CXX object libevdipp/CMakeFiles/evdipp.dir/screen.cpp.o
[ 19%] Building CXX object libevdipp/CMakeFiles/evdipp.dir/evdi.cpp.o
/home/khazakar/downloadedwithgit/evdipp/libevdipp/evdi.cpp:56:5: error: no matching function for call to 'evdi_enable_cursor_events'
evdi_enable_cursor_events(handle);
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/khazakar/downloadedwithgit/evdipp/github_evdi-prefix/src/github_evdi/library/evdi_lib.h:112:6: note: candidate function not viable: requires 2 arguments, but 1 was provided
void evdi_enable_cursor_events(evdi_handle handle, bool enable);
^
1 error generated.
make[2]: *** [libevdipp/CMakeFiles/evdipp.dir/build.make:95: libevdipp/CMakeFiles/evdipp.dir/evdi.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 23%] No patch step for 'github_evdi'
[ 28%] No configure step for 'github_evdi'
[ 33%] Performing build step for 'github_evdi'
[ 38%] No install step for 'github_evdi'
[ 42%] Completed 'github_evdi'
[ 52%] Built target github_evdi
make[1]: *** [CMakeFiles/Makefile2:185: libevdipp/CMakeFiles/evdipp.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Dependencies

Hi,

I had to install these libraries to get your app working (Ubuntu 16.10):

sudo apt-get install libboost-all-dev
sudo apt-get install libev-dev
sudo apt-get install qtbase5-dev

Maybe someone will find it helpful.

Best regards,
Martin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.