Build an open future with us.

Invest in Mycroft and become a community partner.

Issue with MyCroft audio


#1

Hi Team/Fellow Enthusiasts,

I am getting an error that says “Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’” nd Mycroft’s voice is dead. I am using Pi3 B+ board with Mycroft installed from git (and not from PiCroft) as I already had a lot of code on the board already and I just didn’t want to mess with that.

Mycroft can hear my voice (I see wake word utterance and other logs in DEBUG mode) but can’t respond back.

I have used ./start-mycroft audiotest to see if it’s my speakers or mic or anything else. But that test results in perfect voice recording and playback.

I have installed mycroft the same way(using git) earlier and got it to work but now I am seeing this problem.

Any suggestions or help regarding this is greatly appreciated.

Below is my audio.log from var/log/mycroft:

19:02:59.368 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/mycroft-core/mycroft/configuration/mycroft.conf loaded
19:02:59.380 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/mycroft-core/mycroft/configuration/mycroft.conf loaded
19:02:59.388 - mycroft.configuration.config:load_local:129 - DEBUG - Configuration ‘/etc/mycroft/mycroft.conf’ not found
19:02:59.396 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/.mycroft/mycroft.conf loaded
19:02:59.405 - mycroft.identity:_load:44 - DEBUG - Loading identity
19:02:59.429 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
19:02:59.916 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/eaf2db9e-d02c-404a-a92f-22866598cc5b HTTP/1.1” 401 38
19:02:59.943 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /var/tmp/mycroft_web_cache.json loaded
19:02:59.954 - mycroft.configuration.config:load_local:129 - DEBUG - Configuration ‘/etc/mycroft/mycroft.conf’ not found
19:02:59.960 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/.mycroft/mycroft.conf loaded
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.front.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
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 confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround40.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround71.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
/home/pi/.mycroft/mycroft.conf loaded
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.front.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
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 confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround40.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround71.0:CARD=0’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed


#2

I tried uninstalling pulseaudio and reinstalling pulseaudio and restart the Pi Board.
I am getting the below error (please note that there is no audio still).

Connection to mycroft dot a.i, failed, pairing code could not be skills.log, other
fetched. Check your internet connection and try again.


#3

There appear to be two distinct errors here;


#4

Hi @KathyReid,

I am not sure what the issue is with the alsamixer.

When I do ./start-mycroft audiotest the results are as expected (my mic testing is played back thru the speakers as expected without any issues).

But when I do ./start-mycroft debug then I don’t hear the ‘blink’ sound and can’t hear mycroft’s voice most of the times (but once in a while I hear broken words). But I see mycroft responding back in the cli texts!

Not sure what the problem is, except the above mentioned error I don’t see any other errors or failures in the log that pop out.

Please note that I am using your latest code (after pip issue fix that you guys fixed in the last few weeks) and latest raspian Debian.

Any advise or direction is greatly appreciated.

Thanks,
Sarath.D


#5

This definitely sounds like an alsamixer issue, both with hearing audio from a microphone and with outputting audio from a microphone.

  • In the mycroft-cli-client, can you see the microphone meter moving up and down in the bottom left hand corner when you speak?

  • In alsamixer, if you press F6 to select a sound card, do you see your connected Devices? If you choose these Devices does it make a difference?

  • In alsamixer, if you press F4 for capture selection, do you see your microphone listed?


#6

Yes Kathy… I finally gave up and backed up my code and reflashed my SD with latest Debian and latest Mycroft core and installed it.

Now I think it is working as expected (not sure what was wrong before!!).

Thanks,
Sarath.D


#7

Hi @KathyReid,
I found something today. If I install python-vlc to stream any mp3 formatted audio, it is ruining the audio responses (and this was causing the audio related issues).

Once I install python-vlc to play some audio (it helps with events to check when audio is done playing etc) and the audio service provided by default mycroft libraries was failing with some errors.

Did you guys notice this on your end? If so what is a better way to play/steam audio files.

Thanks,
Sarath.D


#8

Hi there @SarathDammala - are you able to post the errors you were getting? This will help us replicate.


#9

Hi @KathyReid,

Attaching 2 sets of logs (one without python-vlc installed and one with installed).

logs_with_python-vlc_installed.zip
logs_without_python-vlc_installed.zip

Not sure what is going bad as I am pretty sure before installing/after uninstalling python-vlc Mycroft functions flawlessly. But audio fails and the bling sound doesn’t play with python-vlc installed on the board.

