Sensory Wake Word engine #284

Closed
amauridimaia opened this Issue Oct 7, 2016 · 11 comments

Comments

Projects
None yet
10 participants
@amauridimaia

When I type:
wakeWordAgent/src && ./wakeWordAgent -e sensory

I got this:
INFO:main: Starting Wake Word Agent
INFO:WakeWordAgent: State set to IDLE(2)
INFO:Initializing Sensory library | library name: TrulyHandsfree | library version: 5.0.0-avs.1 | model file: ../ext/resources/spot-alexa-rpi.snsr
WARNING:Library expires on: License expires on 28 Jan 2017 00:00:00 GMT
INFO:SensoryWakeWordEngine: mainLoop thread started
wakeWordAgent: pcm.c:1046: snd_pcm_prepare: Assertion `pcm' failed.
Aborted

I tryed to google it to find some answers but didnt found nothing that could help me, if anyone have something to say please share.

@mgm2788

This comment has been minimized.

Show comment
Hide comment
@mgm2788

mgm2788 Oct 8, 2016

I'm having the same problem. Let me know if you were able to figure this out.

mgm2788 commented Oct 8, 2016

I'm having the same problem. Let me know if you were able to figure this out.

@moviemanic

This comment has been minimized.

Show comment
Hide comment
@moviemanic

moviemanic Oct 9, 2016

I'm having the same issue except with pcm.c:694

I'm having the same issue except with pcm.c:694

@keleric

This comment has been minimized.

Show comment
Hide comment
@keleric

keleric Oct 10, 2016

Collaborator

What is your speaker set up? Are you using USB speaker? 3.5 headphone jack?

Collaborator

keleric commented Oct 10, 2016

What is your speaker set up? Are you using USB speaker? 3.5 headphone jack?

@YaminMalkawi

This comment has been minimized.

Show comment
Hide comment
@YaminMalkawi

YaminMalkawi Oct 11, 2016

Please see this issue which might help: 277

Please see this issue which might help: 277

@ndphu

This comment has been minimized.

Show comment
Hide comment
@ndphu

ndphu Oct 12, 2016

I got the same problem.
There is a file under wakeWordAgent/sensory/alexa-rpi/config called asound.conf.
I replaced my ~/.asoundrc by this file and it can fix the problem. (make sure you have a backup for your current ~/.asoundrc)

ndphu commented Oct 12, 2016

I got the same problem.
There is a file under wakeWordAgent/sensory/alexa-rpi/config called asound.conf.
I replaced my ~/.asoundrc by this file and it can fix the problem. (make sure you have a backup for your current ~/.asoundrc)

@hotwheelzffx

This comment has been minimized.

Show comment
Hide comment
@hotwheelzffx

hotwheelzffx Oct 17, 2016

I have the same issue as OP on wakeWordAgent: pcm.c:1046: snd_pcm_prepare: Assertion `pcm' failed.
I am using a Raspberry Pi 3 with a HiFiBerry Digi+ DAC and USB microphone. As ndphu says, using the sample asound.conf works for me WITHOUT the Digi+. However, with the Digi+ I could not launch the wakeWordAgent. I have been struggling with the correct settings in .asoundrc.

I noticed that something is overwriting my .asoundrc. I have the configuration below that seems to work now. However, when I set .asoundrc to Read Only, the desktop no longer appears and other functions seem to be disabled. Setting .asoundrc back to Read/Write; my .asoundrc is appended and my configuration no longer works.

pcm.usb
{
type hw
#card YOURDEVICENAME shown with arecord -l;
card Device #this is my USB microphone instance
}

pcm.external
{
type hw
#card YOURDEVICENAME shown with aplay -l
card sndrpihifiberry
}

