ALSA lib dlmisc.c (snd1_dlobj_cache_get) symbol _snd_pcm_plug_open is not defined inside [builtin]

$ aplay -D plug:dmix win7.wav
ALSA lib dlmisc.c:263:(snd1_dlobj_cache_get) symbol _snd_pcm_plug_open is not defined inside [builtin]
aplay: main:788: audio open error: No such device or address
$

代码追踪:
这里写图片描述
_snd_pcm_plug_open所在的代码文件为
这里写图片描述

查看libasound.a有没有编译pcm_plug.c
这里写图片描述
可以看到,并没有此文件的。

编译的时候不指定-with-pcm-plugins或者添加对plug的支持-with-pcm-plugins=plug,这样编译出来的libasound.a中就有pcm_plug.o了。如下图所示:
这里写图片描述
可见,plug本身是也是一个plug,呵呵。

再次aplay也不再报第一个错误了。不过有新的错误,如下所示:

$ aplay -D plug:dmix win7.wav 
ALSA lib pcm_direct.c:1722:(snd1_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio)
aplay: main:788: audio open error: Invalid argument
$ 

这里写图片描述

这里写图片描述
这里写图片描述

getgrnam_r写一个Demo,这里一个简单的DEMO获取了audio这个group的详情。但是这个程序如果使用静态链接就会出错,这一点alsalib开发人员并没有想到。
这里写图片描述
稍作改进:
这里写图片描述

lib

make distclean ; ./gitcompile prefix=$PWD/tmp --enable-shared=no --enable-static=yes --without-libdl && make install

utils

make distclean; ./gitcompile prefix=$PWD/tmp --with-alsa-inc-prefix=/tmp/alsa-lib/tmp/include/ --with-alsa-prefix=/tmp/alsa-lib/tmp/lib CFLAGS="-static" --disable-alsamixer && aplay/aplay -D plug:dmix win7.wav

这次可以播放了。
至此解决了如果使用静态编译,dmix无法使用问题,只是一个grp引起的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

袁保康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值