胆怯:无法打开输出设备

发布于 2024-10-03 17:30:59 字数 178 浏览 1 评论 0原文

我已经在专用的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

从此见与不见 2024-10-10 17:30:59

在 Linux 上,胆怯的人喜欢打开 /dev/dsp,即使不需要(对于旁观者来说,-Ow 表示 wav 文件输出)。

虚拟服务器通常没有有意义的 /dev/dsp。有多个虚拟机想要使用相同的音频硬件,但无论如何都缺乏扬声器和观众。

在我的盒子上,我通过将 /dev/dsp 符号链接到 /dev/null 解决了这个问题:

cd /dev
rm dsp        #/dev/dsp was a symlink to /dev/dsp0
ln -s null dsp

这有效。为了在重新启动时解决这个问题,您需要一个名为 /etc/udev/rules.d/z42_fake_dsp.rules 的文件,其内容有点像这样:

KERNEL=="null", SYMLINK+="dsp", OPTIONS+="link_priority=99"

虽然我还没有实际测试过它重新启动。

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:

cd /dev
rm dsp        #/dev/dsp was a symlink to /dev/dsp0
ln -s null dsp

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:

KERNEL=="null", SYMLINK+="dsp", OPTIONS+="link_priority=99"

though I haven't actually tested it over a reboot.

因为看清所以看轻 2024-10-10 17:30:59

我没有安装 timidity,但阅读了手册页:

它说:

timidity [options] filename [...] 

选项看起来不错,但尝试遵循顺序(某些程序有顺序问题):

timidity -Ow -o out.wav toto.midi

另一件事可能是问题是你真的无法写入 out.wav 文件,因此请检查:

  • 当前文件夹中没有 out.wav,
  • 您所在的文件夹具有写入权限

I don't have timidity installed, but reading the man page:

It says:

timidity [options] filename [...] 

The options look OK, but try following the order (some programs have ordering issues):

timidity -Ow -o out.wav toto.midi

The other thing that might be an issue is that you really cannot write to out.wav file, so check:

  • That there's no out.wav in the current folder,
  • That you are in a folder you have write permissions to
番薯 2024-10-10 17:30:59

当我从源头建立胆怯时,类似的错误也发生在我身上。
配置者:
./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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文