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

2,999 views
Skip to first unread message

Blake Atwell

unread,
Jan 26, 2016, 11:43:44 PM1/26/16
to Jasper Support Forum

I have been messing with this a few days. I have gotten audio output working but it looks like the configuration for the microphone is causing it to crash. Any help would be greatly appreciated.


pi@raspberrypi:~/jasper $ ./jasper.py --debug

*******************************************************

*             JASPER - THE TALKING COMPUTER           *

* (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis *

*******************************************************

DEBUG:client.diagnose:Checking network connection to server 'www.google.com'...

DEBUG:client.diagnose:Network connection working

DEBUG:__main__:Trying to read config file: '/home/pi/.jasper/profile.yml'

DEBUG:client.diagnose:Checking python import 'pocketsphinx'...

DEBUG:client.diagnose:Python module 'pocketsphinx' found: '/usr/lib/python2.7/dist-packages/pocketsphinx.so'

DEBUG:client.diagnose:Checking executable 'aplay'...

DEBUG:client.diagnose:Executable 'aplay' found: '/usr/bin/aplay'

DEBUG:client.diagnose:Checking executable 'espeak'...

DEBUG:client.diagnose:Executable 'espeak' found: '/usr/bin/espeak'

DEBUG:client.vocabcompiler:compiled_revision is 'bb74ae36d130ef20de710e3a77b43424b8fa774f'

DEBUG:client.brain:Looking for modules in: '/home/pi/jasper/client/modules'

DEBUG:client.brain:Found module 'Birthday' with words: ['BIRTHDAY']

DEBUG:client.brain:Found module 'Gmail' with words: ['EMAIL', 'INBOX']

DEBUG:client.brain:Found module 'HN' with words: ['HACKER', 'NEWS', 'YES', 'NO', 'FIRST', 'SECOND', 'THIRD']

DEBUG:client.brain:Found module 'Joke' with words: ['JOKE', 'KNOCK KNOCK']

DEBUG:client.brain:Found module 'Life' with words: ['MEANING', 'OF', 'LIFE']

DEBUG:client.brain:Found module 'MPDControl' with words: ['MUSIC', 'SPOTIFY']

DEBUG:client.brain:Found module 'News' with words: ['NEWS', 'YES', 'NO', 'FIRST', 'SECOND', 'THIRD']

DEBUG:client.brain:Found module 'Notifications' with words: ['FACEBOOK', 'NOTIFICATION']

DEBUG:client.brain:Found module 'Time' with words: ['TIME']

DEBUG:client.brain:Found module 'Unclear' with words: []

DEBUG:client.brain:Found module 'Weather' with words: ['WEATHER', 'TODAY', 'TOMORROW']

DEBUG:client.vocabcompiler:compiled_revision is '8c0e66f387b7177205726ecfcb3edd9df0d23653'

INFO:client.mic:Initializing PyAudio. ALSA/Jack error messages that pop up during this process are normal and can usually be safely ignored.

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

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

Cannot connect to server socket err = No such file or directory

Cannot connect to server request channel

jack server is not running or cannot be started

INFO:client.mic:Initialization of PyAudio completed.

DEBUG:client.tts:Saying 'How can I be of service, Blake?' with 'espeak-tts'

DEBUG:client.tts:Executing espeak -v default+m3 -p 40 -s 160 -w /tmp/tmpdMeA1c.wav 'How can I be of service, Blake?'

DEBUG:client.tts:Executing aplay -D plughw:0,0 /tmp/tmpdMeA1c.wav

DEBUG:client.tts:Output was: 'Playing WAVE '/tmp/tmpdMeA1c.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono

'

DEBUG:client.brain:Looking for modules in: '/home/pi/jasper/client/modules'

DEBUG:client.brain:Found module 'Birthday' with words: ['BIRTHDAY']

DEBUG:client.brain:Found module 'Gmail' with words: ['EMAIL', 'INBOX']

DEBUG:client.brain:Found module 'HN' with words: ['HACKER', 'NEWS', 'YES', 'NO', 'FIRST', 'SECOND', 'THIRD']

DEBUG:client.brain:Found module 'Joke' with words: ['JOKE', 'KNOCK KNOCK']

DEBUG:client.brain:Found module 'Life' with words: ['MEANING', 'OF', 'LIFE']

DEBUG:client.brain:Found module 'MPDControl' with words: ['MUSIC', 'SPOTIFY']

DEBUG:client.brain:Found module 'News' with words: ['NEWS', 'YES', 'NO', 'FIRST', 'SECOND', 'THIRD']

DEBUG:client.brain:Found module 'Notifications' with words: ['FACEBOOK', 'NOTIFICATION']

DEBUG:client.brain:Found module 'Time' with words: ['TIME']

DEBUG:client.brain:Found module 'Unclear' with words: []

DEBUG:client.brain:Found module 'Weather' with words: ['WEATHER', 'TODAY', 'TOMORROW']

INFO:apscheduler.scheduler:Scheduler started

DEBUG:apscheduler.scheduler:Looking for jobs to run

DEBUG:apscheduler.scheduler:No jobs; waiting until a job is added

INFO:apscheduler.scheduler:Added job "Notifier.gather" to job store "default"

INFO:client.conversation:Starting to handle conversation with keyword 'JASPER'.

DEBUG:apscheduler.scheduler:Looking for jobs to run

DEBUG:apscheduler.scheduler:Next wakeup is due at 2016-01-27 04:31:10.191479+00:00 (in 29.978721 seconds)

DEBUG:client.conversation:Started listening for keyword 'JASPER'

Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514

Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818

Traceback (most recent call last):

  File "./jasper.py", line 148, in <module>

    app.run()

  File "./jasper.py", line 118, in run

    conversation.handleForever()

  File "/home/pi/jasper/client/conversation.py", line 31, in handleForever

    threshold, transcribed = self.mic.passiveListen(self.persona)

  File "/home/pi/jasper/client/mic.py", line 112, in passiveListen

    frames_per_buffer=CHUNK)

  File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 747, in open

    stream = Stream(self, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 442, in __init__

    self._stream = pa.open(**arguments)

IOError: [Errno Invalid number of channels] -9998

INFO:apscheduler.scheduler:Scheduler has been shut down

pi@raspberrypi:~/jasper $ 

Niels Looije

unread,
Jan 27, 2016, 5:11:24 AM1/27/16
to Jasper Support Forum
The raspberry pi is a bit finicky with audio. It took me the better part of a day to get it working aswell.
What version of the pi are you using? and can you post your ~/.asoundrc file?

I am using a raspberry pi B model with this ~/.asoundrc file:

pcm.usb
{
    type hw
    card
0
}

pcm
.internal
{
    type hw
    card
1
}

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

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


This is with a usb microphone which is card 0 and the audio jack as card 1.

Alexandre Desautels

unread,
Feb 10, 2017, 1:29:14 PM2/10/17
to Jasper Support Forum
Hi,

 I'm trying to make it work using a USB Sound card and a Usb Mic (PS Eye). Looks like my config is good but when I run a arecord, I get: Device or resource busy. Here is my asoundrc

pcm.CameraB409241
{
    type hw
    card 0
    device 0
}

pcm.Device
{
    type hw
    card 2
    device 0
}

pcm.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "Device"
    }
    capture.pcm
    {
        type plug
        slave.pcm "CameraB409241"
    }
}

