Skip to content

Need help with this alsa error : "Attempt to connect to server failed"

Good evening,

Sound output and recording work fine on my system. However when I launch Audacity, etc. I get this error:

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed

Audacity still works perfectly. But lately I've been trying to use this python lib ("speech recognition") which crashes. I assume it's related to these errors since this is the output:

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Traceback (most recent call last):
  File "/home/geecko/Documents/ba1/Test/main.py", line 17, in <module>
    audio = recognizer.listen(source)                   # listen for the first phrase and extract it into audio data
  File "/usr/lib/python2.7/site-packages/speech_recognition/__init__.py", line 159, in listen
pause_buffer_count = math.ceil(self.pause_threshold / seconds_per_buffer) # number of buffers of quiet audio before the phrase is complete
ZeroDivisionError: float division by zero

Does anybody know how I can fix these errors? Especially the jack_0 one. I've already reported the issue on the github issue tracker, but the dev doesn't seem to be able to help. I believe it's an issue that is specific to my system.

Thank you very much

2 points5 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
2fepl5

Author

15
posts
94
comments
5
media
View profile

8 comments

Do you have a group " audio " on your system?

Are you in that group?

Do you have entries starting with "@audio " /etc/security/limits.conf ?

What do they look like?

1 points

It's been a while man. The issue has been resolved, but thanks.

The issue was with the Speech Recognition lib, some buffering variable needed to be lowered because of the Raspberry Pi's specs.

1 points

The issue was with the Speech Recognition lib, some buffering variable needed to be lowered because of the Raspberry Pi's specs.

do you have any info on this? (i know it's old (damn, very old) but i can't find what bufferin variable needs lowering?)

1 points

I'm glad to hear. I just fixed a similar problem, but it was related to "@audio " in /etc/security/limits.conf and no hints in that direction. So I used the search for similar siiues. I'm still kinda worried, because people won't be able to find the solution in the web and I don't want to make an account to document it.

1 points

I see the same line when I run Audacity. I think it tries to connect to several different kinds of sound setups (JACK being one of them), and lots of them fail before it finds the one that works for your system. I don't think it's anything to worry about.

As for the Python, I'm guessing that's not the cause of the problem. It would be awfully strange for them to assume that your system uses JACK, and I don't see how failing to connect would cause a ZeroDivisionError.

EDIT: To clarify, that's not an ALSA error, it's the program trying to connect to the JACK server, which is a sound server often used for doing realtime audio work.

1 points

Thank you for this very concise analysis, I've informed the developer.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.