Firefly开源社区

标题: asound playback 选哪个 deviceName [打印本页]

作者: snap    时间: 2020-6-15 09:26
标题: asound playback 选哪个 deviceName
板子上应用需要period_size > 1024, 所以不能用deviceName=‘default'。

可以用 “sysdefault:CARD=rockchiprk3308p“,但播放不出声音。

这个问题怎么解决

作者: firefly_zhongw    时间: 2020-6-15 10:42
1. 做什么功能,录音还是播放?
2. 参考维基教程
作者: snap    时间: 2020-6-15 11:08
播放,wiki没有啊,否则也不会在这里问

作者: firefly_zhongw    时间: 2020-6-15 11:13
aplay -D plughw:0,0 xxx.wav
plughw后面的0,0指的是card0,device0.(声卡id和设备id),根据个人情况会有不同
声卡id和设备id可以通过aplay -l命令来查看
作者: snap    时间: 2020-6-15 13:36
你好,能否不通过编译kernel,修改下面asound.conf配置里的period_size不是固定值,而是period_size_min, period_size_max取值范围:

pcm.real_playback {
type dshare
ipc_key 5978293 # must be unique for all dmix plugins!!!! ipc_key_add_uid yes
slave {
    pcm "hw:0,0"
    channels 2 rate 48000
    period_size 1024
    buffer_size 4096
}
bindings {
     00
     11
}
}
作者: snap    时间: 2020-6-15 16:05
aplay -D plughw:0,0 xxx.wav,是可以有声音的。

但程序无非使用card0:0,因为period_size是固定的1024字节。应用程序是计算时间的,所以不能正好是1024字节大小。

有什么办法可以不固定在1024吗?




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1