Commit Graph
26 Commits
Author SHA1 Message Date
imonlinux b43b036198 Update __main__.py
Extended Preferences loading to initialize and backfill a new alarm_duration_seconds field (default 0).

Added a set_alarm_duration event handler to MicMuteHandler which:

validates and normalizes the duration value,

updates state.preferences.alarm_duration_seconds,

persists the updated preferences to disk.

Kept the existing “single writer” pattern (MicMuteHandler) for preferences/state updates.
2025-11-29 14:37:18 -08:00
imonlinux d2a133191b Update __main__.py
File: linux_voice_assistant/__main__.py

In _init_basics(), the --list-output-devices block is updated so that:

It exits with 0 on success.

It exits with 1 only if an exception occurs.
2025-11-21 17:00:25 -08:00
imonlinux adbb37e731 Update __main__.py
New CLI helpers

    Added support for:

    script/run --list-input-devices
    script/run --list-output-devices

    These code paths:

        Initialize just enough of the audio stack to enumerate devices.

        Print a clean, human-readable list of input/output devices (including PipeWire / PulseAudio virtual devices like Echo-Cancel Source and pipewire/echo-cancel-sink).

        Exit cleanly with status 0 instead of trying to start the full LVA process afterward (fixing the previous CalledProcessError when --list-output-devices was used).

Behavior change

    __main__.py now treats the “list devices” modes as early-exit utility modes, not “run LVA and then also print devices”.

    This makes it practical to use these commands in setup docs and shell scripts.
2025-11-20 20:02:23 -08:00
imonlinux 4616645c40 Update __main__.py
Entry point. Clean imports, timestamp logging, integration of AudioEngine.
2025-11-19 18:49:43 -08:00
imonlinux e3216d3e68 Update __main__.py
Wrong version uploaded.
2025-11-18 15:15:07 -08:00
imonlinux 2fdef7d6ce Update __main__.py
Wrong version of file uploaded.
2025-11-18 11:48:04 -08:00
imonlinux fd5cd13f72 Update __main__.py
(Major change) main() function completely refactored into helpers. _init_controllers now handles decoupled initialization. _process_audio loop logic was fixed to correctly initialize wake words on startup.

 mic.recorder() loop is now much more robust against OS buffering issue when the microphone is muted and wakewords were detected and processed after unmute.
2025-11-17 22:40:53 -08:00
imonlinux 8c6df9b245 Update __main__.py
(Major change) main() function completely refactored into helpers. _init_controllers now handles decoupled initialization. _process_audio loop logic was fixed to correctly initialize wake words on startup.
2025-11-17 21:46:42 -08:00
imonlinux a4fa7b8631 Update __main__.py
Replaced sounddevice with soundcard, removed the audio Queue, added the new download directory to the search path, and added the device listing arguments
2025-11-17 20:21:24 -08:00
imonlinux ebd74c1e80 Update __main__.py
Removed all argparse.add_argument() calls, except for the new --config flag.  The main() function now calls load_config_from_json() at startup.  All internal logic now references the config object (e.g., config.app.name) instead of the old args object.
2025-11-17 17:20:18 -08:00
imonlinux 943a8a0d5c Update __main__.py
Fix MpvMediaPlayer Race Condition
Goal: The mpv library runs in its own thread. When a track finishes, its callback (_on_idle_active) runs in that thread and tries to modify the satellite's state, creating a race condition. We will fix this by "marshaling" that callback onto the main asyncio loop.

added loop=loop to the MpvMediaPlayer constructors
2025-11-17 14:40:42 -08:00
imonlinux d427d138e6 Add Support for NEOPixel via SPI 2025-10-15 20:33:24 -07:00
imonlinux e0bef20398 Implement MQTT for Advanced LVA Controls
Adds command-line arguments (--mqtt-host, --mqtt-port, etc., and --num-leds) to configure the MQTT connection and initial LED setup.

Instantiates and starts the MqttController on application startup if an MQTT host is provided.

Includes the MicMuteHandler class, which listens for mute commands, updates the global mic_muted state, and clears the audio queue on unmute to prevent processing stale audio.

Updates the process_audio loop to respect the mic_muted flag.
2025-10-12 12:57:11 -07:00
imonlinux 524ad02228 Revert API Microphone Mute Switch 2025-10-12 10:11:56 -07:00
imonlinux 98c8585ae3 Microphone Mute Button Bug
Bug fix to eliminate "pending" wake word detections while the mic was muted.
2025-10-11 19:34:14 -07:00
imonlinux 39d6d3e010 Add Microphone Mute Switch Entity
Implements the core mute functionality.

Adds a new MicMuteHandler class that subscribes to the set_mic_mute event. This handler updates the state.mic_muted flag and publishes secondary mic_muted or mic_unmuted events for LED feedback.

Modifies the process_audio function to check the state.mic_muted flag in its main loop, pausing audio processing when the flag is True.
2025-10-11 17:10:15 -07:00
imonlinux 92867db2b2 Implement Volume Persistence
Modifies the startup sequence to read the volume_level from the loaded preferences.

This saved value is then passed as the initial_volume when creating the music_player and tts_player instances.
2025-10-11 15:34:45 -07:00
imonlinux abcc7aeaef Updates for EventBus and LedController.
Passes the event_bus and loop instances into the ServerState object upon creation.

Adds new command-line arguments (--led-interface, --led-clock-pin, --led-data-pin) to allow the user to select and configure the LED hardware interface at runtime.
2025-10-11 12:39:57 -07:00
imonlinux ec51b0b11e Add LED Events to __main__.py 2025-10-10 19:04:08 -07:00
Michael Hansen 7a4b3e661a Add zeroconf discovery 2025-09-18 10:52:56 -05:00
Michael Hansen d5300ae694 Support openWakeWord 2025-09-16 15:05:18 -05:00
Michael Hansen e26864a191 Support multiple wake words 2025-09-15 11:29:28 -05:00
Michael Hansen 2c937e3cb3 Save preferences to JSON file 2025-09-15 11:06:09 -05:00
Michael Hansen ea901a1c14 Small refactor 2025-09-15 10:43:51 -05:00
Michael Hansen cda08235de Remove experimental external wake words 2025-08-26 10:53:23 -05:00
Michael Hansen 4356633ed6 Rename to Linux Voice Assistant 2025-08-26 09:30:58 -05:00