Almost going to give up

Hi,
this is my first post and I’m struggling to get my picroft working since 2 days with no success.

Configuration:

  • Picroft 0.8 Image
  • Raspberry Pi 3
  • Microphone usb based on CM108
  • Jack speaker powered by usb

I have mainly 2 issues.

  • When I try the command “Say Hello World” I get:

    2017-07-17 10:52:30,392 - mycroft.configuration - DEBUG - Configuration ‘/usr/local/lib/python2.7/site-packages/mycroft_core-0.8.1-py2.7.egg/mycroft/configuration/mycroft.conf’ loaded
    2017-07-17 10:52:30,393 - mycroft.configuration - DEBUG - Configuration ‘/etc/mycroft/mycroft.conf’ loaded
    2017-07-17 10:52:30,398 - mycroft.configuration - DEBUG - Configuration ‘/home/pi/.mycroft/mycroft.conf’ not found
    2017-07-17 10:52:31,729 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
    2017-07-17 10:52:32,415 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device//setting HTTP/1.1” 401 38
    2017-07-17 10:52:32,428 - mycroft.configuration - WARNING - Failed to fetch remote configuration: HTTPError(u’The supplied authentication is invalid’,)
    Creating client
    2017-07-17 10:52:32,443 - mycroft.messagebus.client.ws - INFO - Connected
    Connected, speaking to Mycroft…‘hello world’
    sent!

And it stucks on “Sent!” The first problem here is that even if I paired the device (2 times) I got the message:

2017-07-17 10:52:32,428 - mycroft.configuration - WARNING - Failed to fetch remote configuration: HTTPError(u'The supplied authentication is invalid',)

How can I get the device paired correctly?

Looking at the log, the last row is:

2017-07-17 10:52:32,656 - SpeechClient - INFO - Speak: Hello
Playing WAVE '/tmp/tts.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono 

That is telling me that I have another issue with the audio. When I boot the device I get:

2017-07-17 11:02:57,343 - mycroft.configuration - DEBUG - Configuration '/usr/local/lib/python2.7/site-packages/mycroft_core-0.8.1-py2.7.egg/mycroft/configuration/mycroft.conf' loaded
2017-07-17 11:02:57,351 - mycroft.configuration - DEBUG - Configuration '/etc/mycroft/mycroft.conf' loaded
2017-07-17 11:02:57,352 - mycroft.configuration - DEBUG - Configuration '/home/mycroft/.mycroft/mycroft.conf' loaded
2017-07-17 11:02:57,762 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-07-17 11:02:58,643 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/c6b5bfb4-1e24-40e8-a466-2dcf4c4bcd79/setting HTTP/1.1" 200 2906
  Carnegie Mellon University, Copyright (c) 1999-2011, all rights reserved
  version: mimic-2.0.0-release Dec 2014 (http://cmuflite.org)
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
2017-07-17 11:02:59,152 - mycroft.messagebus.client.ws - INFO - Connected
2017-07-17 11:03:00,118 - mycroft.client.speech.mic - DEBUG - Waiting for wake word...

It confirms I have an audio issue. I tried the steps as explained here, trying to set up the USB device as input and the default jack as output creating a .asoundrc file:

pcm.!default {
    type asym
    playback.pcm
    {
       type hw
       card 0,0
    }
    capture.pcm
    {
      type hw
      card 1,0
    }
}

ctl.!default {
    type asym
    playback.pcm
    {
       type hw
       card 0,0
    }
    capture.pcm
    {
      type hw
      card 1,0
    }
}

the devices are:

pi@picroft:~ $ lsusb
Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and

pi@picroft:~ $ cat /proc/asound/cards
 0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA
 1 [Device         ]: USB-Audio - USB PnP Sound Device
                      C-Media Electronics Inc. USB PnP Sound Device at usb-3f980000.usb-1.4, full spe

and

pi@picroft:~ $ aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions

if I delete the asoundrc file I have the same error. I also changed the lines
defaults.ctl.card 0
defaults.pcm.card 0.

to 1 in sudo nano /usr/share/alsa/alsa.conf

Any idea?

Thank you

Hi,
I have some update here. I tried to update the system

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

and deleted the .asoundrc file and left the rows:

defaults.ctl.card 1
defaults.pcm.card 1

in the alsa.conf

I still get the same messages

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave

But mycroft doesn’t stuck anymore on play and now is answering to the wake up word and is answering to the key words.

But I have to talk close to the microphone.

how close are you having to talk? If you go into the mycroft cli, at the bottom right corner you can see the noise level on what your mic is picking up. If it passes the threshold (the yellow horizonal mark) then it should be able to pick up what you are saying.

Look at this post to get to the CLI

Hi @Mn0491,
I run some tests.
In the first step Mycroft could catch the wakeup word at a distance about 10cm, in the cli I could see the yellow level at 5 and the level could reach peak of 15 when someone speaks; then I went to alsamixer and changed the autogain control from OFF To AUTO after choosing the usb card, the yellow level went to 42 with peak of 121 and Mycroft can catch the wake up word afrom about 30cm.
I have a dongle usb microphone, are the value acceptable? Do I have to get a better microphone?
Thank you.

If you want to be reliably heard by a microphone from more than a couple feet, you need to have either a perfectly quiet space, a mic array (ala echo), highly directional mics (still limited distance), extremely sensitive mics,or a really loud voice. Or some combination thereof. I use a USB conference call mic, which works pretty well for a small room area without having to shout.

1 Like

Sorry to recovery this old discussion but I have again issue with my audio configuration.
From my first post I just changed my microphone with a Blue snowball mic. It was working for a while but yesterday since my picroft (v 0.8b) couldn’t understand any skill (maybe due the system issue) I decided to reboot the pi3 and now I have no sound in input.

What I have:

pi@picroft:~ $  cat /proc/asound/cards
 0 [ALSA           ]: bcm2835 - bcm2835 ALSA
                      bcm2835 ALSA
 1 [Snowball       ]: USB-Audio - Blue Snowball
                      BLUE MICROPHONE Blue Snowball at usb-3f980000.usb-1.5, full speed

and:

pi@picroft:~ $ lsusb
Bus 001 Device 004: ID 0d8c:0005 C-Media Electronics, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and:

pi@picroft:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Snowball [Blue Snowball], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and:

pi@picroft:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I tried changing defaults.ctl.card and defaults.pcm.card from 0 to 1 in /usr/share/alsa/alsa.conf I also tried to create again the ~/.asoundrc as I had before:

pcm.!default {
    type asym
    playback.pcm
    {
       type hw
       card 0
    }
    capture.pcm
    {
      type hw
      card 1
    }
}

ctl.!default {
    type asym
    playback.pcm
    {
       type hw
       card 0
    }
    capture.pcm
    {
      type hw
      card 1
    }
}

Alsamixer shows the soundcard blue snowball and the mic level is different from 0.

When I open the cli I can see the meter on the left, with a gain fix on 7.86 and level on 0, it seems like it starts as always to move for a quick time when I open cli and then it stops.

Any idea?

Thank you.

Try…
$ pactl list sources
find your mic in the list, there’s a number at the start of each section. Take that number and…
$ pactl set-default-source $(number)
restart things.

Thank you for your answer. What happened is that to test if my mic was broken I connected it to a win pc, after I successfully tested it I reconnected the mic to picroft, after a reboot started to work again. :neutral_face: I’m sure I had disconnected once the mic from picroft before.