并不是说我需要以aplayroot 身份,但它遇到了我,我想知道为什么它不应该工作。
# aplay /home/bibek/apert.wav
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by
uid 1000! (This could e g happen if you try to connect to a non-root
PulseAudio as a root user, over the native protocol. Don't do that.)
ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave
aplay: main:722: audio open error: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我可以看到它给了我合理数量的细节,但我仍然不明白。
好的,我已经安装了 Linux Mint 17.2 Cinnamon。但我也安装了xfce4并且openbox正在使用带有 openbox 的 xfce4 桌面环境。
起初,我在音频音量控制及其按键绑定方面遇到了一些问题。我尝试编写脚本来降低音量并将其绑定到 fn 组合键。但我搞砸了更多。
我尝试删除并重新安装alsamixer、、以及其他一些与音频相关的软件包pavucontrol。
但现在,音频完全被破坏了。现在仅显示“虚拟输出”作为可用的输出设备。 pulseaudiopavucontrol
$ pacmd list-sinks显示 1 个可用的水槽device.description = "Dummy Output"。未检测到内置接收器和 USB 音频设备。
当我尝试时$ sudo alsa force-reload,我得到以下信息:
Unloading ALSA sound driver modules: (none loaded).
Loading ALSA sound driver modules: (none to reload).
我的猜测是我以某种方式破坏了音频驱动程序。我现在不知道该怎么办。
就其价值而言,我在音频组中表现非常出色。
我正在尝试运行这个脚本:
test.sh
#!/bin/bash
BAT_LEVEL=`acpi -b |grep -Eo "[0-9]+%"|grep -Eo "[0-9]+"`
CRIT=0
if [ $BAT_LEVEL -gt $CRIT ]; then
echo "foo"
aplay ~/apert.wav
notify-send "Battery-Low"
echo "bar"
fi
Run Code Online (Sandbox Code Playgroud)
上面的第六行notify-send "Battery-Low"就像您在终端中所期望的那样工作。
但是当脚本执行时,它只是在标准输出foo上吐出bar。
我不知道问题是什么。