Hercules DJ console MK1 HID mapping v0.1

Hercules DJ console MK1 HID mapping v0.1

i have adapted zestoi’s Hercules DJ Console mk2 HID mapping to work with the MK1 Dj Console,

many thaks to hile, and everybody else on #mixxx for their help and patience!

you just need to copy these two files to /usr/share/mixxx/controlers (as root)

there are still some things that don’t work:

  1. the joystick and “mouse” buttons still arent working, but i will get around to it! (it needs a separate hid mapping because the DJ Console Mk1 presents the joystick as a separate HID device, and i still didn’t figure out the format of the HID packets.
  2. the leds for fx/cue/loop/kill arent quite right either, but it does work properly, just that the leds are wrong so you wont know what mode you’re in.

some things to be aware of:

1.the pitch faders and the volume encoders are switched.
this makes more sense if you use bpm sync and i couldn’t get it to work the normal way.

  1. the track seek buttons for track 1 control track select in the library and the track seek buttons for deck 2 load the selected track in track 1 or track 2.
    this is a stop gap mesure untill i get the joystick working for track select.

  2. i have only tested on linux, you don’t need the hercules Dj drivers.

note to devs: this isn’t quite ready for inculsion in mixxx yet, i’ll mail it to the list when it’s ready for prime time.

have fun! test and tell me what i messed up!

ewan.
HerculesDjConsoleMk1HidMappingv0.1forMixxx1.11.zip (5.76 KB)

Thanks for your work, after a few years of waiting i’m able to use the mk1 with ubuntu!
For me it’s only working with the patched hdjmod-drivers from the ppa.
I added headphone-leds with feedback, set initial mode to kill and changed the values vor the loop-mode to 4,8,16.

I guess there is nothing wrong with the leds, but rather some bug in the send-function.
When one of the headphone-leds is triggered by its button or by mouse-click in mixxx, all other leds go to their correct state.
Also in kill-mode every led is working fine (except the initial state sometimes).
Last line of the send-function is: this.cache_out[ctrl.packetid] = this.cache_out[ctrl.packetid];

when this issue is fixed, it should be ready for inclusion (only the names should be changed from mk2 to mk1)!
Hercules-DJ-Console-Mk1-hid-scripts.js.zip (5.11 KB)

thanks for that, i must have missed the pfl leds.

i’m looking at the led code now, actualy i’m thinking of taking out the kills, since it’s hard to tell which mode you are in, and i never use them anyway.maybe there is some way of making them flash?
in my opinion the default mapping for a controller shouldn’t take too may liberties with the button names vs functions, better that the default mapping does what it says on the labels, and an alternative mapping adds extra features.

you’re right, when i press the a pfl button the leds all go to the right setting. [scratches head]

the next thing to get working is the joystick for libray browsing and track loading, so we can use the “track” buttons for seeking in the track like they are suposed to.

which is causing me big headaches, i attatch my not working yet scripts! so far only the track load buttons work.

i already changed the names didn’t i? did i miss something?
Hercules-DJ-Console-Mk1-joystick-hid-scripts.zip (3.75 KB)

yes, the names are already changed. forgot to mention that i had to rename the xml from hid to cntrl.
for the problem with the joystick: in ubuntu it works like a mouse, but with high acc. buttons also work as mouse.
another observation, that the mk1 shows up 3 times in settings/controllers. i had to disable one, otherwise the joystick produced a lot of strange hid/midi-commands. so i guess that you have to assign one controller for the buttons and one controller for the joystick, but i’m not shure…

do you have some ideas for the leds? the code is hard to read with all the bitshifts and offsets, but i guess the cache is not flushed correctly.

i forgot to mention a few things about the joystick mapping.

the device presents itself as 3 HID devices, the first is the controler, the seccond is the Joystick/Mouse, and the third dosent seem to send any messages so i have no idea what it is but i have afeeling that it is used to configure the soundcard,

if you touch the joystick then it starts controling the mouse, but it just shoots to the edges of the page and stays there, making the mouse unusable untill you unplug it.

BUT if you enable the Hid device in mixxx then it no longer controls the mouse! (you don’t even need a mapping loaded, just choose enable in the preferences.

the mouse gives me some pretty odd readings in its hid packets. its not a simple absolute value between 0 and 255 at the top position it gives me 0xCB in the middle 0x07 and at the bottom 0x7E any idea what kind of number its trying to send?

i have tested it with puredata’s hid object and that gives me values max -81 middle -6 and min 124

i should try changing the code to use a signed int and see what happens

i didn’t make any progress with the leds yet either. i think it’s not that bad, i just need to sit down think about it a bit.

*you said before that you have the hercules driver loaded, i promise you it works without!
your life may be simpler without it!

what would be nice though is to be able to switch the soundcard to 44.1khz rather than 48khz, and control the input source selection, i suspect that this is done via the 3rd hid device, can you change these settings with th hercules driver?
maybe there is a way to set these options by echoing the right packet to /dev/input/event8

I feel some real progress after being abandoned by Hercules!
For me the mouse was still useable after using the joystick, even when i touch the joystick very sensitive it’s possible to navigate the mouse-cursor nearly precise.
It was a bit hard to get the actual hdjmod-dkms to work, i tried to uninstall but then mixxx didn’t show any devices, so i installed it again.
The control panel was not working for me on linux anyway, may be it’s possible to sniff all the commands while using Windows, do you know a tool for this?
Another strange thing: when i start mixxx with --controller-debug i get some permanent messages (may be a damaged knot or fader), but i wasn’t able to decrypt the hex numbers.
The mouse-position could be irrelevant for the commands, i guess it’s an encoded vector (x,y,acc) but normally joysticks have to be calibrated anyway?
Really looking forward, btw: All my knobs are not reacting well, i have to press really hard to trigger them. May be i have to clean the contacts somehow?

about your buttons: the mk1 hercules circuit board lacks a corrosion resistant coating on the switch contacts, so with time the button sensitivity gets reduced due to oxidisation on the pads, it’s a simple fix though, open it up with a screwdriver, and clean the pads with a can of switch cleaner and a cotton bud (thats a q-tip in the US) you can get switch cleaner at just about any electronics shop like radioshack, maplin, etc. if you can’t find switch cleaner then isopropol alchohol, or something else that dosent leave a residue.
theres a link here http://djconsole.blogspot.it/2007/11/1-how-can-i-repair-my-dj-console-mk1-to.html

to use HID devices your user needs to have permission to read AND write to the Devices on /dev/input/event*
there is a guide here:http://www.mixxx.org/wiki/doku.php/troubleshooting

the control seems to constantly re-send the last packet, its a bit of a pain when trying to look at debug message, but nothing out of the ordinary.

HID packet description:
the mouse packet is 01 00 00 00

the first byte is always 01

the second byte is the mouse buttons the first bit is left button and the second bit right button

the third byte is x axis,

the forth byte is y axis.

why on earth they decided to make it a mouse i have no idea! it was a perfectly good joystick.

i updated the wiki for the hercules devices recently

i had given up on my Mk1 console untill i heard about the HID device support,

i’ve no idea how to sniff the hid packets from the windows driver, maybe something like this program: usblyzer.com/ (it has a 33 day trial) if you have a windows system you can try it on that’d be fantastic!

Confirm, it’s working without the hdjmod-dkms!
I’m not able to change to 44.1 kHz, but changing to mic was:
Setup Packet
Offset Field Size Value Description
0 bmRequestType 1 40h
4…0: Recipient …00000 Device
6…5: Type .10… Vendor
7: Direction 0… Host-to-Device
1 bRequest 1 03h
2 wValue 2 00A8h // with Talkover: 4CA8h
4 wIndex 2 0000h
6 wLength 2 0000h
and changing to line was:
Setup Packet
Offset Field Size Value Description
0 bmRequestType 1 40h
4…0: Recipient …00000 Device
6…5: Type .10… Vendor
7: Direction 0… Host-to-Device
1 bRequest 1 03h
2 wValue 2 00AAh // with Talkover: 4CAAh
4 wIndex 2 0000h
6 wLength 2 0000h

glad to hear you got it working without hdjmod, not having to load a kernel driver is fantastic.

great!
is that from the usblyser program?

i’ll have to ask the devs exactly what to do with the info, hopefully i can just send it to the device like we do witht he leds,
i’ve got some questions:

which device does this get sent to? is it a hid packet or is is the control pannel comunicating with the device in bulk mode? (mixxx 1.10 can do bulk mode too, as of a few days ago)

which hid device does it get sent to? remember that the Dj console has three devices.

did you try all the devices when looking for the packet that switches from 48 to 44.1 ?

i hope i have time to look into this soon, in the meantime maybe we should colect all this information on a page on the wiki.

i’m realy glad my dj console has stopped colecting dust! i’m sure theres thousand of these things sitting on shelves arround the world because nonbody wants to use the horrible version of virtual dj they came bundled with.

ewan,

Hi, I’ve been trying to get the LED’s working on my MK1 for some time, and was glad to come across this new information. Thanks for all the hard work. Is there any way to get this working on 1.10.1? I’m only asking because 1.11 is less stable. I’m running Ubuntu 12.04 and Mixxx 1.11 as mentioned earlier, now without the hdj kernel mod. I’ve noticed the same things posted earlier, funky led behavior on fx/queue/loop, but I can’t complain, I was just happy to see a LED turn on! Thanks, and I’f I can contribute, I’d be happy to.

hid support is only available in 1.11,

the best thing you can do is to try and get it to crash as many times as possible and open bug reports for each crash on launchpad. the most important thing to do is to provide as much information as possible for each bug, and follow up your bugs with more information as requested by the developers.

1.11 has a new waveform renderer which is going to take time to squeeze the bugs out of. time and above all bugreports!

as far as the mk1 is concerned: none of the main devs have a mk1 so it’s up to us to get it working, thankfully it’s now at the point where it can actualy be used.

i don’t have this controller any more, so you 'll have to get you hands dirty i’m afraid,

hid controllers are only supported in 1.11, so you’ll have to wait until it gets a bit more stable. or even better: start filing bug reports!

hello everybody,

I’m trying to dowload the mapping for my MK1 but all the links seems to be broken… Can someone help me ?

Thank you

As ewanuno ask to me, I repost the zip of the two files … That work fine for me.
HerculesDjConsoleMk1HidMappingv0.1forMixxx1.11-1.zip (5.76 KB)

Thanks to ewanuno and zestoi for this preset, I’ve committed it to the 1.11 branch and it will be in Mixxx 1.11.0.

Can anyone using this controller help out with documenting the mapping?
Please have a look at: https://github.com/mixxxdj/manual/issues/214