简体   繁体   English

ALSA:如何在设备列表中找到设备,但打开该设备时仍收到“无此文件或目录”?

[英]ALSA: How can I find a device in the device list and still I get “No such file or directory” when opening it?

It seems I don't understand the ALSA architecture, even after reading most of the documentation on offer: 即使阅读了提供的大多数文档后,我似乎也不了解ALSA体系结构:

I list all the available ALSA devices using snd_device_name_hint() and snd_device_name_get_hint(). 我使用snd_device_name_hint()和snd_device_name_get_hint()列出了所有可用的ALSA设备。 This lists, among others "pulse" under hwdep class so it looks like PulseAudio is available in my system. 这列出了hwdep类下的“ pulse”,因此我的系统中看起来PulseAudio可用。 But when I try to open it with snd_pcm_open() (non-blocking mode and either in or out) I get "No such file or directory". 但是,当我尝试使用snd_pcm_open()(非阻止模式,无论是进入还是退出)打开它时,都会收到“没有这样的文件或目录”。

What gives? 是什么赋予了? I can open other devices, for instance the in-built Intel chip works fine, why doesn't PulseAudio? 我可以打开其他设备,例如内置的Intel芯片工作正常,为什么PulseAudio不?

Is pulseaudio running with the alsa emulation plugin loaded before you try to open the pulse device? 在尝试打开Pulse设备之前,是否已在alsa仿真插件上加载了pulseaudio? If I understand how asoundrc files work you can create virtual alsa devices from the config file (which is how a pulse device gets created) which will exist whether the backend for that virtual device is running or not. 如果我了解asoundrc文件的工作方式,则可以从配置文件中创建虚拟alsa设备(这是创建脉冲设备的方式),无论该虚拟设备的后端是否在运行,该文件都会存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM