Mycroft Community Forum

Mycroft on Respeaker Core V2

After many hours, and multiple attempts are restarting from scratch (redoing the image), it seems there might be some kind of contention problem on boot. When I boot and start mycroft, the speaker mic level is blank (no bar or movement). I do get log messages coming in from the background services, but Mycroft doesn’t respond to any voice. I quit and restart (which I guess just loads cli at this point) and the mic level is there and it moves, but the value is really low (10-100).

After quitting and doing some combination of killing and starting pulseaudio and stopping and starting respeakerd, I’m able to use parecord to make a recording that plays back … without doing so, I get either silence or occasional squeeks in the recording. When I’m able to do a recording, I can load mycroft fresh and it works, but mic levels are in the thousands. It seems like either something in the boot process seems to be hanging up or capturing the audio device? I need to figure out the proper sequence of starting/stoping the processes and see if that can narrow it down.

Edit (Because discourse won’t let me post 4 times in a row)…

Maybe this will help someone in the future since there seems nothing unique about my setup other than I’m doing this now (Sep '20) and not back in Jan '19. Plenty could have actually changed since then.

First, @Dominik, in your first post, between the update and upgrade, can you add an ‘apt-mark hold’ to prevent firefox from being updated.

sudo apt update
sudo apt-mark hold firefox-esr
sudo apt upgrade

Without this, after you do the upgrade, firefox errors out everytime you try to launch it.

Second, to fix the error message with setuptools, I added the export command I mentioned above to my .bashrc file. I don’t know enough about linux to know if there is a better way of doing it or if doing it this way won’t work with autostarting or not…

Which leads me to the third, I assume I cannot autostart mycroft because I have to manually stop and restart respeakerd before I can get mycroft to work after a boot. I’m not sure what’s causing the problem because I’ve rebuilt from image about 4 times today and got the same results each time… to get around it, I issue the following right after I ssh in:

sudo systemctl stop respeakerd
sudo systemctl start respeakerd

Then when I launch mycroft, and patiently wait for it to be fully loaded, it works.

Finally, I was really surprised to see how much CPU was used while mycroft was running… it sits at 75% cpu usage on average the entire time. I think it will work for my application, but its not a lot of headroom.

@madgrizzle thanks for posting your findings.

When Firefox is installed you most likely are using the “lxqt” Respeaker-image with full GUI/desktop. I recommend to use the “IoT” version which does not have the GUI and use less resources. I have accidently mentioned the “lxqt” instead of the “iot” image in my first post. Unfortunately the forum software does not let me edit it any longer. :frowning:

I remember rarely seeing the issue myself. Maybe it is possible to change the startup procedure and add a pause and a restart of respeaker-daemon - I will think about how to do it…

This is a) because GUI services are running (see above) and b) Mycrofts Precise wake word listener - which is a cpu-hogger…

Thanks… when I first starting out, I escaped (ctrl-c) out of doing the Alexa integration part of the respeaker install and thought that might have been the problem (like I didn’t complete the install or something). I’m now sure that’s not the issue so if I end up having to reload again, I’ll switch to the iot version. As for cpu load, it’s definitely the precise taking up the resources… can see it in htop. I’m hoping it won’t cause a problem with getting the ROS skill running.

That’s odd, maybe because of the age? As it turns out, all that needs to be done is change it from “lxqt” to “iot”. I restarted today from scratch with the iot version, even had it build mimic, and it worked without any deviations from your instructions… no issues - knock on wood… and it loads from boot with no problem. Maybe @gez-mycroft has the ability to mod it?

I’m not sure this is the appropriate place to comment on this, but I’ll do it anyway.

I managed to install ROS Melodic (bare bones package) on the respeaker by building it from source. I followed the directions from wiki.ros.org but had to make two tweaks:

rosdep install --from-paths src --ignore-src --rosdistro melodic -y

changed to:

rosdep install --from-paths src --ignore-src --rosdistro melodic --skip-keys=‘sbcl’ -y

I also had to add sketch-backports to my source list because rosdep dependcy install step failed to find python-pycryptodome. Not sure the proper way, but I edited /etc/apt/sources.list and added the following:

deb http://deb.debian.org/debian stretch-backports main

and then I installed python-pycryptodome using:

sudo apt-get -t stretch-backports install python-pycryptodome

I also created a 2GB swapfile on my SD card because the first time I tried to install ROS, it failed (I also unknowingly had mycroft still running as well). But I figure a swap file isn’t a bad thing if you have the space on the SD card and after doing so (and also shutting down mycroft) it succeeded to build.

So next step is to work on the skill to output ROS messages based upon the commands mycroft hears.

1 Like

This may cause the SD card to wear out fast. Maybe you can put the swapfile on the RC2 internal 4GB eMMC memory instead?

Why not create a new topic in section “modding” with title e.g. “Mycroft on robots” or “Mycroft and ROS”? :wink:

Any idea how to do that?

It was more of a question as to which forum to post it to since it really wasn’t related to Mycroft (getting ROS to run on the respeaker) but this thread had evolved to include robot discussion, I figured I’d mention it here. If I do manage to get the Mycroft-ROS install running, I’ll start a new thread on how I did it. It didn’t work last night as it seems to include its own modified mycroft instance inside a virtualenv. I think it was intended to ‘add’ mycroft node to an existing ROS install rather than just add a ROS skill to an existing mycroft install.

It took me some time to finish assembly, but here it is - Mark-IIR (early Mark-II prototype based on Respeaker Core V2):

Unfortunately the loudspeaker outputs some “electronic noise” as soon as it is powered on, requires probably some shielding/grounding…

4 Likes