mirror of
https://github.com/db9979/speech-on-dgx-spark.git
synced 2026-12-05 12:24:11 +01:00
V01.1.527 Pi-Stimme: spricht der Modell-Rechner nicht, spricht der Panel-Rechner selbst mit der Piper-Stimme Thorsten
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUffhnJjwTupZyjAQ2D
This commit is contained in:
42 files changed
+744
-66
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
Every version in one line, newest first (taken from the commit messages, so some lines are German, some English). Older versions (V01.0.000 to V01.0.999 and the lines before version numbers): [CHANGELOG-V01.0.md](CHANGELOG-V01.0.md).
|
||||
|
||||
- **V01.1.527** · 2026-11-18 · Pi-Stimme (Dominik 2026-11-18 „Piper als eigenes Programm“, Mischbetrieb Schritt 4): Funktionen → Pi-Stimme (`chat.notbetrieb_tts`, ab Werk aus); `speech-spark-nottts` auf dem Panel-Rechner (127.0.0.1:31022, `app/pistimme.py`) spricht mit der Piper-Stimme Thorsten über sherpa-onnx, solange die Sprachausgabe des Modell-Rechners weg oder von der Speicher-Wache freigegeben ist. Paket per SHA-256 gepinnt, nur sicher ausgepackt; ihr Ton wird nie zur Datei einer anderen Stimme. Live „Pi-Stimme spricht|bereit|fehlt“, Doku, `test_pistimme`, P970.
|
||||
- **V01.1.526** · 2026-11-18 · Speicher-Wache im Mischbetrieb (Dominik 2026-11-18 „1a 2a 3a“, Schritt 3): der Wärter schaut alle 5 s nach; startet eine Unit des anderen Projekts oder sind weniger als 6 GiB frei, stoppt er die Engines von Hören und Sprechen (`mischbetrieb.wache`), das Panel hört solange mit Parakeet und zeigt Antworten als Text; nach 6 ruhigen Blicken mit mindestens 18 GiB frei startet er nur die selbst gestoppten wieder. Wärter-Status `mischbetrieb_frei`, Live-Text, Doku, P969.
|
||||
- **V01.1.525** · 2026-11-18 · Mischbetrieb (Dominik 2026-11-18 „1a 2a 3a“, Schritte 2 und 5): `sudo speech-spark mischbetrieb an|aus|status` gibt die GPU des Modell-Rechners einem anderen Projekt (Alzeo): eigenes Sprachmodell, Bilder, Musik, VoiceDesign aus, Hören und Sprechen auf die kleinen 0.6B-Modelle, `aus` stellt genau den Stand von vorher wieder her; solange es an ist, starten die Rollen nicht (engine.sh) und nichts wechselt oder wird gemessen; im Panel antwortet ein fremder Modell-Dienst (auch als Ersatz) oder sofort ein fester Satz, kein Ausfall-Alarm, Live zeigt „Mischbetrieb“; eine Wartungspause oder der Notbetrieb halten Fragen nicht mehr an, solange ein fremder Dienst antwortet (P968)
|
||||
- **V01.1.524** · 2026-11-18 · Alzeo als fremder Modell-Dienst (Dominik 2026-11-18 „1a 2a 3a“, Mischbetrieb Schritt 1): ein fremder Dienst kann bis zu 8 geprüfte Modelle haben; jede Minute schaut das Panel, welches der Dienst nennt, und folgt von selbst einem anderen geprüften (Alzeo bietet je eine Lane zur Zeit an), nennt er keines oder antwortet nicht, antwortet das eigene Modell oder der Ersatz; der Wächter sperrt auf dem Modell-Rechner nur noch die Spark-Ports 31000–31099 (netguard.own_service, eine Regel auch für die fremden Dienste), sodass Alzeo auf tars:30001 eingetragen werden kann; auf dem eigenen Rechner bleiben 30000–31099 gesperrt (P967)
|
||||
|
||||
+1
-1
@@ -43,6 +43,7 @@ Alle Optionen ohne Rückfragen (`--mode api --asr 1.7b --tts 0.6b --yes` …) st
|
||||
|
||||
<!-- New version: add one line at the top here and in CHANGELOG.md, drop the oldest line here (keep 10). Details go to docs/de and docs/en, not into this README. -->
|
||||
|
||||
- **V01.1.527** Pi-Stimme: spricht der DGX Spark gerade nicht (weg oder Speicher-Wache), spricht der Panel-Rechner selbst mit der Piper-Stimme Thorsten; Admin-Schalter, ab Werk aus
|
||||
- **V01.1.526** Speicher-Wache im Mischbetrieb: startet das andere Projekt oder wird der Speicher knapp, geben Hören und Sprechen auf dem DGX Spark ihren Speicher frei, der Pi hört solange mit Parakeet
|
||||
- **V01.1.525** Mischbetrieb: der DGX Spark rechnet für ein anderes Projekt, der Assistent hört und spricht weiter
|
||||
- **V01.1.524** Alzeo als fremder Modell-Dienst: mehrere geprüfte Modelle, das Panel folgt der laufenden Lane
|
||||
@@ -52,7 +53,6 @@ Alle Optionen ohne Rückfragen (`--mode api --asr 1.7b --tts 0.6b --yes` …) st
|
||||
- **V01.1.520** Füllsätze: abwechslungsreicher, ab und zu mit Namen, nur einer pro Antwort und im Auto nicht mehr abgebrochen
|
||||
- **V01.1.519** Gesperrte Dienste sofort ansagen: „Das Internet ist gerade gesperrt, versuch es später noch einmal“ statt „Ich schau nach“ und dann nichts
|
||||
- **V01.1.518** Spark-Konsole neu geordnet: vier Bereiche in einer Seitenleiste (am Handy unten), Überblick mit einem Satz und Verlaufskacheln, Modelle und Verbindungen als Liste und Detail, Wartung mit Updates und Logs, hell und dunkel nach System
|
||||
- **V01.1.517** ROT-FIX: drei Selbsttests setzen ihre Schalter selbst und hängen nicht mehr von der Uhrzeit ab
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ All options for running without questions (`--mode api --asr 1.7b --tts 0.6b --y
|
||||
|
||||
<!-- New version: add one line at the top here and in CHANGELOG.md, drop the oldest line here (keep 10). Details go to docs/de and docs/en, not into this README. -->
|
||||
|
||||
- **V01.1.527** Pi voice: while the DGX Spark does not speak (gone or memory guard), the panel computer speaks by itself with the Piper voice Thorsten; admin switch, off by default
|
||||
- **V01.1.526** Mischbetrieb memory guard: while the other project starts or memory runs short, Hören and Sprechen on the DGX Spark give their memory back, the Pi hears with Parakeet meanwhile
|
||||
- **V01.1.525** Mischbetrieb: the DGX Spark works for another project, the assistant keeps listening and speaking
|
||||
- **V01.1.524** Alzeo as a foreign model service: several checked models, the panel follows the running lane
|
||||
@@ -52,7 +53,6 @@ All options for running without questions (`--mode api --asr 1.7b --tts 0.6b --y
|
||||
- **V01.1.520** Fillers: more varied, now and then with your name, only one per answer and no longer cut off in the car
|
||||
- **V01.1.519** Blocked services are said at once: "The internet is blocked right now, please try again later" instead of "Let me look" and nothing
|
||||
- **V01.1.518** Spark console reordered: four areas in a side bar (at the bottom on a phone), overview with one sentence and tiles with history, models and connections as list and detail, maintenance with updates and logs, light and dark follow the system
|
||||
- **V01.1.517** Red fix: three self-tests set their own switches and no longer depend on the time of day
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
V01.1.526
|
||||
V01.1.527
|
||||
@@ -770,6 +770,16 @@ WAERTER_PORT = 31007
|
||||
NOTASR_PORT = 31009
|
||||
NOTASR_IDLE = 600 # seconds without a recording before Parakeet gives its memory back
|
||||
ASR_UMWEG = None # set by panel/notbetrieb.py: callable(cfg) -> True while this computer's Parakeet hears
|
||||
# Pi-Stimme (plan alzeo-mischbetrieb M4, pistimme.py): the Piper voice Thorsten on this computer's CPU speaks while the
|
||||
# model computer's speech output is gone (Notbetrieb) or given away by its Speicher-Wache (Mischbetrieb)
|
||||
NOTTTS_PORT = 31022
|
||||
NOTTTS_IDLE = 600 # seconds without a sentence before the voice gives its memory back
|
||||
TTS_UMWEG = None # set by panel/notbetrieb.py: callable(cfg) -> True while this computer's voice speaks
|
||||
|
||||
|
||||
def ist_pistimme(url):
|
||||
"""The address goes to this computer's Pi-Stimme (its sound is never kept as another voice's)."""
|
||||
return str(url).startswith(f"http://127.0.0.1:{NOTTTS_PORT}/")
|
||||
WAERTER_KEY = os.path.join(STATE, "waerter.key")
|
||||
WARTUNG_FILE = os.path.join(STATE, "wartung.json") # the Wartungspause (panel/wartung.py); on the model computer its wish
|
||||
|
||||
@@ -1123,6 +1133,8 @@ def model_url(art, path="", cfg=None):
|
||||
cfg = load_config() if cfg is None else cfg
|
||||
if art == "asr" and ASR_UMWEG is not None and ASR_UMWEG(cfg): # Notbetrieb: the model computer is gone
|
||||
return f"http://127.0.0.1:{NOTASR_PORT}{path}"
|
||||
if art == "tts" and TTS_UMWEG is not None and TTS_UMWEG(cfg): # the model computer's speech output is gone
|
||||
return f"http://127.0.0.1:{NOTTTS_PORT}{path}"
|
||||
host = model_host(cfg)
|
||||
port = WAERTER_PORT if art == "waerter" else int(cfg[MODEL_ARTS[art]]["port"])
|
||||
if model_local(cfg):
|
||||
|
||||
@@ -361,6 +361,7 @@
|
||||
"wartung": false,
|
||||
"wartung_auto": false,
|
||||
"notbetrieb_asr": false,
|
||||
"notbetrieb_tts": false,
|
||||
"gehaeuse": false,
|
||||
"system_updates": false,
|
||||
"spark_clients": false,
|
||||
|
||||
+3
-1
@@ -33,7 +33,7 @@ import re
|
||||
import threading
|
||||
import time
|
||||
|
||||
from common import STATE
|
||||
from common import STATE, ist_pistimme
|
||||
|
||||
BRIDGE_S = 6.0 # seconds after the question without any sound of the answer: the second sentence
|
||||
BRIDGE_AFTER_ACK_S = 10.0 # after an opening sentence the second one only after this long without a sound
|
||||
@@ -760,6 +760,8 @@ async def record_missing(url, headers, tts_body, lang, texts=None, sleep=asyncio
|
||||
import httpx
|
||||
import stufe
|
||||
import vorrang
|
||||
if ist_pistimme(url): # the Pi-Stimme: never kept as this voice's clip
|
||||
return 0
|
||||
texts = texts or all_texts(lang == "English", name)
|
||||
todo = []
|
||||
with _lock:
|
||||
|
||||
@@ -176,7 +176,7 @@ OHNE = {
|
||||
"room_remote", "room_voices", "route_off", "route_unklar", "routing", "search", "search_url",
|
||||
"self_echo_mode", "spark_drawer", "spark_help", "spark_suggest", "speaker_code", "speaker_id",
|
||||
"speaker_strictness", "storage_folder", "storage_lan", "storage_offload", "storage_own", "storage_root",
|
||||
"svc_watch", "svc_watch_users", "grund_internet", "rundlauf", "rundlauf_min", "wachposten", "wartung", "wartung_auto", "notbetrieb_asr", "gehaeuse", "gehaeuse_art", "gehaeuse_wechsel_s", "gehaeuse_hell", "gehaeuse_led_hell", "gehaeuse_nacht", "gehaeuse_nacht_von", "gehaeuse_nacht_bis", "gehaeuse_anzeige", "gehaeuse_drehung", "gehaeuse_seiten_aus", "gehaeuse_reihenfolge", "gehaeuse_luefter_an", "gehaeuse_luefter_aus", "schirm", "schirm_an", "schirm_aus", "schirm_schrift", "modelle_wechseln", "modelle_eigene", "modelle_probetag", "modelle_neu", "modelle_fremd", "werkstatt", "werkstatt_nacht", "werkstatt_stunde", "angriffsprobe", "fernzugang_meldung", "fernzugang_verlauf_tage", "fernzugang_entsperrt_min", "fernzugang_datei_mb", "fernzugang_gross_mb", "fernzugang_ki_zeilen", "spontanhilfe_max_min", "fernzugang_leerlauf_min", "fernzugang_sitzungen", "fernzugang_offline_min", "route_tune", "system_prompt", "systemone", "systemone_berater", "helfer", "helfer_angriff",
|
||||
"svc_watch", "svc_watch_users", "grund_internet", "rundlauf", "rundlauf_min", "wachposten", "wartung", "wartung_auto", "notbetrieb_asr", "notbetrieb_tts", "gehaeuse", "gehaeuse_art", "gehaeuse_wechsel_s", "gehaeuse_hell", "gehaeuse_led_hell", "gehaeuse_nacht", "gehaeuse_nacht_von", "gehaeuse_nacht_bis", "gehaeuse_anzeige", "gehaeuse_drehung", "gehaeuse_seiten_aus", "gehaeuse_reihenfolge", "gehaeuse_luefter_an", "gehaeuse_luefter_aus", "schirm", "schirm_an", "schirm_aus", "schirm_schrift", "modelle_wechseln", "modelle_eigene", "modelle_probetag", "modelle_neu", "modelle_fremd", "werkstatt", "werkstatt_nacht", "werkstatt_stunde", "angriffsprobe", "fernzugang_meldung", "fernzugang_verlauf_tage", "fernzugang_entsperrt_min", "fernzugang_datei_mb", "fernzugang_gross_mb", "fernzugang_ki_zeilen", "spontanhilfe_max_min", "fernzugang_leerlauf_min", "fernzugang_sitzungen", "fernzugang_offline_min", "route_tune", "system_prompt", "systemone", "systemone_berater", "helfer", "helfer_angriff",
|
||||
"systemone_check", "unbelegt_mark", "systemone_klage", "systemone_mail", "systemone_min", "systemone_quality", "systemone_tidy", "tasks", "telegram", "thinking", "tool_thinking", "top_p",
|
||||
"usage_count", "usage_quota", "usage_quota_k", "usage_quota_mk", "usage_quota_warn", "usage_quota_wk", "vorgaenge", "weather", "weather_url", "wiki", "wiki_url", "write_apps", "write_help", "wyoming",
|
||||
"wyoming_allow", "wyoming_port", "wyoming_voice", "telefon", "telefon_aussen", "telefon_gaeste", "telefon_anrufen", "telefon_ziel", "telefon_alarm", "telefon_max", "telefon_ton",
|
||||
|
||||
@@ -391,6 +391,7 @@ DATEIEN = [
|
||||
state("wartung-satz-de.pcm", "Wartungssatz als Ton", "Maintenance sentence as sound", lokal="Wartungssatz für Lautsprecher, macht der Spark selbst neu"),
|
||||
state("wartung-satz-en.pcm", "Wartungssatz als Ton (Englisch)", "Maintenance sentence as sound (English)", lokal="Wartungssatz für Lautsprecher, macht der Spark selbst neu"),
|
||||
state("notbetrieb-satz-de.pcm", "Notbetrieb-Satz als Ton", "Emergency sentence as sound", lokal="Satz für Lautsprecher, wenn der Modell-Rechner fehlt; macht der Spark selbst neu"),
|
||||
state("pistimme", "Pi-Stimme: die Piper-Stimme Thorsten (sherpa-onnx-Paket, gegen ihre feste Prüfsumme geprüft)", "Pi voice: the Piper voice Thorsten (sherpa-onnx package, checked against its pinned checksum)", lokal="lädt die Einrichtung des Panel-Rechners, gleich auf jedem Gerät"),
|
||||
state("notbetrieb-saetze", "Feste Sätze und Bausteine für den Notbetrieb als Ton", "Fixed sentences and building blocks for emergency mode as sound", lokal="Sätze für Lautsprecher, wenn der Modell-Rechner fehlt; macht der Spark selbst neu"),
|
||||
state("umzug-hinweis.json", "Hinweis nach dem Umzug (nur die Zeit)", "Hint after the move (time only)", lokal="gilt nur für den Rechner, auf den das Panel umgezogen ist (14 Tage)"),
|
||||
state("notbetrieb-satz-en.pcm", "Notbetrieb-Satz als Ton (Englisch)", "Emergency sentence as sound (English)", lokal="Satz für Lautsprecher, wenn der Modell-Rechner fehlt; macht der Spark selbst neu"),
|
||||
|
||||
@@ -372,6 +372,7 @@ FEATURES = (
|
||||
F(**steckbrief.feature("wartung")),
|
||||
F(**steckbrief.feature("wartungauto")),
|
||||
F(**steckbrief.feature("notbetriebasr")),
|
||||
F(**steckbrief.feature("notbetriebtts")),
|
||||
F(**steckbrief.feature("gehaeuse")),
|
||||
F(**steckbrief.feature("systemupdates")),
|
||||
F(**steckbrief.feature("systemnachtpanel")),
|
||||
|
||||
@@ -3821,7 +3821,7 @@
|
||||
"file": "Architektur und Datenfluss",
|
||||
"head": "Ablauf",
|
||||
"title": "Ablauf",
|
||||
"text": "ersiegelt. 7. Kommt in die Sicherung?: Jede Datei in state/ hat genau eine Zeile im Datei-Register dateien.py: mit ihrer Art kommt sie in jede Sicherung (dateien.STATE_FILES, 52), sonst steht dort ihr Grund (dateien.STATE_LOCAL, 130). backup.py nimmt beide Listen von dort. test_technik findet jeden Namen, den der Code dort schreibt, und verlangt seine Zeile. 8. Umzugs-Sicherung?: secret.key ist in keiner gewöhnlichen Sicherung. Nur eine Umzugs-Sicherung trägt ihn, versiegelt mit einem Passwort des Admins (scrypt und Fernet, move-keys.json). Die Anmelde-Schlüssel des Spark sind in keiner Sicherung. 9. Beim Wiederherstellen in Ordnung?: _check_state prüft jede Datei der Sicherung: höchstens 8 MB, gültiges JSON, der Push-Schlüssel ein echter EC-Schlüssel. Ein zweiter Schritt des Admins, dessen Geheimnis sich hier nicht öffnen lässt, wird nicht übernommen; der bisherige bleibt. 10. Einsetzen mit Rückweg: _swap schreibt jede Datei über eine Zwischendatei (nie durch einen Link) und merkt sich den alten Inhalt. Geht ein Schritt schief, kommt alles Getauschte zurück. 11. Schlüssel neu lesen: _forget_cached lässt die Module, die einen Schlüssel im Speicher halten (vault, push, apns, chats, "
|
||||
"text": "ersiegelt. 7. Kommt in die Sicherung?: Jede Datei in state/ hat genau eine Zeile im Datei-Register dateien.py: mit ihrer Art kommt sie in jede Sicherung (dateien.STATE_FILES, 52), sonst steht dort ihr Grund (dateien.STATE_LOCAL, 131). backup.py nimmt beide Listen von dort. test_technik findet jeden Namen, den der Code dort schreibt, und verlangt seine Zeile. 8. Umzugs-Sicherung?: secret.key ist in keiner gewöhnlichen Sicherung. Nur eine Umzugs-Sicherung trägt ihn, versiegelt mit einem Passwort des Admins (scrypt und Fernet, move-keys.json). Die Anmelde-Schlüssel des Spark sind in keiner Sicherung. 9. Beim Wiederherstellen in Ordnung?: _check_state prüft jede Datei der Sicherung: höchstens 8 MB, gültiges JSON, der Push-Schlüssel ein echter EC-Schlüssel. Ein zweiter Schritt des Admins, dessen Geheimnis sich hier nicht öffnen lässt, wird nicht übernommen; der bisherige bleibt. 10. Einsetzen mit Rückweg: _swap schreibt jede Datei über eine Zwischendatei (nie durch einen Link) und merkt sich den alten Inhalt. Geht ein Schritt schief, kommt alles Getauschte zurück. 11. Schlüssel neu lesen: _forget_cached lässt die Module, die einen Schlüssel im Speicher halten (vault, push, apns, chats, "
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
@@ -3845,7 +3845,7 @@
|
||||
"file": "Architektur und Datenfluss",
|
||||
"head": "Zahlen (aus dem Code)",
|
||||
"title": "Zahlen (aus dem Code)",
|
||||
"text": "- 52 Dateien in jeder Sicherung (Schritt 7) - 130 Dateien und Ordner, die mit Grund draußen bleiben (Schritt 7) - 8 MB größte Datei beim Wiederherstellen (Schritt 9) - 12 Zeichen hat das Umzugs-Passwort mindestens (Schritt 8)"
|
||||
"text": "- 52 Dateien in jeder Sicherung (Schritt 7) - 131 Dateien und Ordner, die mit Grund draußen bleiben (Schritt 7) - 8 MB größte Datei beim Wiederherstellen (Schritt 9) - 12 Zeichen hat das Umzugs-Passwort mindestens (Schritt 8)"
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
@@ -14941,6 +14941,14 @@
|
||||
"file": "Assistent und Oberfläche",
|
||||
"head": "Zugang",
|
||||
"title": "Zugang",
|
||||
"text": "- Pi-Stimme (Funktionen → Zugang → „Pi-Stimme“): Läuft das Panel auf einem eigenen Rechner (Spark teilen) und spricht der DGX gerade nicht, weil er weg ist (Notbetrieb) oder seine Stimme im Mischbetrieb freigegeben hat, damit ein anderes Projekt starten kann, zeigen Browser und Apps di …"
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
"src": "assistent",
|
||||
"file": "Assistent und Oberfläche",
|
||||
"head": "Zugang",
|
||||
"title": "Zugang",
|
||||
"text": "- Gehäuse (Funktionen → Zugang → „Gehäuse“): Steckt der Panel-Rechner in einem SunFounder Pironman 5, steuert der Spark dessen Teile selbst, ohne SunFounders Software: Das kleine Display zeigt dem Admin abwechselnd Zustand und Zahlen (Spark, Dienste und Wartung, Pi, DGX weg oder in …"
|
||||
},
|
||||
{
|
||||
@@ -22021,7 +22029,7 @@
|
||||
"file": "Architecture and data flow",
|
||||
"head": "Way",
|
||||
"title": "Way",
|
||||
"text": "en.py: with its kind it goes into every backup (dateien.STATE_FILES, 52), otherwise the line gives its reason (dateien.STATE_LOCAL, 130). backup.py takes both lists from there. test_technik finds every name the code writes there and wants its line. 8. Move backup?: secret.key is in no ordinary backup. Only a move backup carries it, sealed with a password of the admin (scrypt and Fernet, move-keys.json). The Spark's login keys are in no backup. 9. Fine when restoring?: _check_state checks every file of the backup: at most 8 MB, valid JSON, the push key a real EC key. An admin second step whose secret cannot be opened here is not taken; the current one stays. 10. Put in place with a way back: _swap writes each file through a temporary file (never through a link) and keeps the old content. If a step fails, everything swapped comes back. 11. Read the keys again: _forget_cached makes the modules that keep a key in memory (vault, push, apns, chats, verbund, anrufe, vorrat) read it again, and profiles forgets what it had opened of the profiles' sealed files."
|
||||
"text": "en.py: with its kind it goes into every backup (dateien.STATE_FILES, 52), otherwise the line gives its reason (dateien.STATE_LOCAL, 131). backup.py takes both lists from there. test_technik finds every name the code writes there and wants its line. 8. Move backup?: secret.key is in no ordinary backup. Only a move backup carries it, sealed with a password of the admin (scrypt and Fernet, move-keys.json). The Spark's login keys are in no backup. 9. Fine when restoring?: _check_state checks every file of the backup: at most 8 MB, valid JSON, the push key a real EC key. An admin second step whose secret cannot be opened here is not taken; the current one stays. 10. Put in place with a way back: _swap writes each file through a temporary file (never through a link) and keeps the old content. If a step fails, everything swapped comes back. 11. Read the keys again: _forget_cached makes the modules that keep a key in memory (vault, push, apns, chats, verbund, anrufe, vorrat) read it again, and profiles forgets what it had opened of the profiles' sealed files."
|
||||
},
|
||||
{
|
||||
"lang": "en",
|
||||
@@ -22037,7 +22045,7 @@
|
||||
"file": "Architecture and data flow",
|
||||
"head": "Numbers (from the code)",
|
||||
"title": "Numbers (from the code)",
|
||||
"text": "- 52 files in every backup (step 7) - 130 files and folders that stay out with a reason (step 7) - 8 MB largest file when restoring (step 9) - 12 characters the move password has at least (step 8)"
|
||||
"text": "- 52 files in every backup (step 7) - 131 files and folders that stay out with a reason (step 7) - 8 MB largest file when restoring (step 9) - 12 characters the move password has at least (step 8)"
|
||||
},
|
||||
{
|
||||
"lang": "en",
|
||||
@@ -32909,6 +32917,14 @@
|
||||
"file": "Assistant and panel",
|
||||
"head": "Access",
|
||||
"title": "Access",
|
||||
"text": "- Pi voice (Features → Access → \"Pi voice\"): When the panel runs on a computer of its own (Spark split) and the DGX does not speak right now, because it is gone (emergency mode) or gave its voice away in Mischbetrieb so another project can start, browser and apps otherwise show the …"
|
||||
},
|
||||
{
|
||||
"lang": "en",
|
||||
"src": "assistant",
|
||||
"file": "Assistant and panel",
|
||||
"head": "Access",
|
||||
"title": "Access",
|
||||
"text": "- Case (Features → Access → \"Case\"): If the panel computer sits in a SunFounder Pironman 5, the Spark drives its parts itself, without SunFounder's software: the small display shows the admin status and numbers in turn (Spark, services and maintenance, Pi, DGX gone or pause …"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2461,6 +2461,9 @@ def snapshot(view="admin", now=None):
|
||||
if nbl.get("on"): # Notbetrieb mit Parakeet: hearing or not, fixed commands, speaker files (numbers only)
|
||||
x["sub"] += ((f" · Parakeet hört · {nbl.get('commands', 0)} Befehle · {nbl.get('fixed', 0)} feste Sätze")
|
||||
if nbl.get("hoert") else f" · Notbetrieb-Sätze {nbl.get('files', 0)} von {nbl.get('need', 0)}")
|
||||
if nbl.get("stimme"): # Pi-Stimme: speaking now or ready, the voice there or missing (no text)
|
||||
x["sub"] += (" · Pi-Stimme spricht" if nbl.get("spricht") else
|
||||
" · Pi-Stimme bereit" if nbl.get("stimme_da") else " · Pi-Stimme fehlt")
|
||||
if x["id"] in ("qwen", "modell"): # Modell-Rechner genau (modellgenau.py): requests and tokens, numbers only
|
||||
x["sub"] += _genau(x["id"])
|
||||
if x["id"] == "panelrechner": # Panel-Rechner: CPU, memory, temperature, disk (numbers only, no name)
|
||||
|
||||
@@ -117,6 +117,7 @@ DIRECT_OK = {
|
||||
"admin": ("sprachmodell", "Sprachmodell (/models), eigene Sprachdienste und der Suchtest an der eingetragenen SearXNG-Adresse"),
|
||||
"agent": ("sprachmodell", "Sprachmodell und SearXNG"),
|
||||
"android": ("fest", "App-Release von GitHub, Datei mit SHA-256 geprüft"),
|
||||
"pistimme": ("fest", "Stimmpaket von GitHub (sherpa-onnx), nur bei der Einrichtung, Datei mit fester SHA-256 geprüft"),
|
||||
"apns": ("fest", "Apple-Push (api.push.apple.com); Notaus-Meldungen laufen selbst darüber"),
|
||||
"begleiter": ("fest", "Sprachausgabe auf localhost und Begleiter-Release von GitHub (SHA-256 geprüft)"),
|
||||
"spontansteuern": ("fest", "SparkHilfe-Release von GitHub (Verzeichnis signiert, sobald es einen Schlüssel gibt; jede Datei mit SHA-256 geprüft)"),
|
||||
|
||||
+26
-3
@@ -14,7 +14,10 @@ fixed rules, without any language model:
|
||||
Everything else keeps the fixed sentence (wartung.NOTBETRIEB). The speech output runs on the model computer too, so a
|
||||
speaker or Home Assistant hears these answers from files made while it was there (make_clips, in the loop of
|
||||
wartung.py): whole sentences and building blocks for the time and the count, never a name or a text of a profile.
|
||||
Browser and apps show the answer as text. Logs: "notbetrieb: …" with fixed words and numbers.
|
||||
Browser and apps show the answer as text. With the admin switch chat.notbetrieb_tts (Funktionen → Pi-Stimme, off by
|
||||
default) this computer speaks by itself instead (pistimme.py on 127.0.0.1:NOTTTS_PORT, common.model_url sends "tts"
|
||||
there while spricht() is true), also while the Speicher-Wache of the model computer gave its voice away. Logs:
|
||||
"notbetrieb: …" with fixed words and numbers.
|
||||
"""
|
||||
import datetime
|
||||
import os
|
||||
@@ -63,6 +66,23 @@ def hoert(cfg=None, now=None):
|
||||
common.ASR_UMWEG = hoert # common.model_url: "asr" goes to this computer's Parakeet while it hears
|
||||
|
||||
|
||||
def stimme_an(c=None):
|
||||
return features.admin_on("notbetriebtts", c)
|
||||
|
||||
|
||||
def spricht(cfg=None, now=None):
|
||||
"""The Pi-Stimme (pistimme.py, speech-spark-nottts) speaks: the models run elsewhere, the admin switched it on, and
|
||||
their speech output is gone (Notbetrieb) or the Speicher-Wache gave it away (Mischbetrieb, steuer.stimme_frei)."""
|
||||
try:
|
||||
cfg = load_config() if cfg is None else cfg
|
||||
return steuer.remote(cfg) and stimme_an(cfg.get("chat", {})) and (steuer.weg(now) or steuer.stimme_frei(now))
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
common.TTS_UMWEG = spricht # common.model_url: "tts" goes to this computer's voice while it speaks
|
||||
|
||||
|
||||
def _blocks(en):
|
||||
"""Every block a speaker may need: (file key, text)."""
|
||||
i = 1 if en else 0
|
||||
@@ -213,10 +233,13 @@ def files_ready(now=None):
|
||||
|
||||
|
||||
def for_live(now=None):
|
||||
"""Live: on or off, hearing or not, how many fixed commands and fixed sentences, files ready (only numbers)."""
|
||||
"""Live: on or off, hearing or not, how many fixed commands and fixed sentences, files ready, the Pi-Stimme on,
|
||||
speaking and its voice there (only numbers and states)."""
|
||||
c = load_config()
|
||||
if not steuer.remote(c):
|
||||
return None
|
||||
have, need = files_ready()
|
||||
import pistimme
|
||||
return {"on": admin_on(c.get("chat", {})), "hoert": hoert(c, now), "commands": _n["commands"], "fixed": _n["fixed"],
|
||||
"files": have, "need": need}
|
||||
"files": have, "need": need, "stimme": stimme_an(c.get("chat", {})), "spricht": spricht(c, now),
|
||||
"stimme_da": pistimme.da()}
|
||||
@@ -6721,6 +6721,14 @@
|
||||
"text": "Mischbetrieb an, dann in Alzeo eine Lane starten. Während sie startet, zeigt Zustand → Live beim Modell-Rechner „Hören und Sprechen pausieren“, der Assistent hört trotzdem (Parakeet auf dem Pi) und zeigt Antworten als Text; tars friert nicht ein. Etwa eine halbe Minute nach dem Start der Lane (mindestens 18 GiB frei) spricht der Assistent wieder.",
|
||||
"thread": "tars für Alzeo nutzen, Assistent behalten",
|
||||
"wichtig": true
|
||||
},
|
||||
{
|
||||
"id": "P970",
|
||||
"v": 1527,
|
||||
"titel": "Pi-Stimme spricht, wenn tars schweigt",
|
||||
"text": "Auf dem Pi: sudo ./install.sh --mode panel (holt die Stimme, im Protokoll „notbetrieb: pistimme laden ok“). Funktionen → Pi-Stimme an. Auf tars die Sprachausgabe stoppen (oder Mischbetrieb an und eine Alzeo-Lane starten): eine Frage im Panel wird mit der Stimme Thorsten gesprochen, Zustand → Live zeigt „Pi-Stimme spricht“. Läuft die Sprachausgabe auf tars wieder, kommt die gewohnte Stimme zurück, und die Sätze der Rückmeldung klingen weiter wie vorher.",
|
||||
"thread": "tars für Alzeo nutzen, Assistent behalten",
|
||||
"wichtig": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -44,7 +44,8 @@ RAM_MIN_GIB = 0.5 # GiB available memory on the panel computer (the model c
|
||||
DIENSTE_S = 15 # seconds the panel computer's unit states are kept
|
||||
# the model computer's parts shown as chips (its status "einheiten"), the panel computer's own units
|
||||
MODELL_TEILE = ("asr", "tts", "llm", "llmtor", "sehen", "helfer", "bild", "musik", "werkstatt")
|
||||
PANEL_UNITS = {"turn": "speech-spark-turn", "notasr": "speech-spark-notasr", "gehaeuse": "speech-spark-gehaeuse",
|
||||
PANEL_UNITS = {"turn": "speech-spark-turn", "notasr": "speech-spark-notasr", "nottts": "speech-spark-nottts",
|
||||
"gehaeuse": "speech-spark-gehaeuse",
|
||||
"schirm": "speech-spark-schirm", "guacd": "speech-spark-guacd"}
|
||||
# the parts that run only for a job and then stop again: the image understanding (the LLM-Tor starts it for a picture
|
||||
# question), one Werkstatt order, the case's setup (Einrichten/Entfernen; the case itself runs in the panel). Resting
|
||||
|
||||
@@ -322,6 +322,7 @@
|
||||
<label for="chat.schirm_schrift">Schriftgröße</label><select id="chat.schirm_schrift"><option value="auto">Automatisch nach Auflösung</option><option value="kleiner">Kleiner (mehr Platz)</option><option value="groesser">Größer (besser lesbar)</option></select><div class="fh">Automatisch: Full HD etwa 160 × 45 Zeichen, 4K etwa 240 × 67.</div>
|
||||
</div>
|
||||
<div class="setrow" data-teilen="1"><div class="lbl"><b>Notbetrieb mit Parakeet</b><span>Panel auf eigenem Rechner, DGX weg: Parakeet hört, feste Befehle (Licht, Uhrzeit, Erinnerungen) gehen ohne Sprachmodell.</span></div><label class="tgl"><input type="checkbox" id="chat.notbetrieb_asr"><i></i></label></div>
|
||||
<div class="setrow" data-teilen="1"><div class="lbl"><b>Pi-Stimme</b><span>Panel auf eigenem Rechner, DGX spricht gerade nicht (weg oder Mischbetrieb): der Panel-Rechner spricht selbst mit Piper.</span></div><label class="tgl"><input type="checkbox" id="chat.notbetrieb_tts"><i></i></label></div>
|
||||
<div class="setrow"><div class="lbl"><b>Modelle wechseln</b><span>Admins wechseln unter Zustand → Modelle das Modell einer Art; das alte bleibt 7 Tage zum Zurückholen.</span></div><label class="tgl"><input type="checkbox" id="chat.modelle_wechseln"><i></i></label></div>
|
||||
<div class="setrow" data-show="chat.modelle_wechseln" style="margin-left:18px"><div class="lbl"><b>Eigene Modelle</b><span>Admins fügen Modelle von Hugging Face für jede Art hinzu, nur nach festen Regeln (kein Pickle, kein fremder Code, Probe beim Wechsel).</span></div><label class="tgl"><input type="checkbox" id="chat.modelle_eigene"><i></i></label></div>
|
||||
<div class="setrow" data-show="chat.modelle_wechseln" style="margin-left:18px"><div class="lbl"><b>Probetag nach dem Wechsel</b><span>Nach einem Wechsel des Sprachmodells läuft der Qualitätstest; ist das neue klar schlechter als das alte, geht es zurück.</span></div><label class="tgl"><input type="checkbox" id="chat.modelle_probetag"><i></i></label></div>
|
||||
|
||||
@@ -2058,6 +2058,15 @@ const GUIDES=[
|
||||
out:[['Nichts. Parakeet läuft nur auf dem Panel-Rechner, die Befehle gehen an Home Assistant im Heimnetz. Im Protokoll stehen nur feste Wörter und Zahlen.','Nothing. Parakeet runs only on the panel computer, the commands go to Home Assistant at home. The log holds only fixed words and numbers.']],
|
||||
off:[['Funktionen → Notbetrieb mit Parakeet aus. Dann gibt es im Notbetrieb wieder nur den festen Satz.','Features → Emergency mode with Parakeet off. In emergency mode there is then only the fixed sentence again.']],
|
||||
fix:[['Ein Lautsprecher sagt nach einem Befehl nur den Pause-Satz: die Dateien sind noch nicht fertig (Live-Übersicht, Notbetrieb). Sie entstehen, solange der DGX da ist.','A speaker only says the pause sentence after a command: the files are not ready yet (Live view, emergency mode). They are made while the DGX is there.'],['Die erste Frage im Notbetrieb dauert länger: Parakeet lädt erst dann.','The first question in emergency mode takes longer: Parakeet loads only then.']]},
|
||||
{id:'notbetriebtts',grp:'sec',sw:'chat.notbetrieb_tts',ng:1,t:['Pi-Stimme','Pi voice'],
|
||||
what:[['Läuft das Panel auf einem eigenen Rechner (Spark teilen) und spricht der DGX gerade nicht, weil er weg ist (Notbetrieb) oder seine Stimme im Mischbetrieb freigegeben hat, damit ein anderes Projekt starten kann, zeigen Browser und Apps die Antworten sonst nur als Text. Mit diesem Schalter spricht der Panel-Rechner selbst: die Piper-Stimme Thorsten läuft auf seinem Prozessor, Satz für Satz. Sobald der DGX wieder spricht, kommt die gewohnte Stimme zurück.','When the panel runs on a computer of its own (Spark split) and the DGX does not speak right now, because it is gone (emergency mode) or gave its voice away in Mischbetrieb so another project can start, browser and apps otherwise show the answers as text only. With this switch the panel computer speaks by itself: the Piper voice Thorsten runs on its CPU, sentence by sentence. As soon as the DGX speaks again, the usual voice comes back.'],
|
||||
['Es gibt nur diese eine deutsche Stimme; eigene Stimmen und Sprechweisen gelten in dieser Zeit nicht. Die Stimme wird erst beim ersten Satz geladen (rund 200 MB) und nach 10 Minuten ohne Satz wieder entladen.','There is only this one German voice; own voices and speaking styles do not apply meanwhile. The voice is loaded only at the first sentence (about 200 MB) and unloaded again after 10 minutes without one.']],
|
||||
need:[['Spark teilen: das Panel auf einem eigenen Rechner, zum Beispiel einem Raspberry Pi 5. Die Stimme lädt die Einrichtung des Panel-Rechners einmal (rund 64 MB, gegen ihre feste Prüfsumme geprüft).','Spark split: the panel on a computer of its own, for example a Raspberry Pi 5. The panel computer\'s setup fetches the voice once (about 64 MB, checked against its pinned checksum).']],
|
||||
setup:[['Admin: Funktionen → Pi-Stimme an. Für das Hören in dieser Zeit zusätzlich Funktionen → Notbetrieb mit Parakeet.','Admin: Features → Pi voice on. For hearing meanwhile also Features → Emergency mode with Parakeet.']],
|
||||
say:[['Nichts Besonderes: jede Frage wie sonst. Ob die Pi-Stimme gerade spricht, zeigt die Live-Übersicht.','Nothing special: every question as usual. The Live view shows whether the Pi voice speaks right now.']],
|
||||
out:[['Nichts. Die Stimme läuft nur auf dem Panel-Rechner, nur für ihn selbst erreichbar. Im Protokoll stehen nur feste Wörter und Zahlen.','Nothing. The voice runs only on the panel computer and only it can reach it. The log holds only fixed words and numbers.']],
|
||||
off:[['Funktionen → Pi-Stimme aus. Dann zeigen Browser und Apps die Antworten in dieser Zeit wieder nur als Text.','Features → Pi voice off. Browser and apps then show the answers meanwhile as text only again.']],
|
||||
fix:[['Es bleibt still: die Stimme fehlt noch auf dem Panel-Rechner. sudo ./install.sh --mode panel noch einmal ausführen; im Protokoll steht dann „notbetrieb: pistimme laden ok“.','It stays silent: the voice is still missing on the panel computer. Run sudo ./install.sh --mode panel once more; the log then says "notbetrieb: pistimme laden ok".'],['Der erste Satz dauert länger: die Stimme lädt erst dann.','The first sentence takes longer: the voice loads only then.']]},
|
||||
{id:'gehaeuse',grp:'sec',sw:'chat.gehaeuse',ng:1,t:['Gehäuse','Case'],
|
||||
what:[['Steckt der Panel-Rechner in einem SunFounder Pironman 5, steuert der Spark dessen Teile selbst, ohne SunFounders Software: Das kleine Display zeigt dem Admin abwechselnd Zustand und Zahlen (Spark, Dienste und Wartung, Pi, DGX weg oder in Pause, Netz), die vier LEDs zeigen die Statusfarbe (grün bereit, gelb Pause oder offener Hinweis, rot DGX weg oder Dienst ausgefallen), und die Gehäuselüfter laufen nach der Temperatur.','If the panel computer sits in a SunFounder Pironman 5, the Spark drives its parts itself, without SunFounder\'s software: the small display shows the admin status and numbers in turn (Spark, services and maintenance, Pi, DGX gone or paused, network), the four LEDs show the status colour (green ready, yellow pause or an open hint, red DGX gone or a service down), and the case fans run by temperature.'],
|
||||
['Auf dem Display stehen nur Zustand und Zahlen, nie Namen, Absender oder Inhalte: Es sieht jeder im Raum.','The display holds only status and numbers, never names, senders or contents: everyone in the room sees it.']],
|
||||
|
||||
@@ -3,7 +3,7 @@ const $=id=>document.getElementById(id);
|
||||
// Language: German is written in the markup; English comes from this table. Choice is kept per browser.
|
||||
let L='de';try{L=localStorage.getItem('lang')||(/^de/i.test(navigator.language)?'de':'en')}catch{L=/^de/i.test(navigator.language)?'de':'en'}
|
||||
const t=(de,en)=>L==='en'?en:de;
|
||||
const EN={"Fremde Modell-Dienste": "Foreign model services","Ein Sprachmodell eines Rechners im Heimnetz (Ollama, LM Studio), für alle oder als Ersatz, wenn der Modell-Rechner weg ist.": "A language model of a computer in the home network (Ollama, LM Studio), for everyone or as a fallback while the model computer is gone.","Sprachmodell in Docker": "Language model in Docker","Notbremse": "Emergency brake","Wird der Speicher knapp, beendet das Sprachmodell die längste laufende Antwort, bevor DGX OS Programme beendet.": "When memory runs short, the language model ends the longest running answer before DGX OS ends programs.","Nur auf einem Rechner, auf dem CPU und GPU einen Speicher teilen (DGX Spark). Sinkt der freie Speicher unter die Grenze, nimmt das Sprachmodell keine neuen Anfragen an und beendet alle 2 Sekunden die längste laufende Antwort, bis wieder 2 GiB mehr als die Grenze frei sind. Zu sehen unter Zustand → Modell-Rechner genau.": "Only on a computer where CPU and GPU share one memory (DGX Spark). When the free memory drops below the limit, the language model takes no new requests and ends the longest running answer every 2 seconds until 2 GiB more than the limit are free again. Shown under Status → Model computer in detail.","Notbremse unter": "Emergency brake below","Darunter greift die Notbremse.": "Below this the emergency brake acts.","Modell-Rechner genau": "Model computer in detail","Anfragen, Warteschlangen, Chat-Modell innen, GPU und Verlauf; nur Zahlen, nie Inhalte.": "Requests, queues, the chat model inside, GPU and history; numbers only, never content.","PDF-Formulare ausfüllen": "Fill PDF forms","PDF-Formulare nach festen Regeln vorausfüllen, prüfen, als neues Dokument speichern oder mailen. Nie Unterschrift oder IBAN.": "Prefill PDF forms by fixed rules, check them, save them as a new document or mail them. Never a signature or IBAN.","Termin finden": "Find a time","Im Chat freie Zeiten aller suchen und abstimmen lassen; die gewählte Zeit kommt in die Kalender. Braucht Umfragen.": "Find free times of everyone in a chat and let them vote; the chosen time goes into the calendars. Needs polls.","Umfrage stellen": "Make a poll","Umfragen in Chats": "Polls in chats","Eine Frage mit Antworten als Nachricht; alle im Chat stimmen ab, wer gefragt hat, schließt sie.": "A question with answers as a message; everyone in the chat votes, who asked closes it.","Beschäftigt im Termin": "Busy in an appointment","Im Termin: keine Durchsagen, Mitteilungen warten bis danach, Anrufe klingeln nicht, Chats zeigen „beschäftigt“.": "In an appointment: no announcements, notes wait until after, calls do not ring, the chats show \"busy\".","Abwesenheit": "Away","Jedes Profil trägt unter Kalender → Einstellungen ein, wann es weg ist: Eintrag im Kalender, Hinweis in Chats, Anrufe klingeln nicht.": "Each profile enters under Calendar → Settings when it is away: an entry in the calendar, a note in the chats, calls do not ring.","Hinweis bei neuer Anmeldung": "Note on a new sign-in","Meldet sich ein Profil in einer neuen Art von Browser an, bekommen seine Geräte eine Mitteilung.": "When a profile signs in from a new kind of browser, its devices get a notification.","Geburtstage im Kalender": "Birthdays in the calendar","Die Geburtstage aus den Kontakten als eigener Kalender, nur lesen.": "The birthdays from the contacts as a calendar of their own, read only.","Gespräche nach Thema": "Conversations by topic","Jedes Thema ein eigenes Gespräch: neu nach einer Pause oder einem Themenwechsel, mit Symbol, Name, Anheften und Archiv.": "Every topic its own conversation: new after a pause or a change of topic, with symbol, name, pinning and archive.","Umbenennen": "Rename","Anheften": "Pin","Gespräche": "Conversations","In allen Gesprächen suchen": "Search all conversations","Mit einem Spark koppeln": "Pair with a Spark","Name oder Adresse des Spark und der Code aus seiner Spark-Konsole (Assistent).": "Name or address of the Spark and the code from its Spark-Konsole (Assistant).","In der Spark-Konsole (https, Port 31010 des Spark) → Assistent → „Code zeigen“. Der Code gilt 10 Minuten und nur einmal. Der Pi prüft dabei den Fingerabdruck des Spark, der Code selbst geht nie über das Netz. Danach starten die Dienste dieses Rechners kurz neu und nutzen Sprache und Modelle des Spark.": "In the Spark-Konsole (https, port 31010 of the Spark) → Assistant → “Show a code”. The code lives 10 minutes and works once. The Pi checks the Spark's fingerprint on the way, the code itself never crosses the network. Then this computer's services restart briefly and use the Spark's speech and models.","Spark koppeln": "Pair a Spark","Lange Gespräche zusammenfassen": "Summarize long conversations","Was ein langes Gespräch nicht mehr mitschickt, kommt als kurze Zusammenfassung wieder, im Hintergrund geschrieben.": "What a long conversation no longer sends along comes back as a short summary, written inLine truncated
|
||||
const EN={"Fremde Modell-Dienste": "Foreign model services","Ein Sprachmodell eines Rechners im Heimnetz (Ollama, LM Studio), für alle oder als Ersatz, wenn der Modell-Rechner weg ist.": "A language model of a computer in the home network (Ollama, LM Studio), for everyone or as a fallback while the model computer is gone.","Sprachmodell in Docker": "Language model in Docker","Notbremse": "Emergency brake","Wird der Speicher knapp, beendet das Sprachmodell die längste laufende Antwort, bevor DGX OS Programme beendet.": "When memory runs short, the language model ends the longest running answer before DGX OS ends programs.","Nur auf einem Rechner, auf dem CPU und GPU einen Speicher teilen (DGX Spark). Sinkt der freie Speicher unter die Grenze, nimmt das Sprachmodell keine neuen Anfragen an und beendet alle 2 Sekunden die längste laufende Antwort, bis wieder 2 GiB mehr als die Grenze frei sind. Zu sehen unter Zustand → Modell-Rechner genau.": "Only on a computer where CPU and GPU share one memory (DGX Spark). When the free memory drops below the limit, the language model takes no new requests and ends the longest running answer every 2 seconds until 2 GiB more than the limit are free again. Shown under Status → Model computer in detail.","Notbremse unter": "Emergency brake below","Darunter greift die Notbremse.": "Below this the emergency brake acts.","Modell-Rechner genau": "Model computer in detail","Anfragen, Warteschlangen, Chat-Modell innen, GPU und Verlauf; nur Zahlen, nie Inhalte.": "Requests, queues, the chat model inside, GPU and history; numbers only, never content.","PDF-Formulare ausfüllen": "Fill PDF forms","PDF-Formulare nach festen Regeln vorausfüllen, prüfen, als neues Dokument speichern oder mailen. Nie Unterschrift oder IBAN.": "Prefill PDF forms by fixed rules, check them, save them as a new document or mail them. Never a signature or IBAN.","Termin finden": "Find a time","Im Chat freie Zeiten aller suchen und abstimmen lassen; die gewählte Zeit kommt in die Kalender. Braucht Umfragen.": "Find free times of everyone in a chat and let them vote; the chosen time goes into the calendars. Needs polls.","Umfrage stellen": "Make a poll","Umfragen in Chats": "Polls in chats","Eine Frage mit Antworten als Nachricht; alle im Chat stimmen ab, wer gefragt hat, schließt sie.": "A question with answers as a message; everyone in the chat votes, who asked closes it.","Beschäftigt im Termin": "Busy in an appointment","Im Termin: keine Durchsagen, Mitteilungen warten bis danach, Anrufe klingeln nicht, Chats zeigen „beschäftigt“.": "In an appointment: no announcements, notes wait until after, calls do not ring, the chats show \"busy\".","Abwesenheit": "Away","Jedes Profil trägt unter Kalender → Einstellungen ein, wann es weg ist: Eintrag im Kalender, Hinweis in Chats, Anrufe klingeln nicht.": "Each profile enters under Calendar → Settings when it is away: an entry in the calendar, a note in the chats, calls do not ring.","Hinweis bei neuer Anmeldung": "Note on a new sign-in","Meldet sich ein Profil in einer neuen Art von Browser an, bekommen seine Geräte eine Mitteilung.": "When a profile signs in from a new kind of browser, its devices get a notification.","Geburtstage im Kalender": "Birthdays in the calendar","Die Geburtstage aus den Kontakten als eigener Kalender, nur lesen.": "The birthdays from the contacts as a calendar of their own, read only.","Gespräche nach Thema": "Conversations by topic","Jedes Thema ein eigenes Gespräch: neu nach einer Pause oder einem Themenwechsel, mit Symbol, Name, Anheften und Archiv.": "Every topic its own conversation: new after a pause or a change of topic, with symbol, name, pinning and archive.","Umbenennen": "Rename","Anheften": "Pin","Gespräche": "Conversations","In allen Gesprächen suchen": "Search all conversations","Mit einem Spark koppeln": "Pair with a Spark","Name oder Adresse des Spark und der Code aus seiner Spark-Konsole (Assistent).": "Name or address of the Spark and the code from its Spark-Konsole (Assistant).","In der Spark-Konsole (https, Port 31010 des Spark) → Assistent → „Code zeigen“. Der Code gilt 10 Minuten und nur einmal. Der Pi prüft dabei den Fingerabdruck des Spark, der Code selbst geht nie über das Netz. Danach starten die Dienste dieses Rechners kurz neu und nutzen Sprache und Modelle des Spark.": "In the Spark-Konsole (https, port 31010 of the Spark) → Assistant → “Show a code”. The code lives 10 minutes and works once. The Pi checks the Spark's fingerprint on the way, the code itself never crosses the network. Then this computer's services restart briefly and use the Spark's speech and models.","Spark koppeln": "Pair a Spark","Lange Gespräche zusammenfassen": "Summarize long conversations","Was ein langes Gespräch nicht mehr mitschickt, kommt als kurze Zusammenfassung wieder, im Hintergrund geschrieben.": "What a long conversation no longer sends along comes back as a short summary, written inLine truncated
|
||||
function translatePage(){document.documentElement.lang=L;$('langbtn').textContent=L==='en'?'Deutsch':'English';if(L!=='en')return;
|
||||
// whole sentences with tags inside (B1): data-tr, the key is the inner HTML with single spaces; first, before the words
|
||||
document.querySelectorAll('[data-tr]').forEach(e=>{const v=EN[e.innerHTML.replace(/\s+/g,' ').trim()];if(v)e.innerHTML=v});
|
||||
|
||||
@@ -909,6 +909,12 @@ STECKBRIEFE = {
|
||||
ohne_werkzeug=("ohne", "notbetrieb.py: feste Befehle nach festen Regeln, nur im Notbetrieb, kein "
|
||||
"Sprachmodell und kein Werkzeug"),
|
||||
begleiter="spark", nur_spark=True),
|
||||
# pistimme.py: with the models on another computer, the Piper voice on this one speaks while theirs is gone
|
||||
"notbetriebtts": Steckbrief(de="Pi-Stimme", en="Pi voice", gruppe="sec",
|
||||
schalter=("notbetrieb_tts",), anleitung="notbetriebtts",
|
||||
ohne_werkzeug=("ohne", "pistimme.py: spricht nur die Antworten, die sonst die Sprachausgabe des Modell-Rechners "
|
||||
"spräche; kein Sprachmodell und kein Werkzeug"),
|
||||
begleiter="spark", nur_spark=True),
|
||||
# gehaeuse.py: the case of a panel computer (Pironman 5): OLED pages for the admin, status LEDs, fan thresholds
|
||||
"gehaeuse": Steckbrief(de="Gehäuse", en="Case", gruppe="sec", schalter=("gehaeuse",), anleitung="gehaeuse",
|
||||
ohne_werkzeug=("ohne", "gehaeuse.py: Anzeige und LEDs am Panel-Rechner nach festen Regeln, nur Zahlen und "
|
||||
|
||||
+3
-3
@@ -248,9 +248,9 @@ def for_live(now=None):
|
||||
if isinstance(u, dict) and u.get("state") != "unknown" and u.get("da") is not False] # installed ones only
|
||||
v = str(d.get("version") or "")
|
||||
out = {"on": True, "ok": True, "aktiv": sum(u.get("state") == "active" for u in units), "n": len(units),
|
||||
"version": v if v.startswith("V") and len(v) <= 20 else "", "pause": bool((d.get("pause") or {}).get("on")),
|
||||
"mischbetrieb": d.get("mischbetrieb") is True,
|
||||
"stimme_frei": d.get("mischbetrieb") is True and d.get("mischbetrieb_frei") is True}
|
||||
"version": v if v.startswith("V") and len(v) <= 20 else "", "pause": bool((d.get("pause") or {}).get("on"))}
|
||||
if d.get("mischbetrieb") is True: # Mischbetrieb (mischbetrieb.py): only when on, and whether its guard took the voice
|
||||
out.update(mischbetrieb=True, stimme_frei=d.get("mischbetrieb_frei") is True)
|
||||
# Spark-Clients (mandanten.py): its API version only when it differs from this panel's, the open clients only when any
|
||||
api, cl = d.get("spark_api"), d.get("clients")
|
||||
if isinstance(api, int) and not isinstance(api, bool) and api != SPARK_API:
|
||||
|
||||
@@ -352,6 +352,7 @@ MODULE = {
|
||||
"konsole": ("betrieb", "Spark-Konsole: das Panel als eigene Webseite des Modell-Rechners, nur https, nur Heimnetz, nur eigene Wege"),
|
||||
"hardware": ("sprache", "Hardware-Profil: DGX Spark oder Station aus fester nvidia-smi-Abfrage, GiB des Katalogs als Anteil hier"),
|
||||
"hftoken": ("sprache", "Hugging-Face-Token des Admins: nur auf dem Modell-Rechner, 0600, nur an huggingface.co"),
|
||||
"pistimme": ("teilen", "Pi-Stimme: Piper-Stimme Thorsten auf dem Panel-Rechner, wenn die Sprachausgabe des Modell-Rechners fehlt"),
|
||||
"mischbetrieb": ("betrieb", "Mischbetrieb: ein anderes Projekt bekommt die GPU, der Spark behält Hören und Sprechen (kleine Modelle)"),
|
||||
"gputakt": ("betrieb", "GPU-Taktgrenze: feste Werte, startet die root-Einheit nur bei Änderung, Stand für die GPU-Anzeige"),
|
||||
"schwachstellen_stand": ("betrieb", "Schwachstellen, das gespeicherte Ergebnis: Zahlen für Live und den Hinweis oben, nie ein Paketname"),
|
||||
|
||||
@@ -4,7 +4,7 @@ from technik_seiten import S
|
||||
|
||||
SEITEN = {
|
||||
"llm": {
|
||||
"stand": "7131c6b11b",
|
||||
"stand": "83d36fa13a",
|
||||
"bezug": {
|
||||
"chat.chat": ["s1"], "chat._answer": ["s2", "s4", "s6"], "llm.model": ["s3"], "llm.known_model": ["s3"], "llm.url": ["s1"], "llm.complete": ["s1"],
|
||||
"chat.sampling": ["s4"], "chat.first_within": ["s8"], "chat.ContextFull": ["s7"],
|
||||
|
||||
@@ -4,7 +4,7 @@ from technik_seiten import S
|
||||
|
||||
SEITEN = {
|
||||
"aussen": {
|
||||
"stand": "07b2fef0e1",
|
||||
"stand": "90617903ce",
|
||||
"bezug": {
|
||||
"dienstwacht.TIMEOUT": ["s5"], "notaus.locked_tools": ["s3"], "dienstwacht.tool_down": ["s5"],
|
||||
"netguard.client": ["s8", "s9", "s10"], "netguard.IMAP4_SSL": ["s9"],
|
||||
@@ -199,7 +199,7 @@ SEITEN = {
|
||||
"heute": [("guard_ok", ("verbunden", "connected")), ("guard_bad", ("gesperrt", "blocked"))],
|
||||
},
|
||||
"internet": {
|
||||
"stand": "563951cc7d",
|
||||
"stand": "f6a77416d7",
|
||||
"bezug": {
|
||||
"regeln": ["s3", "s4"], "regel:Seiten aus der Suche": ["s4", "s5"], "regel:Mail, Kalender, Kontakte": ["s4", "s5"],
|
||||
"regel:reMarkable": ["s4", "s5"], "regel:Wetter, Wikipedia": ["s3"], "regel:Telegram": ["s7"],
|
||||
|
||||
+8
-19
@@ -39,6 +39,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # common.py, also as a script (speech-spark pause)
|
||||
import features # noqa: E402
|
||||
import guard # noqa: E402
|
||||
import steuer # noqa: E402
|
||||
from common import WARTUNG_FILE, load_config, model_side, write_json # noqa: E402
|
||||
|
||||
FILE = WARTUNG_FILE
|
||||
@@ -100,7 +101,6 @@ def _clean(d):
|
||||
def _fern(now=None):
|
||||
"""The model computer's pause while its time runs (from its last status, never asked here), else None."""
|
||||
try:
|
||||
import steuer
|
||||
if not steuer.remote():
|
||||
return None
|
||||
p = _clean((steuer.cached() or {}).get("pause") or {})
|
||||
@@ -156,7 +156,6 @@ def notbetrieb():
|
||||
"""Notbetrieb: the models run on another computer that has not answered lately (steuer.weg); every part counts
|
||||
as paused (the fixed sentence at once, background work waits), but the Dienst-Wächter reports it (not quiet)."""
|
||||
try:
|
||||
import steuer
|
||||
return steuer.weg()
|
||||
except Exception:
|
||||
return False
|
||||
@@ -175,7 +174,6 @@ def _fremd_antwortet():
|
||||
def mischbetrieb():
|
||||
"""The model computer is in Mischbetrieb (steuer.mischbetrieb): its own language model is off on purpose."""
|
||||
try:
|
||||
import steuer
|
||||
return steuer.mischbetrieb()
|
||||
except Exception:
|
||||
return False
|
||||
@@ -184,7 +182,6 @@ def mischbetrieb():
|
||||
def stimme_frei():
|
||||
"""Mischbetrieb's Speicher-Wache stopped Hören and Sprechen on the model computer for a while (steuer.stimme_frei)."""
|
||||
try:
|
||||
import steuer
|
||||
return steuer.stimme_frei()
|
||||
except Exception:
|
||||
return False
|
||||
@@ -192,7 +189,8 @@ def stimme_frei():
|
||||
|
||||
def paused(part):
|
||||
"""True while this part (llm, asr, tts, bild) is paused and the admin switch is on, or in Notbetrieb; there the
|
||||
speech recognition goes on when this computer's Parakeet hears (notbetrieb.hoert, chat.notbetrieb_asr). The
|
||||
speech recognition goes on when this computer's Parakeet hears (notbetrieb.hoert, chat.notbetrieb_asr), the speech
|
||||
output when its Piper voice speaks (notbetrieb.spricht, chat.notbetrieb_tts). The
|
||||
language model also while the model computer is in Mischbetrieb; never while a foreign model service answers."""
|
||||
if part == "llm" and _fremd_antwortet():
|
||||
return False
|
||||
@@ -200,17 +198,10 @@ def paused(part):
|
||||
return True
|
||||
if part == "llm" and mischbetrieb():
|
||||
return True
|
||||
if part in ("asr", "tts") and stimme_frei():
|
||||
if part == "asr":
|
||||
import notbetrieb as nb
|
||||
return not nb.hoert()
|
||||
return True
|
||||
if not notbetrieb():
|
||||
return False
|
||||
if part == "asr":
|
||||
if part in ("asr", "tts") and (stimme_frei() or notbetrieb()):
|
||||
import notbetrieb as nb
|
||||
return not nb.hoert()
|
||||
return True
|
||||
return not (nb.hoert() if part == "asr" else nb.spricht())
|
||||
return notbetrieb()
|
||||
|
||||
|
||||
def quiet(part):
|
||||
@@ -303,7 +294,6 @@ def end(why, now=None):
|
||||
now = time.time() if now is None else now
|
||||
s, f = _local(), _fern(now)
|
||||
if f and why == "weiter":
|
||||
import steuer
|
||||
d = steuer.call("weiter")
|
||||
ok = isinstance(d, dict) and d.get("ok") is True
|
||||
print(f"wartung: modell-rechner weiter {'ok' if ok else 'fehler'}", flush=True)
|
||||
@@ -353,7 +343,6 @@ async def tick(now=None, answers=_answers):
|
||||
row end it; not answering when the time is over: the pause stays, one push."""
|
||||
now = time.time() if now is None else now
|
||||
try: # models on another computer: its status (with its pause) stays fresh without a question waiting
|
||||
import steuer
|
||||
if steuer.remote():
|
||||
await asyncio.to_thread(steuer.status)
|
||||
except Exception as e:
|
||||
@@ -422,7 +411,6 @@ def _look(unit):
|
||||
"""(ActiveState, when it last became active) of a unit, None when it is not installed. A model unit on another
|
||||
computer: from its Wärter's status."""
|
||||
import core
|
||||
import steuer
|
||||
if steuer._remote_unit(unit):
|
||||
u = ((steuer.status() or {}).get("einheiten") or {}).get(unit) or {}
|
||||
return None if u.get("state") in (None, "unknown") else (u["state"], str(u.get("eintritt", "")))
|
||||
@@ -483,11 +471,12 @@ async def auto_tick(now=None, look=_look):
|
||||
async def clips_tick(now=None):
|
||||
"""Keeps the speakers' file of the short sentence fresh while the speech output works (esp32.pause_clip)."""
|
||||
c = load_config().get("chat", {})
|
||||
import steuer
|
||||
if not (admin_on() or steuer.remote()) or paused("tts") or not (c.get("esp32") or c.get("wyoming")): # only with speakers or Assist
|
||||
return False
|
||||
import esp32
|
||||
import notbetrieb
|
||||
if notbetrieb.spricht(): # the Pi-Stimme speaks now: the files keep the voice of the model computer
|
||||
return False
|
||||
now = time.time() if now is None else now
|
||||
made = await esp32.make_pause_clips(now)
|
||||
return await notbetrieb.make_clips(now, lambda text: esp32.tts_stream("", text)) or made
|
||||
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Pi-Stimme (plan alzeo-mischbetrieb M4, Dominik 2026-11-18 „Piper als eigenes Programm“): when the panel runs on a
|
||||
computer of its own and the model computer's speech output is gone (Notbetrieb) or given away by its Speicher-Wache
|
||||
(Mischbetrieb), this computer speaks by itself with the Piper voice Thorsten (CC0, 22.05 kHz) on its CPU.
|
||||
|
||||
It runs as its own service speech-spark-nottts, only on 127.0.0.1:NOTTTS_PORT, with the API key like every speech
|
||||
service, and only while the admin switch chat.notbetrieb_tts is on (panel/notbetrieb.py spricht): common.model_url
|
||||
sends "tts" here then. The voice loads at the first sentence and gives its memory back after NOTTTS_IDLE seconds
|
||||
without one. It speaks the same small part of the speech API the panel uses: POST /v1/audio/speech with "pcm" or
|
||||
"wav" (16 bit, 24 kHz, mono, like Qwen3-TTS), "stream": true as speech.audio.delta events, one sentence at a time.
|
||||
Voice, instructions and language of the request are ignored: there is one German voice.
|
||||
|
||||
Fixed rules: the runtime is sherpa-onnx from the panel's lock file (Apache-2.0, already there for Parakeet), the voice
|
||||
is the package of the sherpa-onnx project, fetched once by install.sh (python3 pistimme.py laden) and checked against
|
||||
its pinned SHA-256 before it is unpacked; only plain files and folders below its own folder are unpacked, nothing is
|
||||
run from it. Logs start with "notbetrieb: pistimme" and hold fixed words and numbers only.
|
||||
"""
|
||||
import base64
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import tarfile
|
||||
import threading
|
||||
import time
|
||||
import wave
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from common import NOTTTS_IDLE, NOTTTS_PORT, STATE # noqa: E402
|
||||
|
||||
URL = ("https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/"
|
||||
"vits-piper-de_DE-thorsten-medium.tar.bz2")
|
||||
SHA256 = "50487d9c95fdf2191f31d2588569381063ba1591dcd4c7d4bdd30f12b2191714"
|
||||
PAKET = "vits-piper-de_DE-thorsten-medium"
|
||||
MODELL = "de_DE-thorsten-medium.onnx"
|
||||
NAME = "Piper Thorsten (medium, CPU)"
|
||||
STIMME = "thorsten"
|
||||
DIR = os.path.join(STATE, "pistimme")
|
||||
MAX_BYTES = 100 * 1024**2 # the package is about 64 MiB
|
||||
RATE_IN = 22050
|
||||
RATE = 24000 # what every caller of the speech output reads (Qwen3-TTS)
|
||||
THREADS = 2 # the panel keeps the other cores
|
||||
MAX_INPUT = 3000 # characters per request
|
||||
FORMATE = ("pcm", "wav")
|
||||
SATZ = re.compile(r"(?<=[.!?…:;])\s+")
|
||||
|
||||
|
||||
def _hash(path):
|
||||
h = hashlib.sha256()
|
||||
with open(path, "rb") as f:
|
||||
for b in iter(lambda: f.read(1 << 20), b""):
|
||||
h.update(b)
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
def da(d=DIR):
|
||||
"""The pinned package is unpacked here (its hash noted beside it)."""
|
||||
try:
|
||||
with open(os.path.join(d, ".sha256")) as f:
|
||||
ok = f.read().strip() == SHA256
|
||||
return ok and os.path.isfile(os.path.join(d, PAKET, MODELL))
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def _sicher(tar, ziel):
|
||||
"""Only plain files and folders below PAKET/, never a link, a device or a path out of it."""
|
||||
for m in tar.getmembers():
|
||||
name = m.name
|
||||
if not (name == PAKET or name.startswith(PAKET + "/")) or ".." in name.split("/") or name.startswith("/"):
|
||||
raise ValueError("pfad")
|
||||
if not (m.isfile() or m.isdir()):
|
||||
raise ValueError("art")
|
||||
p = os.path.realpath(os.path.join(ziel, name))
|
||||
if not p.startswith(os.path.realpath(ziel) + os.sep):
|
||||
raise ValueError("pfad")
|
||||
yield m
|
||||
|
||||
|
||||
def entpacken(datei, d=DIR):
|
||||
"""Checks the hash, unpacks into a new folder and puts it in place at once. Raises ValueError("hash") on a wrong file."""
|
||||
if _hash(datei) != SHA256:
|
||||
raise ValueError("hash")
|
||||
neu = d + ".neu"
|
||||
shutil.rmtree(neu, ignore_errors=True)
|
||||
os.makedirs(neu, mode=0o700)
|
||||
with tarfile.open(datei, "r:bz2") as t:
|
||||
for m in _sicher(t, neu):
|
||||
m.mode = 0o700 if m.isdir() else 0o600
|
||||
t.extract(m, neu, set_attrs=False)
|
||||
with open(os.path.join(neu, ".sha256"), "w") as f:
|
||||
f.write(SHA256 + "\n")
|
||||
alt = d + ".alt"
|
||||
shutil.rmtree(alt, ignore_errors=True)
|
||||
if os.path.isdir(d):
|
||||
os.rename(d, alt)
|
||||
os.rename(neu, d)
|
||||
shutil.rmtree(alt, ignore_errors=True)
|
||||
|
||||
|
||||
def laden(d=DIR, url=URL):
|
||||
"""install.sh: fetches the package once (nothing when it is there), at most MAX_BYTES."""
|
||||
if da(d):
|
||||
print("notbetrieb: pistimme da", flush=True)
|
||||
return 0
|
||||
import urllib.request
|
||||
os.makedirs(os.path.dirname(d), exist_ok=True)
|
||||
tmp = d + ".tar.bz2"
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=60) as r, open(tmp, "wb") as f: # noqa: S310 - fixed https URL
|
||||
n = 0
|
||||
for b in iter(lambda: r.read(1 << 20), b""):
|
||||
n += len(b)
|
||||
if n > MAX_BYTES:
|
||||
raise ValueError("gross")
|
||||
f.write(b)
|
||||
entpacken(tmp, d)
|
||||
except (OSError, ValueError, tarfile.TarError) as e:
|
||||
print("notbetrieb: pistimme laden fehler", type(e).__name__, flush=True)
|
||||
return 1
|
||||
finally:
|
||||
if os.path.exists(tmp):
|
||||
os.unlink(tmp)
|
||||
print("notbetrieb: pistimme laden ok", flush=True)
|
||||
return 0
|
||||
|
||||
|
||||
def pcm16(samples, rate_in=RATE_IN, rate=RATE):
|
||||
"""Float samples (-1..1) at rate_in to 16-bit PCM at rate (linear, enough for speech)."""
|
||||
import numpy as np
|
||||
x = np.asarray(samples, dtype=np.float32)
|
||||
if len(x) and rate_in != rate:
|
||||
n = int(round(len(x) * rate / rate_in))
|
||||
x = np.interp(np.arange(n) * (rate_in / rate), np.arange(len(x)), x).astype(np.float32)
|
||||
return (np.clip(x, -1.0, 1.0) * 32767).astype("<i2").tobytes()
|
||||
|
||||
|
||||
def wav(pcm, rate=RATE):
|
||||
b = io.BytesIO()
|
||||
with wave.open(b, "wb") as w:
|
||||
w.setnchannels(1)
|
||||
w.setsampwidth(2)
|
||||
w.setframerate(rate)
|
||||
w.writeframes(pcm)
|
||||
return b.getvalue()
|
||||
|
||||
|
||||
def text_fuer(text, lang="German"):
|
||||
"""The same cleaning as the main speech output (textnorm): no Markdown signs, no secrets, numbers in words."""
|
||||
from textnorm import clean_text, hide_secrets, speak_abbreviations, speak_numbers, speech_markdown
|
||||
t = clean_text(hide_secrets(speech_markdown(str(text)), lang), calm=True)
|
||||
try:
|
||||
t = speak_numbers(speak_abbreviations(t, lang), lang, "words")
|
||||
except Exception: # noqa: BLE001 - never fail a sentence over number formatting
|
||||
pass
|
||||
return t.strip()
|
||||
|
||||
|
||||
def saetze(text):
|
||||
return [s for s in (x.strip() for x in SATZ.split(text)) if s]
|
||||
|
||||
|
||||
class Stimme:
|
||||
"""The voice: loaded at the first sentence, gone again after `idle` seconds without one (vergessen)."""
|
||||
|
||||
def __init__(self, d=DIR, idle=NOTTTS_IDLE):
|
||||
self.d, self.idle = d, idle
|
||||
self.tts = None
|
||||
self.lock = threading.Lock()
|
||||
self.used = time.monotonic()
|
||||
|
||||
def _laden(self):
|
||||
import sherpa_onnx
|
||||
p = os.path.join(self.d, PAKET)
|
||||
vits = sherpa_onnx.OfflineTtsVitsModelConfig(model=os.path.join(p, MODELL), lexicon="",
|
||||
data_dir=os.path.join(p, "espeak-ng-data"),
|
||||
tokens=os.path.join(p, "tokens.txt"))
|
||||
cfg = sherpa_onnx.OfflineTtsConfig(model=sherpa_onnx.OfflineTtsModelConfig(vits=vits, provider="cpu",
|
||||
num_threads=THREADS),
|
||||
max_num_sentences=1)
|
||||
t0 = time.time()
|
||||
self.tts = sherpa_onnx.OfflineTts(cfg)
|
||||
print(f"notbetrieb: pistimme geladen {time.time() - t0:.1f} s", flush=True)
|
||||
|
||||
def sprich(self, satz, speed=1.0):
|
||||
"""One sentence as 16-bit PCM at RATE."""
|
||||
with self.lock:
|
||||
self.used = time.monotonic()
|
||||
if self.tts is None:
|
||||
if not da(self.d):
|
||||
raise RuntimeError("fehlt")
|
||||
self._laden()
|
||||
a = self.tts.generate(satz, sid=0, speed=speed)
|
||||
self.used = time.monotonic()
|
||||
return pcm16(a.samples, a.sample_rate)
|
||||
|
||||
def vergessen(self, now=None):
|
||||
now = time.monotonic() if now is None else now
|
||||
with self.lock:
|
||||
if self.tts is not None and now - self.used > self.idle:
|
||||
self.tts = None
|
||||
print("notbetrieb: pistimme entladen", flush=True)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def anfrage(body):
|
||||
"""(text, format, stream, speed) of a request, or raises ValueError with a fixed word."""
|
||||
if not isinstance(body, dict) or not isinstance(body.get("input"), str) or not body["input"].strip():
|
||||
raise ValueError("input")
|
||||
if len(body["input"]) > MAX_INPUT:
|
||||
raise ValueError("lang")
|
||||
fmt = body.get("response_format") or "pcm"
|
||||
if fmt not in FORMATE:
|
||||
raise ValueError("format")
|
||||
stream = body.get("stream") is True or body.get("stream_format") in ("sse", "audio")
|
||||
speed = body.get("speed", 1.0)
|
||||
speed = float(speed) if isinstance(speed, (int, float)) and not isinstance(speed, bool) and 0.5 <= speed <= 2.0 \
|
||||
else 1.0
|
||||
return body["input"], fmt, stream, speed
|
||||
|
||||
|
||||
def event(pcm):
|
||||
return ("event: speech.audio.delta\ndata: " + json.dumps({"type": "speech.audio.delta",
|
||||
"audio": base64.b64encode(pcm).decode(), "response_format": "pcm"}) + "\n\n").encode()
|
||||
|
||||
|
||||
DONE = b"event: speech.audio.done\ndata: " + json.dumps({"type": "speech.audio.done"}).encode() + b"\n\n"
|
||||
|
||||
|
||||
def app_bauen(stimme=None):
|
||||
import asyncio
|
||||
|
||||
from fastapi import Depends, FastAPI, HTTPException, Request
|
||||
from fastapi.responses import Response, StreamingResponse
|
||||
|
||||
from common import BodyLimit, api_key_dependency
|
||||
stimme = stimme or Stimme()
|
||||
app = FastAPI(title="Pi-Stimme (Piper Thorsten)")
|
||||
app.add_middleware(BodyLimit, limits=[], default=64 * 1024)
|
||||
auth = [Depends(api_key_dependency())]
|
||||
app.state.stimme = stimme
|
||||
n = {"saetze": 0}
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {"status": "ok" if da(stimme.d) else "error", "geladen": stimme.tts is not None, "model": NAME,
|
||||
"saetze": n["saetze"]}
|
||||
|
||||
@app.get("/v1/voices", dependencies=auth)
|
||||
def voices():
|
||||
return {"model_kind": "pistimme", "voices": [STIMME], "languages": ["German"], "voicedesign": False,
|
||||
"eigene": []}
|
||||
|
||||
@app.post("/v1/audio/speech", dependencies=auth)
|
||||
async def speech(request: Request):
|
||||
try:
|
||||
text, fmt, stream, speed = anfrage(await request.json())
|
||||
except ValueError as e:
|
||||
print("notbetrieb: pistimme abgelehnt", e.args[0] if e.args else "json", flush=True)
|
||||
raise HTTPException(400, f"pistimme: {e.args[0] if e.args else 'json'}")
|
||||
stuecke = saetze(await asyncio.to_thread(text_fuer, text))
|
||||
if not stuecke:
|
||||
raise HTTPException(400, "nothing left to speak after removing emojis and markup")
|
||||
if not da(stimme.d):
|
||||
print("notbetrieb: pistimme fehlt", flush=True)
|
||||
raise HTTPException(503, "TTS engine error: pistimme fehlt")
|
||||
if not stream:
|
||||
try:
|
||||
pcm = b"".join([await asyncio.to_thread(stimme.sprich, s, speed) for s in stuecke])
|
||||
except Exception as e: # noqa: BLE001
|
||||
print("notbetrieb: pistimme fehler", type(e).__name__, flush=True)
|
||||
raise HTTPException(503, "TTS engine error: pistimme")
|
||||
n["saetze"] += len(stuecke)
|
||||
print(f"notbetrieb: pistimme gesprochen {len(stuecke)} saetze", flush=True)
|
||||
return Response(wav(pcm) if fmt == "wav" else pcm, media_type="audio/wav" if fmt == "wav" else "audio/pcm")
|
||||
|
||||
async def strom():
|
||||
k = 0
|
||||
try:
|
||||
for s in stuecke:
|
||||
yield event(await asyncio.to_thread(stimme.sprich, s, speed))
|
||||
k += 1
|
||||
yield DONE
|
||||
print(f"notbetrieb: pistimme gesprochen {k} saetze", flush=True)
|
||||
except Exception as e: # noqa: BLE001
|
||||
print("notbetrieb: pistimme fehler", type(e).__name__, k, flush=True)
|
||||
yield (b"event: speech.audio.error\ndata: " + json.dumps({"type": "speech.audio.error",
|
||||
"error": "pistimme"}).encode() + b"\n\n")
|
||||
finally:
|
||||
n["saetze"] += k
|
||||
return StreamingResponse(strom(), media_type="text/event-stream")
|
||||
|
||||
@app.on_event("startup")
|
||||
async def leerlauf():
|
||||
async def schauen():
|
||||
while True:
|
||||
await asyncio.sleep(30)
|
||||
stimme.vergessen()
|
||||
asyncio.get_running_loop().create_task(schauen())
|
||||
|
||||
return app
|
||||
|
||||
|
||||
def main(argv):
|
||||
if argv[:1] == ["laden"]:
|
||||
return laden()
|
||||
if argv[:1] == ["da"]:
|
||||
return 0 if da() else 1
|
||||
if argv:
|
||||
print("pistimme.py [laden|da]", file=sys.stderr)
|
||||
return 2
|
||||
import uvicorn
|
||||
uvicorn.run(app_bauen(), host="127.0.0.1", port=NOTTTS_PORT, log_level="warning", access_log=False)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
@@ -43,6 +43,7 @@ DIENST_NAMEN = {"asr": ("Spracherkennung", "Speech recognition"), "asr-engine":
|
||||
"lokaltest": ("Schnelltest lokaler Änderungen", "Quick test of local changes"),
|
||||
"lokaltest-umgebung": ("Testumgebung lokaler Änderungen", "Test environment of local changes"), "github": ("An GitHub geben", "Hand to GitHub"), "auftrag": ("Code-Auftrag (OpenCode)", "Code order (OpenCode)"), "waerter": ("Wärter", "Wärter"), "panel": ("Panel", "Panel"),
|
||||
"turn": ("Anrufe (TURN)", "Calls (TURN)"), "notasr": ("Notbetrieb-Erkennung", "Emergency recognition"),
|
||||
"nottts": ("Pi-Stimme", "Pi voice"),
|
||||
"gehaeuse": ("Gehäuse", "Case"), "systemupdate": ("System-Updates", "System updates"), "gpu-takt": ("GPU-Taktgrenze", "GPU clock cap"), "clients-fw": ("Spark-Clients (Firewall)", "Spark clients (firewall)"), "konsole": ("Spark-Konsole", "Spark-Konsole"), "koppelcode": ("Assistent koppeln", "Pair an assistant"), "koppeln": ("Spark koppeln", "Pair a Spark"), "schirm": ("Steuerzentrale", "Control centre"),
|
||||
"guacd": ("Bildschirm (guacd)", "Screen (guacd)"), "tlstor": ("TLS-Tor", "TLS gate"),
|
||||
"watch": ("API-Wächter", "API watchdog"), "update": ("Update", "Update"), "wechsel": ("Modellwechsel", "Model switch"),
|
||||
|
||||
+10
-9
@@ -2,12 +2,13 @@
|
||||
# one of these files, its systemd unit, the settings or its Python packages changed; a service that is
|
||||
# not listed here always restarts (the panel, the watchdog and the engines have their own rules).
|
||||
# tests/test_rauchtest.py checks this list against the imports, so a new module cannot be forgotten.
|
||||
asr: asr_proxy.py asr_server.py common.py mandanten.py gputakt.py parakeet.py smartturn.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
tts: tts_proxy.py tts_server.py common.py mandanten.py gputakt.py textnorm.py tempo.py kurzref.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
bild: bild_server.py bedarf.py bildmodell.py musikmodell.py common.py mandanten.py gputakt.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json config.default.json
|
||||
musik: musik_server.py musikmodell.py bedarf.py bildmodell.py common.py mandanten.py gputakt.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json config.default.json
|
||||
llmtor: llm_tor.py modellblick.py einordnung.py textnorm.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py common.py mandanten.py gputakt.py config.default.json
|
||||
tlstor: tlstor.py common.py mandanten.py gputakt.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
waerter: tarswart.py modellblick.py installiert.py stimmablage.py kurzref.py werkstatt.py rechner.py sysupdate.py common.py mandanten.py gputakt.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
notasr: asr_proxy.py common.py mandanten.py gputakt.py parakeet.py smartturn.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
schirm: steuerzentrale.py common.py mandanten.py gputakt.py llmstart.py modelle.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
asr: asr_proxy.py asr_server.py common.py mandanten.py gputakt.py parakeet.py smartturn.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
tts: tts_proxy.py tts_server.py common.py mandanten.py gputakt.py textnorm.py tempo.py kurzref.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
bild: bild_server.py bedarf.py bildmodell.py musikmodell.py common.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json config.default.json
|
||||
musik: musik_server.py musikmodell.py bedarf.py bildmodell.py common.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json config.default.json
|
||||
llmtor: llm_tor.py modellblick.py einordnung.py textnorm.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py common.py mandanten.py gputakt.py config.default.json
|
||||
tlstor: tlstor.py common.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
waerter: tarswart.py modellblick.py installiert.py stimmablage.py kurzref.py werkstatt.py rechner.py sysupdate.py common.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
notasr: asr_proxy.py common.py mandanten.py gputakt.py parakeet.py smartturn.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
nottts: pistimme.py common.py textnorm.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
schirm: steuerzentrale.py common.py mandanten.py gputakt.py llmstart.py modelle.py mischbetrieb.py bench.py hardware.py hftoken.py modelle.json bildmodell.py musikmodell.py config.default.json
|
||||
+4
-4
@@ -9,7 +9,7 @@
|
||||
# speech-spark models choose the models again (same questions as the first install)
|
||||
# speech-spark update [--check] update to the newest version (like the button in the panel)
|
||||
# speech-spark logs [what] [-n N] last log lines: asr, tts, asr-engine, tts-engine, tts-design, tts-klon, bild, musik,
|
||||
# llm, llmtor, sehen, helfer, einbetten, nachsortieren, tlstor, waerter, notasr, schirm, panel, konsole, watch, update, messen, wechsel,
|
||||
# llm, llmtor, sehen, helfer, einbetten, nachsortieren, tlstor, waerter, notasr, nottts, schirm, panel, konsole, watch, update, messen, wechsel,
|
||||
# werkstatt, entwickeln or all (default)
|
||||
# speech-spark panel enable|disable add the web panel later, or remove it (its data stays)
|
||||
# speech-spark notzugang [--yes] locked out: new panel password, its second step and
|
||||
@@ -227,12 +227,12 @@ cmd_logs() {
|
||||
[[ "$n" =~ ^[0-9]{1,5}$ ]] || die "-n needs a number"
|
||||
case "$what" in
|
||||
all) units=(-u 'speech-spark-*') ;;
|
||||
asr|tts|asr-engine|tts-engine|tts-design|tts-klon|bild|musik|llm|llmtor|sehen|helfer|einbetten|nachsortieren|panel|konsole|watch|update|tlstor|waerter|notasr|schirm) units=(-u "speech-spark-$what") ;;
|
||||
asr|tts|asr-engine|tts-engine|tts-design|tts-klon|bild|musik|llm|llmtor|sehen|helfer|einbetten|nachsortieren|panel|konsole|watch|update|tlstor|waerter|notasr|nottts|schirm) units=(-u "speech-spark-$what") ;;
|
||||
messen) units=(-u speech-spark-messen -u speech-spark-messen-wunsch -u speech-spark-messen-engine) ;;
|
||||
werkstatt) units=(-u speech-spark-werkstatt -u speech-spark-werkstatt-lauf) ;;
|
||||
entwickeln) units=(-u speech-spark-update -u speech-spark-lokaltest -u speech-spark-lokaltest-umgebung -u speech-spark-github) ;;
|
||||
wechsel) units=(-u speech-spark-wechsel -u speech-spark-llm -u speech-spark-sehen -u speech-spark-einbetten -u speech-spark-nachsortieren) ;;
|
||||
*) die "logs: asr, tts, asr-engine, tts-engine, tts-design, tts-klon, bild, musik, llm, llmtor, sehen, helfer, einbetten, nachsortieren, tlstor, waerter, notasr, schirm, panel, konsole, watch, update, messen, wechsel, werkstatt, entwickeln or all" ;;
|
||||
*) die "logs: asr, tts, asr-engine, tts-engine, tts-design, tts-klon, bild, musik, llm, llmtor, sehen, helfer, einbetten, nachsortieren, tlstor, waerter, notasr, nottts, schirm, panel, konsole, watch, update, messen, wechsel, werkstatt, entwickeln or all" ;;
|
||||
esac
|
||||
journalctl --namespace=speech-spark "${units[@]}" --no-pager -n "$n"
|
||||
}
|
||||
@@ -1461,6 +1461,6 @@ case "${1:-}" in
|
||||
konsole) shift; need_root konsole "$@"; cmd_konsole "$@" ;; # Spark-Clients (mandanten.py): as the service user
|
||||
lokal) shift; cmd_lokal "$@" ;;
|
||||
entwickeln) shift; cmd_entwickeln "$@" ;;
|
||||
""|-h|--help|help) sed -n '2,47p' "$0" | sed 's/^# \{0,1\}//' ;;
|
||||
""|-h|--help|help) sed -n '2,48p' "$0" | sed 's/^# \{0,1\}//' ;;
|
||||
*) die "unknown command: $1 (see: speech-spark help)" ;;
|
||||
esac
|
||||
@@ -234,6 +234,7 @@
|
||||
"test_meldung": 3.1,
|
||||
"test_messages": 16.5,
|
||||
"test_messen_knopf": 0.2,
|
||||
"test_mischbetrieb": 0.0,
|
||||
"test_mitschreiblink": 0.6,
|
||||
"test_mitteilungen": 0.7,
|
||||
"test_modell_rechner": 0.1,
|
||||
@@ -268,6 +269,7 @@
|
||||
"test_passkey": 4.4,
|
||||
"test_pdftabellen": 2.2,
|
||||
"test_pebble": 2.3,
|
||||
"test_pistimme": 0.9,
|
||||
"test_post_seite": 19.8,
|
||||
"test_praxistest": 1.0,
|
||||
"test_probetag": 10.0,
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
"""Pi-Stimme (plan alzeo-mischbetrieb M4): with the models on another computer, the panel computer speaks by itself with
|
||||
the Piper voice Thorsten only when the admin switched chat.notbetrieb_tts on and the model computer's speech output is
|
||||
gone (Notbetrieb) or given away by its Speicher-Wache (Mischbetrieb). The voice package is pinned by its SHA-256 and
|
||||
unpacked only below its own folder; its files never become clips of another voice. No real model, no network."""
|
||||
import asyncio
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import struct
|
||||
import tarfile
|
||||
import tempfile
|
||||
import unittest
|
||||
from contextlib import redirect_stdout
|
||||
from unittest import mock
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from tests import helpers
|
||||
|
||||
helpers.start()
|
||||
import ack # noqa: E402
|
||||
import common # noqa: E402
|
||||
import notbetrieb # noqa: E402
|
||||
import pistimme # noqa: E402
|
||||
import steuer # noqa: E402
|
||||
import wartung # noqa: E402
|
||||
|
||||
KEY = {"Authorization": "Bearer sk-test"}
|
||||
|
||||
|
||||
def paket(path, extra=None):
|
||||
"""A small package like the real one; extra: (TarInfo, bytes) to add."""
|
||||
with tarfile.open(path, "w:bz2") as t:
|
||||
for name, data in ((pistimme.PAKET + "/" + pistimme.MODELL, b"onnx"), (pistimme.PAKET + "/tokens.txt", b"a 1\n")):
|
||||
i = tarfile.TarInfo(name)
|
||||
i.size = len(data)
|
||||
t.addfile(i, io.BytesIO(data))
|
||||
if extra:
|
||||
t.addfile(extra[0], io.BytesIO(extra[1]) if extra[1] is not None else None)
|
||||
return pistimme._hash(path)
|
||||
|
||||
|
||||
class Paket(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.dir = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, self.dir, True)
|
||||
self.ziel = os.path.join(self.dir, "pistimme")
|
||||
self.tar = os.path.join(self.dir, "p.tar.bz2")
|
||||
|
||||
def test_pinned_and_fixed(self):
|
||||
self.assertTrue(pistimme.URL.startswith("https://github.com/k2-fsa/sherpa-onnx/releases/download/"))
|
||||
self.assertRegex(pistimme.SHA256, r"^[0-9a-f]{64}$")
|
||||
self.assertEqual(common.NOTTTS_PORT, 31022)
|
||||
self.assertIn(common.NOTTTS_PORT, range(31000, 31100), "own ports stay at or below 31099")
|
||||
|
||||
def test_a_wrong_file_is_never_unpacked(self):
|
||||
paket(self.tar)
|
||||
with self.assertRaises(ValueError) as e:
|
||||
pistimme.entpacken(self.tar, self.ziel)
|
||||
self.assertEqual(e.exception.args[0], "hash")
|
||||
self.assertFalse(os.path.exists(self.ziel))
|
||||
self.assertFalse(pistimme.da(self.ziel))
|
||||
|
||||
def test_the_pinned_file_is_unpacked_and_noted(self):
|
||||
h = paket(self.tar)
|
||||
with mock.patch.object(pistimme, "SHA256", h):
|
||||
pistimme.entpacken(self.tar, self.ziel)
|
||||
self.assertTrue(pistimme.da(self.ziel))
|
||||
self.assertFalse(pistimme.da(self.ziel), "another pin: fetched again")
|
||||
|
||||
def test_links_and_paths_out_are_refused(self):
|
||||
link = tarfile.TarInfo(pistimme.PAKET + "/x")
|
||||
link.type, link.linkname = tarfile.SYMTYPE, "/etc/passwd"
|
||||
weg = tarfile.TarInfo(pistimme.PAKET + "/../../boese")
|
||||
weg.size = 1
|
||||
fremd = tarfile.TarInfo("anderes/datei")
|
||||
fremd.size = 1
|
||||
for extra, wort in (((link, None), "art"), ((weg, b"x"), "pfad"), ((fremd, b"x"), "pfad")):
|
||||
with self.subTest(wort=wort):
|
||||
h = paket(self.tar, extra)
|
||||
with mock.patch.object(pistimme, "SHA256", h), self.assertRaises(ValueError) as e:
|
||||
pistimme.entpacken(self.tar, self.ziel)
|
||||
self.assertEqual(e.exception.args[0], wort)
|
||||
self.assertFalse(os.path.exists(os.path.join(self.dir, "boese")))
|
||||
self.assertFalse(pistimme.da(self.ziel))
|
||||
|
||||
|
||||
class Anfrage(unittest.TestCase):
|
||||
def test_only_the_small_part_of_the_api(self):
|
||||
self.assertEqual(pistimme.anfrage({"input": "Hallo."}), ("Hallo.", "pcm", False, 1.0))
|
||||
self.assertEqual(pistimme.anfrage({"input": "Hallo.", "response_format": "wav", "stream": True, "speed": 1.2,
|
||||
"voice": "eigen-x"})[1:], ("wav", True, 1.2))
|
||||
self.assertEqual(pistimme.anfrage({"input": "Hallo.", "speed": 9})[3], 1.0)
|
||||
for body, wort in (({"input": "x", "response_format": "mp3"}, "format"), ({"input": " "}, "input"),
|
||||
({"input": "x" * (pistimme.MAX_INPUT + 1)}, "lang"), ([], "input")):
|
||||
with self.subTest(wort=wort), self.assertRaises(ValueError) as e:
|
||||
pistimme.anfrage(body)
|
||||
self.assertEqual(e.exception.args[0], wort)
|
||||
|
||||
def test_24_khz_like_every_other_voice(self):
|
||||
pcm = pistimme.pcm16([0.0, 0.5, -0.5, 1.0] * 2205)
|
||||
self.assertEqual(len(pcm) // 2, 9600)
|
||||
self.assertEqual(pistimme.wav(pcm)[:4], b"RIFF")
|
||||
self.assertEqual(struct.unpack("<I", pistimme.wav(pcm)[24:28])[0], 24000)
|
||||
|
||||
|
||||
class FakeStimme(pistimme.Stimme):
|
||||
def __init__(self, d):
|
||||
super().__init__(d, idle=600)
|
||||
self.gesagt = []
|
||||
|
||||
def sprich(self, satz, speed=1.0):
|
||||
self.gesagt.append(satz)
|
||||
return b"\x01\x00" * 100
|
||||
|
||||
|
||||
class Dienst(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.dir = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, self.dir, True)
|
||||
self.stimme = FakeStimme(self.dir)
|
||||
self.c = TestClient(pistimme.app_bauen(self.stimme))
|
||||
p = mock.patch.object(pistimme, "da", return_value=True)
|
||||
p.start()
|
||||
self.addCleanup(p.stop)
|
||||
|
||||
def post(self, body, headers=KEY):
|
||||
with redirect_stdout(io.StringIO()) as out:
|
||||
r = self.c.post("/v1/audio/speech", json=body, headers=headers)
|
||||
return r, out.getvalue()
|
||||
|
||||
def test_the_api_key_is_needed(self):
|
||||
r, _ = self.post({"input": "Hallo."}, headers={})
|
||||
self.assertEqual(r.status_code, 401)
|
||||
self.assertEqual(self.stimme.gesagt, [])
|
||||
|
||||
def test_sentence_by_sentence_as_events(self):
|
||||
r, log = self.post({"input": "Hallo. Wie geht es dir?", "stream": True})
|
||||
self.assertEqual(r.status_code, 200)
|
||||
events = [json.loads(ln[5:]) for ln in r.text.splitlines() if ln.startswith("data:")]
|
||||
self.assertEqual([e["type"] for e in events], ["speech.audio.delta"] * 2 + ["speech.audio.done"])
|
||||
self.assertEqual(len(self.stimme.gesagt), 2)
|
||||
self.assertIn("notbetrieb: pistimme gesprochen 2 saetze", log)
|
||||
self.assertNotIn("Hallo", log, "never a text in the log")
|
||||
|
||||
def test_pcm_and_wav_but_no_mp3(self):
|
||||
r, _ = self.post({"input": "Hallo.", "response_format": "wav"})
|
||||
self.assertEqual(r.content[:4], b"RIFF")
|
||||
r, _ = self.post({"input": "Hallo."})
|
||||
self.assertEqual(r.content, b"\x01\x00" * 100)
|
||||
r, log = self.post({"input": "Hallo.", "response_format": "mp3"})
|
||||
self.assertEqual(r.status_code, 400)
|
||||
self.assertIn("notbetrieb: pistimme abgelehnt format", log)
|
||||
|
||||
def test_missing_voice_says_so(self):
|
||||
with mock.patch.object(pistimme, "da", return_value=False):
|
||||
r, log = self.post({"input": "Hallo."})
|
||||
self.assertEqual(r.status_code, 503)
|
||||
self.assertIn("notbetrieb: pistimme fehlt", log)
|
||||
|
||||
def test_it_forgets_after_the_idle_time(self):
|
||||
self.stimme.tts = object()
|
||||
with redirect_stdout(io.StringIO()):
|
||||
self.assertFalse(self.stimme.vergessen(self.stimme.used + 10))
|
||||
self.assertTrue(self.stimme.vergessen(self.stimme.used + 601))
|
||||
self.assertIsNone(self.stimme.tts)
|
||||
|
||||
|
||||
class Panel(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.old = common.load_config()
|
||||
self.addCleanup(helpers.write_config, self.old)
|
||||
c = json.loads(json.dumps(self.old))
|
||||
c["models"]["host"] = "192.168.178.171"
|
||||
c["chat"]["notbetrieb_tts"] = True
|
||||
helpers.write_config(c)
|
||||
self.cfg = c
|
||||
for name, v in (("weg", True), ("stimme_frei", False)):
|
||||
p = mock.patch.object(steuer, name, return_value=v)
|
||||
p.start()
|
||||
self.addCleanup(p.stop)
|
||||
|
||||
def test_off_by_default(self):
|
||||
with open(os.path.join(os.path.dirname(common.__file__), "config.default.json")) as f:
|
||||
self.assertIs(json.load(f)["chat"]["notbetrieb_tts"], False)
|
||||
self.cfg["chat"]["notbetrieb_tts"] = False
|
||||
helpers.write_config(self.cfg)
|
||||
self.assertFalse(notbetrieb.spricht())
|
||||
self.assertTrue(wartung.paused("tts"))
|
||||
self.assertTrue(common.model_url("tts", "/x").startswith("https://192.168.178.171:"))
|
||||
|
||||
def test_in_notbetrieb_this_computer_speaks(self):
|
||||
self.assertTrue(notbetrieb.spricht())
|
||||
self.assertEqual(common.model_url("tts", "/v1/audio/speech"),
|
||||
f"http://127.0.0.1:{common.NOTTTS_PORT}/v1/audio/speech")
|
||||
self.assertFalse(wartung.paused("tts"))
|
||||
self.assertTrue(wartung.paused("llm"), "the language model stays paused")
|
||||
|
||||
def test_while_the_guard_gave_the_voice_away(self):
|
||||
with mock.patch.object(steuer, "weg", return_value=False), \
|
||||
mock.patch.object(steuer, "stimme_frei", return_value=True):
|
||||
self.assertTrue(notbetrieb.spricht())
|
||||
self.assertFalse(wartung.paused("tts"))
|
||||
with mock.patch.object(steuer, "weg", return_value=False):
|
||||
self.assertFalse(notbetrieb.spricht(), "with the model computer speaking nothing changes")
|
||||
self.assertTrue(common.model_url("tts", "/x").startswith("https://"))
|
||||
|
||||
def test_all_in_one_never(self):
|
||||
helpers.write_config(dict(self.cfg, models=self.old["models"]))
|
||||
self.assertFalse(notbetrieb.spricht())
|
||||
|
||||
def test_its_sound_never_becomes_a_clip_of_another_voice(self):
|
||||
url = common.model_url("tts", "/v1/audio/speech")
|
||||
with mock.patch.object(ack, "_record", side_effect=AssertionError("asked")):
|
||||
got = asyncio.run(ack.record_missing(url, KEY, {"voice": "vivian"}, "German", texts=["Moment."]))
|
||||
self.assertEqual(got, 0)
|
||||
with mock.patch("esp32.make_pause_clips", side_effect=AssertionError("made")), \
|
||||
mock.patch.object(notbetrieb, "make_clips", side_effect=AssertionError("made")):
|
||||
self.cfg["chat"]["esp32"] = True
|
||||
helpers.write_config(self.cfg)
|
||||
self.assertFalse(asyncio.run(wartung.clips_tick(1000.0)))
|
||||
|
||||
def test_live_shows_it(self):
|
||||
with mock.patch.object(pistimme, "da", return_value=True):
|
||||
d = notbetrieb.for_live()
|
||||
self.assertTrue(d["stimme"] and d["spricht"] and d["stimme_da"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -19,7 +19,7 @@ APP = helpers.APP
|
||||
# the scripts each front end starts (both kinds: the proxy in front of an engine, the transformers server)
|
||||
ENTRY = {"asr": ("asr_proxy.py", "asr_server.py"), "tts": ("tts_proxy.py", "tts_server.py"), "bild": ("bild_server.py",),
|
||||
"musik": ("musik_server.py",), "llmtor": ("llm_tor.py",), "tlstor": ("tlstor.py",), "waerter": ("tarswart.py",),
|
||||
"notasr": ("asr_proxy.py",), "schirm": ("steuerzentrale.py",)}
|
||||
"notasr": ("asr_proxy.py",), "nottts": ("pistimme.py",), "schirm": ("steuerzentrale.py",)}
|
||||
SAFE = re.compile(r"[A-Za-z0-9_][A-Za-z0-9_./-]*")
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class Smoke(unittest.TestCase):
|
||||
for path in sorted(glob.glob(os.path.join(APP, "panel", "*.py"))):
|
||||
with self.subTest(module=os.path.basename(path)):
|
||||
importlib.import_module(os.path.basename(path)[:-3])
|
||||
for name in ("common", "textnorm", "tempo", "parakeet", "asr_proxy", "tts_proxy", "llm_tor", "einordnung", "modelle"):
|
||||
for name in ("common", "textnorm", "tempo", "parakeet", "asr_proxy", "tts_proxy", "llm_tor", "einordnung", "modelle", "pistimme"):
|
||||
with self.subTest(module=name):
|
||||
importlib.import_module(name)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ GRUND = ("aktiv", "anmeldehinweis", "arbeiter", "ausleiten", "beobachten", "date
|
||||
CHAT_KREIS = {"chat", "chat_modell", "chat_ton", "chat_tools", "chat_turn"}
|
||||
DUNGEON_KREIS = {"dungeon", "dungeon_auto", "dungeon_geschichten", "dungeon_gesicht"}
|
||||
MODUL_KREISE = (CHAT_KREIS, DUNGEON_KREIS) # the cycles at module level on V01.1.395: they may only shrink
|
||||
LOKAL_MAX = 2909
|
||||
LOKAL_MAX = 2904
|
||||
KNOTEN_ALT = ('ablauf', 'abschrift', 'account', 'ack', 'admin', 'aendern', 'agent', 'android', 'angriffsprobe', 'anrufe',
|
||||
'answercheck', 'antwortvorschlag', 'apns', 'appmerken', 'appupdate', 'auftragsplan', 'auslassen', 'auswertung',
|
||||
'backup', 'bedienen', 'befund', 'begleiter', 'berater', 'berater_katalog', 'bilder', 'calendars', 'chat',
|
||||
|
||||
@@ -398,6 +398,7 @@ ADMIN_ON_OK = {
|
||||
"fernordner.py:on": "admin only: the folders of the paired systems on the admin's page, admin-only doors, no profile part",
|
||||
"wachposten.py:an": "admin only: notes to the admins in fixed words, no profile part",
|
||||
"schirm.py:admin_on": "admin only: the control centre on the panel computer's screen, no profile part",
|
||||
"notbetrieb.py:stimme_an": "Spark-wide Pi voice on the panel computer; it only speaks the answers the model computer's voice would speak, no profile part",
|
||||
"notbetrieb.py:admin_on": "Spark-wide emergency mode with Parakeet on the panel computer; the fixed commands keep the turn's own rights (HA, reminders)",
|
||||
"weiche_abstimmen.py:an": "admin only: tuning the Weiche's words on its page, no profile part",
|
||||
"weiche_unklar.py:on": "admin only: whether the Weiche page says collecting is on; each turn asks features.allowed (wanted)",
|
||||
|
||||
@@ -112,6 +112,7 @@ flowchart TB
|
||||
| `speech-spark-tlstor` | dieselben Ports mit TLS | TLS-Tor des Modell-Rechners (nur bei Spark teilen), dazu `speech-spark-teilen-fw` und `speech-spark-clients-fw` (Firewall neu für Spark-Clients) |
|
||||
| `speech-spark-konsole` | HTTPS 31010 | Spark-Konsole: eigene Webseite des Modell-Rechners (vier Bereiche: Überblick mit Modell genau, Modelle, Verbindungen mit Clients und Assistent koppeln, Wartung mit Updates und Logs), nur aus `konsole.netze`, nur mit `speech-spark konsole an`; dazu `speech-spark-koppelcode` (root zeigt auf Knopfdruck einen Kopplungscode, nur mit der Tür); auf dem Panel-Rechner `speech-spark-koppeln` (root koppelt mit Name und Code aus Einstellungen → Spark) |
|
||||
| `speech-spark-notasr` | 127.0.0.1:31009 | Notbetrieb mit Parakeet auf dem Panel-Rechner, wenn der Modell-Rechner weg ist |
|
||||
| `speech-spark-nottts` | 127.0.0.1:31022 | Pi-Stimme auf dem Panel-Rechner, wenn die Sprachausgabe des Modell-Rechners weg oder im Mischbetrieb freigegeben ist |
|
||||
| `speech-spark-watch` | – | Wächter, nur ohne Panel |
|
||||
| `speech-spark-update` | – | Update, nur auf Knopfdruck |
|
||||
| `speech-spark-wechsel` | – | Ein Modell wechseln (Zustand → Modelle), nur auf Knopfdruck |
|
||||
@@ -636,6 +637,7 @@ Panel auf einem eigenen Rechner, Modelle auf dem DGX: Kopplung, TLS-Tor, Wärter
|
||||
| `app/panel/gehaeuse.py` | Gehäuse des Panel-Rechners (Pironman 5): OLED-Seiten für den Admin, Status-LEDs, Lüftergrenzen |
|
||||
| `app/panel/geraetebild.py` | Bild auf den Rechner-Karten: eigene Zeichnung nach dem erkannten Gerät oder ein eigenes Foto des Admins |
|
||||
| `app/panel/notbetrieb.py` | Notbetrieb mit Parakeet: feste Befehle ohne Sprachmodell, wenn der Modell-Rechner fehlt |
|
||||
| `app/pistimme.py` | Pi-Stimme: Piper-Stimme Thorsten auf dem Panel-Rechner, wenn die Sprachausgabe des Modell-Rechners fehlt |
|
||||
| `app/panel/rechenteile.py` | Wer rechnet gerade: CPU je Teil des Panels aus seinen Threads und Hilfsprozessen |
|
||||
| `app/rechner.py` | Werte eines Rechners: CPU (auch je Dienst), Speicher, Platte, Netz, Temperatur, Strom (für beide Rechner gleich) |
|
||||
| `app/panel/rechnerblick.py` | Zustand → Überblick → Rechner: beide Rechner nebeneinander, Kurven, Hinweise nach festen Regeln |
|
||||
@@ -912,6 +914,7 @@ Alle Dateien gehören dem Benutzer `speech` (Ordner 0700, Dateien 0600) und werd
|
||||
| `state/openwebui.json` | Open WebUI: Kennungen von Schlüssel und MCP-Zugang je Profil | – | ja |
|
||||
| `state/panel-password` | Admin-Passwort (Hash) | Hash | ja |
|
||||
| `state/personen-vorrang.json` | Vorrang pro Profil | – | ja |
|
||||
| `state/pistimme` | Pi-Stimme: die Piper-Stimme Thorsten (sherpa-onnx-Paket, gegen ihre feste Prüfsumme geprüft) | – | nein |
|
||||
| `state/praxistest-stand.json` | Praxistest: je Prüfpunkt die Markierung (klappt, Problem, später) und die Zeit | – | ja |
|
||||
| `state/quality-cases.json` | Eigene Testfragen | – | ja |
|
||||
| `state/quality-helfer.json` | Letzter Vergleich Hilfsmodell gegen Sprachmodell | – | nein |
|
||||
@@ -3982,7 +3985,7 @@ flowchart TD
|
||||
4. <a id="kn-state-s4"></a>**Versiegeln**: vault.seal macht aus dem Wert „enc1:“ und ein Fernet-Token (verschlüsselt und gegen Änderung geschützt). Ein schon versiegelter Wert bleibt, wie er ist.
|
||||
5. <a id="kn-state-s5"></a>**Atomar schreiben**: common.write_json schreibt in eine frische Zwischendatei daneben, nie durch einen Link, gibt ihr die Rechte der alten Datei (eine neue ist nur für den Dienst lesbar) und tauscht sie dann in einem Schritt aus. Ein Absturz mittendrin lässt die alte Datei ganz.
|
||||
6. <a id="kn-state-s6"></a>**Lesen**: Ein versiegelter Wert wird mit dem Schlüssel geöffnet. Passt der Schlüssel nicht (Sicherung von einem anderen Spark), kommt ein leerer Wert zurück und der Zugang muss neu eingetragen werden. Ältere unversiegelte Werte werden gelesen und beim nächsten Speichern versiegelt.
|
||||
7. <a id="kn-state-s7"></a>**Kommt in die Sicherung?**: Jede Datei in state/ hat genau eine Zeile im Datei-Register dateien.py: mit ihrer Art kommt sie in jede Sicherung (dateien.STATE_FILES, 52), sonst steht dort ihr Grund (dateien.STATE_LOCAL, 130). backup.py nimmt beide Listen von dort. test_technik findet jeden Namen, den der Code dort schreibt, und verlangt seine Zeile.
|
||||
7. <a id="kn-state-s7"></a>**Kommt in die Sicherung?**: Jede Datei in state/ hat genau eine Zeile im Datei-Register dateien.py: mit ihrer Art kommt sie in jede Sicherung (dateien.STATE_FILES, 52), sonst steht dort ihr Grund (dateien.STATE_LOCAL, 131). backup.py nimmt beide Listen von dort. test_technik findet jeden Namen, den der Code dort schreibt, und verlangt seine Zeile.
|
||||
8. <a id="kn-state-s8"></a>**Umzugs-Sicherung?**: secret.key ist in keiner gewöhnlichen Sicherung. Nur eine Umzugs-Sicherung trägt ihn, versiegelt mit einem Passwort des Admins (scrypt und Fernet, move-keys.json). Die Anmelde-Schlüssel des Spark sind in keiner Sicherung.
|
||||
9. <a id="kn-state-s9"></a>**Beim Wiederherstellen in Ordnung?**: _check_state prüft jede Datei der Sicherung: höchstens 8 MB, gültiges JSON, der Push-Schlüssel ein echter EC-Schlüssel. Ein zweiter Schritt des Admins, dessen Geheimnis sich hier nicht öffnen lässt, wird nicht übernommen; der bisherige bleibt.
|
||||
10. <a id="kn-state-s10"></a>**Einsetzen mit Rückweg**: _swap schreibt jede Datei über eine Zwischendatei (nie durch einen Link) und merkt sich den alten Inhalt. Geht ein Schritt schief, kommt alles Getauschte zurück.
|
||||
@@ -3993,7 +3996,7 @@ flowchart TD
|
||||
#### Zahlen (aus dem Code)
|
||||
|
||||
- **52** Dateien in jeder Sicherung ([Schritt 7](#kn-state-s7))
|
||||
- **130** Dateien und Ordner, die mit Grund draußen bleiben ([Schritt 7](#kn-state-s7))
|
||||
- **131** Dateien und Ordner, die mit Grund draußen bleiben ([Schritt 7](#kn-state-s7))
|
||||
- **8 MB** größte Datei beim Wiederherstellen ([Schritt 9](#kn-state-s9))
|
||||
- **12** Zeichen hat das Umzugs-Passwort mindestens ([Schritt 8](#kn-state-s8))
|
||||
|
||||
|
||||
@@ -1877,6 +1877,8 @@ Jede Funktion des Spark mit ihrem Schalter, worauf sie aufbaut, wo man sie einri
|
||||
|
||||
- **Notbetrieb mit Parakeet** (Funktionen → Zugang → „Notbetrieb mit Parakeet“): Läuft das Panel auf einem eigenen Rechner (Spark teilen) und ist der DGX weg, antwortet der Spark sonst auf jede Frage mit „Der Spark macht gerade Pause.“ Mit diesem Schalter hört der Panel-Rechner selbst: Parakeet erkennt die Sprache au …
|
||||
|
||||
- **Pi-Stimme** (Funktionen → Zugang → „Pi-Stimme“): Läuft das Panel auf einem eigenen Rechner (Spark teilen) und spricht der DGX gerade nicht, weil er weg ist (Notbetrieb) oder seine Stimme im Mischbetrieb freigegeben hat, damit ein anderes Projekt starten kann, zeigen Browser und Apps di …
|
||||
|
||||
- **Gehäuse** (Funktionen → Zugang → „Gehäuse“): Steckt der Panel-Rechner in einem SunFounder Pironman 5, steuert der Spark dessen Teile selbst, ohne SunFounders Software: Das kleine Display zeigt dem Admin abwechselnd Zustand und Zahlen (Spark, Dienste und Wartung, Pi, DGX weg oder in …
|
||||
|
||||
- **System-Updates** (Funktionen → Zugang → „System-Updates“): Eine Karte unter Zustand → Überblick und die Seite Zustand → System-Updates zeigen für jeden Rechner (Pi mit dem Panel, bei Spark teilen auch tars mit den Modellen): wie viele Betriebssystem-Updates warten, wie viele davon für die Sicher …
|
||||
|
||||
@@ -377,7 +377,7 @@ Ab V01.0.386. Etwas klappt nicht? Jedes Profil beschreibt es kurz unter Ich →
|
||||
- **Sprachmodell weg**: Ist das Sprachmodell nicht erreichbar oder antwortet es nicht, sagt der Assistent das in einem festen Satz, auch auf Lautsprecher, Uhr und iPhone.
|
||||
- **Qualitätstest**: Nach jedem Update (wenn die Funktionsprüfung klappt) und auf Knopfdruck (*Zustand → Prüfen → Qualitätstest → Jetzt prüfen*) stellt das Panel dem echten Sprachmodell 20 feste Fragen, die meisten auch in zwei anderen Formulierungen, mit vorbereiteten Werkzeug-Ergebnissen (Termine, Mails, Erinnerungen, Suche, Gedächtnis) und prüft, ob es das richtige Werkzeug nimmt und was nach der Antwort-Prüfung zu hören ist. Ein Fehlschlag läuft einmal neu (dann „erst im zweiten Versuch“); der Verlauf der letzten 20 Läufe (`quality-history.json`) markiert Fragen als „neu kaputt“ oder „wackelt“. Neu kaputte Fragen stehen eine Woche lang als Hinweis oben auf jeder Admin-Seite. Echte Daten werden dabei weder gelesen noch geändert. Während der Test läuft, zeigt ein Balken, bei welcher Frage er ist und wie lange es ungefähr noch dauert. Danach stehen nur Fragen mit Befund offen (Fehlschlag, erst im zweiten Versuch, Antwort-Prüfung hat etwas zurückgehalten), je eine Zeile mit Grund; die Antwort öffnet sich beim Antippen. Alle übrigen Fragen liegen zugeklappt darunter.
|
||||
- **Mischbetrieb** (seit V01.1.525, Dominik 2026-11-18 „1a 2a 3a“, Plan `alzeo-mischbetrieb`): Der DGX Spark rechnet für ein anderes Projekt (Alzeo, sein Qwen-Projekt), und der Assistent läuft trotzdem weiter. `sudo speech-spark mischbetrieb an` (fragt vorher) schaltet das eigene Sprachmodell (mit Bildverständnis, Hilfsmodell, Einbetten und Nachsortieren), Bilder, Musik, VoiceDesign und die Stimmen-Engine ab, stoppt und deaktiviert ihre festen Units (`mischbetrieb.EINHEITEN`) und stellt Hören und Sprechen auf die kleinen Modelle (`mischbetrieb.KLEIN`: Qwen3-ASR 0.6B und Qwen3-TTS 0.6B Base, zusammen etwa 7 GiB; nie auf ein größeres). Vorher merkt es sich in `state/mischbetrieb.json` (0600) genau die Werte, die es ändert, und die Modelle von Hören und Sprechen; `sudo speech-spark mischbetrieb aus` stellt genau diese wieder her, danach startet `sudo speech-spark update` das eigene Sprachmodell, Bilder und Musik wieder. Solange es an ist, startet `engine.sh` keine der gesperrten Rollen (auch nicht nach einem Update, einem Neustart oder einem Wunsch der Konsole), und `modelle.wechsel_pruefen` sowie jede Messung lehnen mit dem festen Wort „mischbetrieb“ ab. Root führt nur aus, was das Python-Modul aus festen Listen nennt (Units mit festem Namen, `modelle wechseln asr|tts <Katalog-Id>`). Der Wärter meldet „mischbetrieb“ im Status; das Panel auf dem Pi liest es (`steuer.mischbetrieb`): Fragen beantwortet ein fremder Modell-Dienst („Für alle“, oder „Ersatz“, der jetzt auch im Mischbetrieb einspringt), sonst kommt sofort ein fester Satz (`wartung.MISCHBETRIEB`), Hintergrundarbeit wartet, der Dienst-Wächter zählt keinen Ausfall des Sprachmodells, und die Live-Übersicht zeigt beim Modell-Rechner „Mischbetrieb: nur Hören und Sprechen“. Bilder und Musik verschwinden von selbst, weil ihre Einrichtung fehlt (`features.READY`). Seitdem hält auch keine Wartungspause und kein Notbetrieb mehr die Fragen an, solange ein fremder Dienst antwortet (`wartung.paused`). Logzeilen: `modelle: mischbetrieb …`.
|
||||
- **Speicher-Wache** (Plan-Schritt M3): Die Engines des anderen Projekts brauchen beim Start 25-40 GB mehr Speicher, als sie anmelden, und auf dem gemeinsamen Speicher des DGX Spark friert ein voller Rechner ein. Darum schaut der Wärter im Mischbetrieb alle 5 Sekunden nach (`mischbetrieb.wache`): startet gerade eine Unit des anderen Projekts (`mischbetrieb.FREMD_EINHEITEN`, nur ihre Namen, nie sein Code; „activating“ oder seit weniger als 15 Minuten aktiv) oder sind weniger als 6 GiB frei, stoppt er die Engines von Hören und Sprechen und gibt ihren Speicher frei. Das Panel hört dann mit Parakeet auf dem Pi (Notbetrieb-Hören) und zeigt Antworten als Text, die Live-Übersicht sagt „Mischbetrieb: Hören und Sprechen pausieren, das andere Projekt startet“. Erst wenn 6 Blicke in Folge nichts startet und mindestens 18 GiB frei sind, startet er sie wieder, und nur die, die er selbst gestoppt hat. Ist der freie Speicher unbekannt, bleiben sie aus. `mischbetrieb aus` startet sie immer wieder. Logzeilen: `modelle: mischbetrieb wache freigeben|zurueck ok|fehler N gib frei`.
|
||||
- **Speicher-Wache** (Plan-Schritt M3): Die Engines des anderen Projekts brauchen beim Start 25-40 GB mehr Speicher, als sie anmelden, und auf dem gemeinsamen Speicher des DGX Spark friert ein voller Rechner ein. Darum schaut der Wärter im Mischbetrieb alle 5 Sekunden nach (`mischbetrieb.wache`): startet gerade eine Unit des anderen Projekts (`mischbetrieb.FREMD_EINHEITEN`, nur ihre Namen, nie sein Code; „activating“ oder seit weniger als 15 Minuten aktiv) oder sind weniger als 6 GiB frei, stoppt er die Engines von Hören und Sprechen und gibt ihren Speicher frei. Das Panel hört dann mit Parakeet auf dem Pi (Notbetrieb-Hören) und zeigt Antworten als Text oder spricht sie mit der Pi-Stimme (Funktionen → Pi-Stimme), die Live-Übersicht sagt „Mischbetrieb: Hören und Sprechen pausieren, das andere Projekt startet“. Erst wenn 6 Blicke in Folge nichts startet und mindestens 18 GiB frei sind, startet er sie wieder, und nur die, die er selbst gestoppt hat. Ist der freie Speicher unbekannt, bleiben sie aus. `mischbetrieb aus` startet sie immer wieder. Logzeilen: `modelle: mischbetrieb wache freigeben|zurueck ok|fehler N gib frei`.
|
||||
- **GPU-Taktgrenze** (seit V01.1.416, Dominik 2026-11-13, Idee aus alzeo v1.47.0): *Einstellungen → Spark → Betrieb → GPU-Taktgrenze* setzt eine Obergrenze für den Takt der GPU auf dem Modell-Rechner: *Aus* (Standard, der Takt, den NVIDIA vorgibt), 2400, 2200 oder 2000 MHz. Gemessen von alzeo an einem GB10 mit einem Sprachmodell bei 4 Anfragen: 2400 MHz gleich schnell bei etwa 11 W weniger an der GPU, 2000 MHz 2,4 % weniger Tokens pro Sekunde bei halber Leistung der GPU und etwa 8 °C weniger; Bilder brauchen bei 2000 MHz etwa 8 % länger. Nur root darf den Takt setzen, und root nimmt dafür kein Wort vom Panel: die feste Unit `speech-spark-gpu-takt` liest die eine Einstellung `watch.gpu_takt` selbst und kennt nur diese vier Werte (`nvidia-smi -lgc 0,<MHz>` oder `nvidia-smi -rgc`, jeder andere Wert setzt keine Grenze). Die Unit läuft bei jedem Start des Modell-Rechners (eine Grenze übersteht keinen Neustart), nach jedem Update und sobald sich die Einstellung ändert: beim Speichern im Panel auf demselben Rechner, mit getrennten Rechnern über den Wärter, nachdem er die Sprach-Einstellungen übernommen hat. Das Panel darf per sudo nur genau diesen Start. Was root gesetzt hat, steht als ein Wort in `/run/speech-spark-gpu-takt/stand` und erscheint unter *Zustand → Überblick* bei der GPU („höchstens 2400 MHz“) und auf der Seite Betrieb mit Takt, Leistung und Temperatur; Logzeilen beginnen mit `gputakt:`. Auf der Kommandozeile: `speech-spark gputakt [status]` und `sudo speech-spark gputakt setzen`. Grenze: Hält kein Programm die GPU (Persistenzmodus aus), kann der Treiber die Grenze verlieren; auf tars hält das Sprachmodell die GPU ständig.
|
||||
- **Speicherwarnung**: Fällt der freie Speicher unter *Einstellungen → Betrieb → Warnen unter* (Standard 10 GiB), zeigt das Panel oben auf jeder Admin-Seite eine Warnung; DGX OS beendet ab etwa 8 GiB Prozesse.
|
||||
- **Hinweise oben auf den Admin-Seiten** (seit V01.0.707, ruhig seit V01.1.475, Dominik 2026-11-15 „meldungen oben sind zu arg und nehmen viel zu viel platz ein“): über der Seite steht keine Zeile mehr, nur ein kleines Zeichen „● N Hinweise“ oben rechts neben dem Käfer; der Punkt ist rot, sobald ein roter Hinweis dabei ist (z. B. ein Dienst fällt aus), sonst orange. Ein Tipp legt die Hinweise als Blase unter das Zeichen, die Seite rückt nicht; je Hinweis eine Zeile mit *Ansehen* (Sprung zur Stelle, schließt die Blase), rote zuerst. Ein Tipp daneben, Esc oder ein zweiter Tipp auf das Zeichen schließt sie. Dienste, die am selben Gerät hängen, stehen als eine Zeile da: fallen NAS-Sicherung, Wissensordner, Ablage-Ordner und Zustand der NAS zusammen aus, heißt es „Die NAS antwortet seit … nicht. Betroffen: …“ (andere Dienste, wenn ihre Adressen denselben Rechner nennen: „Ein Server …“). „Hinweise ansehen“ unter Zustand öffnet die Blase. In der App-Ansicht (Android, Seiten mit Leiste oben) steht das Zeichen „● N“ in der Leiste neben dem Käfer. Die iPhone-App zeigt unter *Spark verwalten → Monitoring → Braucht dich* eine zugeklappte Zeile „N Hinweise“ mit rotem oder orangem Punkt (das iPhone merkt sich, ob sie offen ist).
|
||||
@@ -443,6 +443,7 @@ Ab V01.0.386. Etwas klappt nicht? Jedes Profil beschreibt es kurz unter Ich →
|
||||
- B4c (seit V01.0.612): Welches Modell läuft, bestimmt der Modell-Rechner (`common.MODEL_CHOICE`: Modelle von Spracherkennung und Sprachausgabe, Bilder, eigenes Sprachmodell). Er meldet es im Status, das Panel übernimmt es geprüft (`common.model_choice_take`: nur diese Schlüssel, gleiche Art, Sprachmodelle nur von Qwen, kurze Namen ohne `..`) und ändert es nie selbst. Zustand → Modelle zeigt dann Katalog, Speicher, Messung und eigene Modelle des Modell-Rechners (`modelle`); Wechseln, Zurückholen und eigene Modelle gehen an den Wärter (`wechseln`, `eigen_dazu`, `eigen_weg`), der dieselben festen Regeln mit seinen eigenen Zahlen noch einmal prüft und dort `speech-spark-wechsel` startet. Der Schalter Funktionen → Modelle wechseln bleibt im Panel. Eine Wartungspause des Modell-Rechners (dort `sudo speech-spark pause`, `modelle messen`, ein Wechsel; ohne den Panel-Schalter, der im Panel entscheidet) pausiert dieselben Teile im Panel, solange ihre Zeit läuft. Weil auf dem Modell-Rechner kein Panel nach Ablauf prüft, endet sie dort mit ihrer Zeit (seit V01.0.640): der Wärter löscht eine abgelaufene Pause (`waerter: pause abgelaufen`), `speech-spark pause status` ebenso; vorher blieb eine Pause aus einem abgebrochenen `modelle messen` stehen, und `modelle llm uebernehmen` setzte dann keine eigene und beendete keine. Speicheranzeige und Speicherwarnung zeigen den Speicher des Modell-Rechners aus seinem letzten Status (`mem_avail_gib`, `mem_total_gib`; seit V01.0.642, `monitor.system_stats`), nie den des Panel-Rechners; ohne Status steht dort keine Zahl. Ebenso rechnet Zustand → Dienste den Speicher, den eine Engine reserviert, aus dem Speicher des Modell-Rechners (seit V01.0.680; vorher „geschätzt ~2.2 GiB“ aus den 8 GB des Pi, während die Sprachausgabe ~11.8 GiB belegte). Zustand → Prüfen → Leistung messen (`bench.py`, seit V01.0.674) misst bei getrennten Rechnern auf denselben Wegen wie das Panel: Sprachausgabe und Spracherkennung über `common.model_url` (TLS-Tor mit gepinntem Zertifikat), das Sprachmodell über `llm.py` (eigenes LLM-Tor: erstes Wort, Token/s einzeln und gleichzeitig), Speicher und GPU-Name aus dem Wärter-Status. Fehlt ein Teil, heißt das Ergebnis „Nicht gemessen: …“, nie „Alles flüssig“. Vorher meldete das Panel auf dem Raspberry Pi „Nur noch 7.0 GiB frei“ mit dessen eigenen 8 GB. Das Panel liest sie nur aus dem letzten Status (höchstens eine Minute alt, die Pausen-Runde holt ihn alle 15 Sekunden), eine Frage wartet also nie auf den Modell-Rechner; „Weiter“ beendet beide (`weiter`). Die Automatik sieht die Modell-Einheiten über den Wärter-Status. Zustand → Live zeigt den Kasten „Modell-Rechner“ mit erreichbar, aktiven Diensten, Version und Pause, nie eine Adresse. Seit V01.0.644 auch „Leistung messen“ (`bench.memory_snapshot`): „Frei auf dem Spark“ ist der freie Speicher des Modell-Rechners aus dem Status des Wärters. Für die Lautsprecher-Adresse des Panel-Rechners selbst (http://<Pi-IP>:31080) sagt „Adresse prüfen“, dass der Spark sich über sie nicht prüft; ob der Lautsprecher sie erreicht, zeigt sein eigenes „Prüfen“. Seit V01.0.645 nimmt auch der Melder „Speicher knapp“ unter Verbessern den Speicher des Modell-Rechners; ein Fehler beim Nachsehen schreibt `berater: jetzt` bzw. `berater: loop` mit Art, Datei, Funktion und Zeile (`common.fehler_stelle`, wie `teilen: umzug abgelehnt`), nie den Text. Seit V01.0.662: Die Ursache war eine Absicht der Weiche ohne eigene Gruppe in `befund.expected` (KeyError); sie fügt jetzt kein Werkzeug hinzu, und auch das Laden der Seite schreibt bei einem Fehler `berater: seite` mit der Stelle. Das Vektormodell der Dokumentensuche braucht auf einem Panel-Rechner nur `docembed.MIN_FREE_PANEL_GIB` freien Speicher statt der 8,5 GiB neben den Modellen, und nach zu wenig Speicher versucht es der Pi erst nach 10 Minuten wieder (vorher alle 20 Sekunden `wissen: no vectors`).
|
||||
- B5 (seit V01.0.614): Update auf zwei Rechnern. Das Update des Panel-Rechners (Knopf, nachts oder `sudo speech-spark update`) startet zuerst über den Wärter das eigene Update des Modell-Rechners (`update`) und wartet höchstens 40 Minuten darauf (`speech-spark teilen modelle-update`, `steuer.update_modell_rechner`). Der Modell-Rechner nimmt dabei nach seinen eigenen Regeln die neueste Version mit bestandenen GitHub-Tests, nie eine Version, die das Panel nennt; antwortet er nicht, geht das Update des Panel-Rechners trotzdem weiter. Einstellungen → Update zeigt die Version des Modell-Rechners daneben; zwei verschiedene Versionen sind nur ein Hinweis, denn zwischen Panel und Modellen liegt nur die API. Notbetrieb: Antwortet der Modell-Rechner 30 Sekunden lang nicht (aus, Neustart), gelten alle Teile als pausiert: Fragen bekommen sofort den festen Satz „Der Spark macht gerade Pause.“, Lautsprecher spielen ihn aus einer vorher gemachten Datei, Hintergrundarbeit wartet; der Dienst-Wächter meldet den Ausfall trotzdem. Chats, Anrufe, Erinnerungen, Durchsagen und Logs laufen weiter. Das Panel fragt dafür nie im Fragepfad, nur die Pausen-Runde alle 15 Sekunden (`steuer.weg`, Log `steuer: notbetrieb an|aus`).
|
||||
- B5c (seit V01.0.620): Notbetrieb mit Parakeet (Funktionen → Notbetrieb mit Parakeet, `chat.notbetrieb_asr`, ab Werk aus). Nur auf dem Panel-Rechner läuft `speech-spark-notasr`: dasselbe Spracherkennungs-Vorderteil (`asr_proxy.py` mit `SPEECH_SPARK_NOTASR=1`) mit Parakeet auf dem Prozessor, nur auf 127.0.0.1:31009, mit API-Schlüssel und Größenlimit wie sonst; das Modell (~640 MB) holt `install.sh --mode panel` vorher, danach läuft der Dienst offline (`HF_HUB_OFFLINE=1`). Er lädt Parakeet erst bei der ersten Aufnahme und gibt den Speicher nach 10 Minuten ohne Aufnahme zurück. Ist der Schalter an und der Modell-Rechner weg (`steuer.weg`), schickt `common.model_url` die Aufnahmen dorthin (`notbetrieb.hoert`), und `wartung.paused("asr")` ist nicht mehr wahr; Sprachmodell und Sprachausgabe bleiben pausiert. Feste Befehle nach festen Regeln, ohne Modell (`notbetrieb.antwort`): Schalten über Home Assistant auf dem eigenen Weg des Panels („Erledigt.“, „Das hat nicht geklappt.“, „Home Assistant ist gerade nicht erreichbar.“, nie der Text von Home Assistant), die Uhrzeit, die eigenen Erinnerungen (Anzahl zum Hören, Liste nur als Text). Alles andere bekommt weiter den festen Satz. Lautsprecher und Home Assistant hören die Antworten aus Dateien in `notbetrieb-saetze/`, die die Pausen-Runde macht, solange der Modell-Rechner da ist (höchstens 40 je Runde, wöchentlich neu): ganze Sätze und Bausteine für Uhrzeit und Anzahl, nie ein Name oder ein Text eines Profils (`notbetrieb.ton`). Log `notbetrieb: befehl ok|nicht_ok|fehlgeschlagen`, `uhrzeit`, `erinnerungen N`, `fester satz`, `satzdateien erneuert N|fehlgeschlagen`; Live-Kasten „Modell-Rechner“ zeigt, ob Parakeet hört, die Zahl der Befehle und festen Sätze und wie viele Dateien fertig sind. Selbsttest `test_notbetrieb`.
|
||||
- Pi-Stimme (seit V01.1.527, Plan alzeo-mischbetrieb Schritt 4, Dominik 2026-11-18 „Piper als eigenes Programm“): Funktionen → Pi-Stimme (`chat.notbetrieb_tts`, ab Werk aus). Nur auf dem Panel-Rechner läuft `speech-spark-nottts` (`app/pistimme.py`): die Piper-Stimme Thorsten (CC0, aus der englischen Stimme „lessac“ weitertrainiert) mit sherpa-onnx aus der Sperrdatei des Panels (Apache-2.0, schon für Parakeet da) auf dem Prozessor, nur auf 127.0.0.1:31022, mit API-Schlüssel und Größenlimit, 2 Threads, `MemoryMax=1G`, `CPUQuota` wie das Panel. Das Paket des sherpa-onnx-Projekts (~64 MB) holt `install.sh --mode panel` einmal (`pistimme.py laden`), prüft es gegen die feste SHA-256 (`pistimme.SHA256`) und packt nur einfache Dateien und Ordner unter seinem eigenen Ordner aus (nie einen Link, nie einen Weg nach draußen); es liegt in `state/pistimme/`. Die Stimme lädt beim ersten Satz und gibt den Speicher nach 10 Minuten ohne Satz zurück. Ist der Schalter an und die Sprachausgabe des Modell-Rechners weg (`steuer.weg`) oder von der Speicher-Wache freigegeben (`steuer.stimme_frei`), schickt `common.model_url` die Sprachausgabe dorthin (`notbetrieb.spricht`), und `wartung.paused("tts")` ist nicht mehr wahr. Sie spricht denselben kleinen Teil der Sprach-API (`/v1/audio/speech` mit `pcm` oder `wav`, 24 kHz, `stream` als `speech.audio.delta` Satz für Satz), reinigt den Text wie die Hauptstimme (`textnorm`), kennt nur diese eine deutsche Stimme und lehnt `mp3` ab. Ihr Ton wird nie zur Datei einer anderen Stimme: `ack.record_missing` fragt sie nicht, und die Lautsprecher-Sätze (`wartung.clips_tick`) entstehen in dieser Zeit nicht. Log `notbetrieb: pistimme geladen|entladen|gesprochen N saetze|abgelehnt <wort>|fehlt|fehler|laden ok|laden fehler`; der Live-Kasten „Modell-Rechner“ zeigt „Pi-Stimme spricht|bereit|fehlt“. Selbsttest `test_pistimme`.
|
||||
- B7a (seit V01.0.647): Gehäuse des Panel-Rechners (Funktionen → Gehäuse, `chat.gehaeuse`, ab Werk aus, nur Admin, nur geteilt; `gehaeuse.py`). Display und LEDs schreibt das Panel selbst über `/dev/i2c-1` und `/dev/spidev0.0` (Gruppen `i2c`, `spi`), nur feste Wörter und Zahlen, nie Inhalte, Namen oder Adressen. Einrichten, Entfernen und Neustart gehen nur über einen Wunsch (`state/gehaeuse-wunsch.json`, 5 Minuten gültig, Admin-Code) an die feste root-Einheit `speech-spark-gehaeuse` (sudoers: nur `systemctl start --no-block speech-spark-gehaeuse`); sie nimmt den Wunsch über `gehaeuse.py wunsch-nehmen` (höchstens zwei Zahlen), prüft die Grenzen noch einmal und schreibt den markierten Block in `config.txt` selbst; neu starten nur, solange `/run/speech-spark-gehaeuse-neustart` eine Änderung meldet. Logs `gehaeuse: …`, Live-Kasten „Gehäuse“, Dienst-Wächter meldet ein fehlendes Display. Anleitung: [Spark teilen](spark-teilen.md).
|
||||
- B7b (seit V01.0.662): elf Seiten des Displays mit Vorschau unter Funktionen → Gehäuse (`gehaeuse.vorschau`, `GET /api/admin/gehaeuse/vorschau`, nur Admin, Rate-Limit `gehaeuse`): jede Seite als 128×64-Bild, an oder aus per Antippen (`chat.gehaeuse_seiten_aus`), Reihenfolge per Ziehen (`chat.gehaeuse_reihenfolge`); dieselben festen Wörter und Zahlen wie am Display, nie Namen oder Inhalte. Schutz vor Einbrennen: Versatz alle 3 Minuten, nach 10 Minuten gleichem Bild höchstens 10 % Helligkeit.
|
||||
- Aktiv 10 min (seit V01.0.724, Dominik 2026-10-17 „1b 2a 3a“): `aktiv.py` zählt, wer in den letzten 10 Minuten eine Anfrage gestellt hat. `tracelog.start` meldet jede Anfrage vor seinen Schaltern (`aktiv.sah`), also auch bei ausgeschalteten Logs und Live; ein Profil zählt einmal (der Admin ohne Profil als eins), ein Gast je Gerät (Name des Geräteschlüssels, sonst die Absender-Adresse, nur als gekürzter HMAC-SHA-256 mit bei jedem Start neuem Schlüssel im Arbeitsspeicher); was der Spark von selbst tut (`auto`), zählt nie. Höchstens 2000 Einträge, nichts auf der Platte, nie ein Name. Gezeigt als Zahl: OLED-Seite „Aktiv 10 min“ (große Zahl, daneben Profile und Gäste; in der Wechsel-Reihe, an oder aus und verschiebbar wie die anderen), Zustand → Überblick „Heute“ (`admin.glance` `aktiv`), Zustand → Live (Kennzahl oben, `live.snapshot` `aktiv`), Steuerzentrale (zweite Kopfzeile) und Zustand der iPhone-App. Selbsttests `test_aktiv`, `test_gehaeuse`, `test_steuerzentrale`.
|
||||
|
||||
@@ -112,6 +112,7 @@ flowchart TB
|
||||
| `speech-spark-tlstor` | the same ports with TLS | TLS-Tor of the model computer (only with the Spark split), plus `speech-spark-teilen-fw` and `speech-spark-clients-fw` (firewall anew for Spark clients) |
|
||||
| `speech-spark-konsole` | HTTPS 31010 | Spark-Konsole: the model computer's own web page (four areas: overview with model in detail, models, connections with clients and pair an assistant, maintenance with updates and logs), only from `konsole.netze`, only with `speech-spark konsole an`; with `speech-spark-koppelcode` (root shows a pairing code at a click, only with the door); on the panel computer `speech-spark-koppeln` (root pairs with name and code from Einstellungen → Spark) |
|
||||
| `speech-spark-notasr` | 127.0.0.1:31009 | Emergency mode with Parakeet on the panel computer while the model computer is gone |
|
||||
| `speech-spark-nottts` | 127.0.0.1:31022 | Pi voice on the panel computer when the model computer's speech output is gone or given away in Mischbetrieb |
|
||||
| `speech-spark-watch` | – | Watchdog, only without the panel |
|
||||
| `speech-spark-update` | – | Update, only on request |
|
||||
| `speech-spark-wechsel` | – | Switch one model (Status → Models), only on request |
|
||||
@@ -636,6 +637,7 @@ Panel on its own computer, models on the DGX: pairing, TLS-Tor, Wärter and the
|
||||
| `app/panel/gehaeuse.py` | Gehäuse. |
|
||||
| `app/panel/geraetebild.py` | Geräte-Bild: a picture of each computer on its card. |
|
||||
| `app/panel/notbetrieb.py` | Notbetrieb mit Parakeet. |
|
||||
| `app/pistimme.py` | Pi-Stimme: when the panel runs on a computer of its own and the model computer's speech output is gone (Notbetrieb) or given away by its Speicher-Wache (Misc … |
|
||||
| `app/panel/rechenteile.py` | Status → Summary → Computers, „Wer rechnet gerade“: which part inside the panel takes the CPU, next to the services of both computers (rechner.dienste_cpu). |
|
||||
| `app/rechner.py` | The values of one computer for Status → Summary → Computers: CPU, memory, disk, network, temperature, fan, power flags, running time, device and system name, … |
|
||||
| `app/panel/rechnerblick.py` | Status → Summary → Computers: when the panel and the models run on two computers (Spark teilen), both side by side: a tile each on top and a card each under … |
|
||||
@@ -912,6 +914,7 @@ All files belong to the user `speech` (folders 0700, files 0600) and are written
|
||||
| `state/openwebui.json` | Open WebUI: ids of key and MCP connection per profile | – | yes |
|
||||
| `state/panel-password` | Admin password (hash) | hash | yes |
|
||||
| `state/personen-vorrang.json` | Priority per profile | – | yes |
|
||||
| `state/pistimme` | Pi voice: the Piper voice Thorsten (sherpa-onnx package, checked against its pinned checksum) | – | no |
|
||||
| `state/praxistest-stand.json` | Hands-on test: per point the mark (works, problem, later) and the time | – | yes |
|
||||
| `state/quality-cases.json` | Own test questions | – | yes |
|
||||
| `state/quality-helfer.json` | Last comparison of helper model and language model | – | no |
|
||||
@@ -3982,7 +3985,7 @@ flowchart TD
|
||||
4. <a id="kn-state-s4"></a>**Seal**: vault.seal turns the value into „enc1:“ and a Fernet token (encrypted and protected against change). A value already sealed stays as it is.
|
||||
5. <a id="kn-state-s5"></a>**Write atomically**: common.write_json writes into a fresh temporary file next to it, never through a link, gives it the rights of the old file (a new one is readable for the service only) and then swaps it in one step. A crash in the middle leaves the old file whole.
|
||||
6. <a id="kn-state-s6"></a>**Read**: A sealed value is opened with the key. If the key does not fit (backup from another Spark), an empty value comes back and the account has to be entered again. Older unsealed values are read and sealed the next time they are saved.
|
||||
7. <a id="kn-state-s7"></a>**Goes into the backup?**: Every file in state/ has exactly one line in the file register dateien.py: with its kind it goes into every backup (dateien.STATE_FILES, 52), otherwise the line gives its reason (dateien.STATE_LOCAL, 130). backup.py takes both lists from there. test_technik finds every name the code writes there and wants its line.
|
||||
7. <a id="kn-state-s7"></a>**Goes into the backup?**: Every file in state/ has exactly one line in the file register dateien.py: with its kind it goes into every backup (dateien.STATE_FILES, 52), otherwise the line gives its reason (dateien.STATE_LOCAL, 131). backup.py takes both lists from there. test_technik finds every name the code writes there and wants its line.
|
||||
8. <a id="kn-state-s8"></a>**Move backup?**: secret.key is in no ordinary backup. Only a move backup carries it, sealed with a password of the admin (scrypt and Fernet, move-keys.json). The Spark's login keys are in no backup.
|
||||
9. <a id="kn-state-s9"></a>**Fine when restoring?**: _check_state checks every file of the backup: at most 8 MB, valid JSON, the push key a real EC key. An admin second step whose secret cannot be opened here is not taken; the current one stays.
|
||||
10. <a id="kn-state-s10"></a>**Put in place with a way back**: _swap writes each file through a temporary file (never through a link) and keeps the old content. If a step fails, everything swapped comes back.
|
||||
@@ -3993,7 +3996,7 @@ flowchart TD
|
||||
#### Numbers (from the code)
|
||||
|
||||
- **52** files in every backup ([step 7](#kn-state-s7))
|
||||
- **130** files and folders that stay out with a reason ([step 7](#kn-state-s7))
|
||||
- **131** files and folders that stay out with a reason ([step 7](#kn-state-s7))
|
||||
- **8 MB** largest file when restoring ([step 9](#kn-state-s9))
|
||||
- **12** characters the move password has at least ([step 8](#kn-state-s8))
|
||||
|
||||
|
||||
@@ -1877,6 +1877,8 @@ Every function of the Spark with its switch, what it builds on, where you set it
|
||||
|
||||
- **Emergency mode with Parakeet** (Features → Access → "Emergency mode with Parakeet"): When the panel runs on a computer of its own (Spark split) and the DGX is gone, the Spark otherwise answers every question with "The Spark is taking a break right now." With this switch the panel computer hears by itself: Parakeet recogn …
|
||||
|
||||
- **Pi voice** (Features → Access → "Pi voice"): When the panel runs on a computer of its own (Spark split) and the DGX does not speak right now, because it is gone (emergency mode) or gave its voice away in Mischbetrieb so another project can start, browser and apps otherwise show the …
|
||||
|
||||
- **Case** (Features → Access → "Case"): If the panel computer sits in a SunFounder Pironman 5, the Spark drives its parts itself, without SunFounder's software: the small display shows the admin status and numbers in turn (Spark, services and maintenance, Pi, DGX gone or pause …
|
||||
|
||||
- **System updates** (Features → Access → "System updates"): A card under Status → Summary and the page Status → System updates show for each computer (the Pi with the panel, with Spark split also tars with the models): how many operating system updates wait, how many of them for security, and eac …
|
||||
|
||||
@@ -377,7 +377,7 @@ Since V01.0.386. Something does not work? Every profile describes it briefly und
|
||||
- **Language model gone**: when the language model cannot be reached or does not answer, the assistant says so in a fixed sentence, also on speakers, the watch and the iPhone.
|
||||
- **Quality test**: after every update (when the live check passed) and on request (*Status → Checks → Qualitätstest → Jetzt prüfen*) the panel asks the real language model 20 fixed questions, most also in two other wordings, with prepared tool results (appointments, mail, reminders, search, memory) and checks that it picks the right tool and what is heard after the answer check. A failure runs once more (then "only on the second try"); the history of the last 20 runs (`quality-history.json`) marks questions as "newly broken" or "wobbles". Newly broken questions show as a note on top of every admin page for a week. No real data is read or changed. While the test runs, a bar shows which question it is on and roughly how long it still takes. Afterwards only questions with a finding stay open (failed, only on the second try, answer check held something back), one line each with the reason; the answer opens on tap. All other questions are folded below.
|
||||
- **Mischbetrieb** (since V01.1.525, Dominik 2026-11-18 "1a 2a 3a", plan `alzeo-mischbetrieb`): the DGX Spark works for another project (Alzeo, his Qwen project), and the assistant still goes on. `sudo speech-spark mischbetrieb an` (asks first) switches off the own language model (with image understanding, helper model, embeddings and reranking), pictures, music, VoiceDesign and the voice engine, stops and disables their fixed units (`mischbetrieb.EINHEITEN`) and puts Hören and Sprechen on the small models (`mischbetrieb.KLEIN`: Qwen3-ASR 0.6B and Qwen3-TTS 0.6B Base, about 7 GiB together; never to a bigger one). First it keeps exactly the values it changes and the models of Hören and Sprechen in `state/mischbetrieb.json` (0600); `sudo speech-spark mischbetrieb aus` restores exactly these, then `sudo speech-spark update` starts the own language model, pictures and music again. While it is on, `engine.sh` starts none of the blocked roles (not after an update, a restart or a wish of the console either), and `modelle.wechsel_pruefen` and every measurement refuse with the fixed word "mischbetrieb". Root runs only what the Python module names from fixed lists (units with fixed names, `modelle wechseln asr|tts <catalog id>`). The Wärter reports "mischbetrieb" in its status; the panel on the Pi reads it (`steuer.mischbetrieb`): a foreign model service answers questions ("For everyone", or "Fallback", which now also steps in during Mischbetrieb), else a fixed sentence comes at once (`wartung.MISCHBETRIEB`), background work waits, the service watch counts no outage of the language model, and the Live view shows "Mischbetrieb: nur Hören und Sprechen" at the model computer. Pictures and music disappear by themselves because their setup is missing (`features.READY`). Since then no maintenance pause and no Notbetrieb hold the questions any more while a foreign service answers (`wartung.paused`). Log lines: `modelle: mischbetrieb …`.
|
||||
- **Memory guard** (plan step M3): the other project's engines need 25-40 GB more memory while they start than they announce, and on the DGX Spark's unified memory a full computer freezes. So in Mischbetrieb the Wärter looks every 5 seconds (`mischbetrieb.wache`): while a unit of the other project starts (`mischbetrieb.FREMD_EINHEITEN`, only their names, never its code; "activating" or active for less than 15 minutes) or less than 6 GiB are free, it stops the engines of Hören and Sprechen and gives their memory back. The panel then hears with Parakeet on the Pi (Notbetrieb hearing) and shows answers as text, the Live view says "Mischbetrieb: Hören und Sprechen pausieren, das andere Projekt startet". Only when nothing starts for 6 looks in a row and at least 18 GiB are free does it start them again, and only those it stopped itself. When the free memory is unknown they stay off. `mischbetrieb aus` always starts them again. Log lines: `modelle: mischbetrieb wache freigeben|zurueck ok|fehler N gib frei`.
|
||||
- **Memory guard** (plan step M3): the other project's engines need 25-40 GB more memory while they start than they announce, and on the DGX Spark's unified memory a full computer freezes. So in Mischbetrieb the Wärter looks every 5 seconds (`mischbetrieb.wache`): while a unit of the other project starts (`mischbetrieb.FREMD_EINHEITEN`, only their names, never its code; "activating" or active for less than 15 minutes) or less than 6 GiB are free, it stops the engines of Hören and Sprechen and gives their memory back. The panel then hears with Parakeet on the Pi (Notbetrieb hearing) and shows answers as text or speaks them with the Pi voice (Features → Pi voice), the Live view says "Mischbetrieb: Hören und Sprechen pausieren, das andere Projekt startet". Only when nothing starts for 6 looks in a row and at least 18 GiB are free does it start them again, and only those it stopped itself. When the free memory is unknown they stay off. `mischbetrieb aus` always starts them again. Log lines: `modelle: mischbetrieb wache freigeben|zurueck ok|fehler N gib frei`.
|
||||
- **GPU clock cap** (since V01.1.416, Dominik 2026-11-13, idea from alzeo v1.47.0): *Settings → Spark → Operation → GPU clock cap* sets a ceiling on the GPU clock of the model computer: *Off* (default, the clock NVIDIA sets), 2400, 2200 or 2000 MHz. Measured by alzeo on a GB10 with a language model at 4 requests: 2400 MHz just as fast for about 11 W less on the GPU, 2000 MHz 2.4 % fewer tokens per second for half the GPU's power and about 8 °C less; pictures take about 8 % longer at 2000 MHz. Only root may set the clock, and root takes no word from the panel for it: the fixed unit `speech-spark-gpu-takt` reads the one setting `watch.gpu_takt` itself and knows only these four values (`nvidia-smi -lgc 0,<MHz>` or `nvidia-smi -rgc`, any other value sets no cap). The unit runs at every start of the model computer (a cap does not survive a restart), after every update and as soon as the setting changes: on saving in the panel on the same computer, with the computers apart through the Wärter after it took the speech settings. Through sudo the panel may only start exactly this unit. What root set is one word in `/run/speech-spark-gpu-takt/stand` and appears under *Status → Summary* at the GPU ("at most 2400 MHz") and on the Operation page with clock, power and temperature; log lines start with `gputakt:`. On the command line: `speech-spark gputakt [status]` and `sudo speech-spark gputakt setzen`. Limit: when no program holds the GPU (persistence mode off), the driver may lose the cap; on tars the language model holds the GPU all the time.
|
||||
- **Memory warning**: when free memory drops below *Settings → Operation → Warn below* (default 10 GiB), every admin page shows a warning on top; DGX OS kills processes at about 8 GiB.
|
||||
- **Notes on top of the admin pages** (since V01.0.707, quiet since V01.1.475, Dominik 2026-11-15 "the notes on top are too loud and take far too much room"): no line above the page any more, only a small sign "● N notes" top right beside the bug; the dot is red as soon as a red note is among them (e.g. a service is gone), else orange. A tap lays the notes as a bubble under the sign, the page does not move; one line per note with *View* (jump to the place, closes the bubble), red ones first. A tap beside it, Esc or a second tap on the sign closes it. Services hanging on the same device stand as one line: if NAS backup, knowledge folders, filing folder and NAS status are gone together it reads "The NAS has not answered since … Affected: …" (other services when their addresses name the same computer: "A server …"). "View the notes" under Status opens the bubble. In the app view (Android, pages with the bar on top) the sign "● N" stands in the bar beside the bug. The iPhone app shows under *Manage the Spark → Monitoring → Needs you* one folded line "N notes" with a red or orange dot (the iPhone remembers whether it is open).
|
||||
@@ -443,6 +443,7 @@ Since V01.0.386. Something does not work? Every profile describes it briefly und
|
||||
- B4c (since V01.0.612): which model runs is the model computer's (`common.MODEL_CHOICE`: the speech recognition and speech output models, pictures, the own language model). It reports it in its status, the panel takes it over checked (`common.model_choice_take`: only these keys, same kind, speech models only from Qwen, short names without `..`) and never changes it itself. Status → Models then shows the model computer's catalog, memory, measurement and own models (`modelle`); switching, bringing back and own models go to the Wärter (`wechseln`, `eigen_dazu`, `eigen_weg`), which checks the same fixed rules again with its own numbers and starts `speech-spark-wechsel` there. The admin switch `chat.modelle_wechseln` stays in the panel. A Wartungspause of the model computer (there `sudo speech-spark pause`, `modelle messen`, a switch; without the panel's switch, which decides in the panel) pauses the same parts in the panel while its time runs. Because no panel checks on the model computer after the time, the pause ends there with its time (since V01.0.640): the Wärter deletes a pause whose time is over (`waerter: pause abgelaufen`), `speech-spark pause status` too; before, a pause left by an aborted `modelle messen` stayed, and `modelle llm uebernehmen` then neither set its own nor ended one. The memory display and the memory warning show the model computer's memory from its last status (`mem_avail_gib`, `mem_total_gib`; since V01.0.642, `monitor.system_stats`), never the panel computer's; without a status they show no number. Likewise Status → Services computes what an engine reserves from the model computer's memory (since V01.0.680; before, "estimated ~2.2 GiB" from the Pi's 8 GB while speech output held ~11.8 GiB). Status → Checks → Measure performance (`bench.py`, since V01.0.674) measures the ways the panel takes when the computers are split: speech output and recognition through `common.model_url` (TLS-Tor with the pinned certificate), the language model through `llm.py` (own LLM-Tor: first word, tokens/s alone and at once), memory and GPU name from the Wärter's status. When a part is missing the result says 'Nicht gemessen: …', never 'Alles flüssig'. Before, the panel on the Raspberry Pi said 'only 7.0 GiB free' with the Pi's own 8 GB. The panel reads it only from the last status (at most a minute old, the pause loop fetches it every 15 seconds), so a question never waits for the model computer; "Weiter" ends both (`weiter`). The automatic sees the model units through the Wärter's status. Status → Live shows the box "Model computer" with reachable, active services, version and pause, never an address. Since V01.0.644 "Leistung messen" too (`bench.memory_snapshot`): "Frei auf dem Spark" is the model computer's free memory from the Wärter's status. For the panel computer's own speaker address (http://<Pi-IP>:31080) "Adresse prüfen" says that the Spark does not check itself through it; the speaker's own "Prüfen" shows whether it gets through. Since V01.0.645 the detector "Speicher knapp" under Verbessern also takes the model computer's memory; a failure while looking writes `berater: jetzt` or `berater: loop` with kind, file, function and line (`common.fehler_stelle`, like `teilen: umzug abgelehnt`), never the text. Since V01.0.662: the cause was an intent of the Weiche without a group of its own in `befund.expected` (KeyError); it now adds no tool, and loading the page also writes `berater: seite` with the place on a failure. The vector model of the document search needs only `docembed.MIN_FREE_PANEL_GIB` free memory on a panel computer instead of the 8.5 GiB next to the models, and after too little memory the Pi tries again only after 10 minutes (before, `wissen: no vectors` every 20 seconds).
|
||||
- B5 (since V01.0.614): updating two computers. The panel computer's update (button, at night or `sudo speech-spark update`) first starts the model computer's own update through the Wärter (`update`) and waits for it at most 40 minutes (`speech-spark teilen modelle-update`, `steuer.update_modell_rechner`). The model computer takes the newest version with passed GitHub tests by its own rules, never a version the panel names; if it does not answer, the panel computer's update goes on anyway. Settings → Update shows the model computer's version next to it; two different versions are only a hint, because between panel and models there is only the API. Emergency mode (Notbetrieb): if the model computer does not answer for 30 seconds (off, restarting), every part counts as paused: questions get the fixed sentence "The Spark is taking a break right now." at once, speakers play it from a file made earlier, background work waits; the Dienst-Wächter still reports the outage. Chats, calls, reminders, announcements and logs keep running. The panel never asks on the question path for this, only the pause loop every 15 seconds (`steuer.weg`, log `steuer: notbetrieb an|aus`).
|
||||
- B5c (since V01.0.620): emergency mode with Parakeet (Features → Emergency mode with Parakeet, `chat.notbetrieb_asr`, off by default). Only on the panel computer `speech-spark-notasr` runs: the same speech recognition front end (`asr_proxy.py` with `SPEECH_SPARK_NOTASR=1`) with Parakeet on the CPU, only on 127.0.0.1:31009, with the API key and the size limit as usual; `install.sh --mode panel` fetches the model (~640 MB) beforehand, afterwards the service runs offline (`HF_HUB_OFFLINE=1`). It loads Parakeet only at the first recording and gives the memory back after 10 minutes without one. With the switch on and the model computer gone (`steuer.weg`), `common.model_url` sends the recordings there (`notbetrieb.hoert`) and `wartung.paused("asr")` is no longer true; language model and speech output stay paused. Fixed commands by fixed rules, without a model (`notbetrieb.antwort`): switching through Home Assistant on the panel's own path ("Done.", "That did not work.", "Home Assistant cannot be reached right now.", never Home Assistant's text), the time, the own reminders (the count to hear, the list only as text). Everything else still gets the fixed sentence. Speakers and Home Assistant hear the answers from files in `notbetrieb-saetze/` that the pause loop makes while the model computer is there (at most 40 per round, renewed weekly): whole sentences and building blocks for the time and the count, never a name or a text of a profile (`notbetrieb.ton`). Log `notbetrieb: befehl ok|nicht_ok|fehlgeschlagen`, `uhrzeit`, `erinnerungen N`, `fester satz`, `satzdateien erneuert N|fehlgeschlagen`; the Live box "Model computer" shows whether Parakeet hears, the number of commands and fixed sentences and how many files are ready. Self-test `test_notbetrieb`.
|
||||
- Pi voice (since V01.1.527, plan alzeo-mischbetrieb step 4, Dominik 2026-11-18 "Piper als eigenes Programm"): Features → Pi voice (`chat.notbetrieb_tts`, off by default). Only on the panel computer `speech-spark-nottts` runs (`app/pistimme.py`): the Piper voice Thorsten (CC0, fine-tuned from the English voice "lessac") with sherpa-onnx from the panel's lock file (Apache-2.0, already there for Parakeet) on the CPU, only on 127.0.0.1:31022, with the API key and a size limit, 2 threads, `MemoryMax=1G`, `CPUQuota` like the panel. `install.sh --mode panel` fetches the sherpa-onnx project's package (~64 MB) once (`pistimme.py laden`), checks it against the pinned SHA-256 (`pistimme.SHA256`) and unpacks only plain files and folders below its own folder (never a link, never a path out); it lives in `state/pistimme/`. The voice loads at the first sentence and gives its memory back after 10 minutes without one. With the switch on and the model computer's speech output gone (`steuer.weg`) or given away by the memory guard (`steuer.stimme_frei`), `common.model_url` sends the speech output there (`notbetrieb.spricht`) and `wartung.paused("tts")` is no longer true. It speaks the same small part of the speech API (`/v1/audio/speech` with `pcm` or `wav`, 24 kHz, `stream` as `speech.audio.delta` sentence by sentence), cleans the text like the main voice (`textnorm`), knows only this one German voice and refuses `mp3`. Its sound never becomes a file of another voice: `ack.record_missing` does not ask it, and the speakers' sentences (`wartung.clips_tick`) are not made meanwhile. Log `notbetrieb: pistimme geladen|entladen|gesprochen N saetze|abgelehnt <wort>|fehlt|fehler|laden ok|laden fehler`; the Live box "Model computer" shows "Pi-Stimme spricht|bereit|fehlt". Self-test `test_pistimme`.
|
||||
- B7a (since V01.0.647): case of the panel computer (Funktionen → Gehäuse, `chat.gehaeuse`, off by default, admin only, split only; `gehaeuse.py`). The panel drives display and LEDs itself through `/dev/i2c-1` and `/dev/spidev0.0` (groups `i2c`, `spi`), only fixed words and numbers, never contents, names or addresses. Set up, remove and restart go only through a wish (`state/gehaeuse-wunsch.json`, valid 5 minutes, admin code) to the fixed root unit `speech-spark-gehaeuse` (sudoers: only `systemctl start --no-block speech-spark-gehaeuse`); it takes the wish through `gehaeuse.py wunsch-nehmen` (two numbers at most), checks the limits again and writes the marked block in `config.txt` itself; it restarts only while `/run/speech-spark-gehaeuse-neustart` reports a change. Logs `gehaeuse: …`, Live box "Gehäuse", the service watcher reports a missing display. Guide: [Spark split](spark-split.md).
|
||||
- B7b (since V01.0.662): eleven display pages with a preview under Funktionen → Gehäuse (`gehaeuse.vorschau`, `GET /api/admin/gehaeuse/vorschau`, admin only, rate limit `gehaeuse`): each page as a 128×64 picture, on or off with a tap (`chat.gehaeuse_seiten_aus`), order by dragging (`chat.gehaeuse_reihenfolge`); the same fixed words and numbers as on the display, never names or contents. Against burn-in: a move every 3 minutes, at most 10 % brightness after 10 minutes of the same picture.
|
||||
- Active 10 min (since V01.0.724, Dominik 2026-10-17 "1b 2a 3a"): `aktiv.py` counts who asked something in the last 10 minutes. `tracelog.start` reports every request before its switches (`aktiv.sah`), so also while Logs and Live are off; a profile counts once (the admin without a profile as one), a guest per device (the device key's name, else the sender's address, only as a shortened HMAC-SHA-256 with a key new at every start, in memory); what the Spark does by itself (`auto`) never counts. At most 2000 entries, nothing on disk, never a name. Shown as a number: OLED page "Aktiv 10 min" (one big number, profiles and guests beside it; in the rotation, on or off and movable like the others), Status → Summary "Today" (`admin.glance` `aktiv`), Status → Live (number on top, `live.snapshot` `aktiv`), Steuerzentrale (second header row) and the iPhone app's status. Self-tests `test_aktiv`, `test_gehaeuse`, `test_steuerzentrale`.
|
||||
|
||||
+36
-4
@@ -859,6 +859,9 @@ if [ "$PANEL_ONLY" = 1 ]; then # Notbetrieb mit Parakeet: the model is there b
|
||||
{ cat "$INSTALL_FROM/app/parakeet.py"; echo 'download()'; } \
|
||||
| sudo -u "$SVC_USER" HF_HOME="$VAR/hf" "$PREFIX/venv-panel/bin/python" - \
|
||||
|| warn "Parakeet download failed; run sudo ./install.sh --mode panel again for the emergency mode"
|
||||
say "Fetching the Pi voice for the emergency mode (~64 MB, checked against its pinned SHA-256)"
|
||||
sudo -u "$SVC_USER" SPEECH_SPARK_STATE="$VAR/state" "$PREFIX/venv-panel/bin/python" "$INSTALL_FROM/app/pistimme.py" laden \
|
||||
|| warn "Pi voice download failed; run sudo ./install.sh --mode panel again for the Pi voice"
|
||||
fi
|
||||
if [ "$DOWNLOAD" = 1 ]; then
|
||||
# every speech model on its pinned commit from the catalog, only the allowed file kinds, then each file checked
|
||||
@@ -1865,12 +1868,41 @@ CPUQuota=$PANEL_CPU
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
# Pi-Stimme (plan alzeo-mischbetrieb M4), only on the panel computer: the Piper voice Thorsten on 127.0.0.1:31022
|
||||
# (common.NOTTTS_PORT, app/pistimme.py); it speaks only while the model computer's speech output is gone or given away
|
||||
# and chat.notbetrieb_tts is on (panel/notbetrieb.py spricht), loads at the first sentence, unloads after 10 minutes
|
||||
cat >/etc/systemd/system/speech-spark-nottts.service <<EOF
|
||||
[Unit]
|
||||
Description=Speech on DGX Spark: Piper voice for the emergency mode (the model computer does not speak)
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
LogNamespace=speech-spark
|
||||
User=$SVC_USER
|
||||
Group=$SVC_USER
|
||||
WorkingDirectory=$PREFIX/app
|
||||
$common_env
|
||||
ExecStart=$PREFIX/venv-panel/bin/python $PREFIX/app/pistimme.py
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
MemoryMax=1G
|
||||
# speech output: like the speech services first (Dominik 2026-10-18), the last core stays for the system
|
||||
Nice=-5
|
||||
CPUWeight=1000
|
||||
IOWeight=1000
|
||||
CPUQuota=$PANEL_CPU
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
else
|
||||
systemctl disable --now speech-spark-notasr.service 2>/dev/null || true
|
||||
rm -f /etc/systemd/system/speech-spark-notasr.service
|
||||
systemctl disable --now speech-spark-notasr.service speech-spark-nottts.service 2>/dev/null || true
|
||||
rm -f /etc/systemd/system/speech-spark-notasr.service /etc/systemd/system/speech-spark-nottts.service
|
||||
fi
|
||||
# Hardware-Watchdog (Dominik 2026-10-18 "5a"), only on a Raspberry Pi: systemd tells the Pi's watchdog every few
|
||||
# seconds that it still runs; if the whole computer freezes, the watchdog restarts it after RuntimeWatchdogSec (15 s,
|
||||
@@ -2224,7 +2256,7 @@ svc_print() { # $1 = service: everything it runs from, as one stream (only hash
|
||||
done
|
||||
cat -- "$PREFIX"/venv-*/.pkgs "$PREFIX/venv-panel/.locked" 2>/dev/null || true
|
||||
}
|
||||
restart_front() { # $1 = service (asr, tts, bild, musik, llmtor, tlstor, waerter, notasr or schirm)
|
||||
restart_front() { # $1 = service (asr, tts, bild, musik, llmtor, tlstor, waerter, notasr, nottts or schirm)
|
||||
local fp mark="$PREFIX/.restart-$1"
|
||||
fp=$(svc_print "$1" | sha256sum | cut -c1-64)
|
||||
systemctl enable "speech-spark-$1.service" >/dev/null 2>&1
|
||||
@@ -2282,7 +2314,7 @@ fi
|
||||
|
||||
[ "$LLM_ON" = 1 ] && restart_front llmtor
|
||||
|
||||
[ "$PANEL_ONLY" = 1 ] && restart_front notasr
|
||||
if [ "$PANEL_ONLY" = 1 ]; then restart_front notasr; restart_front nottts; fi
|
||||
# B9: the Steuerzentrale runs only while the admin switch is on (panel/schirm.py); an update restarts it then. Only a
|
||||
# screen: when it does not come back, the update goes on (the Dienst-Wächter reports it), it never stops the update.
|
||||
if systemctl is-active -q speech-spark-schirm.service 2>/dev/null; then
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ if [ "$YES" = 0 ]; then
|
||||
case "$ans" in y|Y|j|J|yes|ja) ;; *) echo "Aborted."; exit 1 ;; esac
|
||||
fi
|
||||
|
||||
for s in asr asr-engine tts tts-engine tts-design turn bild musik llm llmtor sehen panel watch update wechsel messen-wunsch gehaeuse tlstor waerter teilen-fw notasr schirm werkstatt guacd; do
|
||||
for s in asr asr-engine tts tts-engine tts-design turn bild musik llm llmtor sehen panel watch update wechsel messen-wunsch gehaeuse tlstor waerter teilen-fw notasr nottts schirm werkstatt guacd; do
|
||||
systemctl disable --now "speech-spark-$s.service" 2>/dev/null || true
|
||||
rm -f "/etc/systemd/system/speech-spark-$s.service"
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user