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

Traktor Kontrol S2 MK3 Hotcue LED issue #12130

Open
Joskagyerek3000 opened this issue Oct 17, 2023 · 20 comments
Open

Traktor Kontrol S2 MK3 Hotcue LED issue #12130

Joskagyerek3000 opened this issue Oct 17, 2023 · 20 comments

Comments

@Joskagyerek3000
Copy link

Joskagyerek3000 commented Oct 17, 2023

Bug Description

This is in the 2.4.0 beta version!

With the built-in mapping for the Traktor Kontrol S2 MK3, the hotcue pads only light up or change colors when I press the "HOTCUES" switch button. Otherwise, they don't give any feedback.
In other words, it seems like that the 'HOTCUES' button makes a refresh to the hotcue LEDs, otherwise they don't show any changes in light or color.

Version

2.4.0

OS

Windows 11

@Swiftb0y
Copy link
Member

Hey there, thank you for filling your issue. In order to get to the bottom of this. We would like to inspect your log file. Please use our guide to find it and then upload it here and we'll see if we can spot anything in the log. Thank you.

@Joskagyerek3000
Copy link
Author

Joskagyerek3000 commented Oct 17, 2023 via email

@ronso0
Copy link
Member

ronso0 commented Oct 17, 2023

Attachments don't show up on Github if you reply via email.

@Joskagyerek3000
Copy link
Author

mixxx.log

sorry, here it is :)

@subtruth
Copy link

subtruth commented Jun 30, 2024

Same problem, same version version 2.4.1, different OS (Lubuntu 24.04)

mixxx.log

@Swiftb0y
Copy link
Member

@acolombier or @ywwg any chance you can look into this?

@lc-guy
Copy link

lc-guy commented Aug 7, 2024

Getting this on 2.5.0-beta (Windows 10) as well.

It seems to me that the s2 mk3 script only calls padModeHandler when a pad button is clicked, and that is the only function where the colors and lights are set for cues. Maybe it should be called when a hotcue is updated?

@ywwg
Copy link
Member

ywwg commented Aug 9, 2024

I do not own this controller, unfortunately. I don't know who else in mixxx has an s2

@hofq
Copy link

hofq commented Sep 26, 2024

I do not own this controller, unfortunately. I don't know who else in mixxx has an s2

i'd be happy to assist and test code snippets if needed.

@acolombier
Copy link
Member

Sorry @Swiftb0y just seen your tag. I also don't own that controller either unfortunately, and the mapping is quite different to the S4, so even debugging in the dark might be hard sadly..

@Swiftb0y
Copy link
Member

True. Maybe @mi01 (original author) or @olivier-mauras can help out?

@Swiftb0y
Copy link
Member

unfortunately the issue seems to interact with the common-hid-packet-parser.js library which I'm unfamiliar with. The offending code is here:

for (let i = 1; i <= 8; ++i) {
TraktorS2MK3.controller.linkOutput("[Channel1]", "pad_" + i, "[Channel1]", "hotcue_" + i + "_enabled", this.hotcueOutputHandler);
TraktorS2MK3.controller.linkOutput("[Channel2]", "pad_" + i, "[Channel2]", "hotcue_" + i + "_enabled", this.hotcueOutputHandler);
TraktorS2MK3.controller.linkOutput("[Channel1]", "pad_" + i, "[Channel1]", "hotcue_" + i + "_color", this.hotcueColorHandler);
TraktorS2MK3.controller.linkOutput("[Channel2]", "pad_" + i, "[Channel2]", "hotcue_" + i + "_color", this.hotcueColorHandler);
}

The log file gives a pretty good indication of the cause:

Critical [Controller] HIDController.setOutput - Unknown field: [Channel2].hotcue_1_enabled
Warning [Controller] HIDController.linkOutput - Output already linked: [Channel1]
Warning [Controller] HIDController.linkOutput - Output already linked: [Channel2]

Maybe @JoergAtGithub can have a look?

@JoergAtGithub
Copy link
Member

This seems to be a regression of #4637. Colored hotcues are a new mapping feature of 2.4.0.

The message

Warning [Controller] HIDController.linkOutput - Output already linked: [Channel1]

are easy to explain, because "[Channel1]", "pad_" + i is linked twice in the loop. But I do not see the reason for the Unknown field error logged before yet.

@Swiftb0y
Copy link
Member

Thanks for the explanation. Well @goddisignz may be able to fix the code then.

@goddisignz
Copy link
Contributor

I will try to have a look at this next week.

@Swiftb0y
Copy link
Member

Thanks 👍 👍 👍

@lc-guy
Copy link

lc-guy commented Nov 25, 2024

@goddisignz were you able to look into it in the end?

@JeremyDeJong
Copy link

JeremyDeJong commented Jan 21, 2025

Bumping this one, I am happy to take a look sometime as I own the S2 MK3

@Swiftb0y
Copy link
Member

@JeremyDeJong that would be great. Can you reproduce the issue? If so can you try fixing it and open a PR?

@Terka96
Copy link

Terka96 commented Feb 3, 2025

Hey, I've just found where is the problem.

In file /res/controllers/Traktor-Kontrol-S2-MK3-hid-scripts.js callback functions hotcueOutputHandler and hotcueColorHandler calls colorOutputHandler and outputHandler with "key" parameter with value "hotcue_X_enabled"/"hotcue_X_color" instead of "pad_X".

Fix that worked for me was to create in both hotcue handler functions controllerKey by using string replace method and use it while calling colorOutputHandler and outputHandler:

in hotcueOutputHandler:
const controllerKey = key.replace("_enabled","").replace("hotcue_","pad_");
in hotcueColorHandler:
const controllerKey = key.replace("_color","").replace("hotcue_","pad_");

and replace "key" variable in this method calls with "controllerKey" like that:
TraktorS2MK3.colorOutputHandler(color, group, controllerKey);
TraktorS2MK3.outputHandler(0, group, controllerKey);

Also while switching pad mode by default pads in hotcue mode lights up with full brightness and it can be fixed by adding else case to if(active) statement in method padModeHandler:

TraktorS2MK3.outputHandler(0, field.group, "pad_" + i);

I've tested the solution on my controller and it seems to work. I don't know what is the cleanest way to apply this fixes and I don't have now more time so I won't make PR.

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

No branches or pull requests