如何解决 openFrameworks 和其他音频应用程序之间的冲突?
当我尝试执行 openFrameworks 附带的audioOutputExample 时,我得到
RtApiAlsa::getDeviceIno: snd_pcm_open 设备错误 (hw:0,0)、设备或 资源繁忙。
RtApiAlsa::probeDeviceOpen:pcm 设备 (hw:0,0) 不会打开输出。
RtApi::流未打开!
进程返回 0 (0x0) 执行 时间:3.462 秒 按 ENTER 键 继续。
当
- Rhythmbox 正在播放时
- Rhythmbox 最近播放过(大约 5 秒前)
- Firefox 有一个带有 Grooveshark 的选项卡,可以播放乐曲或暂停
- Groovshark 选项卡最近已关闭(大约 5 秒前)
- Firefox 有一个带有 Youtube 的选项卡视频,正在播放或暂停
- Youtube 选项卡最近已关闭(大约 5 秒前)
否则,即使我之前使用过 Rhythmbox、Grooveshark 或 Youtube,该示例也可以正常工作。
我怎样才能解决这个冲突以允许同时使用audioOutputExample和Rythmbox。
PS 我在 Ubuntu 11.04 上,使用 openFrameworks_v0062_linux64_FAt...
When I try executing the audioOutputExample shipped with openFrameworks, I get
RtApiAlsa::getDeviceIno: snd_pcm_open
error for device (hw:0,0), Device or
resource busy.RtApiAlsa::probeDeviceOpen: pcm device
(hw:0,0) won't open for output.RtApi:: a stream is not open!
Process returned 0 (0x0) execution
time : 3.462 s Press ENTER to
continue.
when
- Rhythmbox is playing
- Rhythmbox has played recently (under ~5 seconds ago)
- Firefox has a tab with Grooveshark, either playing a tune or on pause
- The Groovshark tab has been recently closed (under ~5 seconds ago)
- Firefox has a tab with a Youtube Video, either playing or on pause
- The Youtube tab has been recently closed (under ~5 seconds ago)
Otherwise, the example works fine, even if I've used Rhythmbox, Grooveshark or Youtube before.
How can I solve this conflict to allow simultaneous use of audioOutputExample and, say, Rythmbox.
P.S. I am on Ubuntu 11.04, using openFrameworks_v0062_linux64_FAt...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这只是一个猜测,因为我不熟悉 Linux 上的 OF,但我认为 OF 需要访问低级 ALSA 设备才能获得 RT 功能。因此,它无法与 PulseAudio(或他们现在使用的任何东西)共享设备,而 PulseAudio 允许在应用程序之间共享音频设备。您可以尝试查看 JACK 在 PulseAudio 和 ALSA 程序之间进行复用。
this is just a guess since I'm not up on OF on Linux, but I think OF needs access to the low-level ALSA device in order to get the RT functionality. As such, it can't share the device with PulseAudio (or whatever they're using these days) which allows the audio device to be shared between apps. You could try looking at JACK to multiplex between PulseAudio and your ALSA program.
我找到了解决方案。问题是,我注册了两个内部声音设备 - HDMI 和 PCH。 HDMI 设备始终被分配为 card0,可以通过
在终端中键入来检查。这将列出不同的设备。
更改了我的 alsa 配置,
然后,我使用并在末尾添加
从而强制将 HDMI 分配给 card1,将其他设备分配给 card0。
另一种选择是分配
卡片索引。然而,我在这里读到 HDMI,PCH 这并不适合所有人。
注意此方法的详细信息取决于您计算机中的设备。通过输入 aplay -l 查找 alsa 已知的内容。
I found a solution. The problem was, that I have two internal sound devices registered - HDMI and PCH. The HDMI device was always assigned to be card0, which can be checked by typing
into the terminal. This will list the different devices.
I then changed my alsa configuration using
and adding at the end
thereby forcing the HDMI to be assigned to card1 and the other device to card0.
Another option there is to put
assigning the card index. However, I read here HDMI,PCH that this did not work for everybody.
Note the details of this method depend on the devices that you have in your computer. Find those known to alsa by typing aplay -l.