Purejavahidapi and Jna no more compatible?
Its a nice projeckt bat it looks like its no more compatible with new Stream Deck (5 x 3 Buttons).
There was some exceptions. After inserted jna 5.5.0 and build current nyholku/urejavahidapi. I have still exception while running Example1_Displaying_A_Key.java Vendor-ID: 4057, Product-ID: 109 Found ESD [4057:109] Connected Stream Decks: Manufacurer: Elgato Product: Stream Deck Device-Id: HID\VID_0FD9&PID_006D\8&3992574&0&0000 Serial-No: AL17J2C01756 Path: \?\hid#vid_0fd9&pid_006d#8&3992574&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Error sending the following command-class to the esd: class de.rcblum.stream.deck.device.StreamDeck$IconUpdater
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at purejavahidapi.windows.HidDevice.setOutputReport(HidDevice.java:170)
at de.rcblum.stream.deck.device.StreamDeck.internalDrawImage(StreamDeck.java:463)
at de.rcblum.stream.deck.device.StreamDeck$IconUpdater.run(StreamDeck.java:230)
at de.rcblum.stream.deck.device.StreamDeck$DeckWorker.run(StreamDeck.java:182)
at java.lang.Thread.run(Thread.java:748)
It means the place with System.arraycopy(data, 0, m_OutputReportArray, 1, length)
@Override
synchronized public int setOutputReport(byte reportID, byte[] data, int length) {
if (!m_Open)
throw new IllegalStateException("device not open");
if (m_OutputReportLength == 0)
throw new IllegalArgumentException("this device supports no output reports");
// In Windows writeFile() to HID device data has to be preceded with the report
// number, regardless
Arrays.fill(m_OutputReportArray, (byte)0);
m_OutputReportArray[0] = reportID;
System.arraycopy(data, 0, m_OutputReportArray, 1, length);
Length of data is 8190 but m_OutputReportArray is only 1024 get from caps.OutputReportByteLength; Where is this from?
Hi, it's a nice project indeed, I was also interested to get it working with the mk2 version, and was able to figure it out at least up to registering RunnableItem and StreamKeyListener. The differences compared to the earlier streamdeck version seem to be
- mk2 requires to send jpeg image data
- different protocol, e.g. different bytes to send (this includes packet size reduced from 8019 to 1024)
- byte shift to recognize key presses properly You can check my fork and the commit I added in the feature/streamdeck-mk2 branch, along with references to some other repos I came across during research that helped me. The commit is in working state, i.e. just a starting point for someone to take it further.