alsa 排错误记录 ubuntu10.0.4

安装alsa-utils
libasound headers version >= 1.0.16... not present...
先安装alsa-lib


....  panel .. no
configure error required courses helper header not found
安装libncursesw5-dev


configure: error: panelw library not found
./configure --with-curses=ncurses
--->
xmlto man alsactl_init.xml
/bin/bash: xmlto: command not found
make[2]: *** [alsactl_init.7] Error 127
make[2]: Leaving directory `/home/marslo/Tools/Softwares/Audio/alsa-utils-1.0.25/alsactl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/marslo/Tools/Softwares/Audio/alsa-utils-1.0.25/alsactl'
make: *** [all-recursive] Error 1


安装xmlto
xmlto man alsactl_init.xml
/bin/bash: xmlto: command not found
make[2]: *** [alsactl_init.7] Error 127
make[2]: Leaving directory `/home/marslo/Tools/Softwares/Audio/alsa-utils-1.0.25/alsactl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/marslo/Tools/Softwares/Audio/alsa-utils-1.0.25/alsactl'
make: *** [all-recursive] Error 1


---->
安装libxml2


/bin/rm: cannot remove `libtoolt': No such file or directory
强制make!


再安装xml
make[1]: *** [man/man1/xmlto.1] Error 1
make[1]: Leaving directory `/var/tmp/portage/xmlto-0.0.17/work/xmlto-0.0.17'
make: *** [all] Error 2 


。。。




mv: cannot stat `t-ja.gmo': No such file or directory
make[2]: *** [ja.gmo] Error 1


--》安装gettext


http://cyberelk.net/tim/data/xmlto/stable/


./configure --disable-nls --disable-xmlto --with-curses=ncurses
do not make just make install is ok!
### 隐藏 ALSA错误输出的方法 在树莓派或其他基于 Linux 的系统中,ALSA(Advanced Linux Sound Architecture)库可能会频繁输出一些警告或错误消息到终端。这些消息通常是由 `alsa-lib` 或其他音频组件产生的。为了减少干扰并提高用户体验,可以通过以下方法来屏蔽或隐藏这些错误日志。 #### 方法一:设置环境变量 通过修改环境变量可以有效抑制 ALSA错误输出。具体操作如下: 1. **临时禁用** 可以在当前会话中运行以下命令来立即生效: ```bash export ALSA_ERR_LOGGING=0 ``` 这条命令将关闭 ALSA错误日志功能[^3]。 2. **永久禁用** 若要使更改持久化,则需编辑用户的 shell 配置文件(如 `.bashrc` 或 `.zshrc`),并将上述命令添加至其中: ```bash echo 'export ALSA_ERR_LOGGING=0' >> ~/.bashrc source ~/.bashrc ``` #### 方法二:重定向标准错误流 另一种方式是利用 Bash 中的标准输入/输出重定向机制,将错误信息丢弃。例如,在执行播放器程序时可附加以下参数: ```bash aplay some_audio_file.wav 2>/dev/null ``` 此命令中的 `2>` 表示捕获标准错误流(file descriptor 2),而 `/dev/null` 是一个特殊的设备节点,用于丢弃任何写入的数据[^4]。 #### 方法三:配置 asound.conf 文件 如果希望更精细地控制哪些部分的日志被显示或者完全静默某些模块的行为,还可以调整全局或本地的 `asound.conf` 设置。路径通常是 `/etc/asound.conf` 对于全系统范围的应用;或者是 `$HOME/.asoundrc` 用户特定级别上的应用。在此类配置文件里加入类似下面的内容可能有助于降低冗余反馈等级: ```plaintext defaults.pcm.device 0 defaults.pcm.subdevice 0 defaults.pcm.nonblock 1 ``` 以上三种方案各有优劣,请依据实际需求选取合适的方式处理来自 ALSA 的不必要通知。 ```python # 示例 Python 脚本展示如何调用 subprocess 并忽略 stderr 输出 import subprocess subprocess.run(['aplay', 'test_sound.wav'], stderr=subprocess.DEVNULL) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值