O
OpenDeckβ€’2mo ago
ninjadev64

Ajazz devices not functioning properly under Windows

Ajazz device screens not updating with images and other issues with OpenDeck on Windows
84 Replies
ninjadev64
ninjadev64OPβ€’2mo ago
@Hero, @Muumm-Ra and @amsmith525 please could you restate your problem and send over OpenDeck log files as you all seem to have the same issue Please can all three of you try to run the examples of the elgato-streamdeck library, on Windows, and on Linux if you have it All of you mentioned your device drop-down being blank - unless this isn't the case on Linux, I think that can be ignored
Hero
Heroβ€’2mo ago
Puedo agregar acciones pero no lo reconoce mi Ajazz APK153E
No description
Hero
Heroβ€’2mo ago
I don't know exactly what you mean. How do I do that? Is this what I just sent? xD
Hero
Heroβ€’2mo ago
amsmith525
amsmith525β€’2mo ago
Device is an APK153E. On windows 23H2, device dropdown shows up blank, some commands respond when pressing button on device, screen does not update when dragging commands to grid. On linux the dropdown is populated, and the screen updates when dragging commands to the grid.
amsmith525
amsmith525β€’2mo ago
No description
amsmith525
amsmith525β€’2mo ago
No description
amsmith525
amsmith525β€’2mo ago
PS D:\elgato-streamdeck\examples\async> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
Running `target\debug\async.exe`
Akp153E B52F50D4374D 4112
thread 'main' panicked at src/main.rs:20:136:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\async.exe` (exit code: 101)
PS D:\elgato-streamdeck\examples\async> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
Running `target\debug\async.exe`
Akp153E B52F50D4374D 4112
thread 'main' panicked at src/main.rs:20:136:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\async.exe` (exit code: 101)
PS D:\elgato-streamdeck\examples\simple> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Running `target\debug\simple.exe`
Akp153E B52F50D4374D 4112
thread 'main' panicked at src/main.rs:20:124:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\simple.exe` (exit code: 101)
PS D:\elgato-streamdeck\examples\simple> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Running `target\debug\simple.exe`
Akp153E B52F50D4374D 4112
thread 'main' panicked at src/main.rs:20:124:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\simple.exe` (exit code: 101)
Not sure how to run these examples, but it does appear to show the device for each example / cargo run
ninjadev64
ninjadev64OPβ€’2mo ago
These example outputs are helpful, thanks I presume that panic doesn't happen on Linux
amsmith525
amsmith525β€’2mo ago
let me know if there are any specific steps you would like me to do I have not tried in linux
ninjadev64
ninjadev64OPβ€’2mo ago
Please do
amsmith525
amsmith525β€’2mo ago
ok - will post soon
Muumm-Ra
Muumm-Raβ€’2mo ago
I have a Rog Ally X with Windows 11 Home 24h2. I'm traveling, I can't test it on Linux until I get back on 1/1. I have a MiraBox 293S
Muumm-Ra
Muumm-Raβ€’2mo ago
No description
Muumm-Ra
Muumm-Raβ€’2mo ago
Muumm-Ra
Muumm-Raβ€’2mo ago
After reinstalled and restarted windows
No description
amsmith525
amsmith525β€’2mo ago
~/elgato-streamdeck/examples/simple$ cargo run -Znext-lockfile-bump
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/simple`
Akp153E 355499441494 4112
Connected to '355499441494' with version 'V2.293S.00.003'
Key count: 18
Touch point count: 0
~/elgato-streamdeck/examples/simple$ cargo run -Znext-lockfile-bump
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/simple`
Akp153E 355499441494 4112
Connected to '355499441494' with version 'V2.293S.00.003'
Key count: 18
Touch point count: 0
~/elgato-streamdeck/examples/async$ cargo run -Znext-lockfile-bump
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/async`
Akp153E 355499441494 4112
Connected to '355499441494' with version 'V2.293S.00.003'
Key count: 18
Touch point count: 0
~/elgato-streamdeck/examples/async$ cargo run -Znext-lockfile-bump
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/async`
Akp153E 355499441494 4112
Connected to '355499441494' with version 'V2.293S.00.003'
Key count: 18
Touch point count: 0
Sorry this took forever for me to get it to run. I ended up having to modify line 13 of ~/elgato-streamdeck/Cargo.toml hidapi = { version = "2.6", default-features = false, features = ["linux-static-hidraw"] } to keep it from throwing a panic error: failed to run custom build command for hidapi v2.6.3 without features = ["linux-static-hidraw"] it would not build
amsmith525
amsmith525β€’2mo ago
This time while running the example on linux, the screen actually updated with the sample image
No description
amsmith525
amsmith525β€’2mo ago
Akp153E B52F50D4374D 4112 vs Akp153E 355499441494 4112
ninjadev64
ninjadev64OPβ€’5w ago
Oh, you should have just asked, I could have told you the solution It is very odd that the serial number changes
amsmith525
amsmith525β€’5w ago
No description
amsmith525
amsmith525β€’5w ago
Device manager shows the right serial number
ninjadev64
ninjadev64OPβ€’5w ago
Maybe you could try making this same change on Windows, with windows-native instead of the Linux one? I think it may be useful to involve @teras and a few others on the GitHub Issues of this library as they know a bit more about the Ajazz implementation and also possess the devices (which I don't) Maybe you could open an issue, and post your findings from running the examples
amsmith525
amsmith525β€’5w ago
PS D:\elgato-streamdeck\examples\simple> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.47s
Running `target\debug\simple.exe`
Akp153E A62F50D4374D 4112
thread 'main' panicked at src/main.rs:20:124:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
PS D:\elgato-streamdeck\examples\simple> cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.47s
Running `target\debug\simple.exe`
Akp153E A62F50D4374D 4112
thread 'main' panicked at src/main.rs:20:124:
called `Result::unwrap()` on an `Err` value: HidError(HidApiError { message: "Get Input/Feature Report DeviceIoControl: (0x00000001) Incorrect function." })
Same error with windows-native Will do
ninjadev64
ninjadev64OPβ€’5w ago
To be honest this is really a bug with the hidapi library
Subjunctive
Subjunctiveβ€’3w ago
hi @amsmith525 -- did you ever open an issue on this? I'm having the same problem now on Win 11 with an AKP153E: screen doesn't update and it doesn't respond to button presses as configured
ninjadev64
ninjadev64OPβ€’3w ago
It's #25 on the library's repo
Subjunctive
Subjunctiveβ€’3w ago
oh thanks, I looked in hidapi and opendeck, but not there. sorry for the noise!
ninjadev64
ninjadev64OPβ€’3w ago
no worries ;) let us know if you solve it
Subjunctive
Subjunctiveβ€’3w ago
should I look at main or dev branch, generally?
ninjadev64
ninjadev64OPβ€’3w ago
looks like the dev branch is just 8 commits behind main, nothing ahead I just deleted it
Subjunctive
Subjunctiveβ€’3w ago
ok cool -- time to step through hidapi stuff in Linux and Windows I guess wish I had a second device, heh
ninjadev64
ninjadev64OPβ€’3w ago
have fun lol you could pass the device through to a VM to not have to keep switching
Subjunctive
Subjunctiveβ€’3w ago
yeah I think I'll try that
ninjadev64
ninjadev64OPβ€’3w ago
is your username the linguistic meaning?
Subjunctive
Subjunctiveβ€’3w ago
yeah
ninjadev64
ninjadev64OPβ€’3w ago
nice, a fellow programmer and linguist
Subjunctive
Subjunctiveβ€’3w ago
heh, I wouldn't say I'm a linguist, but I am certainly curious about language
ninjadev64
ninjadev64OPβ€’3w ago
yeah same went to the UAE and was trying to read all the Arabic even though I can’t, but managed to figure out the word for bank
Subjunctive
Subjunctiveβ€’3w ago
have you played https://store.steampowered.com/app/1931770/Chants_of_Sennaar/ ? it's on my list because of the language-deciphering bits
Steam
Chants of Sennaar
Winner of Best Indie Game at the 2024 New York Game Awards and nominated multiple times at other ceremonies including The Game Awards and the BAFTA, Chants of Sennaar is a critically-acclaimed puzzle and adventure game developed by Rundisc.Divided since the dawn of time, the Peoples of the Tower no longer speak to each other, isolated by fear or...
Price
$19.99
Recommendations
17476
Metacritic
86
ninjadev64
ninjadev64OPβ€’3w ago
that looks really fun, I’ll try the demo and let you know (might get it depending how it goes) a fun little book I read recently was The Art of Language Invention by David Peterson, the guy who made languages for Game of Thrones and other series read it more as a linguistics 101 than a conlanging intro though
fightforlife
fightforlifeβ€’2w ago
I have the Mirabox and build from source and also have the problem that the device is not updating. USB\VID_5548&PID_6670\355499441494
ninjadev64
ninjadev64OPβ€’2w ago
On Windows?
fightforlife
fightforlifeβ€’2w ago
GitHub
AKP153E - Examples return panic with incorrect serial number on Win...
The following was tested on the same hardware configuration with dual boot Linux / Windows Linux: ~/elgato-streamdeck/examples/simple$ cargo run -Znext-lockfile-bump Finished dev [unoptimized + deb...
fightforlife
fightforlifeβ€’2w ago
Do we need USB Wireshark to go further?
Subjunctive
Subjunctiveβ€’2w ago
that reboot-into-Windows thing is interesting!
fightforlife
fightforlifeβ€’2w ago
Yes, very strange. I can try a few more things later today.
Subjunctive
Subjunctiveβ€’2w ago
makes me think that there's some initialization dance that's happening incorrectly on the Windows side at connect
ninjadev64
ninjadev64OPβ€’2w ago
Might be a driver issue
Quantum
Quantumβ€’4d ago
I'm experiencing this too, is there anything I can do to help debug it?
fightforlife
fightforlifeβ€’4d ago
Can still reproduce on Windows on 2.4.0. Currentlyno time to check further.
Subjunctive
Subjunctiveβ€’4d ago
a good comment from askolds11 in bug 25 there. sounds like the git version of hidapi is a bit better
DjGamewon
DjGamewonβ€’4d ago
That's me, I have no experience with usb aside from simple serial unfortunately, so it's hard to make sense of it. I'm going to just try adding the newest version to the library and see what happens - getting the firmware version won't work, but maybe other stuff starts working. I managed to get the firmware version with rusb though, but that's a bandaid imo. I read some issues on hidapi that feature_report is a lot more strict on Windows, so some stuff might not work like it does on Linux, but the Mirabox github sample seems to use getInputReport, but it's from a library file, so I can't tell if they've changed anything. Do I understand correctly that by simply removing the firmware line the code continued on, but froze at some line? I changed the hidapi to the latest git version and I'm getting key inputs in the simple example, about to try async. However, OpenDeck couldn't upload/download Oh nevermind, now it doesn't react to key presses.. Maybe it reacted because I had the Stream Dock app open
DjGamewon
DjGamewonβ€’3d ago
πŸŽ‰
No description
Subjunctive
Subjunctiveβ€’3d ago
oh wow
DjGamewon
DjGamewonβ€’3d ago
I didn't fix it fully yet, but when writing data just needed to add a 0 byte (or I imagine any value would work). It seems like the code adds a 0 sometimes, but I just currently made it do it everytime
Subjunctive
Subjunctiveβ€’3d ago
nonetheless, good find
fightforlife
fightforlifeβ€’3d ago
The code feels like a workaround for some bug, adding a 0x00 for a specific configs. Changing this could break elgato devices
fightforlife
fightforlifeβ€’3d ago
This sepcific logic for different platforms was created with this PR for akp153. So it seems not to be necessary for/affect elgato? (strange) https://github.com/streamduck-org/elgato-streamdeck/pull/6/commits/25c82e28a1a2390ce7fa1ee82b6cd2ca0552f438 match platform { "windows" => Ok(device.write(payload)?), _ => { if payload[0] == 0 { let mut buf = vec![0u8; payload.len() + 1]; buf[0] = 0; buf[1..].copy_from_slice(payload); return Ok(device.write(buf.as_slice())?); } else { Ok(device.write(payload)?) } } } and then refined here: https://github.com/streamduck-org/elgato-streamdeck/commit/891de15d212d88691498118303ebeeebc7925137 if cfg!(windows) || payload[0] != 0 { device.write(payload) } else { let mut buf = vec![0u8; payload.len() + 1]; buf[0] = 0; buf[1..].copy_from_slice(payload); device.write(buf.as_slice()) }
fightforlife
fightforlifeβ€’3d ago
Here is the explanation
No description
DjGamewon
DjGamewonβ€’3d ago
From hidapi:
/// Write an Output report to a HID device.
///
/// The first byte of `data` must contain the Report ID. For
/// devices which only support a single report, this must be set
/// to 0x0. The remaining bytes contain the report data. Since
/// the Report ID is mandatory, calls to `write()` will always
/// contain one more byte than the report contains. For example,
/// if a hid report is 16 bytes long, 17 bytes must be passed to
/// `write()`, the Report ID (or 0x0, for devices with a
/// single report), followed by the report data (16 bytes). In
/// this example, the length passed in would be 17.
/// `write()` will send the data on the first OUT endpoint, if
/// one exists. If it does not, it will send the data through
/// the Control Endpoint (Endpoint 0).
///
/// If successful, returns the actual number of bytes written.
pub fn write(&self, data: &[u8]) -> HidResult<usize> {
self.inner.write(data)
}
/// Write an Output report to a HID device.
///
/// The first byte of `data` must contain the Report ID. For
/// devices which only support a single report, this must be set
/// to 0x0. The remaining bytes contain the report data. Since
/// the Report ID is mandatory, calls to `write()` will always
/// contain one more byte than the report contains. For example,
/// if a hid report is 16 bytes long, 17 bytes must be passed to
/// `write()`, the Report ID (or 0x0, for devices with a
/// single report), followed by the report data (16 bytes). In
/// this example, the length passed in would be 17.
/// `write()` will send the data on the first OUT endpoint, if
/// one exists. If it does not, it will send the data through
/// the Control Endpoint (Endpoint 0).
///
/// If successful, returns the actual number of bytes written.
pub fn write(&self, data: &[u8]) -> HidResult<usize> {
self.inner.write(data)
}
So it seems normal that we need to add a byte to the start, I'll check on linux in a little bit if it works as intended if I make the change, because imo from the docs it seems like it shouldn't be working either Works under linux - I realised that it enters that branch anyways, only time it doesn't is if the first byte is 0, but is that really correct? So I think I get it. The first byte is the report number - as far as I can see, everywhere where it's being used for elgato devices, it is set before calling the write_data function, so it works for both Linux and Windows. For the chinese devices, the report number is coded into the write_data function, so it adds a 0x00 to the beginning. However, this is coded to only happen on Linux for some reason, so it doesn't work on Windows. I do not know if the check for the first byte being 0 - if so, it doesn't add a 0 - is needed. Huh, the Elgato code only works because of that payload[0] != 0 check - since it's report number is 0x02. Added a comment on github issues as well, I would really appreciate a second look from someone
fightforlife
fightforlifeβ€’3d ago
I scrolled through the Code and checked the differences between AKP and elgato. Your reasoning seems solid. The write_data function should not handle different devices. It should only handle differences in Linux/Windows/macos, if there are any. It is just the communication bridge to the OS. It should not have any device specific logic. The calling function should set the correct report number at the beginning of the buffer. Because write_data should not need to know if this buffer needs a report number or not, and also which number for which device.
DjGamewon
DjGamewonβ€’3d ago
GitHub
Fix writing to Ajazz devices by askolds11 Β· Pull Request #27 Β· stre...
Issue #25 hidapi write requires the first byte to be report id. In the current code this was always done on Elgato devices, but only done on Linux for the Ajazz (and Mirabox or whatever) devices. T...
ninjadev64
ninjadev64OPβ€’2d ago
Nice work!
fightforlife
fightforlifeβ€’2d ago
How do we find someone with an elgato device to test the PR? πŸ˜… Since it only affects fake devices.
ninjadev64
ninjadev64OPβ€’2d ago
Me :) I can test soon Will have to find out how to pass my stream deck into my windows VM though If @Terrorwolf is able to do it before me I think he already has the device set up for passthrough
Terrorwolf
Terrorwolfβ€’2d ago
I am not able to test it today. I would be able to test it tomorrow though. Where do I need to change what to build Opendeck with this PR? (Or do I need to rebuild Opendeck?)
DjGamewon
DjGamewonβ€’2d ago
I changed opendeck's cargo.toml to point to the elgato-streamdeck crate with the path option instead of version
Terrorwolf
Terrorwolfβ€’2d ago
What Software do you use for making the VM?
ninjadev64
ninjadev64OPβ€’2d ago
Dockur under Podman (QEMU/KVM)
Terrorwolf
Terrorwolfβ€’2d ago
ah ok.
ninjadev64
ninjadev64OPβ€’7h ago
@DjGamewon I've tested with my Stream Deck Mini on Linux and Windows, and it all seems good. Should I merge it?
Terrorwolf
Terrorwolfβ€’7h ago
I have also found nothing wrong.
DjGamewon
DjGamewonβ€’7h ago
Cool, I'd appreciate checking the review for lib.rs lines 698 - I'm not sure if it's good to code the 0x00 byte at the start like that, but that function is only used by Ajazz devices so it's fine, but not sure if it's good style. If it's okay, then I'll push a commit for formatting (mainly to remove the comment)
ninjadev64
ninjadev64OPβ€’7h ago
I think it's fine, just remove the comment, cargo fmt, push and I'll merge
DjGamewon
DjGamewonβ€’7h ago
Alright, done!
ninjadev64
ninjadev64OPβ€’6h ago
cool! merged
DjGamewon
DjGamewonβ€’6h ago
The issue on github should still stay open though, since serial will be fixed when updating hidapi-rs, and for the firmware version maybe new issue?
ninjadev64
ninjadev64OPβ€’6h ago
I think the serial was an issue only for teras as his device was faulty I'll leave the issue open for you guys to close when you feel like it published to crates.io πŸ‘
DjGamewon
DjGamewonβ€’6h ago
No, I have it too, fixed on latest hidapi-rs (git), not on crates yet though
ninjadev64
ninjadev64OPβ€’6h ago
Hm. teras was talking about his Stream Deck Mini which had faulty firmware. But ok
DjGamewon
DjGamewonβ€’6h ago
Oh I mixed up people I guess - on github the issue is for the Ajazz devices
fightforlife
fightforlifeβ€’5h ago
I will test in a few minutes if serial works on windows with the current version. (I remember yes, only firmware was broken) Can confirm that Serialnumber works on windows with my mirabox. Only firmware version results in panic. MiraBoxHSV293S 7DB69A763555 26224 Connected to '7DB69A763555' Key count: 18 Touch point count: 0 Button 7 down Button 7 up

Did you find this page helpful?