Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587109

Re: LED devices & poll() for brightness attribute

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: LED devices & poll() for brightness attribute
Date 2017-02-23 21:30 +0100
Message-ID <te8bw-6hU-7@gated-at.bofh.it> (permalink)
References (1 earlier) <tdEwO-1Jr-15@gated-at.bofh.it> <tdMb0-7mE-25@gated-at.bofh.it> <tdMum-7Lo-5@gated-at.bofh.it> <te2IO-2vk-17@gated-at.bofh.it> <te2Su-2AJ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi!

> > Ok, and this is where the problems start. You are not supposed to
> > control keyboard backlight like that. (In the same way you can't
> > control display backlight like that.)
> > 
> > There are numerous problems with the shell script:
> > 
> > 1) how to identify the keyboard backlight LED
> 
> Exactly same as it is doing desktop. It is possible to 100% reimplement
> desktop logic for identification of keyboard backlight LED

Exactly! If you are reimplementing logic from another project, it is
strong hint that you are doing something wrong. 

> > 2) there may be more then one
> 
> Yes and script can be adjusted to use specific one (config option for
> script).

No, you should autoconfigure it, actually. See N900, there are 6 leds
controlling one backlight.

> > 3) synchronization problems
> 
> This is reason why poll() is needed. So desktop GUI will receive
> information that somebody else changed LED.

Actually, poll will not help you. If both your script and desktop
access the LED at the same time, there will be races. ("Hmm. I just
wrote to the brightness file, and received poll notification. What is
the current brightness?")

> > Your shell script should talk to the desktop, because it already knows
> > where the backlight is, and the problems disappear.
> 
> Sometime there does not have to be any desktop loaded. It could but it
> does not have to be.
> 
> Look at TLP scripts. They are very popular, and they have no

Do you have a link?

> > I believe the confusion is not worth it. Talk to the desktop people,
> > there should be good way to control the backlight without reaching
> > lowlevel interfaces directly.
> 
> And probably every desktop will use own different method like before. No
> thanks. I do not want to depend on particular desktop or implement
> zillions of different desktop APIs. And even depend on desktop.

And I don't want led/brightness file to be used for interprocess
communication. I especially don't want to deal with _6_ keyboard led
files to be used for interprocess communication -- what is desktop
expected to do when you set different brightnesses to each of them?

You don't want to deal with desktop API, yet expect all the desktops
to follow your prefferred API (poll on led/brightness?).

There should be one component controlling the keyboard backlight. Your
scripts should talk to that component.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-22 10:10 +0100
  Re: LED devices & poll() for brightness attribute Pavel Machek <pavel@ucw.cz> - 2017-02-22 13:30 +0100
    Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-22 13:50 +0100
      Re: LED devices & poll() for brightness attribute Pavel Machek <pavel@ucw.cz> - 2017-02-22 22:00 +0100
        Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-22 22:20 +0100
          Re: LED devices & poll() for brightness attribute Pavel Machek <pavel@ucw.cz> - 2017-02-23 15:40 +0100
            Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-23 15:50 +0100
              Re: LED devices & poll() for brightness attribute Pavel Machek <pavel@ucw.cz> - 2017-02-23 21:30 +0100
                Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-23 21:50 +0100
                Re: LED devices & poll() for brightness attribute Pavel Machek <pavel@ucw.cz> - 2017-02-23 22:20 +0100
                Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-24 10:00 +0100
                Re: LED devices & poll() for brightness attribute Pali Rohár <pali.rohar@gmail.com> - 2017-02-24 10:00 +0100
                Re: LED devices & poll() for brightness attribute Hans de Goede <hdegoede@redhat.com> - 2017-02-24 10:00 +0100

csiph-web