我已在运行 Raspian 和 Snapclient 的 Raspberry Pi 4 B+ 上安装了
alsaequal
(Linux snapclient 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
)。
当我跑步时:
speaker-test -D equal
扬声器测试正常,alsa 均衡器可以使用
alsamixer -D equal
控制音频输出。
当我列出 Snapclient 可用的音频设备时:
snapclient -l
我得到:
0: null
Discard all samples (playback) or generate zero samples (capture)
1: plugequal
2: equal
3: hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Direct hardware device without any conversions
4: plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Hardware device with all software conversions
5: default:CARD=sndrpihifiberry
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Default Audio Device
6: sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Default Audio Device
7: dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
Direct sample mixing device
但是如果我尝试跑步:
snapclient -s 2
我收到错误:
2024-02-12 11-10-17.610 [Info] (Snapclient) Version 0.27.0, revision 54a3d862
2024-02-12 11-10-17.627 [Info] (Avahi) (Browser) NEW: service 'Snapcast' of type '_snapcast._tcp' in domain 'local'
2024-02-12 11-10-17.628 [Info] (Avahi) (Browser) CACHE_EXHAUSTED
2024-02-12 11-10-18.075 [Info] (Avahi) Service 'Snapcast' of type '_snapcast._tcp' in domain 'local':
2024-02-12 11-10-18.076 [Info] (Avahi) snapserver.local:1704 (192.168.0.237)
2024-02-12 11-10-18.080 [Info] (Controller) Found server 192.168.0.237:1704
2024-02-12 11-10-18.080 [Info] (Connection) Resolving host IP for: 192.168.0.237
2024-02-12 11-10-18.081 [Info] (Connection) Connecting
2024-02-12 11-10-18.099 [Notice] (Connection) Connected to 192.168.0.237
2024-02-12 11-10-18.099 [Info] (Connection) My MAC: "d8:3a:dd:8e:4b:58", socket: 8
2024-02-12 11-10-18.301 [Info] (Controller) ServerSettings - buffer: 1000, latency: 0, volume: 48, muted: 0
2024-02-12 11-10-18.302 [Info] (Controller) Codec: flac, sampleformat: 44100:16:2
2024-02-12 11-10-18.302 [Info] (Player) Player name: alsa, device: equal, description: <none>, idx: 2, sharing mode: unspecified, parameters: <none>
2024-02-12 11-10-18.302 [Info] (Player) Mixer mode: software, parameters: <none>
2024-02-12 11-10-18.302 [Info] (Player) Sampleformat: 44100:16:2, stream: 44100:16:2
2024-02-12 11-10-18.302 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_equal.so (/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_equal.so: cannot open shared object file: No such file or directory)
2024-02-12 11-10-18.303 [Error] (Alsa) Exception: Can't open equal, error: No such device or address, code: -6
2024-02-12 11-10-18.304 [Fatal] (Snapclient) Exception: Can't open equal, error: No such device or address
2024-02-12 11-10-18.304 [Notice] (Snapclient) Snapclient terminated.
我检查了
libasound_module_pcm_equal.so
,可以在 /lib/aarch64-linux-gnu/alsa-lib/
中找到它,但由于某种原因,Snapclient 试图在 /lib/arm-linux-gnueabihf/alsa-lib/
中找到它
如果我尝试添加链接:
sudo ln -s /lib/aarch64-linux-gnu/alsa-lib/libasound_module_* /lib/arm-linux-gnueabihf/alsa-lib/
我收到错误:
ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_equal.so (/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_pcm_equal.so: wrong ELF class: ELFCLASS64)
我的
/etc/asound.conf
看起来像这样:
ctl.equal {
type equal;
}
pcm.plugequal {
type equal;
#slave.pcm "plughw:0,0";
slave.pcm "plug:dmix"
}
pcm.equal {
type plug;
slave.pcm plugequal;
}
有什么办法可以解决这个问题吗?
谢谢你。
所以我设法弄清楚了这一点。我还意识到我在原始帖子中的
/etc/asound.conf
文件中有一个错误,但我将其设置为:
pcm.!default {
type plug
slave.pcm plugequal;
}
ctl.!default {
type hw card 0
}
ctl.equal {
type equal;
}
pcm.plugequal {
type equal;
slave.pcm "plughw:0,0";
}
pcm.equal {
type plug;
slave.pcm plugequal;
}
按照此处的说明:https://www.hi Fiberry.com/docs/software/guide-adding-equalization-using-alsaeq/
否则,由于我已经安装了snapclient的armhf版本,所以我还需要安装
libasound2-plugin-equal
和alsa-utils
的armhf版本:
之后,我可以使用
equal
作为声卡启动 snapclient,然后使用以下命令调整输出:
alsamixer -D equal
我也遇到了以下错误:
/home/pi/.alsaequal.bin is the wrong length.
[Error] (Alsa) Exception: Can't open equal, error: Operation not permitted, code: -1
不确定这是否是我所有的修改造成的,但我删除了
/home/pi/.alsaequal.bin
,错误就消失了。