Code Monkey home page Code Monkey logo

Comments (4)

rockowitz avatar rockowitz commented on September 27, 2024

@agspoon Thank you for the detailed report. Will follow up.

Why are you running ddcutil from a udev rule? What's the use case? I continue to be surprised by the ways people use ddcutil. Other than ddcutil chkusbmon which is specially coded to be run from a udev rule, ddcutil assumes a normally configured environment.

Options --disable-capabilities-cache and --disable-dynamic-sleep should eliminate file io, and --syslog never will disable writing to the system log.

As for suppressing an error message if a file cannot be written, I believe that by default things should not fail silently. I think its reasonable to expect require use of command line options to disable the features that cause the error messages.

from ddcutil.

rockowitz avatar rockowitz commented on September 27, 2024

ddcutil now checks for NULL values returned by dsa2_stats_cache_file_name() and related functions. which should resolve the segfault problem. The changes have been pushed to branch 2.0.0-dev.

If NULL values are encountered, ddcutil writes error messages to the terminal and system log. Use --disable-dynamic-sleep etc. to avoid them.

from ddcutil.

agspoon avatar agspoon commented on September 27, 2024

Thanks! User's, the bane of every developer :)

My use case is basically that I'm too cheap to buy a KVM to switch between my two computers. A low level aggravation that I suffer a couple dozen times a day. I have a small USB A/B switch that I use to swap the keyboard/mouse, but had to go through a awkward button and OSD interface on my LG monitor to switch inputs.

Thanks to someone figuring out how to programmatically switch inputs on these broken LG monitors (Issue #100) , and your implementation of the --i2c-source-addr option, I can now automate the process.

I wrote a couple udev rules that fire whenever the USB keyboard is added or removed, that runs ddcutil to switch the monitor input accordingly. Works great. A poor man's KVM. I noticed only later that my journal was filled with backtrace logs from the above SEGV fault in ddcutil (apparently the stats are written after the work is done).

I agree that suppressing the error message is not a good idea, I was just wondering if I was missing out on some important functionality by disabling the dynamic-sleep capability, when all I really wanted to avoid was writing to the cache file. Regardless, it works for my weird corner use case, so I'm good. Just thought I'd pass on what I found regarding the NULL pointer.

Thanks again :)

from ddcutil.

rockowitz avatar rockowitz commented on September 27, 2024

Thank you for letting me know the use case. I'll keep it in mind as I'm working on ddcutil. I'm continually amazed at the clever ways people find to use ddcutil.

Dynamic sleep depends on having a cache file to tune the sleep-multiplier over many program executions, so disabling dynamic sleep has little impact on execution time in your case. If execution time matters, you can experiment with option --sleep-multiplier.

from ddcutil.

Related Issues (20)

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.