Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyAudio does not work and breaks sound on ubuntu

Ok, so I installed pyaudio from the package python-pyaudio using apt-get , now when I Import and Invoke as follows:

Python 2.7.3 (default, Sep 26 2012, 21:53:58) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyaudio
>>> p= pyaudio.PyAudio()
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_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
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 request channel
jack server is not running or cannot be started

It spits out those error messages. After some researching, I found this question:

PyAudio working, but spits out error messages each time

And in the answers it is mentioned that they are just warnings

But for me, the audio actually does not work and breaks audio on my system, making the Sound applet show all blanks and no audio outs work

Before:

After:

Is this a problem that I can fix?

like image 634
Amith KK Avatar asked Mar 03 '13 04:03

Amith KK


1 Answers

You need to configure alsa properly, make sure that arecord works and default device properly records sound. If fixed it should start to work.

It is better to recompile PyAudio(Portaudio) without Jack and Alsa with Pulseaudio support.

Pulseaudio is a default sound framework in Ubuntu and should work without issues.

like image 165
Nikolay Shmyrev Avatar answered Nov 08 '22 16:11

Nikolay Shmyrev