Thanks,
Sarath.D


#10

Thanks @SarathDammala. I had a look at these, but couldn’t find any specific differences, other than that if python-vlc is not installed, this error is seen in the logs;

11:38:26.025 - mycroft.skills.core:load_skill:117 - INFO - ATTEMPTING TO LOAD SKILL: mycroft-playmemusic.mycroftai with ID mycroft-playmemusic.mycroftai
11:38:26.037 - mycroft.skills.core:load_skill:159 - ERROR - Failed to load skill: mycroft-playmemusic.mycroftai
Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/core.py", line 126, in load_skill
    imp.PY_SOURCE))
  File "/usr/lib/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/opt/mycroft/skills/mycroft-playmemusic.mycroftai/__init__.py", line 21, in <module>
    import vlc
ImportError: No module named 'vlc'

Some other questions that will help with debugging:

  • Is it all audio that is failing, or just spoken audio? For example, does the News Skill work if python-vlc is installed? I’m trying to differentiate whether this is a particular audio file format issue, as the “ding” sound link to ding sound file is a WAVE file, most podcasts are mp3 files and the generated TTS from memory is also a WAV file - so I have a hunch this is just a WAV file format issue, but want to rule that out by getting you to play an mp3 file with python-vlc not installed.

  • Based on the code in your GitHub repo, this looks like a Magic Mirror installation - is that correct? Is there anything special or unique that Magic Mirror does with the audio?


#11

Hi @KathyReid,
Thanks a lot for looking into this. When python-vlc isn’t installed the skill that plays songs using vlc player fails and it is expected.

Below are the responses for the questions:

  1. After python-vlc is installed I don’t hear the “ding” sound or mycroft’s voice but I am able to play music using the new skill I wrote (the same skill that failed due to missing vlc). Just to add I added 2 more skills to play ted talks podcast and a podcast called “20000 hertz”, and those are played using play_mp3 utils that mycroft libraries provide and do not use vlc player.

These 2 podcasts skills play the shows properly but mycroft’s dialog of acknowledging the request or the “ding” sound cant be heard! But as soon as I uninstall python-vlc everything goes back to normal (ie., I hear the ding sounds and mycroft’s voice as expected).

  1. The mirror doesn’t do anything special with the audio. The reason I had to install vlc was I didn’t know how to play songs from youtube and still add events like song completed etc (not just “stop” but automatically trigger a piece of code when the song is over). If you think I can utilize any core mycroft libraries to do these please let me know.

If you are interested, I made a demo video and I can share it with you guys. Any feedback is greatly appreciated.

Adding the demo video, Just a heads up it’s 8mins long.

Thanks,
Sarath.D


#12

Hi @SarathDammala, the error you receive looks very weird. Those indicate that there is some error in the messagebus but I’m not sure how python-vlc could cause that.

If python-vlc is installed the vlc backend will be activated in the audio process. mycroft-core should have installed python-vlc==1.2.0 and isn’t tested with the latest version (although I just upgraded and here it’s running fine so far)

If not configured to anything else the speech and ding will be played by paplay, which require pulseaudio. On picroft these are configured to use aplay by changing adding

"play_wav_cmdline": "aplay %1"

To the mycroft config.

It may be worth to check if paplay is working (or aplay if you have that configuration)


#13

Hi @forslund,

I will check that and try changing the conf file and see if that works. If not, you were saying that installing python-vlc on your side didn’t break anything. So I just can you please confirm the below statement:

Did you install python-vlc latest version (pip3 install python-vlc) or did you install any specific version? If you used any specific version please let me know what you used.

Thanks for the responses,
Sarath.D


#14

Yes I used the latest. I think it was 3.0.something


#15

Hi @forslund and @KathyReid,

Unfortunately it didn’t work! When I changed mycroft.conf to have
“play_wav_cmdline”: “aplay %1” and I commented out the line
“play_wav_cmdline”: “paplay %1 --stream-name=mycroft-voice” and it broke the audio and mic completely.

Below is the file I edited.
sudo leafpad /home/pi/mycroft-core/mycroft/configuration/mycroft.conf.

I am trying to find alternatives to python-vlc (and first I am going to try installing python-vlc 1.2.0 specific version and see)


#16

I installed python-vlc (version 1.1.2) and it worked.

Thanks everyone for your time,
Sarath.D


#17

Thanks so much for confirming, @SarathDammala