Mycroft Community Forum

Upgraded ubuntu from 18.04 to 20.04, no more TTS

Hello, everybody. I hope you are well. I’m working on this now for several days and am not finding a solution. The problem is essentially the same as this one, but I am not achieving the fix with the same results.

Summary: After I upgraded from Ubuntu 18.04 to 20.04. I can wake Mycroft, and I even hear the wake chime. The speaker mutes. I look at the log file and can see all the time signatures that it’s trying to hear me. But there is no audible response.

I have tried these, without success…
30 sec + delay between wake word and recording
Picroft + rpi4 + Respeaker Mic Array v2.0 - Audio issues
Mycroft not responding to “pair my device”
Mycroft does not work in ubuntu 20.04
Mycroft not responding ubuntu 20.04

I have also tried some TTS and ALSA troubleshooting guides. Most of them tell me to do things that I don’t really know what they mean. (I honestly just learned what ALSA is.)

I’m more than a little beyond my comfort zone now of attempting fixes. If anybody has any ideas, I’m all ears.

Thank you!
Dan.

Hey, just to check, did you install Mycroft via the Git method, the alpha-release Snap or some other method?

From your message in the other thread, what happened when you tried to run Mycroft using Python3.8? Can you check what version of Python is being used in the virtual environment?

cd ~/mycroft-core
source .venv/bin/activate
python --version
deactivate

Mycroft works on 20.04 but I haven’t done an upgrade from 18.04 so there seems to be some issues there.

@gez-mycroft Thank you for the reply! :slightly_smiling_face:

Originally, with Ubuntu 18.04, I installed using git. This installation carried over into Ubuntu 20.04. I first tried solving the issue with downgrading python from 3.8 to 3.7.5.

I also tried uninstalling and reinstalling using snap. That presented the same issue. I uninstalled again and reinstalled using git, which is the current installation. (I’m trying my best to maintain a single variable per trial, other than maintaining python 3.7.5 throughout.)

I checked the virtual environment python version, and it is 3.7.5. (That never crossed my mind to check, which seems so obvious now!)

I thought about wiping everything with a fresh Ubuntu 20.04 installation. But I don’t like not knowing what’s causing this problem. Plus, I suppose, there’s no guarantee that a fresh install will actually fix it.

Dan.

Have you tried the audiotest? Can you check your default source in pulse audio?

Hi, @baconator. Thanks for the reply.

Have you tried the audiotest?

I’m not sure what the audiotest is. That sounds like something I should familiarize myself with. I did some searches that gave me results about different methods for testing audio. Which one in particular should I do?

I tried this one that had a bunch of different alsa+pulseaudio hardware and software diagnostics. It gave me information. And I’m not sure what to do with it.

Can you check your default source in pulse audio?

I ran $ pactl info and it returned Default Source: alsa_input.pci-0000_00_1f.3.analog-stereo. Is this useful?

In both cases, they’re only useful if you can tell.

pactl list sources short
should list the inputs, one should hopefully seem familiar.
If that’s not the one you have for default source you’d need to change it. Also check out the audio troubleshooting guide for more.

Thank you again. I used Mycroft Audio Troubleshooting for these actions.

I ran audiotest and I heard my voice playback. So according to the text output, mycroft can hear what I’m saying and should be able to act on it.

I ran pactl list sources short and got:

1 alsa_output.pci-0000_00_1f.3.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_input.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

I tried changing it using pactl set-default-source 1. This made mycroft not listen. So I changed it back to 2, and it’s listening again. Still no TTS, though. I tried to find a mimic troubleshooting guide. But I didn’t see one.

One thing I noticed is when I stop mycroft, I get some errors with stopping audio.

~/mycroft-core$ ./stop-mycroft.sh all
Stopping all mycroft-core services
Stopping skills (5430)…stopped.
Stopping audio (5729)…failed to stop.
Killing audio (5729)…killed.
Stopping speech (5774)…stopped.
Stopping enclosure (5793)…stopped.
Stopping messagebus.service (5379)…stopped.

Could this possibly be anything useful?
Does anybody know of a mimic troubleshooting guide?

Never wrote one. :o

Nothing interesting in the audio.log?

This seems relevent from audio.log

2020-10-16 19:48:26.221 | INFO | 4004 | mycroft.messagebus.load_config:load_message_bus_config:33 | Loading message bus configs
2020-10-16 19:48:26.337 | ERROR | 4004 | mycroft.tts.tts:create:529 | The TTS could not be loaded.
Traceback (most recent call last):
File “/home/dan/mycroft-core/mycroft/tts/mimic_tts.py”, line 187, in validate_connection
subprocess.call([BIN, ‘–version’])
File “/usr/local/lib/python3.7/subprocess.py”, line 339, in call
with Popen(*popenargs, **kwargs) as p:
File “/usr/local/lib/python3.7/subprocess.py”, line 800, in init
restore_signals, start_new_session)
File “/usr/local/lib/python3.7/subprocess.py”, line 1465, in _execute_child
executable = os.fsencode(executable)
File “/usr/local/lib/python3.7/os.py”, line 810, in fsencode
filename = fspath(filename) # Does type-checking of filename.
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/dan/mycroft-core/mycroft/tts/tts.py”, line 519, in create
tts.validator.validate()
File “/home/dan/mycroft-core/mycroft/tts/tts.py”, line 435, in validate
self.validate_connection()
File “/home/dan/mycroft-core/mycroft/tts/mimic_tts.py”, line 189, in validate_connection
LOG.info("Failed to find mimic at: " + BIN)
TypeError: can only concatenate str (not “NoneType”) to str
2020-10-16 19:48:26.340 | ERROR | 4004 | main:on_error:34 | Audio service failed to launch (TypeError(‘can only concatenate str (not “NoneType”) to str’)).

These are the TTS settings in mycroft-core/mycroft/configuration/mycroft.conf

// Text to Speech parameters
// Override: REMOTE
“tts”: {
// Engine. Options: “mimic”, “google”, “marytts”, “fatts”, “espeak”,
// “spdsay”, “responsive_voice”, “yandex”, “polly”
“pulse_duck”: false,
“module”: “mimic”,
“polly”: {
“voice”: “Matthew”,
“region”: “us-east-1”,
“access_key_id”: “”,
“secret_access_key”: “”
},
“mimic”: {
“voice”: “ap”
},
“mimic2”: {
“lang”: “en-us”,
“url”: “https://mimic-api.mycroft.ai/synthesize?text=”,
“preloaded_cache”: “/opt/mycroft/preloaded_cache/Mimic2”
},
“espeak”: {
“lang”: “english-us”,
“voice”: “m1”
}
},

There does not appear to be a /etc/mycroft/mycroft.conf

.mycroft/mycroft.conf has…

{
“max_allowed_core_version”: 20.8
}

It’s not finding mimic2 or 1, it seems. Surprised there’s not another error message about mimic2.

I get exactly the same error (and no voice) as @dan, but only when using the British Male voice, while the other two choices from https://account.mycroft.ai/ work fine.
Mimic is not build locally, but that is optional, as well for the default voice, isn’t it?

I suppose I should close this one out. However, the verdict is not at all satisfying.

I opted to do a fresh linux installation, as mycroft was not the only issue I was encountering with the upgrade. I was getting tired of spending so much time troubleshooting, and it seemed like everybody is doing well with new installs.

Sorry for taking the easy way out! :pensive:

Dan.

Yes. Mimic(1) is the default fallback.

However, this seems to fail:

2020-11-17 21:25:26.828 | DEBUG    |  1902 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
2020-11-17 21:25:27.715 | DEBUG    |  1902 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/<UUID>/subscription HTTP/1.1" 200 17
2020-11-17 21:25:27.723 | ERROR    |  1902 | mycroft.tts.tts:create:529 | The TTS could not be loaded.
Traceback (most recent call last):
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/mimic_tts.py", line 187, in validate_connection
    subprocess.call([BIN, '--version'])
  File "/usr/lib/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1436, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python3.7/os.py", line 809, in fsencode
    filename = fspath(filename)  # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/tts.py", line 519, in create
    tts.validator.validate()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/tts.py", line 435, in validate
    self.validate_connection()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/mimic_tts.py", line 189, in validate_connection
    LOG.info("Failed to find mimic at: " + BIN)
TypeError: can only concatenate str (not "NoneType") to str
2020-11-17 21:25:27.725 | ERROR    |  1902 | mycroft.audio.speech:handle_speak:99 | Error in mute_and_speak
Traceback (most recent call last):
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/mimic_tts.py", line 187, in validate_connection
    subprocess.call([BIN, '--version'])
  File "/usr/lib/python3.7/subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1436, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python3.7/os.py", line 809, in fsencode
    filename = fspath(filename)  # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/audio/speech.py", line 95, in handle_speak
    mute_and_speak(chunk, ident, listen)
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/audio/speech.py", line 123, in mute_and_speak
    tts = TTSFactory.create()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/tts.py", line 519, in create
    tts.validator.validate()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/tts.py", line 435, in validate
    self.validate_connection()
  File "/mnt/dietpi_userdata/mycroft-core/mycroft/tts/mimic_tts.py", line 189, in validate_connection
    LOG.info("Failed to find mimic at: " + BIN)
TypeError: can only concatenate str (not "NoneType") to str

This is btw not a single instance but I tested it on three different VMs (different Debian versions) and a notebook, so it must be an issue with our implementation, however I cannot find an issue (tanking into account that with all other voices it works fine) and the error messages doesn’t tell me much as I am no good Python programmer :sweat_smile:.

fixed in dev branch

EDIT:

you are using mimic TTS without mimic installed, so you if you choose british male then you must install mimic, mimic is optional, in the sense that you can choose other voices, but if you choose mimic without having mimic… thats a problem on your side :wink:

I recommend you always install mimic, because if the other voice fails, like google recently did, then you get mimic as fallback

2 Likes

Many thanks for implementing proper handling of this error and clarifying that Mimic == British Voice. I thought for each voice there is an “online” version. Since this voice is configured by default, this information could be added to the installers output, however finally found it in the documentation TTS section as well.

I built/installed it, needed to learn that it needs to be called from the mycroft-core directory (to have binary and libs being found by Mycroft core services), and now the British Voice works perfectly fine. Many thanks!