From d1dffdbbf67bf2a327f9ca3b8cc81ecf3a5e3099 Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Sun, 5 Oct 2025 00:22:17 +0100 Subject: [PATCH 1/2] fix #44: generate udev rules for custom soundcard names Doesn't automatically build or install these. --- Makefile | 3 +++ example.config.json | 29 +++++++++++++++++++++ templates/70-multizone-audio.rules.template | 4 +++ 3 files changed, 36 insertions(+) create mode 100644 templates/70-multizone-audio.rules.template diff --git a/Makefile b/Makefile index b7f1d74..1dbc78f 100644 --- a/Makefile +++ b/Makefile @@ -186,6 +186,9 @@ $(output_dir)/iris.%.conf: $(CONFIG) templates/iris.template $(RENDER) $(output_dir)/home-assistant.%.yaml: $(CONFIG) templates/home-assistant.yaml.template $(RENDER) -z $* -d $< templates/home-assistant.yaml.template > $@ +$(output_dir)/70-multizone-audio.%.rules: $(CONFIG) templates/70-multizone-audio.rules.template $(RENDER) + $(RENDER) -z $* -d $< templates/70-multizone-audio.rules.template > $@ + snapserver: $(output_dir)/snapserver.conf systemctl $(SYSTEMCTL_USER) restart snapserver diff --git a/example.config.json b/example.config.json index 7e4ecd8..2c701f7 100644 --- a/example.config.json +++ b/example.config.json @@ -99,6 +99,35 @@ }, "streams": ["spotify", "airplay", "iris"], "other_streams": ["Google Chromecast"] + }, + { + "name": "room-with-static-soundcard-name", + "name_": "room_with_static_soundcard_name", + "Name": "Room with Static Soundcard Name", + "airplay": { + "port": "5112" + }, + "mopidy": { + "http_port": "6692", + "mpd_port": "6612" + }, + "snapcast": { + "latency": 0, + "opts": "-s MyCard --mixer=hardware", + "volume": 65 + }, + "spotify": { + "api_port": "24812", + "crossfade_ms": "0", + "zeroconf": "39812" + }, + "udev": { + "soundcard": { + "name": "MyCard", + "path": "/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/sound" + } + }, + "streams": ["spotify", "airplay", "iris"] } ], "announcers": [ diff --git a/templates/70-multizone-audio.rules.template b/templates/70-multizone-audio.rules.template new file mode 100644 index 0000000..ebd43dc --- /dev/null +++ b/templates/70-multizone-audio.rules.template @@ -0,0 +1,4 @@ +# multizone-audio: give soundcards deterministic names +{{#zone.udev.soundcard}} +ACTION=="add", SUBSYSTEM=="sound", DEVPATH=="{{path}}/card?", ATTR{id}="{{name}}" +{{/zone.udev.soundcard}} From 2eaa30a7674767fd1b70ba46b634e0ceb95f060f Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Sun, 5 Oct 2025 15:59:06 +0100 Subject: [PATCH 2/2] README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb990d9..5625ac1 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ A **config generator** for a multizone audio system based on snapcast, Mopidy an - [ ] no snapcast controls visible to end-users(!) - [x] eliminate unnecessary software volume controls - [x] replaygain support +- [x] supports multiple audio outputs per player # Architecture