digitaltrails / ddcutil-service

A Dbus ddcutil server for control of DDC Monitors/VDUs
GNU General Public License v2.0
11 stars 1 forks source link

ddcutil-service

A D-Bus ddcutil service for control of DDC Monitors/VDUs

The aim of this service is to make it easier to create widgets and apps for ddcutil. The service's client interface is now quite stable, but there may be some additions or tweaks if new requirements are discovered.

The service is written in C. It has very few dependencies (glib-2 and libddcutil) and is consequently quite easy to build. Once built, running the executable should make a ddcutil service available on the D-Bus Session-Bus.

Testing using the d-feet D-Bus interactive GUI:

  1. start d-feet;
  2. press the session-bus button in the d-feet header;
  3. search for ddcutil.
  4. click on com.ddcutil.DdcutilService
  5. open the Object Path com/ddcutil/DdcutilService and navigate down to the com.ddcutil.DdcutilInterface
  6. Double-click methods and properties to run or view them.

Method inputs can be supplied as CSV, for example, Method Input to GetVcp could be

1,'',0x10

This would access display 1, blank-edid '', DDC VCP Feature code 0x10 (brightness). VDU's are identified either by display-number or base-64-encoded EDID.

Several bash and python scripts that demonstrate using the service are included in the examples folder. They cover the use of the dbus-send command line utility and the python dasbus and QtDBus libraries.

The service was developed with the assistance of amendments to libddcutil by @rockowitz.
The current intention is to eventually package it with ddcutil/libddcutil.

Usage warning/guidelines

When using this service, avoid excessively writing VCP values because each VDU's NVRAM likely has a write-cycle limit/lifespan. The suggested guideline is to limit updates to rates comparable to those observed when using the VDU's onboard controls. Avoid coding that might rapidly or infinitely loop, including when recovering from errors and bugs.

Non-standard manufacturer specific features should only be experimented with caution, some may have irreversible consequences, including bricking the hardware.

Command-line and API Documentation

Detailed documentation can be found in the two manual pages:

Installing the DdcutilService as a dbus-daemon auto-started service

Installation via prebuilt binaries

OpenSUSE Tumbleweed RPM:

There is an official Tumbleweed RPM:

The same page also provides links to unofficial builds I've done for Leap.

AUR (Arch Linux User Repository):

Mark Wagie (yochananmarqos) has kindly provided AUR packaging:

Debian/Ubuntu unofficial packages

Maciej Wójcik (https://gitlab.com/w8jcik) has kindly provided a collection of unofficial debian/ubuntu packages along with instructions for installing the required versions of libddcutil:

Installation via Makefile

Check/modify the dependencies specified in the Makefile:

The names of required development packages may vary depending on which distribution you are targeting.

Check the install PREFIX in the Makefile and make any changes required for your circumstances, and issue make install or sudo make install as appropriate.

Manual installation steps

Manual steps for installing a dbus-daemon service file for auto-starting and auto-restarting the service are as follows:

  1. Edit com.ddcutil.DdcutilService.service and set the Exec location of the service executable (can be anywhere).
  2. Install to: /usr/share/dbus-1/services/com.ddutil.DdcutilService.service Or maybe to: $HOME/.local/share/dbus-1/services/com.ddutil.DdcutilService.service
  3. Install the executable at the location set in step 1.
  4. Logout and login to a new session.
  5. Check service is available (use d-feet or any other test program).

Installing the service file is optional. The service file enables autostart of the service by dbus-daemon. The service executable can be manually started without the service file being installed.

Use with vdu_controls

The vdu_controls GUI has been modified to use the service by default, see: https://github.com/digitaltrails/vdu_controls

Optional ddcutil-client

The source includes an ddcutil-client (ddcutil-client.c and man page ddcutil-client.1). Packaging and deployment of the client is optional. If busctl or dbus-send is available, they will be about as fast. A purpose built client is mostly a convenience for those that might want a syntactically straight forward command line interface.

Acknowledgements

Thanks go out to Sanford Rockowitz (rockowitz) for libddcutil, ddcutil and all the assistance and advice provided during the development of this service.

Thanks also to Michal Suchanek for assistance with the OpenSUSE RPM spec; Johan Grande (nahoj) for the Ubuntu patches; Mark Wagie (yochananmarqos) for AUR packaging; and Maciej Wójcik (https://gitlab.com/w8jcik) for debian/ubuntu packaging.

The development IDE is JetBrains CLion-Nova/CLion. Thanks go out to JetBrains for granting the Open Source development license.

Version History