Skip to content
Snippets Groups Projects
  1. Jan 05, 2024
    • Richard Muzik's avatar
      compat.sh: get rid of error output · 137a10ad
      Richard Muzik authored
      When testing if function exists command type returned error message if
      the function did not exist:
      
      /usr/libexec/rainbow/compat.sh: line 61: type: get_brightness_raw: not found
      
      It is used just for condition, so it is fine to get rid of the message.
      137a10ad
  2. Dec 04, 2023
  3. Jul 20, 2023
  4. Jul 19, 2023
    • Marek Behun's avatar
      backend/omnia: determine max brightness from sysfs · e9b6230b
      Marek Behun authored and Michal Hrusecky's avatar Michal Hrusecky committed
      Upstream kernel did not yet apply the patch that sets the max_brightness
      sysfs property of Omnia LEDs to 1 (from 255).
      
      Because of this, when using upstream kernel we need to set brightness
      to 255. Otherwise the LEDs are very dim, because although we set
      multi_intensity to "255 255 255", this is then recomputed to "1 1 1"
      before kernel sends it to hardware, since brightness is set to 1/255.
      e9b6230b
  5. Jul 13, 2023
    • Marek Behun's avatar
      backend/omnia: fix brightness conversion to and from percent value · 5a7a27ee
      Marek Behun authored
      The global brightness on Omnia in sysfs (and in hardware) is represented
      by percents (range [0,100], let's call this the P value), but the
      rainbow.all.brightness UCI setting uses range [0,255] (let's call this
      the B value).
      
      The get_brightness() and preapply() functions in Omnia's backend use the
      formulas:
        PtoB(B) = B * 100 // 255
        BtoP(P) = P * 255 // 100
      
      These formulas convert between ranges [0,100] and [0,255], and after the
      conversion they floor the result. This is wrong, because then the
      function BtoP is not an inverse of PtoB.
      For example
        BtoP(PtoB(1)) = 0, or
        BtoP(PtoB(99)) = 98.
      
      This is bad for example in the following situation:
      - The button_sync.sh script periodically reads the P value from sysfs,
        converts it via PtoB and updates the rainbow.all.brightness UCI value.
        Let's say the user uses the front button to configure brightness to
        P=1 (out of 100). The button_sync.sh script uses the PtoB formula and
        sets rainbow.all.brightness = PtoB(1) = 2.
      
      - The user then uses the following command:
          rainbow wan green
        to change the color of the WAN LED to green.
        The preapply() function is called, which uses the BtoP formula and
        configures sysfs value of brightness to
          BtoP(rainbow.all.brightness) = BtoP(2) = 0.
        This disables all LEDs.
      
        So by setting the WAN LED to green color, we have managed to disable
        all LEDs.
      
      Fix this issue by changing the formulas to round the value after the
      range conversion, instead of flooring it. This is done by setting
        PtoB(B) = (B * 100 + 127) // 255
        BtoP(P) = (P * 255 + 50) // 100
      5a7a27ee
  6. Nov 14, 2022
  7. Nov 11, 2022
  8. Nov 10, 2022
  9. Nov 07, 2022
  10. Nov 01, 2022
  11. Oct 27, 2022
  12. Oct 20, 2022
  13. Oct 13, 2022
  14. Sep 22, 2022
  15. Sep 19, 2022
    • Michal Vasilek's avatar
      mox: use activity heartbeat as auto mode · 01126352
      Michal Vasilek authored
      Previously mode_args was missing from apply_args, so when using the auto
      mode, rainbow ran apply_activity activity and failed because of a
      missing argument:
      
      	%: /etc/init.d/rainbow start
      	/usr/bin/rainbow: Internal error: Unsupported activity arguments:
      01126352
  16. Sep 16, 2022
  17. Sep 15, 2022
  18. Sep 14, 2022
  19. Sep 05, 2022
Loading