Skip to content

Provide a UNIX domain control socket#126

Open
blufor wants to merge 1 commit into
projectM-visualizer:masterfrom
blufor:master
Open

Provide a UNIX domain control socket#126
blufor wants to merge 1 commit into
projectM-visualizer:masterfrom
blufor:master

Conversation

@blufor

@blufor blufor commented Jun 11, 2026

Copy link
Copy Markdown

...to control the application by other means (ie. StreamDecks and such). This integrates creating AF_UNIX/SOCK_STREAM listen socket with a very simple JSON API (using Poco/JSON) that allows one to do thing such as:

  • switch presets
  • toggle lock and shuffle
  • get status

from outside of the application.

Wayland by design doesn't allow one to send keystrokes to non-active
windows. It's actually against the design.

Every API response reports on the status as well. The simplicity allows one to integrate practically anything with just bash, socat and jq.

In the examples/vj-control, one can find a tool that parses the output into stylish format that can be used on StreamDecks.

One thing I'm not very sure about is how it's hooked into the RenderLoop, however it seems to me there's no other (simple) way around it to properly report back with the status. It is definitely a compromise.

NOTE: I'm a senior devops engineer, however C++ is not one of the languages
I'm friends with (on the contrary actually), so - guilty as charged - I've used Claude Code to help me implement it. The feature is guarded behind -DENABLE_CONTROL_SOCKET=ON

...to control the application by other means (ie. StreamDecks and such).
This integrates creating `AF_UNIX`/`SOCK_STREAM` listen socket with a very
simple JSON API (using `Poco/JSON`) that allows one to do thing such as:

- switch presets
- toggle lock and shuffle
- get status

from outside of the application.

> Wayland by design doesn't allow one to send keystrokes to non-active
windows. It's actually against the design.

Every API response reports on the status as well. The simplicity allows one
to integrate practically anything with just `bash`, `socat` and `jq`.

In the `examples/vj-control`, one can find a tool that parses the output
into stylish format that can be used on StreamDecks.

One thing I'm not very sure about is how it's hooked into the
RenderLoop, however it seems to me there's no other (simple) way around it to
properly report back with the status. It is definitely a compromise.

> NOTE: I'm a senior devops engineer, however C++ is not one of the languages
I'm friends with (on the contrary actually), so - guilty as charged - I've
used Claude Code to help me implement it. The feature is guarded behind
`-DENABLE_CONTROL_SOCKET=ON`
@blufor

blufor commented Jun 11, 2026

Copy link
Copy Markdown
Author

image

example usage

@revmischa

Copy link
Copy Markdown
Member

maybe something like https://en.wikipedia.org/wiki/Open_Sound_Control would be more flexible/standard?

@blufor

blufor commented Jun 11, 2026

Copy link
Copy Markdown
Author

@revmischa Using standard protocols is definitely a better approach and I'm all for that. However (not knowing the details of OSC) - doesn't this present a completely different communication model? Basically you get notified about changes (events) that happen on the other side, no? The implemented model in this PR is purely req->resp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants