Alsa problems with python2.7- Unable to open slave

I am using python's module pyaudio to process sound but ALSA returns:

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

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

Alsa works fine in recording sound and playing it from terminal, but python (2.7) keeps returning these errors. I dont know if it is relevant but i can dual boot to Windows 8.1 as well.


This can get rid of the Unknown Device messages: sudo nano /usr/share/alsa/alsa.conf and comment out cards.pcm.{device} where {device} is the unknown devices listed

this will get rid of the jack server error, not sure about the others

sudo apt install multimedia-jack
pulseaudio --kill
jack_control  start

If you get memory errors logout/login AFTER running:

sudo usermod -a -G audio MYUSERNAME

Make sure you log out / in, otherwise permissions won't be updated.

You may need to run:

jack_control  start

again