My environment is OpenWrt 22.03.2 running on MediaTek MT7620A
I can't remember which packages were installed, but they all come from the following URL, and there are no third-party packages.
https://openwrt.org/docs/guide-user/hardware/bluetooth/bluetooth.audio
https://openwrt.org/docs/guide-user/hardware/bluetooth/bluetooth.speakers
paplay
is working good, and I can hear it on the speaker.
root@OpenWrt:~# paplay -v test.wav
Opening a playback stream with sample specification 's16le 1ch 22050Hz' and channel map 'mono'.
Connection established.
Stream successfully created.
Buffer metrics: maxlength=4194304, tlength=88200, prebuf=87320, minreq=882
Using sample spec 's16le 1ch 22050Hz', channel map 'mono'.
Connected to device bluez_sink.AA_BB_CC_DD_EE_FF.a2dp_sink (index: 1, suspended: no).
Stream started.
Playback stream drained.: 54194 usec.
Draining connection to server.
but aplay
not, looks like ALSA can't find the card it needs.
root@OpenWrt:~# aplay test.wav
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:831: audio open error: No such file or directory
How can I let ALSA find that card? I know it exists.
root@OpenWrt:~# pactl list cards
Card #0
Name: bluez_card.AA_BB_CC_DD_EE_FF
Driver: module-bluez5-device.c
Owner Module: 12
Properties:
device.description = "A-02"
device.string = "AA:BB:CC:DD:EE:FF"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "hands-free"
bluez.path = "/org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF"
bluez.class = "0x240408"
bluez.alias = "A-02"
device.icon_name = "audio-handsfree-bluetooth"
device.intended_roles = "phone"
Profiles:
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: a2dp_sink
Ports:
handsfree-output: Handsfree (type: Handsfree, priority: 0, latency offset: 0 usec, availability unknown)
Part of profile(s): a2dp_sink
handsfree-input: Handsfree (type: Handsfree, priority: 0, latency offset: 0 usec, not available)