razzo04 / rhasspy-mobile-app

A simple mobile app for rhasspy.
MIT License
118 stars 13 forks source link

Multiple SiteIds #20

Open gitisz opened 2 years ago

gitisz commented 2 years ago

This could be configuration related, however my experience is that using the mobile app allows for the wake word to be detected at random times, but there is usually 1 to 5 minutes gap after I get an attempt to be recognized, and requires saying the wake word after many repeated attempts.

Base Environment: Rhasspy installed as an add-on (Docker) in Home Assistant. v2.5.11

Configuration from Backup

{
    "dialogue": {
        "satellite_site_ids": "mobileapp-1",
        "system": "rhasspy"
    },
    "handle": {
        "satellite_site_ids": "mobileapp-1,homeassist,kitchenapp-1"
    },
    "home_assistant": {
        "access_token": "[redacted]",
        "handle_type": "event",
        "url": "[redacted]"
    },
    "intent": {
        "satellite_site_ids": "mobileapp-1",
        "system": "fsticuffs"
    },
    "microphone": {
        "system": "pyaudio"
    },
    "mqtt": {
        "enabled": true,
        "host": "[redacted]",
        "password": "[redacted]",
        "site_id": "homeassist",
        "username": "mqtt_assistant"
    },
    "sounds": {
        "system": "aplay"
    },
    "speech_to_text": {
        "satellite_site_ids": "mobileapp-1",
        "system": "kaldi"
    },
    "text_to_speech": {
        "satellite_site_ids": "mobileapp-1",
        "system": "nanotts"
    },
    "wake": {
        "porcupine": {
            "keyword_path": "alexa_linux.ppn",
            "sensitivity": "0.99",
            "udp_audio": "0.0.0.0:12333:mobileapp-1"
        },
        "precise": {
            "sensitivity": "0.99",
            "udp_audio": "0.0.0.0:12333:mobileapp-1,0.0.0.0:12333:kitchenapp-1"
        },
        "satellite_site_ids": "mobileapp-1",
        "system": "porcupine"
    }
}

Note: when using Backup Profile, as provided in the JSON above, it does not actually align with the values provided in the UI. This is even after saving settings and restarting Rhasspy. image

Example: Backup shows "udp_audio": "0.0.0.0:12333:mobileapp-1,0.0.0.0:12333:kitchenapp-1" while saved value is 0.0.0.0:12333:mobileapp-1

Satellite Environment: v1.7.0 Storage and Microphone permissions are allowed. image image

When the mobile app microphone icon goes red, and then back to black, is there some amount of time required before the wake word will work again?

gitisz commented 2 years ago

At first I thought this was due to having more than one satellite (instance of mobile app running on another tablet). Seems though that issue continues, where wake word is unresponsive using only my phone instance. Any pointers on how to better troubleshoot why wake word is not being handled?

gitisz commented 2 years ago

After some further digging, my original problem is likely having more thank one client using the same UDP port (12333). Also, for the base to work, seems it is best to have default,mobileapp-1 at the top level Settings to whitelist all services.

Question now is how can I get Home Assistant to support more than one UDP port?

razzo04 commented 2 years ago

Probably your guess is correct, you can't use the same UDP port with multiple devices as I said in the rhasspy community post. However I don't know how to map multiple ports, if not defined in the manifest, to the rhasspy container because I haven't used home assistant OS recently.

Doni49 commented 1 year ago

Probably your guess is correct, you can't use the same UDP port with multiple devices as I said in the rhasspy community post. However I don't know how to map multiple ports, if not defined in the manifest, to the rhasspy container because I haven't used home assistant OS recently.

Although I'm new to Rhasspy, I do have an understanding of network communications. Each client only needs to point to ONE port -- it's the server that needs to handle communications from multiple sites. Surely the Rhasspy satellites running with the actual Rhasspy software don't need to have one port per satellite. Maybe have a discussion with the Rhasspy dev team to see what they do. It's most likely a matter of including the site ID in the data packet and the server knowing how to parse that out.