Repository navigation
agent: configurable volume command - #22
Conversation
|
Если я не ошибаюсь, уже имеется такой способ взаимодействия через dbus, там же можно читать ивенты из приложения (активация, изменение громкости и тд). |
|
Проверил на колонке, чтобы не гадать. В системной шине: У shairport D-Bus действительно богатый: У агента своя шина Поэтому на этой колонке источник громкости — твикер, и backend должен звать то, что умеет в него писать. Но D-Bus-часть могу закрыть отдельно, и, кажется, это полезно: добавить в |
yawaflua
left a comment
There was a problem hiding this comment.
Это может быть удобно, но только если DBus не установлен или был выключен юзером вручную. Как по мне, DBus все-таки лучше, но резервный путь можно оставить
Adds an opt-in volume backend that runs an external program, so a device can use whichever tool owns its mixer without the agent knowing about it. This is the rework of #15 (closed) in the direction you suggested: the core stays free of any single program instead of shipping a device-specific one.
Contract
The program runs directly, not through a shell, with the 10 s timeout from
syscmd. The state word is optional and defaults tounmuted; a trailing%on the level is accepted. Levels outside 0..100 are clamped.Wiring
-volume_cmd/MARUSYA_VOLUME_CMD;mixer_control, which stays the default, so nothing changes for existing speakers;Example adapter
configs/volume-capsule-ipc.example.shadaptscapsule-ipcon a VK Capsula Mini: it is the client to the tweaker IPC that the panel and AirPlay use, so panel, ALSA and the phone slider stay in sync. It is a config example, not part of the package.With #21
When
/run/capsule-controls.sockexists, the AirPlay plugin leaves the volume toap2-bridge; the speaker still reports and accepts volume through the configured command, so both paths agree.Tests
go vet,go test ./internal/controller/...,marusya-agentbuilds;get 60 unmuted->set 85->set 60,mute ontwice (second is a no-op),mute off, volume restored.Targets
stage, as requested.