by xlii · 3mo ago · 0 comments
I had a high-end webcam that flickered. There should be switch in the software to switch from 50hz to 60hz that'd fix it but it was nowhere to be found. After digging deeper I found that it was only available in English version of software. It was before macOS had Setting to set language per app, so I had to manually replace Polish bundle with English one through binary.
Another one: Has K810 keyboard that started in "FN-by-default" mode. K811, Mac version of said keyboard allowed for changing default setting just as K810 on Windows, but K810 on Mac - no dice. Support told me to shell out 200€ on Mac keyboard so I ended up writing small binary switcher [0] that would run after keyboard got connected [0].
Similar issue, although I'm not sure if it's the Logitech webcam or just how webcams are automatically configured on Linux these days in general: if I use a really bright LED lamp, the automatic exposure time goes down to the point that it doesn't matter if the webcam is set to 50hz or 60hz, it's going to catch flickering from other subtle frequencies affecting light output. I've also had situations where I wanted to use it to film a white piece of paper that I'm writing on, but it automatically adjusts exposure to make it gray instead.
It took me forever to find something with a straightforward GUI that lets me manually override this behavior on Linux. I ended up settling for cameractrls.
My once top of the range Brio USB 3.0 webcam produces so much high frequency EMI that GNSS receivers in its vicinity completely fail to operate across all bands (1.1 - 1.6 GHz). I had to disconnect it and use it from elsewhere, otherwise my lab dies. I have tens of others USB 3.0 devices that don't do this.
https://github.com/ru13r/k380_fkeys_mac Thank you!
How did you know / learn how to write a binary switcher?
So in that particular case I have a keyboard and it's misbehaving. I know that by some dark magic I can make it behave as I want and that software on Windows can do that.
So I think, "ok, how does it communicate?" - with Bluetooth, obviously. So my next thought it: can I transmit over bluetooth magic bytes that do exactly like this. I definitely have a device on my computer, so I can try to make it.
From that it's all about "how to send arbitrary stuff from bluetooth" search. Instinct tells me there has to be a library, or that at least on person on world wide web tried to do something similar.
If I find even single instance of this, I'm home - read what they did, try to figure out if I can adjust it and do so. Hocus pocus - binary switcher happens.
Though, in the end, it's all about approach. I found many people say "I don't know how to do it, so I don't". My approach is "I rarely know what do, but that doesn't stop me from trying". And this trying new stuff brings practice for the next unknown endeavor.