pcm.!default
{
type asym
playback.pcm
{
type plug
slave.pcm "external"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

ctl.!default
{
type asym
playback.pcm
{
type plug
slave.pcm "external"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

What is appended on reboot is the following, which breaks functionality.

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

I have the same issue as OP on wakeWordAgent: pcm.c:1046: snd_pcm_prepare: Assertion `pcm' failed.
I am using a Raspberry Pi 3 with a HiFiBerry Digi+ DAC and USB microphone. As ndphu says, using the sample asound.conf works for me WITHOUT the Digi+. However, with the Digi+ I could not launch the wakeWordAgent. I have been struggling with the correct settings in .asoundrc.

I noticed that something is overwriting my .asoundrc. I have the configuration below that seems to work now. However, when I set .asoundrc to Read Only, the desktop no longer appears and other functions seem to be disabled. Setting .asoundrc back to Read/Write; my .asoundrc is appended and my configuration no longer works.

pcm.usb
{
type hw
#card YOURDEVICENAME shown with arecord -l;
card Device #this is my USB microphone instance
}

pcm.external
{
type hw
#card YOURDEVICENAME shown with aplay -l
card sndrpihifiberry
}

pcm.!default
{
type asym
playback.pcm
{
type plug
slave.pcm "external"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

ctl.!default
{
type asym
playback.pcm
{
type plug
slave.pcm "external"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

What is appended on reboot is the following, which breaks functionality.

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

@hotwheelzffx

This comment has been minimized.

Show comment
Hide comment
@hotwheelzffx

hotwheelzffx Oct 22, 2016

Following up: USB Microphone and a HiFiBerry Digi+ DAC on my Raspberry Pi 3. I was able to get this working by installing PulseAudio.
sudo apt-get install VLC
sudo apt-get install pulseaudio
sudo apt-get install pavucontrol
The running it with: pulseaudio -D
Then starting the Alexa services.
If you still don't hear sound, check on the PulseAudio mixer application. Alexa looks like it routes thru VLC. Make sure you have the volume up on that entry.

Following up: USB Microphone and a HiFiBerry Digi+ DAC on my Raspberry Pi 3. I was able to get this working by installing PulseAudio.
sudo apt-get install VLC
sudo apt-get install pulseaudio
sudo apt-get install pavucontrol
The running it with: pulseaudio -D
Then starting the Alexa services.
If you still don't hear sound, check on the PulseAudio mixer application. Alexa looks like it routes thru VLC. Make sure you have the volume up on that entry.

@DocHopper

This comment has been minimized.

Show comment
Hide comment
@DocHopper

DocHopper Oct 31, 2016

ndphu said:
I got the same problem.
There is a file under wakeWordAgent/sensory/alexa-rpi/config called asound.conf.
I replaced my ~/.asoundrc by this file and it can fix the problem. (make sure you have a backup for your current ~/.asoundrc)

I concur. This resolved my issue as well.

Now here's the strange thing. I stopped the wakeWordAgent, and reran it a couple of times and it kept working. I fiddled with the sound/volume settings from the tray at the top right, and after a couple minutes, it stopped working with the PCM error. After I RECOPIED the config as above it launched straight away.

I'm not savvy enough with Linux to be able to debug how or what is getting jiggered... but something is, apparently in the background swizzling something and breaking the wakeWordEngine.

ndphu said:
I got the same problem.
There is a file under wakeWordAgent/sensory/alexa-rpi/config called asound.conf.
I replaced my ~/.asoundrc by this file and it can fix the problem. (make sure you have a backup for your current ~/.asoundrc)

I concur. This resolved my issue as well.

Now here's the strange thing. I stopped the wakeWordAgent, and reran it a couple of times and it kept working. I fiddled with the sound/volume settings from the tray at the top right, and after a couple minutes, it stopped working with the PCM error. After I RECOPIED the config as above it launched straight away.

I'm not savvy enough with Linux to be able to debug how or what is getting jiggered... but something is, apparently in the background swizzling something and breaking the wakeWordEngine.

@deriidf

This comment has been minimized.

Show comment
Hide comment
@deriidf

deriidf Jan 4, 2017

got the same problem and fixed
try this

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

deriidf commented Jan 4, 2017

got the same problem and fixed
try this

pcm.!default
{
  type asym
  playback.pcm {
    type hw
    card 0
    device 0
  }
  capture.pcm {
    type plug
    slave {
      pcm {
        type hw
        card 1
        device 0
      }
    }
  }
}
@keleric

This comment has been minimized.

Show comment
Hide comment
@keleric

keleric Jan 26, 2017

Collaborator

We're closing this Issue since the original poster (or another commenter) hasn't yet responded to the question or request made to them 22 days ago. We therefore assume that the user has lost interest or resolved the problem on their own.
Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the Issue.
Thanks!

Collaborator

keleric commented Jan 26, 2017

We're closing this Issue since the original poster (or another commenter) hasn't yet responded to the question or request made to them 22 days ago. We therefore assume that the user has lost interest or resolved the problem on their own.
Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the Issue.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment