我遵循本教程(https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage)添加MAX98357 I2S放大器到覆盆子圆周率。它的工作原理很棒,但我希望有一个软件eq来调整高低。我似乎无法确定所需的/etc/asound.conf
配置,以使它实现使用libasound2-plugin-equal
包插件到ASLA。有什么建议吗?
以下是我所拥有的,以及我尝试过的一些评论
pcm.speakerbonnet {
type hw card 0
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "speakerbonnet"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
channels 2
}
}
ctl.dmixer {
type hw card 0
}
pcm.softvol {
type softvol
slave.pcm "dmixer"
control.name "PCM"
control.card 0
}
ctl.softvol {
type hw card 0
}
pcm.!default {
type plug
# this works (ie not using eq)
#slave.pcm "softvol"
# tried setting this to plugin, but this fails to produce sound
slave.pcm plugequal
}
# attempt to get libasound2-plugin-equal working
ctl.equal {
type equal
}
pcm.plugequal {
type equal
slave.pcm "dmixer"
}
pcm.equal {
type plug
slave.pcm plugequal
}
使用上面的配置,我得到以下信息
pi@pi:~ $ speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav
speaker-test 1.1.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
Broken configuration for playback: no configurations available: No such file or directory
Setting of hwparams failed: No such file or directory
pi@pi:~ $
pi@pi:~ $ mpg123 /tmp/test_song.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
Directory: /tmp/
Terminal control enabled, press 'h' for listing of keys and functions.
Playing MPEG stream 1 of 1: test_song.mp3 ...
[src/libout123/modules/alsa.c:80] error: initialize_device(): no configuration available
main: [src/mpg123.c:309] error: out123 error 7: failed to open device
pi@pi:~ $
发布于 2019-07-26 17:03:55
解决方案是设置slave.pmc "plug:dmix"
pcm.speakerbonnet {
type hw card 0
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "speakerbonnet"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
channels 2
}
}
ctl.dmixer {
type hw card 0
}
pcm.softvol {
type softvol
slave.pcm "dmixer"
control.name "PCM"
control.card 0
}
ctl.softvol {
type hw card 0
}
pcm.!default {
type plug
#slave.pcm "softvol"
slave.pcm plugequal
}
# attempt to get libasound2-plugin-equal working
ctl.equal {
type equal
}
pcm.plugequal {
type equal
slave.pcm "plug:dmix"
}
pcm.equal {
type plug
slave.pcm plugequal
}
https://unix.stackexchange.com/questions/532277
复制相似问题