ottokiksmaler / nx500_nx1_modding

Samsung NX500 and NX1 Modding
GNU Affero General Public License v3.0
123 stars 42 forks source link

Reverse engineering `st` logic #123

Open ge0rg opened 11 months ago

ge0rg commented 11 months ago

The st command is very slow (0.3-0.7s) and can crash the camera if it is run too often / too fast from a shell script (e.g. my camera crashes after 20-30 shots in focus_stack).

NX-KS comes with stapp which is just a wrapper around send_message() from mod_lapse. It is much much faster for sending commands, and e.g. works much better than st in focus_stack, but it cannot receive responses via IPC.

I suppose @ottokiksmaler reverse engineered the send IPC (msgget(0x8828) and msgsnd() with the 208-byte-buffer). I'd like to understand how the back-channel works for string outputs. I've seen code to parse an integer return code from /tmp/app_result, but it seems to be unused. The client-side logic is part of libshell-command.so, but what's the server-side? di-camera-app? And what's the protocol to output responses / values?

ge0rg commented 11 months ago

P.S: I'd like to rewrite focus_stack with using send_message() as well, but I'm apparently too dumb to compile any of the Enlightenment-using programs. Should I cross-compile the old E version with the NX500 SDK? Should I rip apart the NX300's existing Enlightenment libraries?