quietnet icon indicating copy to clipboard operation
quietnet copied to clipboard

Problems under ubuntu

Open vgezer opened this issue 10 years ago • 21 comments

I think everything is normal until this:

volkan@ubuntu:~/Belgeler/quietnet$ python send.py ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_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 bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream 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 Welcome to quietnet. Use ctrl-c to exit

But when I send something, i receive the following:

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

As a result, nothing comes in listening part. What can be the problem?

vgezer avatar Jan 13 '14 02:01 vgezer

Curious if pulseaudio works on your pc and if it makes a difference.

lance0 avatar Jan 13 '14 03:01 lance0

volkan@ubuntu:~/Belgeler/quietnet$ pulseaudio E: [pulseaudio] pid.c: Daemon already running.

I think yes :/

vgezer avatar Jan 13 '14 11:01 vgezer

@wakeup did you install pyaudio using apt-get or from the pyaudio site?

Katee avatar Jan 13 '14 14:01 Katee

Give these instructions a try, if they work I'll add that as a note in the readme.

Katee avatar Jan 13 '14 14:01 Katee

I installed using apt-get and tried your instructions, but unfortunately it is the same issue.

vgezer avatar Jan 13 '14 16:01 vgezer

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

The underun is likely caused because pulseaudio is already accessing the card - you can pause it using http://linux.die.net/man/1/pasuspender. In general to avoid such deadlock, you need a soundserver like jackd https://help.ubuntu.com/community/What%20is%20JACK, but you already figured this out from the following log entries in your trace ;-) (apt-get install jackd)

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave"

You need to change "pcm.front cards.pcm.front" to "pcm.front cards.pcm.default" in /usr/share/alsa/alsa.conf.

The rest of the errors are not meaningful, for instance, "bt_audio_service_open: connect() failed: Connection refused (111)" refers to your bluetooth device - you are likely missing some bluethooth packages, but you can simply ignore it.

This should get you moving forward and debug further.

alouche avatar Jan 13 '14 17:01 alouche

@Katee Nice work :+1:

@alouche ,

Thanks for your suggestion. :+1:

I started jackd(via qjackctl) which when started suspends pulseaudio (pasuspender -- /usr/bin/jackd).

But I get the following errors.

$:quietnet (master)$ python send.py ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave Cannot lock down 82246176 byte memory area (Cannot allocate memory) Welcome to quietnet. Use ctrl-c to exit

whereas If I stop jackd(via qjackctl) it throws this error

quietnet (master)$ python send.py ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started Welcome to quietnet. Use ctrl-c to exit

Any pointers would be of good help.

My System Info

quietnet (master)$ uname -a Linux manjurajv 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

quietnet (master)$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog] Subdevices: 0/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0

**** List of CAPTURE Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog] Subdevices: 0/1 Subdevice #0: subdevice #0

quietnet (master)$ aplay -L null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server default Playback/recording through the PulseAudio sound server sysdefault:CARD=PCH HDA Intel PCH, ALC269VC Analog Default Audio Device front:CARD=PCH HDA Intel PCH, ALC269VC Analog Default Audio Device ....

quietnet (master)$ arecord -L null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server default Playback/recording through the PulseAudio sound server sysdefault:CARD=PCH HDA Intel PCH, ALC269VC Analog Default Audio Device front:CARD=PCH HDA Intel PCH, ALC269VC Analog Default Audio Device

manjurajv avatar Jan 16 '14 11:01 manjurajv

You need to make sure real time and memory lock are enabled for jackd

dpkg-reconfigure -p high jackd

Then make sure your username is added to the group "audio".

ulimit -l -r

should display

max locked memory (kbytes, -l) unlimited real-time priority (-r) 95

alouche avatar Jan 18 '14 08:01 alouche

I have Ubuntu 12.04.3 and I started jackd by qjackctl. (note, the package to reconfigure on Ubuntu 12.04 is jackd2, not jackd)

[16:08:37] erinacity:~
alisonc $ python --version
Python 2.7.3
[16:09:20] erinacity:~/Code/quietnet
alisonc $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[16:09:23] erinacity:~/Code/quietnet
alisonc $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
[16:09:40] erinacity:~/Code/quietnet
alisonc $ uname -a
Linux erinacity 3.8.0-35-generic #50~precise1-Ubuntu SMP Wed Dec 4 17:25:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[16:09:43] erinacity:~/Code/quietnet
alisonc $ ulimit -l -r
max locked memory       (kbytes, -l) unlimited
real-time priority              (-r) 95
[16:10:31] erinacity:~/Code/quietnet
alisonc $ 

listen.py:

[16:12:49] erinacity:~/Code/quietnet
alisonc $ python listen.py
Quietnet listening at 19100HzALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave

send.py:

[16:12:36] erinacity:~/Code/quietnet
alisonc $ python send.py
ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Welcome to quietnet. Use ctrl-c to exit
> testing

at this point send.py hangs irresponsible to sigint, and i have to sigkill it.

without using jackd:

[16:15:37] erinacity:~/Code/quietnet
alisonc $ python listen.py
Quietnet listening at 19100HzALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
[16:14:52] erinacity:~/Code/quietnet
alisonc $ python send.py
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
Welcome to quietnet. Use ctrl-c to exit
> testing

at this point send.py also becomes irresponsible to sigint.

alis0nc avatar Jan 18 '14 21:01 alis0nc

... It works now, after I put my laptop to standby and woke it up again.

alis0nc avatar Jan 18 '14 21:01 alis0nc

Even if I try to change the priority to the real-time for some reason I always see it to be 0 and not 95

quietnet# dpkg-reconfigure -p high jackd2 quietnet# ulimit -l -r max locked memory (kbytes, -l) 64 real-time priority (-r) 0

and so do I get the following error

#python listen.py

Quietnet listening at 19100HzALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started Traceback (most recent call last): File "listen.py", line 128, in start_analysing_stream() File "listen.py", line 121, in start_analysing_stream input=True, frames_per_buffer=frames_per_buffer, stream_callback=callback) File "/usr/lib/pymodules/python2.7/pyaudio.py", line 714, in open stream = Stream(self, _args, *_kwargs) TypeError: init() got an unexpected keyword argument 'stream_callback'

quietnet# python send.py ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream Cannot connect to server socket err = No such file or directory Cannot connect to server socket jack server is not running or cannot be started Welcome to quietnet. Use ctrl-c to exit

xeffect avatar Apr 16 '14 22:04 xeffect

Kubuntu 14.10x64:

$ python send.py          
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_route.c:947:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:947:(find_matching_chmap) Found no matching channel map
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
Welcome to quietnet. Use ctrl-c to exit
>

int-ua avatar Nov 03 '14 22:11 int-ua

Is there a way to hide these messages??

vishnudas-raveendran avatar Feb 23 '15 13:02 vishnudas-raveendran

@xeffect : Did you figure out what was going on as far as the priorities are concerned?

I'm having trouble running the example script from PyAudio Website (Wire (Callback)).

manaskarekar avatar Dec 10 '15 18:12 manaskarekar

use following tips for solve bt_audio_service_open: connect() failed: Connection refused (111)

1.sudo apt-get install jackd1
2.sudo apt-get purge bluez-alsa

after that,it still have follow errors, but it doesn't matter. I can listen and say, but i still want to solve it, hope you help me!

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.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_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave

thank you for you tips again.

smilelhh avatar Mar 01 '16 06:03 smilelhh

code--- import speech_recognition as sr

r = sr.Recognizer() with sr.Microphone() as source:
audio = r.listen(source)

try: print("You said " + r.recognize(audio))
print("Could not understand audio")

output: ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream Traceback (most recent call last): File "ll.py", line 9, in print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition AttributeError: 'Recognizer' object has no attribute 'recognize'

nageshd88 avatar Apr 16 '16 11:04 nageshd88

I am getting error at

root@xion:/home/xion/pyaudio# python microphone_recognition.py 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.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 bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave Say something!

theja0473 avatar Jun 08 '16 10:06 theja0473

this started when i crashed the program myself... some soc file is locked it looks like dont know were to look

fenderrex avatar Jun 24 '16 02:06 fenderrex

Did someone find an answer to it. 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.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_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave``

credi-himanshu avatar Nov 22 '16 06:11 credi-himanshu

Maybe this could help (don't forget to reboot and kill pulse as mentioned): https://github.com/Uberi/speech_recognition#user-content-on-ubuntudebian-i-get-errors-like-jack-server-is-not-running-or-cannot-be-started-or-cannot-lock-down--byte-memory-area-cannot-allocate-memory

fwaechter avatar Nov 29 '16 11:11 fwaechter

You need to make sure real time and memory lock are enabled for jackd

dpkg-reconfigure -p high jackd

Then make sure your username is added to the group "audio".

ulimit -l -r

should display

max locked memory (kbytes, -l) unlimited real-time priority (-r) 95 Mine is showing in ubuntu 16.04 baxter@baxter:/usr/share/alsa$ cd baxter@baxter:~$ dpkg-reconfigure -p high jackd /usr/sbin/dpkg-reconfigure must be run as root baxter@baxter:~$ ulimit -l -r max locked memory (kbytes, -l) 64 real-time priority (-r) 0 baxter@baxter:~$

will u please help i also changed "pcm.front cards.pcm.front" to "pcm.front cards.pcm.default" in /usr/share/alsa/alsa.conf.

priyashkla avatar Feb 14 '19 07:02 priyashkla