python2.7的Alsa问题-无法打开奴隶


12

我正在使用python的模块pyaudio处理声音,但ALSA返回:

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可以很好地录制声音并从终端播放声音,但是python(2.7)不断返回这些错误。我不知道它是否相关,但是我也可以双重引导到Windows 8.1。



您是否尝试过以root用户身份运行该程序?也许您需要audio和其他人在一起?
LittleByBlue '16

Answers:


3

这可以摆脱“未知设备”消息: sudo nano /usr/share/alsa/alsa.conf并注释掉列出的未知设备cards.pcm.{device}在哪里{device}

这将摆脱杰克服务器错误,不确定其他

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

如果在运行后出现内存错误,则注销/登录:

sudo usermod -a -G audio MYUSERNAME

确保您注销/登录,否则权限将不会更新。

您可能需要运行:

jack_control  start

再次


在类似情况下不适合我。也许相关的stackoverflow.com/q/35652194/54964是否需要重新启动才能产生效果?我没做这个。
莱奥波德·赫兹(LéoLéopoldHertz)2016年

仅需要重新启动(实际上注销)usermod才能生效。要查看它是否运行groups,请运行并且您会看到audio列出的内容
乔纳森(Jonathan),
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.