Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command lightbar on overrides command lightbar [0-255] -> Remains ONLY BLUE #12

Open
MartinVonReichenberg opened this issue Nov 20, 2022 · 4 comments

Comments

@MartinVonReichenberg
Copy link

As mentioned,
dualsensectl lightbar on overrides dualsensectl lightbar 255 255 255 255 -> WHITE colour this makes changing colors and brightness on the controller impossible . . .
The only way to change colors is to use dualsensectl lightbar off and then dualsensectl lightbar [0-255] ...................
dualsensectl lightbar 0 0 0 0 turns off the lightbar too, but in another sense.

  • My DualSense version: 0307
@nowrep
Copy link
Owner

nowrep commented Dec 27, 2022

Does this help?

diff --git a/main.c b/main.c
index dfe9f3a..a163320 100644
--- a/main.c
+++ b/main.c
@@ -489,6 +489,9 @@ static int command_lightbar3(struct dualsense *ds, uint8_t red, uint8_t green, u
     rp.common->lightbar_green = brightness * green / max_brightness;
     rp.common->lightbar_blue = brightness * blue / max_brightness;
 
+    rp.common->valid_flag2 = DS_OUTPUT_VALID_FLAG2_LIGHTBAR_SETUP_CONTROL_ENABLE;
+    rp.common->lightbar_setup = DS_OUTPUT_LIGHTBAR_SETUP_LIGHT_ON;
+
     dualsense_send_output_report(ds, &rp);
 
     return 0;

@MartinVonReichenberg
Copy link
Author

I do not entirely understand ...

Did you remove lines 480-488:

{
    struct dualsense_output_report rp;
    uint8_t rbuf[DS_OUTPUT_REPORT_BT_SIZE];
    dualsense_init_output_report(ds, &rp, rbuf);

    uint8_t max_brightness = 255;

    rp.common->valid_flag1 = DS_OUTPUT_VALID_FLAG1_LIGHTBAR_CONTROL_ENABLE;
    rp.common->lightbar_red = brightness * red / max_brightness;

Then moved from 479 to 488:

static int command_lightbar3(struct dualsense *ds, uint8_t red, uint8_t green, u

And added 492-493:

rp.common->valid_flag2 = DS_OUTPUT_VALID_FLAG2_LIGHTBAR_SETUP_CONTROL_ENABLE;
rp.common->lightbar_setup = DS_OUTPUT_LIGHTBAR_SETUP_LIGHT_ON;

Because I added 492-493:

rp.common->valid_flag2 = DS_OUTPUT_VALID_FLAG2_LIGHTBAR_SETUP_CONTROL_ENABLE;
rp.common->lightbar_setup = DS_OUTPUT_LIGHTBAR_SETUP_LIGHT_ON;

After 479-490:

static int command_lightbar3(struct dualsense *ds, uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness)
{
    struct dualsense_output_report rp;
    uint8_t rbuf[DS_OUTPUT_REPORT_BT_SIZE];
    dualsense_init_output_report(ds, &rp, rbuf);

    uint8_t max_brightness = 255;

    rp.common->valid_flag1 = DS_OUTPUT_VALID_FLAG1_LIGHTBAR_CONTROL_ENABLE;
    rp.common->lightbar_red = brightness * red / max_brightness;
    rp.common->lightbar_green = brightness * green / max_brightness;
    rp.common->lightbar_blue = brightness * blue / max_brightness;
  • And it does not work, the lightbar remains either turned off or on and in blue color only . . .

Please send the fully changed file main.c as .txt in the attachment so I can see it more clearly . . .

main.c.txt

@nowrep
Copy link
Owner

nowrep commented Jul 31, 2023

That patch doesn't work.

It needs to query the current state (=color) to avoid overwriting previously set values.

@sTiKyt
Copy link

sTiKyt commented Feb 28, 2024

Have the same issue

hardware: 617, firmware: 1050024
build_date: Dec 16 2022, build_time: 17:00:32
fw_type: 2, sw_series 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants