SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
236 stars 16 forks source link

Can not reach MARYTTS 5.2 #180

Closed SHU-red closed 2 years ago

SHU-red commented 2 years ago

Describe the bug Using MARYTTS in a separate docker Server from source https://hub.docker.com/r/synesthesiam/marytts https://github.com/synesthesiam/docker-marytts

As i enter a command --> "UI: TTS Fehler - Ausgabe konnte nicht generiert werden."

Working as standalone and mounted at standard port http://(myip):59125/

SEPIA client and server versions

To Reproduce Steps to reproduce the behavior:

  1. Client: choose MARYTTS API
  2. Client: no voice choosable
  3. Client: Voice server: http://(myip):59125/
  4. Server: create marytts_server = http://(myip):59125/ (and also tried http://(myip)/
  5. As i enter a command --> "UI: TTS Fehler - Ausgabe konnte nicht generiert werden."

Expected behavior Voice via MARYTTS can be heard Different voices can be chosen at sepia client menu

Additional context Everything installed on the same server in docker containers

SHU-red commented 2 years ago

EDIT: Very strange but maybe there is something i did not understand.

From the client on my android phone i can immediately reach MARYTTS if put in http://(myip):59125/ for Voice server

The chance is high that there is just something i did not understand (maybe related to ngix server?)

SHU-red commented 2 years ago

EDIT2: I tried to follow this and wnated to add the nginx-config faile https://github.com/SEPIA-Framework/sepia-assist-server/blob/master/Xtensions/TTS/marytts/INSTALL.md#solving-cors-problems

As i executed setup-nginx.sh and executed options 1 and then 2, i got highlighted, that the nginx-config file is stored at

Copying /home/admin/SEPIA/nginx/sites-available/sepia-fw-http.conf to /etc/nginx/sites-enabled/ ...
Restarting NGINX to load new config ...
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If im not mistaken is this not a file/folder which is persistent when using docker So this may also has to be mentioned on docker hub or something? --> Additionally mount /etc/nginx

fquirin commented 2 years ago

Hey,

Very strange but maybe there is something i did not understand. From the client on my android phone i can immediately reach MARYTTS if put in http://(myip):59125/ for Voice server

That is a bit confusing because I think the Android client should have the same CORS problem :thinking: , not 100% sure though if any Cordova/Android setting is maybe suppressing that.

If im not mistaken is this not a file/folder which is persistent when using docker

That is true. I would not recommend to use the internal Nginx though if you have everything in separate Docker containers. It would be better to have a Proxy in front of your containers. That said the Mary-TTS Docker container should not have any CORS problems at all, see this note about it:

The image uses a reverse proxy (Nginx) internally to avoid CORS problems with Mary-TTS server

Taking this into account and the Android curiosities I wonder if there is a different issue. Can you open http://(myip):59125/ directly on your Vivaldi desktop browser? And when you run SEPIA in Vivaldi can you open the dev console (F12) and check if you see any error messages?

fquirin commented 2 years ago

Oh sorry I just realized you were using Michael's Mary-TTS Container. Can you try this one: https://hub.docker.com/r/sepia/marytts

If not you can also use Michael's Larynx server, it has a Mary-TTS compatible API (voices are more resource demanding though, not meant for Raspberry Pi): https://hub.docker.com/r/rhasspy/larynx

SHU-red commented 2 years ago

My bad! I completely did oversee that there is a marytts from sepia. Although i think linux/arm64 is not the right plattform for me

I will presumably be able to check this during the coming week

Thanks for your very detailled reply

fquirin commented 2 years ago

Although i think linux/arm64 is not the right plattform for me

Ah yes, I think I only made this one because it was the hardest one to do :sweat_smile: , you will probably not be able to use the Arm64 version on your x86 machine. I'm not exactly sure how the 'synesthesiam' container is configured. Maybe it does make sense to try the SEPIA internal version first and just add another Docker volume for the /etc/nginx/sites-enabled folder. For the internal one you can stay inside the SEPIA container and use cd ~/SEPIA/sepia-assist-server/tree/master/Xtensions/TTS/marytts && bash download_linux.sh. If you walk this path you will also have the Mary-TTS voices available via TTS engine sepia (should work without Nginx changes) AND Mary-TTS API

SHU-red commented 2 years ago

For the internal one you can stay inside the SEPIA container and use cd ~/SEPIA/sepia-assist-server/tree/master/Xtensions/TTS/marytts && bash download_linux.sh. If you walk this path you will also have the Mary-TTS voices available via TTS engine sepia (should work without Nginx changes) AND Mary-TTS API

Just to correct your path, i think it shuld be: cd sepia-assist-server/Xtensions/TTS/marytts/ && bash download_linux.sh

Everything seems to be downloaded and unzipped. I then restarted my whole sepia container

I cleared the MARYTTS host paths I tried it with localhost Nothing works and i do never get to the point where i can choose the voices ...

Sorry maybe i did something wrong ...

fquirin commented 2 years ago

Can you check sepia-assist-server/log.out and look for a Mary-TTS comment plz. At the very top in the log file during start-up you should see all the active TTS engines and an error message if Mary-TTS server could not be contacted.

Inside the container you can check /etc/nginx/sites-enabled/speia.. and uncomment (or add) the part:

location /sepia/marytts/ {
        # NOTE: For the official SEPIA Mary-TTS Docker container remove 'add_header' entries.
        add_header Access-Control-Allow-Origin "$http_origin" always;
        add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept" always;
        add_header Access-Control-Allow-Methods "GET, POST, PUT, OPTIONS, DELETE" always;
        proxy_pass http://localhost:59125/;
}

After that restart Nginx with sudo nginx -s reload and see if you can reach http://[SEPIA-IP]:20726/sepia/marytts/ (or port 20727 if you changed to self-signed SSL etc.).

[EDIT] You can try to reach the Mary-TTS server from inside the container as well via curl http://localhost:59125/version or some other endpoint

SHU-red commented 2 years ago

Can you check sepia-assist-server/log.out and look for a Mary-TTS comment plz. At the very top in the log file during start-up you should see all the active TTS engines and an error message if Mary-TTS server could not be contacted.

2022-04-07 19:22:43 LOG - Running TTS module setup ...
2022-04-07 19:22:44 ERROR - TTS module - MaryTTS server () did not answer or had no voices installed. Support has been deactivated for now.
2022-04-07 19:22:44 LOG - TTS module - Added 6 'pico' voices.
2022-04-07 19:22:44 LOG - TTS module - Added 5 'espeak' voices.
2022-04-07 19:22:44 LOG - TTS module setup has cleaned up '0' leftover files.
2022-04-07 19:22:44 LOG - TTS module setup successful.

Inside the container you can check /etc/nginx/sites-enabled/speia.. and uncomment (or add) the part:

location /sepia/marytts/ {
        # NOTE: For the official SEPIA Mary-TTS Docker container remove 'add_header' entries.
        add_header Access-Control-Allow-Origin "$http_origin" always;
        add_header Access-Control-Allow-Headers "Origin, Content-Type, Accept" always;
        add_header Access-Control-Allow-Methods "GET, POST, PUT, OPTIONS, DELETE" always;
        proxy_pass http://localhost:59125/;
}

After that restart Nginx with sudo nginx -s reload and see if you can reach http://[SEPIA-IP]:20726/sepia/marytts/ (or port 20727 if you changed to self-signed SSL etc.).

[EDIT] You can try to reach the Mary-TTS server from inside the container as well via curl http://localhost:59125/version or some other endpoint

Did all of that

Additional hint: I created a variable in the general settings named marytts_server, which is empty at the moment I also once ran the nginx installation stuff, but i think there is no chance this can cause problems, because the folder where the /etc/nginx-suff is stored is not mounted --> Not persistent

EDIT: I inserted Voice server: http://sepiaip:20726/ Dropdown changed to - no voices -

Does this mean it finally connected and i have to download voices?

fquirin commented 2 years ago
  • Can reach MARY from typing in the url in the browser
  • Command inside the container gives me Mary TTS server 6.0-SNAPSHOT (impl. unknown)

Ok that's good, the server seems to work and can be accessed. The strange thing is that the server does throw an error at startup. Can you check if your core settings are still default for Mary-TTS, you should see the entry marytts_server=http://127.0.0.1:59125 (SEPIA Control-HUB core-settings page, or SEPIA/sepia-assist-server/Xtensions/assist.custom.properties file).

I've attached improved run and tests scripts that write a new startup-log.out into the main SEPIA folder when you run the server: sepia-run-scripts.zip. Can you replace your existing ones (~/SEPIA/ folder), restart the server and then check the log output plz..

When everything works you should see the Mary-TTS voices as option in the SEPIA engine: image

If you can reach the Mary-TTS server in your browser via the proxy the Mary-TTS API setting should work as well (example hostname): image

fquirin commented 2 years ago

Something that might become relevant after the connection is fixed: https://github.com/SEPIA-Framework/sepia-docs/issues/166

SHU-red commented 2 years ago

OK i finally got time to check this again.

What i did is

  1. Go to Control HUB settings and insert marytts_server=http://[MYSERVERIP]:20726/sepia/marytts/
  2. Go to client Settings, choose MaryTTS API and insert http://[MYSERVERIP]:20726/sepia/marytts/ into server location

Sorry for the inconvenience and thanks very much for your support!

fquirin commented 2 years ago

If you use the Mary-TTS API setting you actually don't even need to set the core-setting. The difference between Mary-TTS API and SEPIA (Stream) is that the latter calls Mary-TTS from the SEPIA server, including all the user-permission checks, voice tweaks and some pre-processing of the text while the Mary-TTS API calls the server directly from the app without any extra processing.

SHU-red commented 2 years ago

Tested to remove the core-setting Works! Thanks!