我的 Ubuntu 12.04 上有一些应用程序需要 Jack。没有 Jack,它们就无法启动,所以我必须保留 Jackd + (QjackCtl)。现在的问题是 jackd 始终无法正常启动。有时它运行良好,有时却无法启动(我怀疑是 Pulseaudio 的原因)。
现在,我找到了一种解决方法,可以让 Jack 和 Pulseaudio 并行运行,以下是我所做的
1. Installing pulseaudio-modules-jack
2. Editing /etc/pulse/default.pa and adding these lines
### Load audio drivers statically
load-module module-jack-sink
load-module module-jack-source
重启电脑后,我可以看到 Jack 和 Pulseaudio 都正常工作。但还有另一个问题,扬声器的声音输出非常低,CPU 峰值增加了很多,硬件设备未显示。声音控制显示 5:1 声音系统,而我只有 2:1 声音系统。
我需要一种在 Pulseaudio 和 Jack 之间切换的方法。我不是专业的音乐制作人。我只在使用 Ardour 或任何其他需要 Jack 的应用程序时才需要 Jackd。您一定以为启动 Jack 时会自动禁用 Pulseaudio。但对我来说情况并非如此。以前我尝试这样做时遇到过错误
这是该错误的日志
14:36:48.194 Patchbay deactivated.
14:36:48.198 Statistics reset.
14:36:48.228 ALSA connection change.
14:36:48.241 D-BUS: Service is available (org.jackaudio.service aka jackdbus).
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
Registered event listener change listener: true
14:36:48.258 ALSA connection graph change.
14:37:12.679 D-BUS: JACK server could not be started. Sorry
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
QSpiAccessible::accessibleEvent not handled: "2" obj: QMessageBox(0xbfd7c2d0) ""
FIXME: handle dialog start.
Sat Feb 2 14:37:12 2013: Starting jack server...
Sat Feb 2 14:37:12 2013: JACK server starting in realtime mode with priority 10
Sat Feb 2 14:37:12 2013: [1m[31mERROR: Cannot lock down 82241434 byte memory area (Cannot allocate memory)[0m
Sat Feb 2 14:37:12 2013: control device hw:0
Sat Feb 2 14:37:12 2013: control device hw:0
Sat Feb 2 14:37:12 2013: [1m[31mERROR: Failed to acquire device name : Audio0 error : Cannot allocate memory[0m
Sat Feb 2 14:37:12 2013: [1m[31mERROR: Audio device hw:0 cannot be acquired...[0m
Sat Feb 2 14:37:12 2013: [1m[31mERROR: Cannot initialize driver[0m
Sat Feb 2 14:37:12 2013: [1m[31mERROR: JackServer::Open() failed with -1[0m
Sat Feb 2 14:37:12 2013: [1m[31mERROR: Failed to open server[0m
Sat Feb 2 14:37:13 2013: Saving settings to "/home/soham/.config/jack/conf.xml" ...
FIXME: handle dialog end.
14:37:17.923 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
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
QSpiAccessible::accessibleEvent not handled: "2" obj: QMessageBox(0xbfd7cb40) ""
FIXME: handle dialog start.
FIXME: handle dialog end.
QSpiAccessible::accessibleEvent not handled: "6" obj: QMenu(0x8d0f0a0) ""
现在我的问题是如何安全地在 Pulse 和 Jack 之间切换?有没有什么应用程序可以做到这一点?
以下是截图 -
答案1
目前我发现的最佳选择是在 jack 运行时暂停 pulseaudio。pulseaudio 和 jack页面,并涉及通过调用jack服务器pasuspender
。
从手册页中:
pasuspender is a tool that can be used to tell a local PulseAudio sound
server to temporarily suspend access to the audio devices, to allow
other applications access them directly. pasuspender will suspend
access to the audio devices, fork a child process, and when the child
process terminates, resume access again.
答案2
我意识到这个问题很久以前就被问到/回答过了,但我有一些额外的信息可能会对那些遇到这个问题的人有所帮助。
原始发帖者表示,他们在同时使用脉冲音频和 jackd 时遇到了 CPU 峰值(延迟)。根据我的经验(我是一名专业录音室工程师),这是由于没有运行可用于 ardour 等的低延迟内核造成的。
我的建议是先使用 rt-kernel 安装并重启您的 PC。内核应该在 repo 和 synaptic 中可用,但是源可能需要激活。
就我个人而言,我会推荐 rt-kernel,因为 ubuntu 积极支持它并且可用(并且不会影响您电脑的整体日常使用)。