ctl.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "Device"
    }
    capture.pcm
    {
        type plug
        slave.pcm "CameraB409241"
    }
}

What do to?

Thanks

Matthew Curry

unread,
Feb 27, 2017, 8:45:27 PM2/27/17
to Jasper Support Forum
You shouldn't need the asoundrc, what is your audio output device?

cbss...@gmail.com

unread,
Mar 31, 2017, 5:36:22 AM3/31/17
to Jasper Support Forum
please help me how can i solve this error 
im using raspberry pi3 model B

i dont know how to overcome this error


*******************************************************
*              JASPER - THE TALKING COMPUTER            *
* (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis  *
*******************************************************
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
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 pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
WARNING:client.notifier:gmail_address or gmail_password not set in profile, Gmail notifier will not be used
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
  File "jasper.py", line 151, in <module>
    app.run()
  File "jasper.py", line 121, in run
    conversation.handleForever()
  File "/home/pi/jasper/client/conversation.py", line 31, in handleForever
    threshold, transcribed = self.mic.passiveListen(self.persona)
  File "/home/pi/jasper/client/mic.py", line 110, in passiveListen
    frames_per_buffer=CHUNK)
  File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 747, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 442, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno Invalid sample rate] -9997



Kaibo Fu

unread,
Jun 6, 2017, 8:07:18 AM6/6/17
to Jasper Support Forum
Hi, I also met the same error as you. Have you solved your problem ?
Please help !!

在 2017年3月31日星期五 UTC+8下午5:36:22,The CBS写道:

Emilio D

unread,
Jun 27, 2017, 2:33:47 AM6/27/17
to Jasper Support Forum
I get the same error. Any luck?
Reply all
Reply to author
Forward
0 new messages