在Ubuntu 14.04上使用python读取音频错误



使用python 2.7 (Ubuntu 14.04)运行以下代码

import pyaudio
p = pyaudio.PyAudio()

我得到以下异常:

ALSA lib pcm_dsnoop_c:618:(snd_pcm_dsnoop_open) cannot open slave

ALSA lib pcm_dmix_c:1022:(snd_pcm_dmix_open) cannot open slave

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) cannot open slave

无法连接到服务器套接字err =没有这样的文件或目录

无法连接到服务器请求通道插孔服务器未运行或无法启动

非常感谢您的帮助

您是否安装了bluez-alsa包?如果是,请将其移除并重新测试。应该去掉错误

如果没有,这里也有一些讨论(https://github.com/Katee/quietnet/issues/18)可能会有所帮助。

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)

最新更新