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

Possible Bug - DPI Setting #1

Open
nbulischeck opened this issue Aug 9, 2020 · 11 comments
Open

Possible Bug - DPI Setting #1

nbulischeck opened this issue Aug 9, 2020 · 11 comments

Comments

@nbulischeck
Copy link

This issue is looking at the following block:

    transfer(device, 12, device->command_prefix,
         0x06, 0x00, 0x06, 0x00, 0x00, 0x00,
         0x00,  /* Indicator LED's red */
         0x00,  /* Main LED's red */
         0xff,  /* Indicator LED's green */
         0x00,  /* Main LED's green */
         0xff,  /* Indicator LED's blue */
         0x00); /* Main LED's blue */

    transfer(device, 5, 0x01, 0x20, 0x00, 0x08, 0x70); /* Set DPI (708 hex = 1800) */

I'm using the corsair harpoon w/ the wireless dongle and I was able to alter the middle click indicator LED by changing the first transfer, but when attempting to drop the DPI to 500 or even 10 I don't seem to get any change.

I'm on Arch Linux, but libusb is cross-platform so I reckon that shouldn't matter.

I appreciate all the research you're doing on this to get some working cross-platform support for the Harpoon!

@andreldm
Copy link
Owner

andreldm commented Aug 11, 2020

You're right, during the last refactoring I forgot to send the command prefix when setting DPI.
Please let me know if f8494dd solves the problem for you.

@nbulischeck
Copy link
Author

It occasionally works! - though it seems very hit or miss as to whether it'll actually update the DPI or not.

@andreldm
Copy link
Owner

Do you mean the same value will work occasionally? or some values work while others don't?

@nbulischeck
Copy link
Author

If I set the DPI to 6000 and change the light, the light definitely changes and the DPI might as well. If they both change, I'll kill the program, recompile, edit the light, set the DPI to 1800, and rerun it. Upon rerunning, the light will change as expected, but the DPI will stay at 6000.

@andreldm
Copy link
Owner

Hi Nick, sorry for the long time to reply. I've noticed that sometimes DPI settings are not properly applied, unfortunately I can't reliably reproduce the problem, while switching between 400 (0xC8 0x00) and 6000 (0x70 0x17) DPI it works fine.

@mtoohey31
Copy link

Hello! Sorry to bring this up here, but I'm not really sure about where to contact you about this, are you able to provide a little more guidance about this line in particular?

    transfer(device, 6, device->command_prefix, 0x01, 0x20, 0x00, 0x08, 0x70); /* Set DPI (708 hex = 1800) */

I've got the service working and changing the lighting, but I don't quite understand how to use the 6 values in that line to change the DPI... I don't know C and I've never dealt with hardware drivers before so I don't really where to begin...

@andreldm
Copy link
Owner

@mtoohey31 no problem, I have added a clarification note in 73e2215, hope that helps.

@mtoohey31
Copy link

Yes, thank you very much, now I get it!

@catm4n
Copy link

catm4n commented Apr 22, 2023

not really a problem but can someone tell me how i would adjust 0x06, 0x00, 0x06, 0x00, 0x00, 0x00 to obtain a solid blue led and indicator?

@mtoohey31
Copy link

Based on the comments, the 0x06, 0x00, 0x06, 0x00, 0x00, 0x00 line isn't supposed to be changed. You'll need to adjust the lines below that one. The following changes should do the trick:

--- a/harpoond.c
+++ b/harpoond.c
@@ -117,10 +117,10 @@ static void init_device(Device *device)
         0x06, 0x00, 0x06, 0x00, 0x00, 0x00, /* Do not change */
         0x00,  /* Indicator LED's red */
         0x00,  /* Main LED's red */
-        0xff,  /* Indicator LED's green */
+        0x00,  /* Indicator LED's green */
         0x00,  /* Main LED's green */
-        0x00,  /* Indicator LED's blue */
-        0x00); /* Main LED's blue */
+        0xff,  /* Indicator LED's blue */
+        0xff); /* Main LED's blue */
 
     transfer(device, 6, device->command_prefix,
         0x01, 0x20, 0x00, /* Do not change */

@catm4n
Copy link

catm4n commented Apr 22, 2023

Based on the comments, the 0x06, 0x00, 0x06, 0x00, 0x00, 0x00 line isn't supposed to be changed. You'll need to adjust the lines below that one. The following changes should do the trick:

--- a/harpoond.c
+++ b/harpoond.c
@@ -117,10 +117,10 @@ static void init_device(Device *device)
         0x06, 0x00, 0x06, 0x00, 0x00, 0x00, /* Do not change */
         0x00,  /* Indicator LED's red */
         0x00,  /* Main LED's red */
-        0xff,  /* Indicator LED's green */
+        0x00,  /* Indicator LED's green */
         0x00,  /* Main LED's green */
-        0x00,  /* Indicator LED's blue */
-        0x00); /* Main LED's blue */
+        0xff,  /* Indicator LED's blue */
+        0xff); /* Main LED's blue */
 
     transfer(device, 6, device->command_prefix,
         0x01, 0x20, 0x00, /* Do not change */

well I'm a dummy.. thank you so much.

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

4 participants