From 46c39c6ae5fa79bbda70821281ea692ed748325a Mon Sep 17 00:00:00 2001 From: imonlinux <39863321+imonlinux@users.noreply.github.com> Date: Fri, 12 Dec 2025 15:18:39 -0800 Subject: [PATCH] Update config.json.example cleanup and restore of missing options --- linux_voice_assistant/config.json.example | 229 ++++++++++------------ 1 file changed, 109 insertions(+), 120 deletions(-) diff --git a/linux_voice_assistant/config.json.example b/linux_voice_assistant/config.json.example index 6f64071..989952f 100644 --- a/linux_voice_assistant/config.json.example +++ b/linux_voice_assistant/config.json.example @@ -1,133 +1,122 @@ { + // --------------------------------------------------------------------------- + // Required + // --------------------------------------------------------------------------- "app": { - // Human-readable name; also used to derive the MQTT device_id - // Example: "Bedroom Voice Assistant" -> device_id = "bedroom_voice_assistant" - "name": "Linux Voice Assistant" - }, + // Required + "name": "My Linux Voice Assistant", - "mqtt": { - // Standard MQTT settings (optional if you don't use MQTT/HA discovery) - "host": "192.168.1.2", - "port": 1883, - "username": "mqtt_username", - "password": "mqtt_password" + // Optional + "wakeup_sound": "sounds/wake_word_triggered.flac", + "timer_finished_sound": "sounds/timer_finished.flac", + "preferences_file": "preferences.json", + "debug": false }, // --------------------------------------------------------------------------- - // LED CONFIGURATION + // Optional: Audio I/O // --------------------------------------------------------------------------- - // - // The LVA has a single logical LED backend that reflects the internal - // voice states (idle/listening/thinking/responding/error) and mic mute. - // - // "led_type" selects WHICH hardware is used: - // - "dotstar" = external APA102/DotStar strip - // - "neopixel" = external WS281x/NeoPixel strip - // - "xvf3800" = use the XVF3800 built-in LED ring via USB control - // - // "interface" is only meaningful for dotstar/neopixel: - // - "spi" = hardware SPI (e.g. for APA102 strips) - // - "gpio" = bit-banged output on GPIO pins - // - // For "xvf3800", LEDs are always controlled over USB; "interface", - // "clock_pin", "data_pin", and "num_leds" are ignored by the driver. - // - "led": { - // ------------------------------------------------------------------------- - // Example 1: XVF3800 built-in LED ring - // ------------------------------------------------------------------------- - // Use the XVF3800 ring as the LVA's state indicator (recommended when - // the device is present). The driver talks to the XVF3800 over USB - // using the XMOS control protocol (LED_EFFECT, LED_COLOR, etc.). - // - "led_type": "xvf3800", - - // For xvf3800, the interface is always USB internally. - // This field is kept for schema compatibility but is ignored. - "interface": "gpio", - - // Ignored when led_type == "xvf3800" - "clock_pin": 13, - "data_pin": 12, - - // Ignored when led_type == "xvf3800" (ring length is fixed in hardware). - // The MQTT "Number of LEDs" entity will not affect the XVF3800 ring. - "num_leds": 10 - - // ------------------------------------------------------------------------- - // Example 2: (commented out) DotStar on Grove port - // ------------------------------------------------------------------------- - /* - "led_type": "dotstar", - "interface": "gpio", - - // For ReSpeaker 2-Mic HAT Grove port: - // Yellow wire -> GPIO12 (data) - // White wire -> GPIO13 (clock) - "clock_pin": 13, - "data_pin": 12, - - // Default number of LEDs for a DotStar strip. - // This is overridden by preferences.json after first run. - "num_leds": 16 - */ - - // ------------------------------------------------------------------------- - // Example 3: (commented out) NeoPixel on Grove port - // ------------------------------------------------------------------------- - /* - "led_type": "neopixel", - "interface": "gpio", - - // For NeoPixel, only data_pin is used. - // Grove yellow -> GPIO12 (data) - "clock_pin": 13, // Ignored for NeoPixel - "data_pin": 12, - - "num_leds": 16 - */ - }, - "button": { - // "mode" can be: - // - "gpio" : ReSpeaker 2-Mic HAT or generic Pi GPIO button - // - "xvf3800" : Onboard mute button of the ReSpeaker XVF3800 - "mode": "gpio", - - // GPIO button only (ignored for xvf3800): - "enabled": true, - "pin": 17, - "long_press_seconds": 1.0, - - // XVF3800 mode has no extra options (for now). - // It always acts as a "mute toggle" only. - }, - - // --------------------------------------------------------------------------- - // AUDIO CONFIGURATION - // --------------------------------------------------------------------------- - // - // The XVF3800 presents itself as a standard USB audio device: - // - Input: "reSpeaker XVF3800 4-Mic Array Analog Stereo" - // - Output: "reSpeaker XVF3800 4-Mic Array Analog Stereo" - // - // With PipeWire or PulseAudio, these names show up in: - // script/run --list-input-devices - // script/run --list-output-devices - // "audio": { - // Input device name (or leave omitted/empty to use the system default). - "input_device": "reSpeaker XVF3800 4-Mic Array Analog Stereo", + // Optional: + // - null/omit => default microphone + // - string name => exact device name (soundcard backend) + // - string number => index into soundcard device list (e.g. "0", "1", ...) + "input_device": null, - // Default block size for the wake-word + streaming pipeline. + // Optional: audio capture block size "input_block_size": 1024, - // Output device used for TTS and media playback. - // For XVF3800 you can: - // - Use its own speaker output, or - // - Use HDMI/other sinks instead. - "output_device": "pipewire/alsa_output.usb-Seeed_Studio_reSpeaker_XVF3800_4-Mic_Array_101991441253700076-00.analog-stereo" - } + // Optional: + // - null/omit => mpv chooses default output + // - string => mpv audio-device (e.g. "pulse/alsa_output....") + "output_device": null + }, - // You can also include other sections (zeroconf, additional settings, etc.) - // as needed by the rest of the LVA configuration model. + // --------------------------------------------------------------------------- + // Optional: Wake word config + // --------------------------------------------------------------------------- + "wake_word": { + // Optional: if omitted/empty, code falls back to defaults: + // ["wakewords", "wakewords/openWakeWord"] + "directories": [], + + // Optional: default wake word model id + "model": "okay_nabu", + + // Optional: stop model id (micro wake word) + "stop_model": "stop", + + // Optional: debounce/refractory window after wake word triggers + "refractory_seconds": 2.0, + + // Optional: directory for downloaded models (relative to repo) + "download_dir": "local" + }, + + // --------------------------------------------------------------------------- + // Optional: ESPHome protocol server settings (the LVA exposes an ESPHome API) + // --------------------------------------------------------------------------- + "esphome": { + "host": "0.0.0.0", + "port": 6053 + }, + + // --------------------------------------------------------------------------- + // Optional: LEDs + // --------------------------------------------------------------------------- + "led": { + // Optional: if false, LED controller runs in no-op mode + "enabled": true, + + // "dotstar" | "neopixel" | "xvf3800" + "led_type": "dotstar", + + // "spi" | "gpio" | "usb" + // - dotstar: "spi" or "gpio" + // - neopixel: "spi" or "gpio" + // - xvf3800: "usb" (current intended support) + "interface": "spi", + + // GPIO pins (BCM-ish via adafruit "board.Dxx" mapping) — used when interface="gpio" + // For DotStar GPIO: both clock_pin + data_pin are used + // For NeoPixel GPIO: only data_pin is used (clock_pin ignored) + // For xvf3800: unused and ignored + "clock_pin": 13, + "data_pin": 12, + + // Default number of LEDs (may be overridden by preferences.json after first run) + "num_leds": 3 + }, + + // --------------------------------------------------------------------------- + // Optional: MQTT (enabled automatically when host is set) + // --------------------------------------------------------------------------- + "mqtt": { + // If set, mqtt.enabled becomes true automatically + "host": null, + + "port": 1883, + "username": null, + "password": null + }, + + // --------------------------------------------------------------------------- + // Optional: Button controller + // --------------------------------------------------------------------------- + "button": { + // Master enable + "enabled": false, + + // "gpio" | "xvf3800" + // - gpio: short/long press logic (pin + long_press_seconds) + // - xvf3800: uses the XVF3800 built-in mute button as a pure mute toggle + "mode": "gpio", + + // gpio mode only + "pin": 17, + "long_press_seconds": 1.0, + + // Polling interval (used by both gpio + xvf3800 button controllers) + "poll_interval_seconds": 0.01 + } }