胆怯:无法打开输出设备
我已经在专用的 Linux 服务器上安装了 timidity。 当我尝试将 midi 转换为 wav 或 mp3 时:
timidity toto.midi -Ow -o out.wav
我总是收到错误 无法打开输出设备
有什么想法吗?
问候
I have installed timidity on a dedicated Linux server.
when I try to convert a midi to a wav or mp3:
timidity toto.midi -Ow -o out.wav
I always get an error
couldn't open output device
Any idea ?
regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Linux 上,胆怯的人喜欢打开
/dev/dsp
,即使不需要(对于旁观者来说,-Ow
表示 wav 文件输出)。虚拟服务器通常没有有意义的
/dev/dsp
。有多个虚拟机想要使用相同的音频硬件,但无论如何都缺乏扬声器和观众。在我的盒子上,我通过将
/dev/dsp
符号链接到/dev/null
解决了这个问题:这有效。为了在重新启动时解决这个问题,您需要一个名为
/etc/udev/rules.d/z42_fake_dsp.rules
的文件,其内容有点像这样:虽然我还没有实际测试过它重新启动。
On linux, timidity likes to open
/dev/dsp
even when it doesn't need to (for bystanders,-Ow
means wav file output).Virtual servers often don't have a meaningful
/dev/dsp
. There are several VMs wanting to use the same audio hardware, which in any case lacks speakers and an audience.On my box, I solved this by symlinking
/dev/dsp
to/dev/null
:Which works. To bed that in over reboots, you need a file called something like
/etc/udev/rules.d/z42_fake_dsp.rules
, with contents a bit like this:though I haven't actually tested it over a reboot.
我没有安装
timidity
,但阅读了手册页:它说:
选项看起来不错,但尝试遵循顺序(某些程序有顺序问题):
另一件事可能是问题是你真的无法写入
out.wav
文件,因此请检查:I don't have
timidity
installed, but reading the man page:It says:
The options look OK, but try following the order (some programs have ordering issues):
The other thing that might be an issue is that you really cannot write to
out.wav
file, so check:当我从源头建立胆怯时,类似的错误也发生在我身上。
配置者:
./configure --prefix=/usr/local --enable-audio=default,alsa,ao
但后来我发现我的配置有:
conftest.c:73:10: 致命错误: alsa/asoundlib.h: 没有这样的文件或目录
73 | 73 #include
| ^~~~~~~~~~~~~~~~~~
所以之后
apt install libasound2-dev # 以root身份
重新配置如上,
./configure --prefix=/usr/local --enable-audio=default,alsa,ao
制作
sudo make install
现在胆怯运行得很好。
Similar error happened to me when I build timidity from source.
Configured by:
./configure --prefix=/usr/local --enable-audio=default,alsa,ao
But later I discovered my configuration had:
conftest.c:73:10: fatal error: alsa/asoundlib.h: No such file or directory
73 | #include <alsa/asoundlib.h>
| ^~~~~~~~~~~~~~~~~~
So after
apt install libasound2-dev # as root
re-configure as above,
./configure --prefix=/usr/local --enable-audio=default,alsa,ao
make
sudo make install
Now timidity runs fine.