3

我尝试通过两种方法在 RHEL 6 中设置 NAS(网络音频系统):

首先,通过 RPM 安装,

[root@localhost ~]# rpm -Uvh nas-1.9.2-1.el6.x86_64.rpm nas-libs-1.9.2-1.el6.x86_64.rpm

它已安装,但我在 /etc/init.d/ 目录中找不到该服务。只有 /etc/nas/nasd.conf 文件被创建。如果我运行命令

[root@localhost ~]# nasd
Network Audio System Release 1.9.2
Network Audio System Release 1.9.2
Init: Output open(/dev/dsp) failed: No such file or directory

Fatal server error:
could not create audio connection block info

其次,通过配置 NAS 站点提供的最新 tar-ball nas-1.9.3.src.tar.gz。但问题是一样的。

请帮助我正确安装它,因为我想为基于 qt 的应用程序启用音频,并且 qt 使用 NAS 来实现其音频功能。

4

2 回答 2

1

NAS尝试了很多,但没有成功解决我的问题。

然后我使用 Phonon 库来解决声音问题!

无论如何,谢谢你帮助我!:)

于 2013-01-09T11:37:54.477 回答
1

好的。好吧,已经有一段时间了,但是...

您没有足够的权限来打开底层套接字。

我@dev $ strace -o ./nasd.txt nasd -aa -config ./nasd.conf

Network Audio System Release 1.9.3
Network Audio System Release 1.9.3
Error binding unix socket: /var/run/nasd/audio0
: Address already in use

Fatal server error:
Cannot establish unix listening socket

适当的位来自 strace

ioctl(0, SIOCGIFCONF, {96, {{"lo", {AF_INET, inet_addr("127.0.0.1")}}, {"wlan0", {AF_INET, inet_addr("192.168.1.69")}}, {"usb0", {AF_INET, inet_addr("192.168.15.100")}}}}) = 0
umask(0)                                = 022
mkdir("/var/run/nasd", 0777)            = -1 EEXIST (File exists)
unlink("/var/run/nasd/audio0")          = -1 EPERM (Operation not permitted)
socket(PF_FILE, SOCK_STREAM, 0)         = 1
bind(1, {sa_family=AF_FILE, path="/var/run/nasd/audio0"}, 22) = -1 EADDRINUSE (Address already in use)

unlink("/var/run/nasd/audio0") = -1 EPERM (Operation not allowed) 是线索。

如果我们在本地复制 nasd.conf 并将调试值调整为 1 并以 root 身份运行它

我@dev $ sudo nasd -aa -config ./nasd.conf

config: Maxfrags set to 3
config: Minfrags set to 2
config: Fragsize set to 256
config: Maxfrags set to 3
config: Minfrags set to 2
config: Fragsize set to 256
Network Audio System Release 1.9.3
Network Audio System Release 1.9.3
AuInitPhysicalDevices();
Init: will close device when finished with stream.
Init: will keep mixer device open.
Init: Leaving the mixer device options alone at startup.
Init: openDevice OUT /dev/snd/pcmC1D0p mode 1
Init: openDevice(1) IN /dev/snd/pcmC1D0c mode 0
setupSoundcard(...);
++ Setting up Output device (/dev/snd/pcmC1D0p)
+++ requesting wordsize of 16, got 8
+++ requesting 2 channel(s), got 1 channel(s)
+++ Requesting minimum sample rate of 5000, got 5000
+++ Requesting maximum sample rate of 44100, got 44100
setupSoundcard(...);
++ Setting up Input device (/dev/snd/pcmC1D0c)
+++ requesting wordsize of 8, got 8
+++ requesting 2 channel(s), got 1 channel(s)
+++ Requesting minimum sample rate of 4000, got 4000
+++ Requesting maximum sample rate of 44100, got 44100
initMixer: could not open output mixer device /dev/mixer: No such file or directory
Init: initMixer failed
createServerComponents(...);
closeDevice: out
closeDevice OUT /dev/snd/pcmC1D0p mode 1
closeDevice: in
closeDevice IN /dev/snd/pcmC1D0c mode 0
closeDevice: mixer
closeDevice: leaving mixer device(s) open

在我的情况下,看起来我需要设置混音器部分,但这应该会削弱你的错误。

编辑:initMixer: could not open output mixer device /dev/mixer: No such file or directory 这可以通过放置mixer =""在 nasd.conf 中来解决(即使文档声明它不会被尊重,它是)

另外:记得设置您的 AUDIOSERVER 环境变量

export AUDIOSERVER=tcp/localhost:8000 

是默认设置,但确定永远不会伤害...

最后的想法:

默认情况下,现在有许多 x 服务器-nolisten tcp,这可能是实施中需要考虑的问题。

nmap 是你的朋友。

而且,为了记录,我实际上还没有一个端到端的系统工作......希望其他一些善良的灵魂会加入并指出我错过的任何东西。

希望能帮助到你。

我没有 rhel 盒子……但这可能是同一个烫发问题。文档充其量是“瘦”

于 2013-10-05T13:48:37.023 回答