Hey Mycroft
I have to admit I am still having problems with audio. He speaks well, but when I tell him to record the play-back sound quality is very poor. Also, when I say Hey Mycroft he doesn’t always hear, I have to go up close and speak quite loudly.
If I do ‘arecord -d10 /home/test-mic.wav’ and ‘aplay /home/test-mic.wav’ from the command line the sound quality is way better, which leads me to think that pycroft is’nt dealing with output from the mic very well.
Thanks for reading.
I am sorry that you hassnt w wellworking picroft. I hassnt any idea why or what could be done to fix that.
I know that either @gez-mycroft or @Forslund are kings when it comes to Linux, ALSA and pulse audio.
Speaking of which - do you have pulse audio installed ? Try install pulseaudio by
sudo apt-get install pulseaudio
What I see is that many problems regarding to audio is fixed by adding pulseaudio to the picroft.
One thing to check would be your microft.conf files to see whether they are using the defaults for both sound devices. This was causing other peoples devices to not work, but it could equally be causing different behaviour to system level audio.
Can you run: cat /etc/mycroft/mycroft.conf
and see if you can find the following two lines: "play_wav_cmdline": "aplay %1" "play_mp3_cmdline": "mpg123 %1"
Less likely but still possible is that they are in your user level conf file: cat ~/.mycroft/mycroft.conf
If they have other flags or parameters then you can override them by adding the two lines above to your home directory’s mycroft.conf: sudo nano ~/.mycroft/mycroft.conf
Let us know if that has any effect, and I’ll keep thinking about other possibilities…
This is what I get when I do cat /etc/mycroft/mycroft.conf ----------------------------------------------------------------- (.venv) pi@picroft:~ $ cat /etc/mycroft/mycroft.conf { _ “play_wav_cmdline”: “aplay %1”,_ _ “play_mp3_cmdline”: “mpg123 %1”,_ _ “enclosure”: {_ _ “platform”: “picroft”_ _ },_ _ “tts”: {_ _ “mimic”: {_ _ “path”: “/home/pi/mycroft-core/mimic/bin/mimic”_ _ }_ _ },_ _ “ipc_path”: “/ramdisk/mycroft/ipc/”_ } ------------------------------------------------------------------------- I assume this is as it should be?
Hi forsland
Thanks but I am afraid I do not understand your instructions. I can cd to mycroft-core and ls to see venv-activate.sh, but I don’t know what to do with any of it.
Sorry
(I prepared a shortened url to the script linked above in case you’re typing directly into the picroft)
You should see something like this:
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
==========================================
Found devices:
HD-Audio Generic: ALC892 Analog (hw:1,0): Samplerate 44100.0 Channels 2
HD-Audio Generic: ALC892 Alt Analog (hw:1,2): Samplerate 44100.0 Channels 2
pulse: Samplerate 44100.0 Channels 32
default: Samplerate 44100.0 Channels 32
where the part after Found devices is the interesting parts.
The part before the : Samplerate is the device name that can be entered into the config as described above
For example I could set the “device_name” to HD-Audio Generic: ALC892 Analog (hw:1,0) or pulse or any of the other devices.
Hi Aaron, apologies I just noticed there was a small typo in the instructions, the first line should be: source venv-activate.sh
It looks like you got that the first time yourself, which brings you into the virtual environment aka venv, but then missed downloading the script so it gave you the “No such file or directory” error. The second time you tried it downloaded the script but as you weren’t in the venv it wouldn’t have found any devices and most likely gave you an error about pyaudio not being found.
Can you try it one more time with the updated first line, it should look like:
pi@picroft:~ $ cd ~/mycroft-core
pi@picroft:~/mycroft-core $ source venv-activate.sh
>>>> Entering Mycroft virtual environment. Run 'mycroft-venv-deactivate' to exit
(.venv) pi@picroft:~/mycroft-core $ wget goo.gl/TsUAaK -O list_inputs.py
>>>> A lot of stuff about downloading...
>>>> Saving to: ‘list_inputs.py’
>>>> list_inputs.py 100%[===================>] 474 --.-KB/s in 0s
>>>> 2019-01-30 13:01:21 (2.55 MB/s) - ‘list_inputs.py’ saved [474/474]
(.venv) pi@picroft:~/mycroft-core $ python list_inputs.py
This final line should output something similar to what Forslund posted above. We’re just interested in what comes after “Found devices:”
The list_inputs.py script shows this device as well as the default and pulseaudio ones. The mycroft-mic-test script works correctly and records audio and plays it back at acceptable levels (after using alsamixer to adjust the ADC input gain to 61).
However, the mycroft-cli only shows the microphone levels intermittently, I have not been able to determine a pattern, sometimes restarting mycroft a few times makes it work, sometimes not. In no cases are the default wake-words recognised.
Where the array shows up as card #1 and channels 5,6,7,8 are the ADC channels for each microphone. For some reason by default the card has the digital channels (what are they used for?) with gains set reasonably and the analogue channels with gains set to the minimum.
Unfortunately, mycroft still doesn’t seem to want to hear anything.
_Hi gez
Sorry your reply passed me by. No I couldn’t get the seedstudio hat to work (I saw one post that said it was incompatible with Pi3, and gave up) so I swapped it for a ‘raspiauduo pi hat’ Now the speakers work well but I have to talk very close to mycroft for him to hear.
Thanx