Open leearthur56 opened 7 years ago
I am having the same problem. Did you find the solution?
no i have not :(
why not you try below in ~/.asoundrc file. check which one is your USB Card and replace card value (card 0) accordingly. do the same for internal sound card.
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"
}
}
@ArthurLee1 I finally got it working last night. I had to change the RATE in the mic.py. Once I fixed that I started getting overflow error then I had to go in and change the CHUNK size.
I set the RATE to 48000 and chunk to 8132. Now its listening but it doesn't detect voice much. I am going to try the dev branch to see if that improves anything
hi i also got this error and changed it like u did @ashishmusale and got a overflow error
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_equal.c:196:(_snd_pcm_equal_open) No slave configuration for equal pcm
ALSA lib pcm_equal.c:196:(_snd_pcm_equal_open) No slave configuration for equal pcm
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
WARNING:client.notifier:gmail_address or gmail_password not set in profile, Gmail notifier will not be used
Traceback (most recent call last):
File "jasper.py", line 151, in
i changed it like u did but i still get the same error 89 def passiveListen(self, PERSONA): 90 """ 91 Listens for PERSONA in everyday sound. Times out after LISTEN_TIME, so 92 needs to be restarted. 93 """ 94 95 THRESHOLD_MULTIPLIER = 1.8 96 RATE = 48000 97 CHUNK = 8132 98
sorry, my bad. The chunk value is 8192
@ashishmusale did u change all RATE = 16000 CHUNK = 1024 in mic.py?
i think i need some other value if i use 8192 and get: No disturbance detected No disturbance detected No disturbance detected
and when i use 4096 i get the same error
Cannot connect to server request channel
jack server is not running or cannot be started
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
@flipchan Yes, I changed all the instances of RATE and CHUNK
@ashishmusale seem like some kind of wierd error i have tried
42000 #36000 #24000 #48000 #16000 7168 #6144 #5120 #4096 #8192 #1024
and IOError: [Errno Invalid sample rate] -9997
Hi, I also changed all the RATE's and CHUNK's, but it still doesn't work and I am getting this weird message:
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
Traceback (most recent call last):
File "jasper/jasper.py", line 151, in
Thanks all for helping!
Hi! If your mic doesn't support a sample rate of 16kHz (which seems to be the case in this issue thread) you can fix it by doing some edits in mic.py:
RATE
variables to one that your mic does supportCHUNK
variable in the magnitude in order to make up for the increase in data size. In my case I increased the sample rate from 16000Hz to 44100Hz, so I also increased the chunk size from 1024 to 3072 (since around 3 times more data is generated). For simple usage, one could use the formula (NEW_SAMPLE_RATE/16000) * 1024
to get a rough estimate.def resample(self, data, rate):
(newfragment, state) = audioop.ratecv(data, 2, 1, rate, 16000, None)
return newfragment
Change so that you always call this function when you read the data, i.e. change all lines with
data = stream.read(CHUNK)
to
data = self.resample(stream.read(CHUNK), RATE)
This should do the trick! If I have the time I will try to generalize this part and make a pull request, but in the meantime I hope this help you.
This worked perfectly! I was using this microphone from amazon
No problem!
On Sun, Jan 28, 2018 at 8:11 PM, presingjos notifications@github.com wrote:
THANK YOU!
This worked perfectly! I was using this microphone https://www.amazon.com/Kinobo-Microphone-Desktop-Recognition-Software/dp/B00IR8R7WQ/ref=sr_1_4?ie=UTF8&qid=1517188236&sr=8-4&keywords=usb+2.0+microphone from amazon
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jasperproject/jasper-client/issues/595#issuecomment-361114855, or mute the thread https://github.com/notifications/unsubscribe-auth/ARhKK_vz7_ZHmfoGeTYGgXwmi8FPI8qjks5tPRq2gaJpZM4L6FeF .
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 confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.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 surround21 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.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 surround21 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.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 surround40 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.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 surround41 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.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 surround50 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.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 surround51 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.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 surround71 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' 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 iec958 ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' 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 spdif ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2' 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 spdif 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
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 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/jasper.py", line 151, in
app.run()
File "jasper/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